草庐IT

饭碗警告

全部标签

java - 如何获得有关函数返回 null 引起的 NPE 的警告?

背景有时,函数在某些情况下会返回null,但使用它们的人并不知道,因此NPE是不可避免的。例如(它只是一个示例,以展示我在说什么):publicclassTest{publicstaticvoidmain(finalString[]args){finalintt=0;System.out.println("result:"+foo(t).toString());//nowarninghere...}publicstaticStringfoo(finalintt){if(t>0)return"positive";elsereturnnull;}}问题Eclipse不会对此类事情发出警告,

java - 如何隐藏 TieredCompilation 警告?

我正在使用LinuxMint和OpenJDK。java-version显示:javaversion"1.7.0_79"OpenJDKRuntimeEnvironment(IcedTea2.5.6)(7u79-2.5.6-0ubuntu1.14.04.1)OpenJDKClientVM(build24.79-b02,mixedmode,sharing)每当我运行像lein这样的基于Java的应用程序时,我都会收到此警告:OpenJDKClientVMwarning:TieredCompilationisdisabledinthisrelease.这与我的兴趣无关,所以我不想在命令输出中看

Java - 忽略目录/包级别的警告

我们的一些代码是自动生成的(由ApacheAxis),它会报告大量警告。一个例子是:privatejava.util.HashMapfaultExceptionNameMap=newjava.util.HashMap();在这里,警告是HashMapisarawtype.ReferencestogenerictypeHashMapshouldbeparameterized.当然,实际解决这些警告是没有意义的,因为无论如何我们都必须信任ApacheAxis,它只会按原样重新创建代码。因为我们的团队使用不同的IDE,从VSCode到IntelliJIDEA再到Eclipse,我正在寻找一种

java - 为什么 NetBeans 会警告将 int[] 传递给 vararg?

为什么NetBeans预编译器会为此发出警告?publicclassPrimitiveVarArgs{publicstaticvoidmain(String[]args){int[]ints=newint[]{1,2,3,4,5};prints(ints);}staticvoidprints(int...ints){for(inti:ints)System.out.println(i);}}它提示第5行,说:Confusingprimitivearraypassedtovarargmethod但据我(andothersonSO)所知,int...与int[]相同。如果它是非原始类型(如

Java HotSpot(TM) 64 位服务器 VM 警告、CentOS、SmartGit、SmartSvn

在运行SmartGit提供的shell脚本时,JavaHotSpot(TM)64-BitServerVMwarning:Youhaveloadedlibrary/home/User/.smartgit/6/jna-tmp/com/sun/jna/linux-i386/libjnidispatch.sowhichmighthavedisabledstackguard.TheVMwilltrytofixthestackguardnow.It'shighlyrecommendedthatyoufixthelibrarywith'execstack-c',orlinkitwith'-znoex

java - 如何在 SonarQube 中抑制警告 'Source files should not have any duplicated blocks'?

我正在使用SonarQube5.4并调查几个问题的抑制。我发现一旦我插入@SuppressWarnings("common-java:DuplicatedBlocks"),SonarQube就没有检测到抑制规则Sourcefilesshouldnothaveanyduplicatedblocks在文件的开头(文件无法编译)或在其中一个重复代码块的标记处。我在http://docs.sonarqube.org/display/PLUG/Java+FAQ找到了信息声明如下:The//NOSONARtagisusefultodeactivateallrulesatagivenlinebuti

java - 如何配置 Tika 的 pom.xml 以停止获取所有许可证依赖性警告?

当我尝试使用Tika时,我收到了所有这些警告:Feb24,20189:24:35PMorg.apache.tika.config.InitializableProblemHandler$3handleInitializableProblemWARNING:JBIG2ImageReadernotloaded.jbig2fileswillbeignoredSeehttps://pdfbox.apache.org/2.0/dependencies.html#jai-image-ioforoptionaldependencies.TIFFImageWriternotloaded.tifffil

java - 使用 Maven 编译时如何获取 Eclipse 警告?

我有一个使用m2eclipse的Java项目。在我的Eclipse中,我收到了几个警告。如何在我的Maven编译中显示这些警告?我想在jenkins上使用warnings-plugin来跟踪警告的数量。我找到了this关于如何在Maven中启用警告的帖子,但它只给了我一小部分警告。例如"Thevalueof...isnotused"warningsdon'tshowup.如何获得与Eclipse中显示的警告相同的警告?感谢您的帮助:)为清楚起见进行编辑:我想显示与eclipse中相同的警告,而不是FindBugs、PMD或checkstyle报告的其他错误

java - 为什么我在 Netbeans 中收到此编译警告?

我正在从事一个涉及Glassfish3.1.2.2的Java-EE项目,客户端组件正在运行Java7Update21。基于Swing的客户端以前基于Java6Update38,直到我们决定迁移到新的Java7更新21。我在Netbeans7.3中收到以下编译警告:warning:Supportedsourceversion'RELEASE_6'fromannotationprocessor'org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor'lessthan-source'1.7'此时,编译过程挂起

java - 运行时警告报告 : Found two components for namespace

我在使用JasperReports时遇到问题。我在我的程序上运行了报告,它可以工作,但是有这样的错误消息net.sf.jasperreports.engine.component.ComponentsEnvironmentfindComponentBundles警告:为命名空间http://jasperreports.sourceforge.net/jasperreports/components找到两个组件当我搜索任何与我相同的建议时,没有一个是解决方案。你知道如何解决这个问题吗?这个'jrxml文件 最佳答案 这意味着您的Jas