Jason, Firstly, thanks for your suggestion, however I had already tried that, including shutting down windows, clearing cache, ensuring NetBeans fully loaded (went away and had lunch!) before doing anything, clean and rebuild the main project. I even copied the source into notepad (to strip any offending characters), created a new Java Class file in the same package and pasted it in. Immediately the [!] appeared against that file as well! I then did a grep search of the NetBeans directory for the offending file name and voila! In my John/var/log/messages.log it is reporting that NetBeans produced an error which I will (as requested) raise as a bug against java/source, but in case you are interested, I have attached the offending log text file. Apparently the exception is java.lang.IllegalStateException: java.lang.AssertionError: Method parameter without PARAMETER flag at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:383) Whatever that means!
Again, thanks for your time in responding which led me to think about deducing what might be causing it. John From: Jason Abreu John, I've noticed on NetBeans 12.6 that there are some background processes that get hung up every now and then. Close NetBeans and check your Task Manager and look for any lingering Java processes. Kill them and re-open NetBeans. Let it do it's background scan and check your file to see if it still has the error indicator. A tell-tale, that I found, was that a Clean-Build works to build the project, even with files flagged as containing an error. This has even bitten me with building Gradle projects. -- Jason Abreu On 2/23/22 07:00, John Barrow wrote: > Hi, > > I have recently cloned Tomcat for some development work and resolving > issues and came across a file that had a red [!] on the file tab, but > the file (very short) didn't mark any lines as exceptions. The project > also builds perfectly. > > I have attached a screenshot of the offending file. > > Is there a way of determining why the [!] appears? > > Hovering over or <right/left-click] on the [!] doesn't reveal anything. > > I have shut down NetBeans, removed the cache folder and tried again > but it is persistently there. > > Tomcat is an Ant project so that may be relevant as I normally work with Maven. > > John > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org > For additional commands, e-mail: users-h...@netbeans.apache.org > > For further information about the NetBeans mailing lists, visit: > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org For additional commands, e-mail: users-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists |
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.catalina.ant;
import java.io.File; import java.io.IOException; import java.io.InputStream; import org.junit.Assert; import org.junit.Test; import org.apache.catalina.startup.Tomcat; import org.apache.catalina.startup.TomcatBaseTest; import org.apache.tools.ant.BuildException; public class TestDeployTask extends TomcatBaseTest { @Test public void bug58086a() { DeployTask deployTask = new DeployTask() { @Override public void execute(String command, InputStream istream, String contentType, long contentLength) throws BuildException { Assert.assertEquals("/deploy?path=somepath", command); Assert.assertEquals("application/octet-stream", contentType); try { istream.close(); } catch (IOException e) { } } }; setDefaults(deployTask); testExecute(deployTask, "file:./test/deployment/context.war"); testExecute(deployTask, new File("test/deployment/context.war").toURI().toString()); testExecute(deployTask, new File("test/deployment/context.war").getAbsolutePath()); testExecute(deployTask, "jar:" + new File("test/deployment/context.jar").toURI().toString() + "!/context.war"); testExecute(deployTask, "file:./test/deployment/dir with spaces/context.war"); testExecute(deployTask, new File("test/deployment/dir with spaces/context.war").toURI().toString()); testExecute(deployTask, new File("test/deployment/dir with spaces/context.war").getAbsolutePath()); testExecute(deployTask, "jar:" + new File("test/deployment/dir with spaces/context.jar").toURI().toString() + "!/context.war"); testExecute(deployTask, "file:./test/deployment/dir%20with%20spaces/context.war"); } @Test(expected = BuildException.class) public void bug58086b() { DeployTask deployTask = new DeployTask(); setDefaults(deployTask); testExecute(deployTask, "scheme:./test/deployment/context.war"); } @Test(expected = BuildException.class) public void bug58086c() { DeployTask deployTask = new DeployTask(); setDefaults(deployTask); testExecute(deployTask, "sc:./test/deployment/context.war"); } @Test public void bug58086d() throws Exception { Tomcat tomcat = getTomcatInstance(); File root = new File("test/deployment"); tomcat.addWebapp("", root.getAbsolutePath()); tomcat.start(); DeployTask deployTask = new DeployTask() { @Override public void execute(String command, InputStream istream, String contentType, long contentLength) throws BuildException { Assert.assertEquals("/deploy?path=somepath", command); Assert.assertEquals("application/octet-stream", contentType); try { istream.close(); } catch (IOException e) { } } }; setDefaults(deployTask); testExecute(deployTask, "http://localhost:" + getPort() + "/context.war"); } private void setDefaults(DeployTask deployTask) { deployTask.setUrl("someurl"); deployTask.setUsername("someuser"); deployTask.setPassword("somepassword"); deployTask.setPath("somepath"); } private void testExecute(DeployTask deployTask, String war) { deployTask.setWar(war); deployTask.execute(); } } ----- Classpath: --------------------------------------------- bootPath: nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/java.base/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/java.compiler/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/java.datatransfer/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/java.desktop/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/java.instrument/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/java.logging/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/java.management/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/java.management.rmi/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/java.naming/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/java.net.http/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/java.prefs/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/java.rmi/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/java.scripting/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/java.se/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/java.security.jgss/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/java.security.sasl/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/java.smartcardio/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/java.sql/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/java.sql.rowset/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/java.transaction.xa/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/java.xml/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/java.xml.crypto/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.accessibility/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.attach/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.charsets/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.compiler/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.crypto.cryptoki/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.crypto.ec/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.crypto.mscapi/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.dynalink/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.editpad/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.hotspot.agent/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.httpserver/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.incubator.foreign/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.incubator.vector/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.internal.ed/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.internal.jvmstat/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.internal.le/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.internal.opt/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.internal.vm.ci/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.internal.vm.compiler/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.internal.vm.compiler.management/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.jartool/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.javadoc/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.jcmd/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.jconsole/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.jdeps/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.jdi/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.jdwp.agent/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.jfr/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.jlink/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.jpackage/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.jshell/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.jsobject/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.jstatd/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.localedata/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.management/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.management.agent/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.management.jfr/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.naming.dns/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.naming.rmi/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.net/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.nio.mapmode/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.random/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.sctp/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.security.auth/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.security.jgss/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.unsupported/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.unsupported.desktop/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.xml.dom/;nbjrt:file:/C:/Development/JDK/jdk-17/!/modules/jdk.zipfs/ classPath: C:\Community\tomcat\output\classes;C:\Community\tomcat\output\testclasses;C:\Community\DownloadedTomcatLibraries\junit-4.13.2\junit-4.13.2.jar;C:\Community\DownloadedTomcatLibraries\easymock-4.3\easymock-4.3.jar;C:\Community\DownloadedTomcatLibraries\objenesis-3.2\objenesis-3.2.jar;C:\Community\DownloadedTomcatLibraries\cglib-3.3.0\cglib-nodep-3.3.0.jar;C:\Community\DownloadedTomcatLibraries\hamcrest-2.2\hamcrest-2.2.jar;C:\Community\DownloadedTomcatLibraries\unboundid-ldapsdk-6.0.3\unboundid-ldapsdk-6.0.3.jar sourcePath: C:\Community\tomcat\test ----- Original exception --------------------------------------------- java.lang.IllegalStateException: java.lang.AssertionError: Method parameter without PARAMETER flag at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:383) at org.netbeans.modules.java.source.parsing.JavacParser.moveToPhase(JavacParser.java:729) at org.netbeans.modules.java.source.parsing.JavacParser.getResult(JavacParser.java:515) at org.netbeans.modules.java.source.parsing.JavacParser.getResult(JavacParser.java:139) at org.netbeans.modules.parsing.impl.TaskProcessor.callGetResult(TaskProcessor.java:608) at org.netbeans.modules.parsing.impl.SourceCache.getResult(SourceCache.java:239) at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.run(TaskProcessor.java:775) at org.openide.util.lookup.Lookups.executeWith(Lookups.java:279) at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.execute(TaskProcessor.java:702) at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:663) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418) at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45) at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033) Caused by: java.lang.AssertionError: Method parameter without PARAMETER flag at jdk.compiler/com.sun.tools.javac.util.Assert.error(Assert.java:162) at jdk.compiler/com.sun.tools.javac.util.Assert.check(Assert.java:95) at jdk.compiler/com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitMethodDef(Flow.java:2152) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:921) at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49) at jdk.compiler/com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444) at jdk.compiler/com.sun.tools.javac.comp.Flow$AssignAnalyzer.scan(Flow.java:1724) at jdk.compiler/com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitClassDef(Flow.java:2098) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:819) at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49) at jdk.compiler/com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444) at jdk.compiler/com.sun.tools.javac.comp.Flow$AssignAnalyzer.scan(Flow.java:1724) at jdk.compiler/com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitNewClass(Flow.java:2695) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCNewClass.accept(JCTree.java:1852) at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49) at jdk.compiler/com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444) at jdk.compiler/com.sun.tools.javac.comp.Flow$AssignAnalyzer.scan(Flow.java:1724) at jdk.compiler/com.sun.tools.javac.comp.Flow$AssignAnalyzer.scanExpr(Flow.java:1981) at jdk.compiler/com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitVarDef(Flow.java:2245) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:1027) at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49) at jdk.compiler/com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444) at jdk.compiler/com.sun.tools.javac.comp.Flow$AssignAnalyzer.scan(Flow.java:1724) at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57) at jdk.compiler/com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitBlock(Flow.java:2257) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1091) at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49) at jdk.compiler/com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444) at jdk.compiler/com.sun.tools.javac.comp.Flow$AssignAnalyzer.scan(Flow.java:1724) at jdk.compiler/com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitMethodDef(Flow.java:2160) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:921) at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49) at jdk.compiler/com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444) at jdk.compiler/com.sun.tools.javac.comp.Flow$AssignAnalyzer.scan(Flow.java:1724) at jdk.compiler/com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitClassDef(Flow.java:2098) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:819) at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49) at jdk.compiler/com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444) at jdk.compiler/com.sun.tools.javac.comp.Flow$AssignAnalyzer.scan(Flow.java:1724) at jdk.compiler/com.sun.tools.javac.comp.Flow$AssignAnalyzer.analyzeTree(Flow.java:2871) at jdk.compiler/com.sun.tools.javac.comp.Flow$AssignAnalyzer.analyzeTree(Flow.java:2853) at jdk.compiler/com.sun.tools.javac.comp.Flow.analyzeTree(Flow.java:221) at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1377) at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1341) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:404) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$analyze$1(JavacTaskImpl.java:379) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.invocationHelper(JavacTaskImpl.java:152) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:379) ... 15 more
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org For additional commands, e-mail: users-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists