草庐IT

execute_func

全部标签

java - HTMLUnit : super slow execution?

我一直在使用HTMLUnit。很符合我的要求。但它似乎非常缓慢。例如:我使用HTMLUnit自动化了以下场景GotoGooglepageEntersometextClickonthesearchbuttonGetthetitleoftheresultspageClickonthefirstresult.代码:longt1=System.currentTimeMillis();Loggerlogger=Logger.getLogger("");logger.setLevel(Level.OFF);WebClientwebClient=createWebClient();WebReques

java - Elasticsearch 失败,错误为 "Failed to execute phase [query_fetch], all shards failed"

当我尝试索引数据然后进行查询时,一切都很好,但是如果我启动我的应用程序并在它之前进行不索引的查询,我会收到该错误Exceptioninthread"main"org.elasticsearch.action.search.SearchPhaseExecutionException:Failedtoexecutephase[query_fetch],allshardsfailedatorg.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(Transp

Java : Getting the currently executing Method corresponding object

将当前正在执行的方法作为Method对象获取的最优雅的方法是什么?我的第一个明显的方法是在辅助类中使用静态方法,它将加载当前线程堆栈,获取正确的堆栈跟踪元素,并根据其信息构造Method元素。有没有更优雅的方式来实现这一点? 最佳答案 本主题涵盖更深入inthisSOQuestion.我需要做同样的事情,我发现最好的解决方案是@alexsmail提供的解决方案。这似乎有点hacky,但总体思路是您在方法中声明一个本地类,然后利用class.getEnclosingMethod();代码从@alexsmail的解决方案中略微修改:pu

java - .execute 无法解析为类型 - AsyncTask (Android)

我正在编写一个需要从我的数据库中获取一些json的应用程序,我收到了数据,但现在我还试图在ListView中显示的信息旁边查看一个图标。麻烦的线路是:mChart.setTag(URL);newDownloadImagesTask.execute(mChart);主要Activity:publicclassMainActivityextendsActivity{ListViewlist;TextViewicon;TextViewname;TextViewdeveloper;TextViewsize;ButtonBtngetdata;ArrayList>mList=newArrayLis

java - "T is a top-level class, and an assert statement lexically nested within T is executed."是什么意思?

我正在学习“类和接口(interface)的初始化”,它说“T是顶级类,并且执行词法嵌套在T中的断言语句。”任何人都可以告诉我“T是顶级类,并且执行词法嵌套在T中的断言语句”是什么意思。举例说明?这句话来自JLS,原文是这样的:AclassorinterfacetypeTwillbeinitializedimmediatelybeforethefirstoccurrenceofanyoneofthefollowing:TisaclassandaninstanceofTiscreated.TisaclassandastaticmethoddeclaredbyTisinvoked.Asta

java - Spring 启动 + Gradle : how to build executable jar

我正在尝试在SpringBoot+Gradle项目中构建一个可执行jar,但目前没有任何效果。这是最简单的结构。Gradle配置中可能缺少某些内容。Gradle:buildscript{ext{springBootVersion='1.5.8.RELEASE'}repositories{mavenCentral()}dependencies{classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")}}applyplugin:'java'applyplugin:'org.spr

java - 核心异常 : Could not get the value for parameter compilerId for plugin execution default-compile: PluginResolutionException

每次我创建一个maven简单项目时,我都会遇到以下错误。请让我知道可能的解决方案。我尝试了很多方法来解决它但都失败了。可能是什么原因?这是因为eclipse还是因为存储库或任何证书问题?CoreException:CouldnotgetthevalueforparametercompilerIdforpluginexecutiondefault-compile:PluginResolutionException:Pluginorg.apache.maven.plugins:maven-compiler-plugin:3.1 最佳答案

java - Maven 不会运行我的项目 : Failed to execute goal org. codehaus.mojo :exec-maven-plugin:1. 2.1:exec

我无法运行MavenNetbeansJavaFX示例:Failedtoexecutegoalorg.codehaus.mojo:exec-maven-plugin:1.2.1:exec(default-cli)onprojectmavenproject3:Commandexecutionfailed.Processexitedwithanerror:1(Exitvalue:1)->[Help1]Toseethefullstacktraceoftheerrors,re-runMavenwiththe-eswitch.Re-runMavenusingthe-Xswitchtoenablef

Java 为 ( x : y) execution

我有以下for循环:for(Strings:someString.split("\\s+")){//dosomething}java是在每次循环迭代时都执行split()方法,还是只执行一次并保留一个临时数组进行迭代? 最佳答案 它只执行一次,并使用该数组并通过它进行交互。编辑:来自MatThisisreference 关于Java为(x:y)execution,我们在StackOverflow上找到一个类似的问题: https://stackoverflow

java - 错误 :Execution failed for task ':app:mergeDebugResources' . > 某些文件处理失败,有关详细信息,请参阅日志构建 gradle 问题

当前,当我运行我的应用程序时,我正在使用AndroidStudio2.1,它在MessageGradleBuild中显示了一些错误,说明如下Information:Gradletasks[:app:clean,:app:generateDebugSources,:app:prepareDebugUnitTestDependencies,:app:mockableAndroidJar,:app:generateDebugAndroidTestSources,:app:assembleDebug]:app:clean:app:preBuildUP-TO-DATE:app:preDebugB