草庐IT

new_size

全部标签

java - 使用 Mockito 在其中调用 new() 测试类

我有一个包含new()调用以实例化LoginContext对象的旧类:publicclassTestedClass{publicLoginContextlogin(Stringuser,Stringpassword){LoginContextlc=newLoginContext("login",callbackHandler);}}我想使用Mockito来模拟LoginContext来测试这个类,因为它要求在实例化之前设置JAAS安全性东西,但我不确定如何在不更改code>login()方法来外部化LoginContext。是否可以使用Mockito来模拟LoginContext类?

java - 具有多个 SELECT NEW 语句的 jpa 构造函数表达式

有没有办法拥有多个SELECTNEWjpql中的语句查询(hibernate)?这对我有用:@Query("SELECTNEWcom.test.project.dto.ItemService(g,s,l,r)"+"FROMItemg,Services,Servicel,Servicer"+"WHEREs.id=g.id"+"ANDs.location=l.name"+"ANDs.serviceType='type'"+"ANDl.serviceType='Location'"+"ANDl.area=r.name"+"ANDr.serviceType='Region'")publicLi

java - @Transactional(propagation=Propagation.REQUIRES_NEW) 的奇怪行为

这是我的问题:我正在JavaEE/Spring/Hibernate应用程序上运行批处理。此批处理调用method1。这个方法调用一个method2,它可以抛出UserException(一个扩展RuntimeException的类)。这是它的样子:@TransactionalpublicclassBatchServiceimplementsIBatchService{@Transactional(propagation=Propagation.REQUIRES_NEW)publicUsermethod2(Useruser){//Processing,whichcanthrowaRunt

Mysql tmp_table_size max_heap_table_size

两天前在我的服务器上,我的tmp_table_size=max_heap_table_size(16M)。我做了一个每小时运行一次的cron作业,并从以下位置生成报告:created_tmp_disk_tables、created_tmp_files、created_tmp_tables在我的报告中:created_tmp_disk_tables+created_tmp_files+created_tmp_tables=我的临时数据的100%这样:使用tmp_table_size=max_heap_table_size=16M报告向我展示了下一个平均报告:27.37%(created_

dart - 在 Dart 中,使用 'new' 关键字和直接调用构造函数有什么区别?

我知道我可以使用argument:MyClassName(a,b)还有argument:newMyClassName(a,b)我想了解new在Dart中是可选的吗?或者这两个返回完全不同的东西? 最佳答案 在Dart2.0强模式下newandconstareoptional所以两者都是一样的。 关于dart-在Dart中,使用'new'关键字和直接调用构造函数有什么区别?,我们在StackOverflow上找到一个类似的问题: https://stackove

dart - Flutter:从 Activity 上下文外部调用 startActivity() 需要 FLAG_ACTIVITY_NEW_TASK 标志

我正在尝试launch("tel://21213123123")但是,我收到以下错误!PlatformException(PlatformException(error,CallingstartActivity()fromoutsideofanActivitycontextrequirestheFLAG_ACTIVITY_NEW_TASKflag.Isthisreallywhatyouwant?,null))在这个文件中message_codecs.dart这是我的错误日志E/MethodChannel#plugins.flutter.io/url_launcher(26131):Fa

android - 空对象引用上的 TransitionSet ArrayList.size()

通过本指南开始实现具有共享元素和动画的开放图像。https://android-developers.googleblog.com/2018/02/continuous-shared-element-transitions.html但是捕获了一个异常:java.lang.NullPointerException:Attempttoinvokevirtualmethod'intjava.util.ArrayList.size()'onanullobjectreferenceatandroid.support.transition.TransitionSet.setDuration(Tra

kotlin - 为什么 kotlin 放弃了 "new"关键字?

关闭。这个问题是opinion-based.它目前不接受答案。想要改进这个问题吗?更新问题,以便editingthispost提供事实和引用来回答它.关闭6年前。Improvethisquestion为什么kotlin放弃了new关键字?它使函数调用和对象分配之间的区别更难看出。 最佳答案 KotlinCodingConventions明确说明:useofcamelCasefornames(andavoidunderscoreinnames)typesstartwithuppercasemethodsandpropertiessta

android - New Intent() 使用 Android : launchMode ="singleTop" 启动新实例

我在list中有带有android:launchMode="singleTop"的ActivityA。如果我转到ActivityB、C和D,我有菜单快捷方式可以返回到我的应用程序根Activity(A)。代码如下所示:IntentmyIntent=newIntent(getBaseContext(),MainActivity.class);startActivity(myIntent);但是,它不是返回到我的MainActivity.class的现有实例A而是创建一个新实例->它转到onCreate()而不是onNewIntent().这不是预期的行为,对吧?

android - 敏捷异常 : Cannot merge new index 65536 into a non-jumbo instruction

由于某种未知原因,我的应用突然无法从AndroidStudio构建。我一直在努力>com.android.ide.common.internal.LoggedErrorException:Failedtoruncommand:/home/martynas/android-sdk/build-tools/19.1.0/dx--dex--num-threads=4--output.........ErrorCode:2Output:UNEXPECTEDTOP-LEVELEXCEPTION:com.android.dex.DexException:Cannotmergenewindex655