Java里遇到的奇怪错误.注意分号

本文记录了一次在Java开发过程中遇到的难以捉摸的Bug排查经历。作者通过反复调试和代码审查,最终定位到一个因误加的分号导致的逻辑错误。此错误发生在条件判断语句中,使得程序行为不符合预期。
找了半天,懒人啊,看似不起眼的东西,稍微修改就直接打包,部署,测试,不对,再来,都不先写一个单元测试,晕死....然后检查DAO,sql语句,还怀疑是不是Oracle出错了...最后还是不行,找不到错误.看来又应验了经常说的那句话,千奇百怪的错误,肯定是自己出问题了.
java 代码
  1. if(statisticInfo == null);   
  2. {   
  3.          log.debug("the statistic of member: '" + memberName + "' is not exists,then create it");   
  4.          memberStatisticInfoDao.create(memberName);   
  5. }  
> Task :app:preBuild UP-TO-DATE > Task :app:preDebugBuild UP-TO-DATE > Task :app:javaPreCompileDebug UP-TO-DATE > Task :app:checkDebugAarMetadata UP-TO-DATE > Task :app:processDebugNavigationResources UP-TO-DATE > Task :app:compileDebugNavigationResources UP-TO-DATE > Task :app:generateDebugResValues UP-TO-DATE > Task :app:mapDebugSourceSetPaths UP-TO-DATE > Task :app:generateDebugResources UP-TO-DATE > Task :app:mergeDebugResources UP-TO-DATE > Task :app:packageDebugResources UP-TO-DATE > Task :app:parseDebugLocalResources UP-TO-DATE > Task :app:createDebugCompatibleScreenManifests UP-TO-DATE > Task :app:extractDeepLinksDebug UP-TO-DATE > Task :app:processDebugMainManifest UP-TO-DATE > Task :app:processDebugManifest UP-TO-DATE > Task :app:processDebugManifestForPackage UP-TO-DATE > Task :app:processDebugResources UP-TO-DATE > Task :app:compileDebugJavaWithJavac UP-TO-DATE > Task :app:bundleDebugClassesToRuntimeJar UP-TO-DATE > Task :app:bundleDebugClassesToCompileJar UP-TO-DATE > Task :app:preDebugUnitTestBuild UP-TO-DATE > Task :app:javaPreCompileDebugUnitTest UP-TO-DATE > Task :app:compileDebugUnitTestJavaWithJavac UP-TO-DATE > Task :app:processDebugJavaRes NO-SOURCE > Task :app:processDebugUnitTestJavaRes NO-SOURCE Could not write standard input to Gradle Test Executor 2. java.io.IOException: 管道正在被关闭。 at java.base/java.io.FileOutputStream.writeBytes(Native Method) at java.base/java.io.FileOutputStream.implWriteBytes(Unknown Source) at java.base/java.io.FileOutputStream.write(Unknown Source) at java.base/java.io.BufferedOutputStream.flushBuffer(Unknown Source) at java.base/java.io.BufferedOutputStream.implFlush(Unknown Source) at java.base/java.io.BufferedOutputStream.flush(Unknown Source) at org.gradle.process.internal.streams.ExecOutputHandleRunner.writeBuffer(ExecOutputHandleRunner.java:98) at org.gradle.process.internal.streams.ExecOutputHandleRunner.forwardContent(ExecOutputHandleRunner.java:85) at org.gradle.process.internal.streams.ExecOutputHandleRunner.run(ExecOutputHandleRunner.java:64) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64) at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:48) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source) > Task :app:testDebugUnitTest FAILED ����: �Ҳ������޷��������� JDK\bin;D:\Java ԭ��: java.lang.ClassNotFoundException: JDK\bin;D:\Java [Incubating] Problems report is available at: file:///D:/Android%20TEST/build/reports/problems/problems-report.html FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:testDebugUnitTest'. > Process 'Gradle Test Executor 2' finished with non-zero exit value 1 * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. For more on this, please refer to https://docs.gradle.org/8.13/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. BUILD FAILED in 663ms 22 actionable tasks: 1 executed, 21 up-to-date 13:52:47: Execution finished 'testDebugUnitTest'.
最新发布
10-24
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值