Merge pull request #4630 from sdedic/maven/lifecycle-participants
Allow to disable warning for specific lifecycle participants.
diff --git a/.github/ISSUE_TEMPLATE/netbeans_bug_report.yml b/.github/ISSUE_TEMPLATE/netbeans_bug_report.yml
index b408d54..716e03d 100644
--- a/.github/ISSUE_TEMPLATE/netbeans_bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/netbeans_bug_report.yml
@@ -27,8 +27,8 @@
Latest releases are always available from https://netbeans.apache.org/download/
multiple: false
options:
- - "Apache NetBeans 14"
- - "Apache NetBeans 15 release candidate"
+ - "Apache NetBeans 15"
+ # - "Apache NetBeans 16 release candidate"
- "Apache NetBeans latest daily build"
validations:
required: true
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index b5899ef..02e2ae8 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -103,7 +103,7 @@
run: tar --zstd -xf build.tar.zst
- name: Setup Xvfb
- if: ${{ matrix.java != '19-ea' }} # see #4299
+ if: ${{ matrix.java != '20-ea' }} # see #4299
run: |
echo "DISPLAY=:99.0" >> $GITHUB_ENV
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
diff --git a/.travis.yml b/.travis.yml
index 0fad142..f25454b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -198,6 +198,20 @@
- hide-logs.sh ant $OPTS -f platform/templates test
- hide-logs.sh ant $OPTS -f platform/templatesui test
- hide-logs.sh ant $OPTS -f platform/uihandler test
+
+ - name: Test platform modules on JDK 11, Batch 1
+ jdk: openjdk8
+ env:
+ - OPTS="-Dmetabuild.jsonurl=https://raw.githubusercontent.com/apache/netbeans-jenkins-lib/master/meta/netbeansrelease.json -silent -Dcluster.config=platform -Djavac.compilerargs=-nowarn -Dbuild.compiler.deprecation=false -Dtest-unit-sys-prop.ignore.random.failures=true -Dvanilla.javac.exists=true"
+ before_script:
+ - nbbuild/travis/ant.sh $OPTS clean
+ - nbbuild/travis/ant.sh $OPTS build
+ - wget https://cdn.azul.com/zulu/bin/zulu11.58.23-ca-jdk11.0.16.1-linux_x64.tar.gz
+ - tar --extract --gzip --directory $HOME -f zulu11.58.23-ca-jdk11.0.16.1-linux_x64.tar.gz
+ - TEST_JDK=$HOME/zulu11.58.23-ca-jdk11.0.16.1-linux_x64
+ - export OPTS="$OPTS -Dtest.nbjdk.home=$TEST_JDK"
+ script:
+ - hide-logs.sh ant $OPTS -f platform/o.n.bootstrap test
- name: Test ide modules
jdk: openjdk8
@@ -441,8 +455,9 @@
env:
- OPTS="-Dmetabuild.jsonurl=https://raw.githubusercontent.com/apache/netbeans-jenkins-lib/master/meta/netbeansrelease.json -quiet -Dcluster.config=java -Djavac.compilerargs=-nowarn -Dbuild.compiler.deprecation=false -Dtest-unit-sys-prop.ignore.random.failures=true"
before_script:
- - wget https://raw.githubusercontent.com/sormuras/bach/master/install-jdk.sh
- - export TEST_JDK=`bash install-jdk.sh --feature 11 --license GPL --emit-java-home --silent | tail -1`
+ - wget https://cdn.azul.com/zulu/bin/zulu11.58.23-ca-jdk11.0.16.1-linux_x64.tar.gz
+ - tar --extract --gzip --directory $HOME -f zulu11.58.23-ca-jdk11.0.16.1-linux_x64.tar.gz
+ - TEST_JDK=$HOME/zulu11.58.23-ca-jdk11.0.16.1-linux_x64
- export OPTS="-Dmetabuild.jsonurl=https://raw.githubusercontent.com/apache/netbeans-jenkins-lib/master/meta/netbeansrelease.json $OPTS -Dtest.nbjdk.home=$TEST_JDK -Dtest.run.args=--limit-modules=java.base,java.logging,java.xml,java.prefs,java.desktop,java.management,java.instrument,jdk.zipfs,java.scripting,java.naming -Dtest.bootclasspath.prepend.args=-Dno.netbeans.bootclasspath.prepend.needed=true"
- nbbuild/travis/ant.sh $OPTS clean
- nbbuild/travis/ant.sh $OPTS build
@@ -620,8 +635,9 @@
before_script:
- nbbuild/travis/ant.sh $BUILD_OPTS clean
- nbbuild/travis/ant.sh $BUILD_OPTS build
- - wget https://raw.githubusercontent.com/sormuras/bach/master/install-jdk.sh
- - export TEST_JDK=`bash install-jdk.sh --feature 11 --license GPL --emit-java-home --silent | tail -1`
+ - wget https://cdn.azul.com/zulu/bin/zulu11.58.23-ca-jdk11.0.16.1-linux_x64.tar.gz
+ - tar --extract --gzip --directory $HOME -f zulu11.58.23-ca-jdk11.0.16.1-linux_x64.tar.gz
+ - TEST_JDK=$HOME/zulu11.58.23-ca-jdk11.0.16.1-linux_x64
- export OPTS="-Dmetabuild.jsonurl=https://raw.githubusercontent.com/apache/netbeans-jenkins-lib/master/meta/netbeansrelease.json $OPTS -Dtest.nbjdk.home=$TEST_JDK -Dtest.run.args=--limit-modules=java.base,java.logging,java.xml,java.prefs,java.desktop,java.management,java.instrument,jdk.zipfs,java.scripting,java.naming -Dtest.bootclasspath.prepend.args=-Dno.netbeans.bootclasspath.prepend.needed=true"
script:
#- ant $TEST_OPTS -f groovy/groovy test
diff --git a/apisupport/apisupport.ant/test/unit/src/org/netbeans/modules/apisupport/project/suite/SuiteBrandingModelTest.java b/apisupport/apisupport.ant/test/unit/src/org/netbeans/modules/apisupport/project/suite/SuiteBrandingModelTest.java
index 669141b..0dc644d 100644
--- a/apisupport/apisupport.ant/test/unit/src/org/netbeans/modules/apisupport/project/suite/SuiteBrandingModelTest.java
+++ b/apisupport/apisupport.ant/test/unit/src/org/netbeans/modules/apisupport/project/suite/SuiteBrandingModelTest.java
@@ -19,7 +19,6 @@
package org.netbeans.modules.apisupport.project.suite;
-import static junit.framework.Assert.*;
import org.netbeans.api.project.ProjectManager;
import org.netbeans.junit.NbTestCase;
import org.netbeans.modules.apisupport.project.TestBase;
diff --git a/apisupport/apisupport.project/test/unit/src/org/netbeans/modules/apisupport/project/DialogDisplayerImpl.java b/apisupport/apisupport.project/test/unit/src/org/netbeans/modules/apisupport/project/DialogDisplayerImpl.java
index 51448e6..95a6912 100644
--- a/apisupport/apisupport.project/test/unit/src/org/netbeans/modules/apisupport/project/DialogDisplayerImpl.java
+++ b/apisupport/apisupport.project/test/unit/src/org/netbeans/modules/apisupport/project/DialogDisplayerImpl.java
@@ -20,7 +20,7 @@
package org.netbeans.modules.apisupport.project;
import java.awt.Dialog;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.openide.DialogDescriptor;
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
diff --git a/apisupport/apisupport.project/test/unit/src/org/netbeans/modules/apisupport/project/ErrorManagerImpl.java b/apisupport/apisupport.project/test/unit/src/org/netbeans/modules/apisupport/project/ErrorManagerImpl.java
index 8b13d92..579bd47 100644
--- a/apisupport/apisupport.project/test/unit/src/org/netbeans/modules/apisupport/project/ErrorManagerImpl.java
+++ b/apisupport/apisupport.project/test/unit/src/org/netbeans/modules/apisupport/project/ErrorManagerImpl.java
@@ -22,7 +22,6 @@
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Date;
-import junit.framework.Assert;
import org.netbeans.junit.NbTestCase;
import org.openide.ErrorManager;
diff --git a/apisupport/apisupport.project/test/unit/src/org/netbeans/modules/apisupport/project/InputOutputProviderImpl.java b/apisupport/apisupport.project/test/unit/src/org/netbeans/modules/apisupport/project/InputOutputProviderImpl.java
index dee7633..071259e 100644
--- a/apisupport/apisupport.project/test/unit/src/org/netbeans/modules/apisupport/project/InputOutputProviderImpl.java
+++ b/apisupport/apisupport.project/test/unit/src/org/netbeans/modules/apisupport/project/InputOutputProviderImpl.java
@@ -24,9 +24,8 @@
import java.io.StringReader;
import java.io.StringWriter;
import java.util.logging.Logger;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.netbeans.junit.NbTestCase;
-import org.openide.ErrorManager;
import org.openide.windows.IOProvider;
import org.openide.windows.InputOutput;
import org.openide.windows.OutputListener;
diff --git a/apisupport/apisupport.project/test/unit/src/org/netbeans/modules/apisupport/project/layers/LayerTestBase.java b/apisupport/apisupport.project/test/unit/src/org/netbeans/modules/apisupport/project/layers/LayerTestBase.java
index 0ca9100..098280a 100644
--- a/apisupport/apisupport.project/test/unit/src/org/netbeans/modules/apisupport/project/layers/LayerTestBase.java
+++ b/apisupport/apisupport.project/test/unit/src/org/netbeans/modules/apisupport/project/layers/LayerTestBase.java
@@ -19,7 +19,6 @@
package org.netbeans.modules.apisupport.project.layers;
-import junit.framework.Assert;
import org.netbeans.api.xml.services.UserCatalog;
import org.netbeans.junit.NbTestCase;
import org.netbeans.spi.project.support.ant.AntBasedProjectType;
@@ -43,7 +42,7 @@
static {
// XXX replace with MockServices
System.setProperty("org.openide.util.Lookup", Lkp.class.getName());
- Assert.assertEquals(Lkp.class, Lookup.getDefault().getClass());
+ assertEquals(Lkp.class, Lookup.getDefault().getClass());
Lookup p = Lookups.forPath("Services/AntBasedProjectTypes/");
p.lookupAll(AntBasedProjectType.class);
projects = p;
@@ -52,7 +51,7 @@
private static Lkp DEFAULT;
private static final Lookup projects;
public Lkp() {
- Assert.assertNull(DEFAULT);
+ assertNull(DEFAULT);
DEFAULT = this;
ClassLoader l = Lkp.class.getClassLoader();
setLookups(new Lookup[] {
diff --git a/enterprise/j2ee.clientproject/test/unit/src/org/netbeans/modules/j2ee/clientproject/test/TestUtil.java b/enterprise/j2ee.clientproject/test/unit/src/org/netbeans/modules/j2ee/clientproject/test/TestUtil.java
index c2b3bc6..2f8bb8d 100644
--- a/enterprise/j2ee.clientproject/test/unit/src/org/netbeans/modules/j2ee/clientproject/test/TestUtil.java
+++ b/enterprise/j2ee.clientproject/test/unit/src/org/netbeans/modules/j2ee/clientproject/test/TestUtil.java
@@ -30,7 +30,7 @@
import java.util.Map;
import java.util.StringTokenizer;
import java.util.WeakHashMap;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.netbeans.api.project.Project;
import org.netbeans.junit.NbTestCase;
import org.netbeans.spi.project.ProjectFactory;
diff --git a/enterprise/j2ee.common/test/unit/src/org/netbeans/modules/j2ee/common/ClasspathUtilTest.java b/enterprise/j2ee.common/test/unit/src/org/netbeans/modules/j2ee/common/ClasspathUtilTest.java
index 36c0972..fe102cc 100644
--- a/enterprise/j2ee.common/test/unit/src/org/netbeans/modules/j2ee/common/ClasspathUtilTest.java
+++ b/enterprise/j2ee.common/test/unit/src/org/netbeans/modules/j2ee/common/ClasspathUtilTest.java
@@ -27,8 +27,6 @@
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.junit.NbTestCase;
import org.openide.filesystems.FileUtil;
diff --git a/enterprise/j2ee.ddloaders/test/unit/src/org/netbeans/modules/j2ee/ddloaders/app/EarDataNodeTest.java b/enterprise/j2ee.ddloaders/test/unit/src/org/netbeans/modules/j2ee/ddloaders/app/EarDataNodeTest.java
index f2a0960..ee243aa 100644
--- a/enterprise/j2ee.ddloaders/test/unit/src/org/netbeans/modules/j2ee/ddloaders/app/EarDataNodeTest.java
+++ b/enterprise/j2ee.ddloaders/test/unit/src/org/netbeans/modules/j2ee/ddloaders/app/EarDataNodeTest.java
@@ -29,7 +29,6 @@
import java.nio.charset.StandardCharsets;
import java.util.Enumeration;
import javax.swing.Action;
-import junit.framework.Assert;
import org.netbeans.junit.NbTestCase;
import org.openide.actions.OpenAction;
import org.openide.filesystems.FileObject;
@@ -58,13 +57,13 @@
static {
// XXX replace with MockServices
System.setProperty("org.openide.util.Lookup", Lkp.class.getName());
- Assert.assertEquals(Lkp.class, Lookup.getDefault().getClass());
+ assertEquals(Lkp.class, Lookup.getDefault().getClass());
}
public static final class Lkp extends ProxyLookup {
private static Lkp DEFAULT;
public Lkp() {
- Assert.assertNull(DEFAULT);
+ assertNull(DEFAULT);
DEFAULT = this;
setLookup(new Object[0]);
}
diff --git a/enterprise/j2ee.earproject/test/unit/src/org/netbeans/modules/j2ee/earproject/EarProjectTest.java b/enterprise/j2ee.earproject/test/unit/src/org/netbeans/modules/j2ee/earproject/EarProjectTest.java
index 3616480..bf173cd 100644
--- a/enterprise/j2ee.earproject/test/unit/src/org/netbeans/modules/j2ee/earproject/EarProjectTest.java
+++ b/enterprise/j2ee.earproject/test/unit/src/org/netbeans/modules/j2ee/earproject/EarProjectTest.java
@@ -30,8 +30,6 @@
import java.net.URL;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
-import junit.framework.Assert;
-import static junit.framework.Assert.assertEquals;
import org.netbeans.api.project.Project;
import org.netbeans.api.project.ProjectManager;
import org.netbeans.api.project.ui.OpenProjects;
@@ -296,9 +294,9 @@
}
public static void validate(FileObject ddFO) throws Exception {
- Assert.assertNotNull(ddFO);
+ assertNotNull(ddFO);
File ddF = FileUtil.toFile(ddFO);
- Assert.assertNotNull(ddF);
+ assertNotNull(ddF);
validate(ddF);
}
diff --git a/enterprise/j2ee.earproject/test/unit/src/org/netbeans/modules/j2ee/earproject/test/TestUtil.java b/enterprise/j2ee.earproject/test/unit/src/org/netbeans/modules/j2ee/earproject/test/TestUtil.java
index b9413d7..ec39caf 100644
--- a/enterprise/j2ee.earproject/test/unit/src/org/netbeans/modules/j2ee/earproject/test/TestUtil.java
+++ b/enterprise/j2ee.earproject/test/unit/src/org/netbeans/modules/j2ee/earproject/test/TestUtil.java
@@ -33,7 +33,7 @@
import java.util.WeakHashMap;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.netbeans.api.project.Project;
import org.netbeans.junit.NbTestCase;
import org.netbeans.spi.project.ProjectFactory;
diff --git a/enterprise/j2ee.ejbjarproject/test/unit/src/org/netbeans/modules/j2ee/ejbjarproject/EjbJarProviderTest.java b/enterprise/j2ee.ejbjarproject/test/unit/src/org/netbeans/modules/j2ee/ejbjarproject/EjbJarProviderTest.java
index 963f8c5..6226a40 100644
--- a/enterprise/j2ee.ejbjarproject/test/unit/src/org/netbeans/modules/j2ee/ejbjarproject/EjbJarProviderTest.java
+++ b/enterprise/j2ee.ejbjarproject/test/unit/src/org/netbeans/modules/j2ee/ejbjarproject/EjbJarProviderTest.java
@@ -20,7 +20,6 @@
package org.netbeans.modules.j2ee.ejbjarproject;
import java.io.File;
-import static junit.framework.Assert.assertEquals;
import org.netbeans.api.j2ee.core.Profile;
import org.netbeans.api.project.Project;
import org.netbeans.api.project.ProjectManager;
diff --git a/enterprise/j2ee.ejbjarproject/test/unit/src/org/netbeans/modules/j2ee/ejbjarproject/test/TestUtil.java b/enterprise/j2ee.ejbjarproject/test/unit/src/org/netbeans/modules/j2ee/ejbjarproject/test/TestUtil.java
index f16edac..41f2d01 100644
--- a/enterprise/j2ee.ejbjarproject/test/unit/src/org/netbeans/modules/j2ee/ejbjarproject/test/TestUtil.java
+++ b/enterprise/j2ee.ejbjarproject/test/unit/src/org/netbeans/modules/j2ee/ejbjarproject/test/TestUtil.java
@@ -30,7 +30,7 @@
import java.util.Map;
import java.util.StringTokenizer;
import java.util.WeakHashMap;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.netbeans.api.project.Project;
import org.netbeans.junit.NbTestCase;
import org.netbeans.spi.project.ProjectFactory;
diff --git a/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/AnnotationPostContructTest.java b/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/AnnotationPostContructTest.java
index e57e3e1..8f898b4 100644
--- a/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/AnnotationPostContructTest.java
+++ b/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/AnnotationPostContructTest.java
@@ -18,7 +18,6 @@
*/
package org.netbeans.modules.j2ee.ejbverification.rules;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.modules.j2ee.ejbverification.HintTestBase;
import org.netbeans.modules.j2ee.ejbverification.TestBase;
diff --git a/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/BMnotPartOfRBIandLBITest.java b/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/BMnotPartOfRBIandLBITest.java
index d55151e..0f03255 100644
--- a/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/BMnotPartOfRBIandLBITest.java
+++ b/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/BMnotPartOfRBIandLBITest.java
@@ -18,7 +18,6 @@
*/
package org.netbeans.modules.j2ee.ejbverification.rules;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.modules.j2ee.ejbverification.HintTestBase;
import org.netbeans.modules.j2ee.ejbverification.TestBase;
import org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater;
diff --git a/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/BeanImplementsBITest.java b/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/BeanImplementsBITest.java
index 9d86a21..3f6d599 100644
--- a/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/BeanImplementsBITest.java
+++ b/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/BeanImplementsBITest.java
@@ -18,7 +18,6 @@
*/
package org.netbeans.modules.j2ee.ejbverification.rules;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.modules.j2ee.ejbverification.HintTestBase;
import org.netbeans.modules.j2ee.ejbverification.TestBase;
import static org.netbeans.modules.j2ee.ejbverification.TestBase.copyStringToFileObject;
diff --git a/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/BusinessMethodExposedTest.java b/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/BusinessMethodExposedTest.java
index 76aea52..e3c79d5 100644
--- a/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/BusinessMethodExposedTest.java
+++ b/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/BusinessMethodExposedTest.java
@@ -18,7 +18,6 @@
*/
package org.netbeans.modules.j2ee.ejbverification.rules;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.modules.j2ee.ejbverification.HintTestBase;
import org.netbeans.modules.j2ee.ejbverification.TestBase;
import static org.netbeans.modules.j2ee.ejbverification.TestBase.copyStringToFileObject;
diff --git a/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/HasNoArgContructorTest.java b/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/HasNoArgContructorTest.java
index 7fb1b73..b5b4089 100644
--- a/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/HasNoArgContructorTest.java
+++ b/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/HasNoArgContructorTest.java
@@ -18,7 +18,6 @@
*/
package org.netbeans.modules.j2ee.ejbverification.rules;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.modules.j2ee.ejbverification.HintTestBase;
import org.netbeans.modules.j2ee.ejbverification.TestBase;
diff --git a/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/LegalModifiersTest.java b/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/LegalModifiersTest.java
index bf034e4..c053132 100644
--- a/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/LegalModifiersTest.java
+++ b/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/LegalModifiersTest.java
@@ -18,7 +18,6 @@
*/
package org.netbeans.modules.j2ee.ejbverification.rules;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.modules.j2ee.ejbverification.HintTestBase;
import org.netbeans.modules.j2ee.ejbverification.TestBase;
diff --git a/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/LocalAnnotatedBeanHasLBITest.java b/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/LocalAnnotatedBeanHasLBITest.java
index b2e8e42..c20996c 100644
--- a/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/LocalAnnotatedBeanHasLBITest.java
+++ b/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/LocalAnnotatedBeanHasLBITest.java
@@ -18,7 +18,6 @@
*/
package org.netbeans.modules.j2ee.ejbverification.rules;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.modules.j2ee.ejbverification.HintTestBase;
import org.netbeans.modules.j2ee.ejbverification.TestBase;
diff --git a/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/PersistentTimerInEjbLiteTest.java b/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/PersistentTimerInEjbLiteTest.java
index 1b102d4..120458f 100644
--- a/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/PersistentTimerInEjbLiteTest.java
+++ b/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/PersistentTimerInEjbLiteTest.java
@@ -18,7 +18,6 @@
*/
package org.netbeans.modules.j2ee.ejbverification.rules;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.modules.j2ee.ejbverification.HintTestBase;
import org.netbeans.modules.j2ee.ejbverification.TestBase;
diff --git a/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/RemoteAnnotatedBeanHasRBITest.java b/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/RemoteAnnotatedBeanHasRBITest.java
index 325e3e5..e99468b 100644
--- a/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/RemoteAnnotatedBeanHasRBITest.java
+++ b/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/RemoteAnnotatedBeanHasRBITest.java
@@ -18,7 +18,6 @@
*/
package org.netbeans.modules.j2ee.ejbverification.rules;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.modules.j2ee.ejbverification.HintTestBase;
import org.netbeans.modules.j2ee.ejbverification.TestBase;
diff --git a/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/SBSuperClassNotSBTest.java b/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/SBSuperClassNotSBTest.java
index 4f5727c..f019600 100644
--- a/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/SBSuperClassNotSBTest.java
+++ b/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/SBSuperClassNotSBTest.java
@@ -18,7 +18,6 @@
*/
package org.netbeans.modules.j2ee.ejbverification.rules;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.modules.j2ee.ejbverification.HintTestBase;
import org.netbeans.modules.j2ee.ejbverification.TestBase;
import static org.netbeans.modules.j2ee.ejbverification.TestBase.copyStringToFileObject;
diff --git a/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/SessionSynchImplementedBySFSBOnlyTest.java b/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/SessionSynchImplementedBySFSBOnlyTest.java
index b60412f..8899ac7 100644
--- a/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/SessionSynchImplementedBySFSBOnlyTest.java
+++ b/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/SessionSynchImplementedBySFSBOnlyTest.java
@@ -18,7 +18,6 @@
*/
package org.netbeans.modules.j2ee.ejbverification.rules;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.modules.j2ee.ejbverification.EJBAPIAnnotations;
import org.netbeans.modules.j2ee.ejbverification.HintTestBase;
import org.netbeans.modules.j2ee.ejbverification.TestBase;
diff --git a/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/ValueNotSpecifiedForRemoteAnnotationInterfaceTest.java b/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/ValueNotSpecifiedForRemoteAnnotationInterfaceTest.java
index a3faa2a..b0542be 100644
--- a/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/ValueNotSpecifiedForRemoteAnnotationInterfaceTest.java
+++ b/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/ValueNotSpecifiedForRemoteAnnotationInterfaceTest.java
@@ -18,7 +18,6 @@
*/
package org.netbeans.modules.j2ee.ejbverification.rules;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.modules.j2ee.ejbverification.HintTestBase;
import org.netbeans.modules.j2ee.ejbverification.TestBase;
diff --git a/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/WSisSLSBTest.java b/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/WSisSLSBTest.java
index 336373f..2ddf97c 100644
--- a/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/WSisSLSBTest.java
+++ b/enterprise/j2ee.ejbverification/test/unit/src/org/netbeans/modules/j2ee/ejbverification/rules/WSisSLSBTest.java
@@ -18,7 +18,6 @@
*/
package org.netbeans.modules.j2ee.ejbverification.rules;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.modules.j2ee.ejbverification.HintTestBase;
import org.netbeans.modules.j2ee.ejbverification.TestBase;
diff --git a/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/JavaEEProjectSettingsImplTest.java b/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/JavaEEProjectSettingsImplTest.java
index f6b61b3..ec42268 100644
--- a/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/JavaEEProjectSettingsImplTest.java
+++ b/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/JavaEEProjectSettingsImplTest.java
@@ -18,7 +18,6 @@
*/
package org.netbeans.modules.maven.j2ee;
-import static junit.framework.Assert.assertEquals;
import org.netbeans.api.j2ee.core.Profile;
import org.netbeans.api.project.Project;
import org.netbeans.modules.javaee.project.api.JavaEEProjectSettings;
diff --git a/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/web/WebModuleImplTest.java b/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/web/WebModuleImplTest.java
index 7ef3735..8800f0f 100644
--- a/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/web/WebModuleImplTest.java
+++ b/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/web/WebModuleImplTest.java
@@ -19,7 +19,6 @@
package org.netbeans.modules.maven.j2ee.web;
import java.io.IOException;
-import static junit.framework.Assert.assertEquals;
import org.netbeans.api.j2ee.core.Profile;
import org.netbeans.modules.javaee.project.api.JavaEEProjectSettings;
import org.netbeans.modules.maven.j2ee.JavaEEMavenTestBase;
diff --git a/enterprise/performance.scripting/test/qa-functional/src/org/netbeans/performance/languages/actions/CountingSecurityManager.java b/enterprise/performance.scripting/test/qa-functional/src/org/netbeans/performance/languages/actions/CountingSecurityManager.java
index b3a387c..fdab7ff 100644
--- a/enterprise/performance.scripting/test/qa-functional/src/org/netbeans/performance/languages/actions/CountingSecurityManager.java
+++ b/enterprise/performance.scripting/test/qa-functional/src/org/netbeans/performance/languages/actions/CountingSecurityManager.java
@@ -31,7 +31,7 @@
import java.util.Map;
import java.util.TreeSet;
import java.util.concurrent.atomic.AtomicLong;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.openide.util.Exceptions;
/**
diff --git a/enterprise/profiler.j2ee/test/unit/src/org/netbeans/modules/profiler/categories/j2ee/TestUtilities.java b/enterprise/profiler.j2ee/test/unit/src/org/netbeans/modules/profiler/categories/j2ee/TestUtilities.java
index 832de79..553159f 100644
--- a/enterprise/profiler.j2ee/test/unit/src/org/netbeans/modules/profiler/categories/j2ee/TestUtilities.java
+++ b/enterprise/profiler.j2ee/test/unit/src/org/netbeans/modules/profiler/categories/j2ee/TestUtilities.java
@@ -25,9 +25,7 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
-
-import junit.framework.Assert;
-
+import org.junit.Assert;
import org.netbeans.api.editor.mimelookup.MimePath;
import org.netbeans.modules.java.source.indexing.JavaCustomIndexer;
import org.netbeans.modules.java.source.parsing.ClassParser;
diff --git a/enterprise/web.core.syntax/test/qa-functional/src/org/netbeans/test/syntax/CompletionSanityTest.java b/enterprise/web.core.syntax/test/qa-functional/src/org/netbeans/test/syntax/CompletionSanityTest.java
index 740cd3b..df9b313 100644
--- a/enterprise/web.core.syntax/test/qa-functional/src/org/netbeans/test/syntax/CompletionSanityTest.java
+++ b/enterprise/web.core.syntax/test/qa-functional/src/org/netbeans/test/syntax/CompletionSanityTest.java
@@ -20,7 +20,6 @@
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
-import static junit.framework.Assert.assertEquals;
import junit.framework.Test;
import org.netbeans.jellytools.EditorOperator;
import org.netbeans.jellytools.modules.editor.CompletionJListOperator;
diff --git a/enterprise/web.core.syntax/test/qa-functional/src/org/netbeans/test/syntax/CompletionTagSanityTest.java b/enterprise/web.core.syntax/test/qa-functional/src/org/netbeans/test/syntax/CompletionTagSanityTest.java
index ff3fcdd..4eac185 100644
--- a/enterprise/web.core.syntax/test/qa-functional/src/org/netbeans/test/syntax/CompletionTagSanityTest.java
+++ b/enterprise/web.core.syntax/test/qa-functional/src/org/netbeans/test/syntax/CompletionTagSanityTest.java
@@ -20,7 +20,6 @@
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
-import static junit.framework.Assert.assertEquals;
import junit.framework.Test;
import org.netbeans.jellytools.EditorOperator;
import org.netbeans.jellytools.modules.editor.CompletionJListOperator;
diff --git a/enterprise/web.core.syntax/test/qa-functional/src/org/netbeans/test/syntax/ExpressionLang30Test.java b/enterprise/web.core.syntax/test/qa-functional/src/org/netbeans/test/syntax/ExpressionLang30Test.java
index e01eb93..c770f21 100644
--- a/enterprise/web.core.syntax/test/qa-functional/src/org/netbeans/test/syntax/ExpressionLang30Test.java
+++ b/enterprise/web.core.syntax/test/qa-functional/src/org/netbeans/test/syntax/ExpressionLang30Test.java
@@ -19,8 +19,6 @@
package org.netbeans.test.syntax;
import java.awt.event.InputEvent;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
import junit.framework.Test;
import org.netbeans.jellytools.EditorOperator;
import org.netbeans.jellytools.modules.editor.CompletionJListOperator;
diff --git a/enterprise/web.core.syntax/test/qa-functional/src/org/netbeans/test/syntax/GeneralJSP.java b/enterprise/web.core.syntax/test/qa-functional/src/org/netbeans/test/syntax/GeneralJSP.java
index c31cd21..c5514fb 100644
--- a/enterprise/web.core.syntax/test/qa-functional/src/org/netbeans/test/syntax/GeneralJSP.java
+++ b/enterprise/web.core.syntax/test/qa-functional/src/org/netbeans/test/syntax/GeneralJSP.java
@@ -25,7 +25,6 @@
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
-import static junit.framework.Assert.fail;
import org.netbeans.jellytools.EditorOperator;
import org.netbeans.jellytools.ProjectsTabOperator;
import org.netbeans.jellytools.modules.editor.CompletionJListOperator;
diff --git a/enterprise/web.core.syntax/test/unit/src/org/netbeans/modules/web/core/syntax/JspKitTest.java b/enterprise/web.core.syntax/test/unit/src/org/netbeans/modules/web/core/syntax/JspKitTest.java
index e2975ba..3fc8e7c 100644
--- a/enterprise/web.core.syntax/test/unit/src/org/netbeans/modules/web/core/syntax/JspKitTest.java
+++ b/enterprise/web.core.syntax/test/unit/src/org/netbeans/modules/web/core/syntax/JspKitTest.java
@@ -20,7 +20,7 @@
package org.netbeans.modules.web.core.syntax;
import javax.swing.text.EditorKit;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.junit.Test;
import org.netbeans.api.editor.mimelookup.MimeLookup;
import org.netbeans.api.editor.mimelookup.MimePath;
diff --git a/enterprise/web.core/test/unit/src/org/netbeans/modules/web/core/test/TestUtil.java b/enterprise/web.core/test/unit/src/org/netbeans/modules/web/core/test/TestUtil.java
index df43123..f170c95 100644
--- a/enterprise/web.core/test/unit/src/org/netbeans/modules/web/core/test/TestUtil.java
+++ b/enterprise/web.core/test/unit/src/org/netbeans/modules/web/core/test/TestUtil.java
@@ -35,7 +35,7 @@
import java.util.WeakHashMap;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.netbeans.api.project.Project;
import org.netbeans.junit.NbTestCase;
import org.netbeans.modules.j2ee.deployment.impl.ServerRegistry;
diff --git a/enterprise/web.el/test/unit/src/org/netbeans/modules/web/el/ELTestBase.java b/enterprise/web.el/test/unit/src/org/netbeans/modules/web/el/ELTestBase.java
index a8e623c..96e931a 100644
--- a/enterprise/web.el/test/unit/src/org/netbeans/modules/web/el/ELTestBase.java
+++ b/enterprise/web.el/test/unit/src/org/netbeans/modules/web/el/ELTestBase.java
@@ -60,8 +60,6 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.api.j2ee.core.Profile;
import org.netbeans.api.java.classpath.ClassPath;
import org.netbeans.modules.csl.api.CodeCompletionContext;
diff --git a/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/TestBase.java b/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/TestBase.java
index 0e478a6..609dab4 100644
--- a/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/TestBase.java
+++ b/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/TestBase.java
@@ -61,7 +61,6 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.api.j2ee.core.Profile;
import org.netbeans.api.java.classpath.ClassPath;
import org.netbeans.api.xml.services.UserCatalog;
diff --git a/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/TestBaseForTestProject.java b/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/TestBaseForTestProject.java
index 977b2de..5d4b428 100644
--- a/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/TestBaseForTestProject.java
+++ b/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/TestBaseForTestProject.java
@@ -24,7 +24,6 @@
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.api.java.classpath.ClassPath;
import org.netbeans.api.project.Project;
import org.netbeans.api.project.Sources;
diff --git a/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/el/JsfVariablesModelTest.java b/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/el/JsfVariablesModelTest.java
index 1e60e3c..99fa282 100644
--- a/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/el/JsfVariablesModelTest.java
+++ b/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/el/JsfVariablesModelTest.java
@@ -20,7 +20,6 @@
import java.util.Iterator;
import java.util.SortedSet;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.modules.parsing.api.ParserManager;
import org.netbeans.modules.parsing.api.ResultIterator;
import org.netbeans.modules.parsing.api.UserTask;
diff --git a/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/facelets/FaceletsLibrarySupportTest.java b/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/facelets/FaceletsLibrarySupportTest.java
index 81f0d9f..13f92d8 100644
--- a/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/facelets/FaceletsLibrarySupportTest.java
+++ b/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/facelets/FaceletsLibrarySupportTest.java
@@ -23,7 +23,6 @@
import java.util.logging.ConsoleHandler;
import java.util.logging.Handler;
import java.util.logging.Level;
-import static junit.framework.Assert.assertNotNull;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.netbeans.modules.web.jsf.editor.JsfSupportImpl;
diff --git a/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/index/ResourcesMappingModelTest.java b/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/index/ResourcesMappingModelTest.java
index c1a07b9..83be08c 100644
--- a/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/index/ResourcesMappingModelTest.java
+++ b/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/index/ResourcesMappingModelTest.java
@@ -20,8 +20,6 @@
import java.util.ArrayList;
import java.util.List;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
import org.junit.Test;
import org.netbeans.junit.NbTestCase;
import org.netbeans.modules.web.jsf.editor.index.ResourcesMappingModel.Resource;
diff --git a/enterprise/web.jsf.navigation/test/unit/src/org/netbeans/modules/web/jsf/navigation/TestUtilities.java b/enterprise/web.jsf.navigation/test/unit/src/org/netbeans/modules/web/jsf/navigation/TestUtilities.java
index 83de9e6..df2eddb 100644
--- a/enterprise/web.jsf.navigation/test/unit/src/org/netbeans/modules/web/jsf/navigation/TestUtilities.java
+++ b/enterprise/web.jsf.navigation/test/unit/src/org/netbeans/modules/web/jsf/navigation/TestUtilities.java
@@ -20,7 +20,7 @@
import java.io.File;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.netbeans.api.editor.mimelookup.MimePath;
import org.netbeans.modules.java.source.indexing.JavaCustomIndexer;
import org.netbeans.modules.java.source.parsing.ClassParser;
diff --git a/enterprise/web.jsf/test/unit/src/org/netbeans/modules/web/jsf/metamodel/CommonTestCase.java b/enterprise/web.jsf/test/unit/src/org/netbeans/modules/web/jsf/metamodel/CommonTestCase.java
index cfbab26..3f2c9ad 100644
--- a/enterprise/web.jsf/test/unit/src/org/netbeans/modules/web/jsf/metamodel/CommonTestCase.java
+++ b/enterprise/web.jsf/test/unit/src/org/netbeans/modules/web/jsf/metamodel/CommonTestCase.java
@@ -27,9 +27,7 @@
import java.util.Map;
import javax.swing.Icon;
import javax.swing.event.ChangeListener;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.api.j2ee.core.Profile;
-
import org.netbeans.api.java.classpath.ClassPath;
import org.netbeans.api.project.FileOwnerQuery;
import org.netbeans.api.project.Project;
diff --git a/enterprise/web.jsf/test/unit/src/org/netbeans/modules/web/jsf/xdm/model/ElementOrderingTest.java b/enterprise/web.jsf/test/unit/src/org/netbeans/modules/web/jsf/xdm/model/ElementOrderingTest.java
index c0a7962..59f77a1 100644
--- a/enterprise/web.jsf/test/unit/src/org/netbeans/modules/web/jsf/xdm/model/ElementOrderingTest.java
+++ b/enterprise/web.jsf/test/unit/src/org/netbeans/modules/web/jsf/xdm/model/ElementOrderingTest.java
@@ -22,9 +22,6 @@
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNull;
-
import org.netbeans.junit.NbTestCase;
import org.netbeans.modules.web.jsf.api.facesmodel.Application;
import org.netbeans.modules.web.jsf.api.facesmodel.Clazz;
diff --git a/enterprise/web.jspparser/test/unit/src/org/netbeans/modules/web/jspparser/TestUtil.java b/enterprise/web.jspparser/test/unit/src/org/netbeans/modules/web/jspparser/TestUtil.java
index 64b71ec..b9e6788 100644
--- a/enterprise/web.jspparser/test/unit/src/org/netbeans/modules/web/jspparser/TestUtil.java
+++ b/enterprise/web.jspparser/test/unit/src/org/netbeans/modules/web/jspparser/TestUtil.java
@@ -33,7 +33,7 @@
import java.util.logging.Logger;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.netbeans.api.project.Project;
import org.netbeans.api.project.ProjectManager;
import org.netbeans.junit.NbTestCase;
diff --git a/enterprise/web.project/test/unit/src/org/netbeans/modules/web/project/WebProjectTest.java b/enterprise/web.project/test/unit/src/org/netbeans/modules/web/project/WebProjectTest.java
index 31e1a81..d007888 100644
--- a/enterprise/web.project/test/unit/src/org/netbeans/modules/web/project/WebProjectTest.java
+++ b/enterprise/web.project/test/unit/src/org/netbeans/modules/web/project/WebProjectTest.java
@@ -20,7 +20,6 @@
package org.netbeans.modules.web.project;
import java.io.File;
-import static junit.framework.Assert.assertEquals;
import org.netbeans.api.j2ee.core.Profile;
import org.netbeans.api.project.Project;
import org.netbeans.api.project.ProjectManager;
@@ -29,7 +28,6 @@
import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
import org.netbeans.modules.project.uiapi.ProjectOpenedTrampoline;
import org.netbeans.modules.web.project.api.WebPropertyEvaluator;
-import org.netbeans.modules.web.project.test.TestUtil;
import org.netbeans.spi.project.ui.ProjectOpenedHook;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil;
diff --git a/enterprise/web.project/test/unit/src/org/netbeans/modules/web/project/test/TestUtil.java b/enterprise/web.project/test/unit/src/org/netbeans/modules/web/project/test/TestUtil.java
index 5478ee3..982a45d 100644
--- a/enterprise/web.project/test/unit/src/org/netbeans/modules/web/project/test/TestUtil.java
+++ b/enterprise/web.project/test/unit/src/org/netbeans/modules/web/project/test/TestUtil.java
@@ -36,7 +36,7 @@
import java.util.WeakHashMap;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.netbeans.api.editor.mimelookup.MimePath;
import org.netbeans.api.project.Project;
import org.netbeans.junit.NbTestCase;
@@ -47,7 +47,6 @@
import org.netbeans.spi.editor.mimelookup.MimeDataProvider;
import org.netbeans.spi.project.ProjectFactory;
import org.netbeans.spi.project.ProjectState;
-import org.netbeans.spi.project.support.ant.AntBasedProjectType;
import org.netbeans.spi.project.support.ant.AntProjectHelper;
import org.netbeans.spi.project.support.ant.EditableProperties;
import org.openide.filesystems.FileLock;
diff --git a/enterprise/websvc.design/test/unit/src/org/netbeans/modules/websvc/design/javamodel/SourceUtilsTestUtil.java b/enterprise/websvc.design/test/unit/src/org/netbeans/modules/websvc/design/javamodel/SourceUtilsTestUtil.java
index 4b58852..169d1c4 100644
--- a/enterprise/websvc.design/test/unit/src/org/netbeans/modules/websvc/design/javamodel/SourceUtilsTestUtil.java
+++ b/enterprise/websvc.design/test/unit/src/org/netbeans/modules/websvc/design/javamodel/SourceUtilsTestUtil.java
@@ -25,7 +25,7 @@
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.netbeans.modules.parsing.api.indexing.IndexingManager;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileSystem;
diff --git a/enterprise/websvc.rest/test/unit/src/org/netbeans/modules/websvc/rest/codegen/TestBase.java b/enterprise/websvc.rest/test/unit/src/org/netbeans/modules/websvc/rest/codegen/TestBase.java
index 5370afc..e855974 100644
--- a/enterprise/websvc.rest/test/unit/src/org/netbeans/modules/websvc/rest/codegen/TestBase.java
+++ b/enterprise/websvc.rest/test/unit/src/org/netbeans/modules/websvc/rest/codegen/TestBase.java
@@ -25,7 +25,6 @@
import java.util.Collections;
import java.util.List;
import javax.persistence.Entity;
-import junit.framework.Assert;
import org.netbeans.api.java.classpath.ClassPath;
import org.netbeans.api.java.source.ClasspathInfo;
import org.netbeans.api.java.source.JavaSource;
@@ -105,13 +104,13 @@
URL url = Thread.currentThread().getContextClassLoader().getResource(
"org/netbeans/modules/websvc/rest/resources/layer.xml");
URL url2 = TestBase.class.getResource("layer.xml");
- Assert.assertNotNull(url);
- Assert.assertNotNull(url2);
+ assertNotNull(url);
+ assertNotNull(url2);
try {
xmlFS.setXmlUrls(new URL[] { url, url2 });
} catch(Exception e) {
e.printStackTrace();
- Assert.fail(e.getMessage());
+ fail(e.getMessage());
}
FileSystem system = new MultiFileSystem(new FileSystem[] {FileUtil.createMemoryFileSystem(), xmlFS});
defaultRepository = new Repository(system);
diff --git a/extide/gradle/src/org/netbeans/modules/gradle/NbGradleProjectFactory.java b/extide/gradle/src/org/netbeans/modules/gradle/NbGradleProjectFactory.java
index 628e3f8..6663416 100644
--- a/extide/gradle/src/org/netbeans/modules/gradle/NbGradleProjectFactory.java
+++ b/extide/gradle/src/org/netbeans/modules/gradle/NbGradleProjectFactory.java
@@ -43,7 +43,12 @@
@Override
public ProjectManager.Result isProject2(FileObject dir) {
- return isProject(dir) ? new ProjectManager.Result(NbGradleProject.getIcon()) : null;
+ if (!isProject(dir)) {
+ return null;
+ }
+ // project display name can be only safely determined if the project is loaded
+ return isProject(dir) ? new ProjectManager.Result(
+ null, NbGradleProject.GRADLE_PROJECT_TYPE, NbGradleProject.getIcon()) : null;
}
@Override
diff --git a/extide/gradle/src/org/netbeans/modules/gradle/spi/GradleFiles.java b/extide/gradle/src/org/netbeans/modules/gradle/spi/GradleFiles.java
index 5652510..eca56b7 100644
--- a/extide/gradle/src/org/netbeans/modules/gradle/spi/GradleFiles.java
+++ b/extide/gradle/src/org/netbeans/modules/gradle/spi/GradleFiles.java
@@ -220,7 +220,7 @@
}
public boolean isRootProject() {
- return (buildScript != null) && rootDir.equals(projectDir);
+ return isProject() && rootDir.equals(projectDir);
}
public boolean isSubProject() {
diff --git a/extide/gradle/test/unit/src/org/netbeans/modules/gradle/NbGradleProjectFactoryTest.java b/extide/gradle/test/unit/src/org/netbeans/modules/gradle/NbGradleProjectFactoryTest.java
index 4041f77..c2ea1e5 100644
--- a/extide/gradle/test/unit/src/org/netbeans/modules/gradle/NbGradleProjectFactoryTest.java
+++ b/extide/gradle/test/unit/src/org/netbeans/modules/gradle/NbGradleProjectFactoryTest.java
@@ -21,6 +21,7 @@
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.util.Random;
+import org.netbeans.modules.gradle.api.NbGradleProject;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil;
import org.openide.filesystems.LocalFileSystem;
@@ -129,9 +130,31 @@
}
FileObject app = FileUtil.createFolder(parentPrj, "app");
FileObject gradle = FileUtil.createData(app, "build.gradle");
-
+ assertProjectsRecognized(parentPrj, app);
+ }
+
+ private void assertProjectsRecognized(FileObject parentPrj, FileObject app) {
assertTrue("Parent Gradle recognized", NbGradleProjectFactory.isProjectCheck(parentPrj, false));
assertTrue("Child Gradle recognized", NbGradleProjectFactory.isProjectCheck(app, false));
+ NbGradleProjectFactory factoryInstance = new NbGradleProjectFactory();
+ assertEquals("Gradle project type of main project", NbGradleProject.GRADLE_PROJECT_TYPE, factoryInstance.isProject2(parentPrj).getProjectType());
+ assertEquals("Gradle project type of subproject", NbGradleProject.GRADLE_PROJECT_TYPE, factoryInstance.isProject2(app).getProjectType());
+ }
+
+ /**
+ * Checks that project with just settings.gradle and no build.gradle is recognized as a project.
+ */
+ public void testNoBuildFileProject() throws Exception {
+ FileObject parentPrj = root;
+ FileObject settings = FileUtil.createData(parentPrj, "settings.gradle");
+ try (OutputStream os = settings.getOutputStream()) {
+ os.write(("\n"
+ + "rootProject.name = 'example'\n"
+ + "include('app')\n"
+ ).getBytes(StandardCharsets.UTF_8));
+ }
+ FileObject app = FileUtil.createFolder(parentPrj, "app");
+ assertProjectsRecognized(parentPrj, app);
}
}
diff --git a/harness/nbjunit/src/org/netbeans/junit/ControlFlow.java b/harness/nbjunit/src/org/netbeans/junit/ControlFlow.java
index e8bc035..6b1323f 100644
--- a/harness/nbjunit/src/org/netbeans/junit/ControlFlow.java
+++ b/harness/nbjunit/src/org/netbeans/junit/ControlFlow.java
@@ -32,7 +32,7 @@
import java.util.logging.LogRecord;
import java.util.logging.Logger;
import java.util.regex.Pattern;
-import junit.framework.Assert;
+import org.junit.Assert;
/** Basic skeleton for logging test case.
*
diff --git a/harness/nbjunit/src/org/netbeans/junit/Log.java b/harness/nbjunit/src/org/netbeans/junit/Log.java
index 454347f..8964a56 100644
--- a/harness/nbjunit/src/org/netbeans/junit/Log.java
+++ b/harness/nbjunit/src/org/netbeans/junit/Log.java
@@ -41,8 +41,8 @@
import java.util.logging.LogManager;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
-import junit.framework.Assert;
import junit.framework.AssertionFailedError;
+import static junit.framework.TestCase.fail;
import org.netbeans.junit.internal.NbModuleLogHandler;
/** Collects log messages.
@@ -420,7 +420,7 @@
}
if (count == 0) {
- Assert.fail("No instance of this type reported");
+ fail("No instance of this type reported");
}
for (int i = 0; i < count; i++) {
diff --git a/harness/nbjunit/src/org/netbeans/junit/NbModuleSuite.java b/harness/nbjunit/src/org/netbeans/junit/NbModuleSuite.java
index 2abfe13..47ad32a 100644
--- a/harness/nbjunit/src/org/netbeans/junit/NbModuleSuite.java
+++ b/harness/nbjunit/src/org/netbeans/junit/NbModuleSuite.java
@@ -54,13 +54,13 @@
import java.util.regex.Pattern;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
-import junit.framework.Assert;
import junit.framework.AssertionFailedError;
import junit.framework.Protectable;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestFailure;
import junit.framework.TestResult;
+import org.junit.Assert;
import org.netbeans.junit.internal.NbModuleLogHandler;
/**
diff --git a/harness/nbjunit/src/org/netbeans/junit/diff/Diff.java b/harness/nbjunit/src/org/netbeans/junit/diff/Diff.java
index 797085a..6c18827 100644
--- a/harness/nbjunit/src/org/netbeans/junit/diff/Diff.java
+++ b/harness/nbjunit/src/org/netbeans/junit/diff/Diff.java
@@ -36,7 +36,7 @@
*
* @author Jan Becicka
* @version 0.1
- * @see junit.framework.Assert Assert class
+ * @see org.junit.Assert Assert class
*/
public interface Diff {
diff --git a/harness/nbjunit/test/unit/src/org/netbeans/junit/OrderAZTest.java b/harness/nbjunit/test/unit/src/org/netbeans/junit/OrderAZTest.java
index 412b908..569a8b1 100644
--- a/harness/nbjunit/test/unit/src/org/netbeans/junit/OrderAZTest.java
+++ b/harness/nbjunit/test/unit/src/org/netbeans/junit/OrderAZTest.java
@@ -19,9 +19,9 @@
package org.netbeans.junit;
import java.lang.reflect.Method;
-import junit.framework.Assert;
import junit.framework.TestResult;
import junit.framework.TestSuite;
+import org.junit.Assert;
import org.junit.Test;
/** Check the a-z behaviour.
diff --git a/harness/nbjunit/test/unit/src/org/netbeans/junit/OrderTest.java b/harness/nbjunit/test/unit/src/org/netbeans/junit/OrderTest.java
index f12a40e..97d5f0b 100644
--- a/harness/nbjunit/test/unit/src/org/netbeans/junit/OrderTest.java
+++ b/harness/nbjunit/test/unit/src/org/netbeans/junit/OrderTest.java
@@ -19,9 +19,9 @@
package org.netbeans.junit;
import java.lang.reflect.Method;
-import junit.framework.Assert;
import junit.framework.TestResult;
import junit.framework.TestSuite;
+import org.junit.Assert;
import org.junit.Test;
/** Check the shuffle behaviour.
diff --git a/harness/nbjunit/test/unit/src/org/netbeans/junit/OrderZATest.java b/harness/nbjunit/test/unit/src/org/netbeans/junit/OrderZATest.java
index 61a5bda..a11bde5 100644
--- a/harness/nbjunit/test/unit/src/org/netbeans/junit/OrderZATest.java
+++ b/harness/nbjunit/test/unit/src/org/netbeans/junit/OrderZATest.java
@@ -19,9 +19,9 @@
package org.netbeans.junit;
import java.lang.reflect.Method;
-import junit.framework.Assert;
import junit.framework.TestResult;
import junit.framework.TestSuite;
+import org.junit.Assert;
import org.junit.Test;
/** Check the z-a behaviour.
diff --git a/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/api/IssueTest.java b/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/api/IssueTest.java
index 5bebc46..b96bbab 100644
--- a/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/api/IssueTest.java
+++ b/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/api/IssueTest.java
@@ -23,9 +23,6 @@
import java.beans.PropertyChangeListener;
import java.io.File;
import java.util.logging.Level;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNull;
import org.netbeans.junit.NbTestCase;
import org.netbeans.modules.bugtracking.APIAccessor;
import org.netbeans.modules.bugtracking.IssueImpl;
diff --git a/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/api/QueryTest.java b/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/api/QueryTest.java
index e672476..66feade 100644
--- a/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/api/QueryTest.java
+++ b/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/api/QueryTest.java
@@ -22,11 +22,6 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.logging.Level;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
import org.netbeans.junit.NbTestCase;
import org.netbeans.modules.bugtracking.APIAccessor;
import org.netbeans.modules.bugtracking.ui.query.QueryTopComponent;
diff --git a/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/api/RepositoryManagerTest.java b/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/api/RepositoryManagerTest.java
index f0f7a5c..d0da06b 100644
--- a/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/api/RepositoryManagerTest.java
+++ b/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/api/RepositoryManagerTest.java
@@ -25,7 +25,6 @@
import java.util.LinkedList;
import java.util.List;
import java.util.logging.Level;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.junit.NbTestCase;
import org.netbeans.modules.bugtracking.BugtrackingManager;
import org.netbeans.modules.bugtracking.DelegatingConnector;
diff --git a/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/api/RepositoryTest.java b/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/api/RepositoryTest.java
index 81903e2..2fc8658 100644
--- a/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/api/RepositoryTest.java
+++ b/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/api/RepositoryTest.java
@@ -24,7 +24,6 @@
import java.io.IOException;
import java.util.Map;
import java.util.logging.Level;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.junit.NbTestCase;
import org.netbeans.junit.NbTestSuite;
import org.netbeans.modules.bugtracking.RepositoryImpl;
diff --git a/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/api/UtilTestCase.java b/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/api/UtilTestCase.java
index 46317c3..0a49575 100644
--- a/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/api/UtilTestCase.java
+++ b/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/api/UtilTestCase.java
@@ -21,10 +21,6 @@
import java.util.Set;
import java.util.logging.Level;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.fail;
import org.netbeans.junit.NbTestCase;
import org.netbeans.modules.bugtracking.APIAccessor;
import org.netbeans.modules.bugtracking.IssueImpl;
diff --git a/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/spi/SchedulingPickerTest.java b/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/spi/SchedulingPickerTest.java
index bcf40a6..cca90db 100644
--- a/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/spi/SchedulingPickerTest.java
+++ b/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/spi/SchedulingPickerTest.java
@@ -20,7 +20,7 @@
package org.netbeans.modules.bugtracking.spi;
import java.util.Date;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.junit.Test;
/**
diff --git a/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/tasks/cache/DashboardStorageTest.java b/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/tasks/cache/DashboardStorageTest.java
index bd9eb13..39a7936 100644
--- a/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/tasks/cache/DashboardStorageTest.java
+++ b/ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/tasks/cache/DashboardStorageTest.java
@@ -26,11 +26,6 @@
import java.util.Collections;
import java.util.List;
import java.util.logging.Level;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.junit.NbTestCase;
/**
diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/MylynStorageTest.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/MylynStorageTest.java
index 241a3f8..5514f04 100644
--- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/MylynStorageTest.java
+++ b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/MylynStorageTest.java
@@ -34,12 +34,6 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertSame;
-import static junit.framework.Assert.assertTrue;
import junit.framework.Test;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaNotSupportedTest.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaNotSupportedTest.java
index 0f3f588..83be6de 100644
--- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaNotSupportedTest.java
+++ b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaNotSupportedTest.java
@@ -19,7 +19,6 @@
package org.netbeans.modules.bugzilla.autoupdate;
-import static junit.framework.Assert.assertFalse;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion;
import org.netbeans.junit.NbTestCase;
import org.netbeans.modules.bugzilla.TestConstants;
diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaPluginUCTest.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaPluginUCTest.java
index 8c8f9e5..a99f7f7 100644
--- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaPluginUCTest.java
+++ b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaPluginUCTest.java
@@ -20,9 +20,6 @@
package org.netbeans.modules.bugzilla.autoupdate;
import org.netbeans.modules.bugtracking.commons.AutoupdatePluginUCTestCase;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
-import junit.framework.Test;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion;
import org.netbeans.junit.NbModuleSuite;
import org.netbeans.modules.bugtracking.commons.AutoupdateSupport;
diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaSupportedTest.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaSupportedTest.java
index 54aab73..ed03970 100644
--- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaSupportedTest.java
+++ b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaSupportedTest.java
@@ -19,7 +19,6 @@
package org.netbeans.modules.bugzilla.autoupdate;
-import static junit.framework.Assert.assertTrue;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion;
import org.netbeans.junit.NbTestCase;
import org.netbeans.modules.bugzilla.TestConstants;
diff --git a/ide/c.jcraft.jsch/build.xml b/ide/c.jcraft.jsch/build.xml
index a7252c9..d06dfb5 100644
--- a/ide/c.jcraft.jsch/build.xml
+++ b/ide/c.jcraft.jsch/build.xml
@@ -33,6 +33,7 @@
<!-- Ensure that the necessary modules/bundles are made available to JSch -->
<attribute name="Require-Bundle" value="com.jcraft.jzlib,bcprov,libs.c.kohlschutter.junixsocket,org.netbeans.libs.jna,org.netbeans.libs.jna.platform"/>
<attribute name="NB-Original-CRC" value="${c.jcraft.jsch.crc32}"/>
+ <attribute name="Multi-Release" value="true"/>
</manifest>
</jar>
</target>
diff --git a/ide/css.lib/test/unit/src/org/netbeans/modules/css/lib/Css3ParserTest.java b/ide/css.lib/test/unit/src/org/netbeans/modules/css/lib/Css3ParserTest.java
index cc3a99c..4012197 100644
--- a/ide/css.lib/test/unit/src/org/netbeans/modules/css/lib/Css3ParserTest.java
+++ b/ide/css.lib/test/unit/src/org/netbeans/modules/css/lib/Css3ParserTest.java
@@ -27,8 +27,6 @@
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.swing.text.BadLocationException;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.modules.css.lib.api.*;
import org.netbeans.modules.parsing.spi.ParseException;
import org.openide.filesystems.FileObject;
diff --git a/ide/css.model/test/unit/src/org/netbeans/modules/css/model/impl/ElementHandleImplTest.java b/ide/css.model/test/unit/src/org/netbeans/modules/css/model/impl/ElementHandleImplTest.java
index 129642b..2f2b9e1 100644
--- a/ide/css.model/test/unit/src/org/netbeans/modules/css/model/impl/ElementHandleImplTest.java
+++ b/ide/css.model/test/unit/src/org/netbeans/modules/css/model/impl/ElementHandleImplTest.java
@@ -18,7 +18,6 @@
*/
package org.netbeans.modules.css.model.impl;
-import static junit.framework.Assert.assertEquals;
import org.netbeans.modules.css.model.api.Element;
import org.netbeans.modules.css.model.api.ElementHandle;
import org.netbeans.modules.css.model.api.Model;
diff --git a/ide/css.prep/test/qa-functional/src/org/netbeans/modules/css/prep/syntax/LessSyntaxTest.java b/ide/css.prep/test/qa-functional/src/org/netbeans/modules/css/prep/syntax/LessSyntaxTest.java
index 4f1c5d5..c22ee9b 100644
--- a/ide/css.prep/test/qa-functional/src/org/netbeans/modules/css/prep/syntax/LessSyntaxTest.java
+++ b/ide/css.prep/test/qa-functional/src/org/netbeans/modules/css/prep/syntax/LessSyntaxTest.java
@@ -19,11 +19,8 @@
package org.netbeans.modules.css.prep.syntax;
-import static junit.framework.Assert.assertTrue;
import junit.framework.Test;
import org.netbeans.jellytools.EditorOperator;
-import org.netbeans.jellytools.ProjectsTabOperator;
-import org.netbeans.jellytools.nodes.Node;
import org.netbeans.jemmy.JemmyProperties;
import org.netbeans.junit.NbModuleSuite;
import org.netbeans.modules.css.prep.GeneralCSSPrep;
diff --git a/ide/css.prep/test/unit/src/org/netbeans/modules/css/prep/editor/model/CPModelTest.java b/ide/css.prep/test/unit/src/org/netbeans/modules/css/prep/editor/model/CPModelTest.java
index 2540fee..4e08d8d 100644
--- a/ide/css.prep/test/unit/src/org/netbeans/modules/css/prep/editor/model/CPModelTest.java
+++ b/ide/css.prep/test/unit/src/org/netbeans/modules/css/prep/editor/model/CPModelTest.java
@@ -24,8 +24,6 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
-import static junit.framework.Assert.assertEquals;
-import static org.junit.Assert.*;
import org.netbeans.modules.csl.api.OffsetRange;
import org.netbeans.modules.css.lib.CssTestBase;
import org.netbeans.modules.css.lib.TestUtil;
diff --git a/ide/css.prep/test/unit/src/org/netbeans/modules/css/prep/less/LessExecutableTest.java b/ide/css.prep/test/unit/src/org/netbeans/modules/css/prep/less/LessExecutableTest.java
index 72d099d..f7020df 100644
--- a/ide/css.prep/test/unit/src/org/netbeans/modules/css/prep/less/LessExecutableTest.java
+++ b/ide/css.prep/test/unit/src/org/netbeans/modules/css/prep/less/LessExecutableTest.java
@@ -19,8 +19,6 @@
package org.netbeans.modules.css.prep.less;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNull;
import org.netbeans.junit.NbTestCase;
import org.netbeans.modules.css.prep.util.VersionOutputProcessorFactory;
diff --git a/ide/db.dataview/test/unit/src/org/netbeans/modules/db/dataview/api/DataViewPageContextTest.java b/ide/db.dataview/test/unit/src/org/netbeans/modules/db/dataview/api/DataViewPageContextTest.java
index d4c4554..9341dc3 100644
--- a/ide/db.dataview/test/unit/src/org/netbeans/modules/db/dataview/api/DataViewPageContextTest.java
+++ b/ide/db.dataview/test/unit/src/org/netbeans/modules/db/dataview/api/DataViewPageContextTest.java
@@ -18,8 +18,6 @@
*/
package org.netbeans.modules.db.dataview.api;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.junit.NbTestCase;
/**
diff --git a/ide/db.dataview/test/unit/src/org/netbeans/modules/db/dataview/output/SQLStatementGeneratorTest.java b/ide/db.dataview/test/unit/src/org/netbeans/modules/db/dataview/output/SQLStatementGeneratorTest.java
index f786b84..8d7053f 100644
--- a/ide/db.dataview/test/unit/src/org/netbeans/modules/db/dataview/output/SQLStatementGeneratorTest.java
+++ b/ide/db.dataview/test/unit/src/org/netbeans/modules/db/dataview/output/SQLStatementGeneratorTest.java
@@ -29,7 +29,6 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
-import static junit.framework.Assert.assertEquals;
import org.netbeans.api.db.explorer.DatabaseConnection;
import org.netbeans.junit.NbTestCase;
import org.netbeans.modules.db.dataview.meta.DBColumn;
diff --git a/ide/db/test/unit/src/org/netbeans/api/db/explorer/support/DatabaseExplorerUIsTest.java b/ide/db/test/unit/src/org/netbeans/api/db/explorer/support/DatabaseExplorerUIsTest.java
index ff7590b..21eb5ba 100644
--- a/ide/db/test/unit/src/org/netbeans/api/db/explorer/support/DatabaseExplorerUIsTest.java
+++ b/ide/db/test/unit/src/org/netbeans/api/db/explorer/support/DatabaseExplorerUIsTest.java
@@ -19,7 +19,6 @@
package org.netbeans.api.db.explorer.support;
import javax.swing.JComboBox;
-import static junit.framework.Assert.assertEquals;
import org.netbeans.api.db.explorer.*;
import org.netbeans.modules.db.test.TestBase;
import org.netbeans.modules.db.test.Util;
diff --git a/ide/db/test/unit/src/org/netbeans/modules/db/explorer/DatabaseConnectionConvertor2Test.java b/ide/db/test/unit/src/org/netbeans/modules/db/explorer/DatabaseConnectionConvertor2Test.java
index 98d2088..602ad3f 100644
--- a/ide/db/test/unit/src/org/netbeans/modules/db/explorer/DatabaseConnectionConvertor2Test.java
+++ b/ide/db/test/unit/src/org/netbeans/modules/db/explorer/DatabaseConnectionConvertor2Test.java
@@ -19,8 +19,6 @@
package org.netbeans.modules.db.explorer;
import java.io.IOException;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
import static org.netbeans.modules.db.explorer.DatabaseConnectionConvertor.CONNECTIONS_PATH;
import org.netbeans.modules.db.test.TestBase;
import org.netbeans.modules.db.test.Util;
diff --git a/ide/dlight.nativeexecution/test/unit/src/org/netbeans/modules/nativeexecution/ConcurrentTasksSupport.java b/ide/dlight.nativeexecution/test/unit/src/org/netbeans/modules/nativeexecution/ConcurrentTasksSupport.java
index a053f2c..c199870 100644
--- a/ide/dlight.nativeexecution/test/unit/src/org/netbeans/modules/nativeexecution/ConcurrentTasksSupport.java
+++ b/ide/dlight.nativeexecution/test/unit/src/org/netbeans/modules/nativeexecution/ConcurrentTasksSupport.java
@@ -29,7 +29,7 @@
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import java.util.logging.Logger;
-import junit.framework.Assert;
+import org.junit.Assert;
/**
*
diff --git a/ide/dlight.nativeexecution/test/unit/src/org/netbeans/modules/nativeexecution/test/NbClustersInfoProvider.java b/ide/dlight.nativeexecution/test/unit/src/org/netbeans/modules/nativeexecution/test/NbClustersInfoProvider.java
index 418e9a7..766a845 100644
--- a/ide/dlight.nativeexecution/test/unit/src/org/netbeans/modules/nativeexecution/test/NbClustersInfoProvider.java
+++ b/ide/dlight.nativeexecution/test/unit/src/org/netbeans/modules/nativeexecution/test/NbClustersInfoProvider.java
@@ -21,7 +21,7 @@
import java.io.File;
import java.io.FileFilter;
import java.util.TreeSet;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.netbeans.junit.NbModuleSuite;
/**
diff --git a/ide/editor.errorstripe/test/unit/src/org/netbeans/modules/editor/errorstripe/UnitUtilities.java b/ide/editor.errorstripe/test/unit/src/org/netbeans/modules/editor/errorstripe/UnitUtilities.java
index 4b770ae..523142e 100644
--- a/ide/editor.errorstripe/test/unit/src/org/netbeans/modules/editor/errorstripe/UnitUtilities.java
+++ b/ide/editor.errorstripe/test/unit/src/org/netbeans/modules/editor/errorstripe/UnitUtilities.java
@@ -24,7 +24,7 @@
import java.io.IOException;
import java.net.URL;
import javax.swing.text.Utilities;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.netbeans.junit.NbTestCase;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil;
diff --git a/ide/editor.fold/test/unit/src/org/netbeans/modules/editor/fold/FoldContentReaderTest.java b/ide/editor.fold/test/unit/src/org/netbeans/modules/editor/fold/FoldContentReaderTest.java
index 714a384..e2af1e7 100644
--- a/ide/editor.fold/test/unit/src/org/netbeans/modules/editor/fold/FoldContentReaderTest.java
+++ b/ide/editor.fold/test/unit/src/org/netbeans/modules/editor/fold/FoldContentReaderTest.java
@@ -24,7 +24,6 @@
import javax.swing.event.DocumentEvent;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
-import junit.framework.Assert;
import org.netbeans.api.editor.fold.Fold;
import org.netbeans.api.editor.fold.FoldHierarchy;
import org.netbeans.api.editor.fold.FoldTemplate;
@@ -38,9 +37,6 @@
import org.netbeans.spi.editor.fold.FoldOperation;
import org.openide.util.Exceptions;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-
/**
*
* @author
@@ -228,7 +224,7 @@
idx = idx2;
}
} catch (BadLocationException ex) {
- Assert.fail("Unexpected exception");
+ fail("Unexpected exception");
return;
}
}
diff --git a/ide/editor.fold/test/unit/src/org/netbeans/modules/editor/fold/FoldGuardTest.java b/ide/editor.fold/test/unit/src/org/netbeans/modules/editor/fold/FoldGuardTest.java
index b264920..1b9393b 100644
--- a/ide/editor.fold/test/unit/src/org/netbeans/modules/editor/fold/FoldGuardTest.java
+++ b/ide/editor.fold/test/unit/src/org/netbeans/modules/editor/fold/FoldGuardTest.java
@@ -23,11 +23,6 @@
import javax.swing.event.DocumentEvent;
import javax.swing.text.AbstractDocument;
import javax.swing.text.BadLocationException;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertSame;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.api.editor.fold.Fold;
import org.netbeans.api.editor.fold.FoldHierarchy;
import org.netbeans.api.editor.fold.FoldHierarchyEvent;
diff --git a/ide/editor.lib2/src/org/netbeans/modules/editor/lib2/view/DocumentViewOp.java b/ide/editor.lib2/src/org/netbeans/modules/editor/lib2/view/DocumentViewOp.java
index 06cbd5a..7475b09 100644
--- a/ide/editor.lib2/src/org/netbeans/modules/editor/lib2/view/DocumentViewOp.java
+++ b/ide/editor.lib2/src/org/netbeans/modules/editor/lib2/view/DocumentViewOp.java
@@ -1391,7 +1391,7 @@
TextLayout createTextLayout(String text, Font font) {
checkSettingsInfo();
- if (fontRenderContext != null && font != null) {
+ if (fontRenderContext != null && font != null && text.length() > 0) {
ViewStats.incrementTextLayoutCreated(text.length());
FontInfo fontInfo = getFontInfo(font);
TextLayout textLayout = new TextLayout(text, fontInfo.renderFont, fontRenderContext);
diff --git a/ide/editor.lib2/test/unit/src/org/netbeans/modules/editor/lib2/highlighting/WhitespaceHighlightingTest.java b/ide/editor.lib2/test/unit/src/org/netbeans/modules/editor/lib2/highlighting/WhitespaceHighlightingTest.java
index 185c60b..eeb307a 100644
--- a/ide/editor.lib2/test/unit/src/org/netbeans/modules/editor/lib2/highlighting/WhitespaceHighlightingTest.java
+++ b/ide/editor.lib2/test/unit/src/org/netbeans/modules/editor/lib2/highlighting/WhitespaceHighlightingTest.java
@@ -26,9 +26,6 @@
import javax.swing.text.AttributeSet;
import javax.swing.text.Document;
import javax.swing.text.StyleConstants;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.api.editor.settings.AttributesUtilities;
import org.netbeans.junit.Filter;
import org.netbeans.junit.NbTestCase;
diff --git a/ide/editor.lib2/test/unit/src/org/netbeans/modules/editor/lib2/view/TestHighlightsViewFactory.java b/ide/editor.lib2/test/unit/src/org/netbeans/modules/editor/lib2/view/TestHighlightsViewFactory.java
index 651902a..b201d95 100644
--- a/ide/editor.lib2/test/unit/src/org/netbeans/modules/editor/lib2/view/TestHighlightsViewFactory.java
+++ b/ide/editor.lib2/test/unit/src/org/netbeans/modules/editor/lib2/view/TestHighlightsViewFactory.java
@@ -21,7 +21,6 @@
import java.util.List;
import javax.swing.text.JTextComponent;
import javax.swing.text.View;
-import junit.framework.Assert;
import junit.framework.TestCase;
/**
diff --git a/ide/editor.settings.lib/test/unit/src/org/netbeans/modules/editor/settings/storage/EditorTestLookup.java b/ide/editor.settings.lib/test/unit/src/org/netbeans/modules/editor/settings/storage/EditorTestLookup.java
index 9df3eb0..e52298f 100644
--- a/ide/editor.settings.lib/test/unit/src/org/netbeans/modules/editor/settings/storage/EditorTestLookup.java
+++ b/ide/editor.settings.lib/test/unit/src/org/netbeans/modules/editor/settings/storage/EditorTestLookup.java
@@ -31,7 +31,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import java.util.concurrent.Executor;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.openide.filesystems.AbstractFileSystem;
import org.openide.filesystems.DefaultAttributes;
import org.openide.filesystems.FileObject;
diff --git a/ide/editor.settings.storage/test/unit/src/org/netbeans/modules/editor/settings/storage/EditorTestLookup.java b/ide/editor.settings.storage/test/unit/src/org/netbeans/modules/editor/settings/storage/EditorTestLookup.java
index 9df3eb0..e52298f 100644
--- a/ide/editor.settings.storage/test/unit/src/org/netbeans/modules/editor/settings/storage/EditorTestLookup.java
+++ b/ide/editor.settings.storage/test/unit/src/org/netbeans/modules/editor/settings/storage/EditorTestLookup.java
@@ -31,7 +31,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import java.util.concurrent.Executor;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.openide.filesystems.AbstractFileSystem;
import org.openide.filesystems.DefaultAttributes;
import org.openide.filesystems.FileObject;
diff --git a/ide/editor.settings.storage/test/unit/src/org/netbeans/modules/editor/settings/storage/preferences/ProxyPreferencesImplTest.java b/ide/editor.settings.storage/test/unit/src/org/netbeans/modules/editor/settings/storage/preferences/ProxyPreferencesImplTest.java
index 5b862ba..5c3d4d0 100644
--- a/ide/editor.settings.storage/test/unit/src/org/netbeans/modules/editor/settings/storage/preferences/ProxyPreferencesImplTest.java
+++ b/ide/editor.settings.storage/test/unit/src/org/netbeans/modules/editor/settings/storage/preferences/ProxyPreferencesImplTest.java
@@ -32,7 +32,6 @@
import java.util.prefs.PreferenceChangeEvent;
import java.util.prefs.PreferenceChangeListener;
import java.util.prefs.Preferences;
-import static junit.framework.Assert.assertEquals;
import org.netbeans.junit.NbTestCase;
import org.netbeans.modules.editor.settings.storage.api.OverridePreferences;
import org.netbeans.modules.editor.settings.storage.api.MemoryPreferences;
diff --git a/ide/editor/src/org/netbeans/modules/editor/NbEditorDocument.java b/ide/editor/src/org/netbeans/modules/editor/NbEditorDocument.java
index 468d86c..2f570f0 100644
--- a/ide/editor/src/org/netbeans/modules/editor/NbEditorDocument.java
+++ b/ide/editor/src/org/netbeans/modules/editor/NbEditorDocument.java
@@ -130,7 +130,6 @@
return null;
}
});
- putProperty("Issue-222763-debug", new Exception()); // Issue #222763 debugging - to be removed soon
}
public @Override int getShiftWidth() {
diff --git a/ide/editor/test/unit/src/org/netbeans/modules/editor/EditorTestLookup.java b/ide/editor/test/unit/src/org/netbeans/modules/editor/EditorTestLookup.java
index e9727da..1ef0310 100644
--- a/ide/editor/test/unit/src/org/netbeans/modules/editor/EditorTestLookup.java
+++ b/ide/editor/test/unit/src/org/netbeans/modules/editor/EditorTestLookup.java
@@ -22,7 +22,7 @@
import java.beans.PropertyVetoException;
import java.io.IOException;
import java.net.URL;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.openide.filesystems.Repository;
import org.openide.filesystems.XMLFileSystem;
import org.openide.util.Lookup;
diff --git a/ide/git/test/qa-functional/src/org/netbeans/test/git/main/diff/DiffTest.java b/ide/git/test/qa-functional/src/org/netbeans/test/git/main/diff/DiffTest.java
index c2e836d..3902762 100644
--- a/ide/git/test/qa-functional/src/org/netbeans/test/git/main/diff/DiffTest.java
+++ b/ide/git/test/qa-functional/src/org/netbeans/test/git/main/diff/DiffTest.java
@@ -22,7 +22,6 @@
import java.io.PrintStream;
import java.util.logging.Level;
import java.util.logging.Logger;
-import static junit.framework.Assert.assertNotNull;
import junit.framework.Test;
import org.netbeans.jellytools.EditorOperator;
import org.netbeans.jellytools.JellyTestCase;
diff --git a/ide/git/test/qa-functional/src/org/netbeans/test/git/main/diff/ExportDiffPatchTest.java b/ide/git/test/qa-functional/src/org/netbeans/test/git/main/diff/ExportDiffPatchTest.java
index 3278309..d07f085 100644
--- a/ide/git/test/qa-functional/src/org/netbeans/test/git/main/diff/ExportDiffPatchTest.java
+++ b/ide/git/test/qa-functional/src/org/netbeans/test/git/main/diff/ExportDiffPatchTest.java
@@ -25,8 +25,6 @@
import java.io.PrintStream;
import java.util.logging.Level;
import java.util.logging.Logger;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
import junit.framework.Test;
import org.netbeans.jellytools.EditorOperator;
import org.netbeans.jellytools.JellyTestCase;
diff --git a/ide/git/test/unit/src/org/netbeans/modules/git/ExternalChangesTest.java b/ide/git/test/unit/src/org/netbeans/modules/git/ExternalChangesTest.java
index d1071eb..1382776 100644
--- a/ide/git/test/unit/src/org/netbeans/modules/git/ExternalChangesTest.java
+++ b/ide/git/test/unit/src/org/netbeans/modules/git/ExternalChangesTest.java
@@ -29,7 +29,6 @@
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.junit.MockServices;
import org.netbeans.junit.RandomlyFails;
import org.netbeans.libs.git.GitBranch;
diff --git a/ide/html.editor/test/unit/src/org/netbeans/modules/html/editor/completion/HtmlCompletionTestSupport.java b/ide/html.editor/test/unit/src/org/netbeans/modules/html/editor/completion/HtmlCompletionTestSupport.java
index f205f37..8e7e733 100644
--- a/ide/html.editor/test/unit/src/org/netbeans/modules/html/editor/completion/HtmlCompletionTestSupport.java
+++ b/ide/html.editor/test/unit/src/org/netbeans/modules/html/editor/completion/HtmlCompletionTestSupport.java
@@ -26,7 +26,6 @@
import javax.swing.JEditorPane;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
-import junit.framework.AssertionFailedError;
import org.junit.Assert;
import org.netbeans.modules.html.editor.api.completion.HtmlCompletionItem;
import org.netbeans.modules.html.editor.api.gsf.HtmlParserResult;
@@ -114,7 +113,7 @@
try {
assertCompletionItemNames(expectedItemsNames, items, type);
- } catch (AssertionFailedError e) {
+ } catch (AssertionError e) {
for (CompletionItem item : items) {
System.out.println(((HtmlCompletionItem) item).getItemText());
}
diff --git a/ide/html.editor/test/unit/src/org/netbeans/modules/html/editor/spi/embedding/JsEmbeddingProviderPluginTest.java b/ide/html.editor/test/unit/src/org/netbeans/modules/html/editor/spi/embedding/JsEmbeddingProviderPluginTest.java
index f339f07..eebe6d7 100644
--- a/ide/html.editor/test/unit/src/org/netbeans/modules/html/editor/spi/embedding/JsEmbeddingProviderPluginTest.java
+++ b/ide/html.editor/test/unit/src/org/netbeans/modules/html/editor/spi/embedding/JsEmbeddingProviderPluginTest.java
@@ -18,11 +18,7 @@
*/
package org.netbeans.modules.html.editor.spi.embedding;
-import java.util.Collections;
import java.util.List;
-import java.util.concurrent.atomic.AtomicReference;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.api.editor.mimelookup.MimeRegistration;
import org.netbeans.api.html.lexer.HTMLTokenId;
import org.netbeans.api.lexer.TokenSequence;
@@ -31,14 +27,8 @@
import org.netbeans.modules.html.editor.api.gsf.HtmlParserResult;
import org.netbeans.modules.html.editor.embedding.JsEmbeddingProviderTest;
import org.netbeans.modules.parsing.api.Embedding;
-import org.netbeans.modules.parsing.api.ParserManager;
-import org.netbeans.modules.parsing.api.ResultIterator;
import org.netbeans.modules.parsing.api.Snapshot;
-import org.netbeans.modules.parsing.api.Source;
-import org.netbeans.modules.parsing.api.UserTask;
-import org.netbeans.modules.parsing.spi.ParseException;
import org.netbeans.modules.web.common.api.LexerUtils;
-import org.netbeans.modules.web.common.api.WebUtils;
/**
*
@@ -69,7 +59,8 @@
public static boolean started, ended, processed;
@Override
- public boolean startProcessing(HtmlParserResult parserResult, Snapshot snapshot, TokenSequence<HTMLTokenId> ts, List<Embedding> embeddings) { assertNotNull(snapshot);
+ public boolean startProcessing(HtmlParserResult parserResult, Snapshot snapshot, TokenSequence<HTMLTokenId> ts, List<Embedding> embeddings) {
+ assertNotNull(snapshot);
assertNotNull(parserResult);
assertNotNull(ts);
assertNotNull(embeddings);
diff --git a/ide/ide.kit/test/qa-functional/src/org/netbeans/test/ide/CountingSecurityManager.java b/ide/ide.kit/test/qa-functional/src/org/netbeans/test/ide/CountingSecurityManager.java
index fb6e46c..770c208 100755
--- a/ide/ide.kit/test/qa-functional/src/org/netbeans/test/ide/CountingSecurityManager.java
+++ b/ide/ide.kit/test/qa-functional/src/org/netbeans/test/ide/CountingSecurityManager.java
@@ -40,7 +40,7 @@
import java.util.concurrent.Callable;
import java.util.logging.Level;
import java.util.logging.Logger;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.openide.util.Utilities;
/**
diff --git a/ide/javascript2.debug/test/unit/src/org/netbeans/modules/javascript2/debug/sources/SourceFSTest.java b/ide/javascript2.debug/test/unit/src/org/netbeans/modules/javascript2/debug/sources/SourceFSTest.java
index f8492c0..bbaad5d 100644
--- a/ide/javascript2.debug/test/unit/src/org/netbeans/modules/javascript2/debug/sources/SourceFSTest.java
+++ b/ide/javascript2.debug/test/unit/src/org/netbeans/modules/javascript2/debug/sources/SourceFSTest.java
@@ -20,10 +20,12 @@
package org.netbeans.modules.javascript2.debug.sources;
import java.io.IOException;
-import static junit.framework.Assert.*;
import org.junit.Test;
import org.openide.filesystems.FileObject;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
/**
*
* @author Martin Entlicher
diff --git a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/EmbeddedSectionsHighlighting.java b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/EmbeddedSectionsHighlighting.java
index 6711aad..5182019 100644
--- a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/EmbeddedSectionsHighlighting.java
+++ b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/EmbeddedSectionsHighlighting.java
@@ -37,7 +37,7 @@
import org.netbeans.editor.BaseDocument;
import org.netbeans.editor.Utilities;
import org.netbeans.lib.editor.util.swing.DocumentUtilities;
-import static org.netbeans.modules.languages.yaml.YamlTokenId.YAML_MIME_TYPE;
+import static org.netbeans.modules.languages.yaml.YamlLanguage.MIME_TYPE;
import org.netbeans.spi.editor.highlighting.HighlightsLayer;
import org.netbeans.spi.editor.highlighting.HighlightsLayerFactory;
import org.netbeans.spi.editor.highlighting.HighlightsSequence;
@@ -257,7 +257,7 @@
}
} // End of Highlights class
- @MimeRegistration(mimeType = YAML_MIME_TYPE, service = HighlightsLayerFactory.class)
+ @MimeRegistration(mimeType = MIME_TYPE, service = HighlightsLayerFactory.class)
public static final class Factory implements HighlightsLayerFactory {
@Override
diff --git a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlCompletion.java b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlCompletion.java
index 6ff3089..2e8e665 100644
--- a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlCompletion.java
+++ b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlCompletion.java
@@ -326,7 +326,7 @@
@Override
public String getMimeType() {
- return YamlTokenId.YAML_MIME_TYPE;
+ return YamlLanguage.MIME_TYPE;
}
@Override
diff --git a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlLanguage.java b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlLanguage.java
index 218e7e2..c0f59ab 100644
--- a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlLanguage.java
+++ b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlLanguage.java
@@ -18,7 +18,13 @@
*/
package org.netbeans.modules.languages.yaml;
+import java.util.Collection;
+import java.util.EnumSet;
+import org.netbeans.api.lexer.InputAttributes;
import org.netbeans.api.lexer.Language;
+import org.netbeans.api.lexer.LanguagePath;
+import org.netbeans.api.lexer.Token;
+import org.netbeans.api.lexer.TokenId;
import org.netbeans.core.spi.multiview.MultiViewElement;
import org.netbeans.core.spi.multiview.text.MultiViewEditorElement;
import org.netbeans.modules.csl.api.CodeCompletionHandler;
@@ -29,6 +35,11 @@
import org.netbeans.modules.csl.spi.DefaultLanguageConfig;
import org.netbeans.modules.csl.spi.LanguageRegistration;
import org.netbeans.modules.parsing.spi.Parser;
+import org.netbeans.spi.lexer.LanguageEmbedding;
+import org.netbeans.spi.lexer.LanguageHierarchy;
+import org.netbeans.spi.lexer.LanguageProvider;
+import org.netbeans.spi.lexer.Lexer;
+import org.netbeans.spi.lexer.LexerRestartInfo;
import org.openide.awt.*;
import org.openide.filesystems.MIMEResolver;
import org.openide.util.Lookup;
@@ -102,12 +113,12 @@
position = 1500
)
})
-@LanguageRegistration(mimeType = "text/x-yaml", useMultiview = true) //NOI18N
+@LanguageRegistration(mimeType = YamlLanguage.MIME_TYPE, useMultiview = true)
public class YamlLanguage extends DefaultLanguageConfig {
@Override
public Language getLexerLanguage() {
- return YamlTokenId.language();
+ return language();
}
@Override
@@ -155,12 +166,73 @@
return null;
}
+ public static final Language<YamlTokenId> language() {
+ return language;
+ }
+
+ private static final Language<YamlTokenId> language =
+ new LanguageHierarchy<YamlTokenId>() {
+
+ @Override
+ protected String mimeType() {
+ return MIME_TYPE;
+ }
+
+ @Override
+ protected Collection<YamlTokenId> createTokenIds() {
+ return EnumSet.allOf(YamlTokenId.class);
+ }
+
+ @Override
+ protected Lexer<YamlTokenId> createLexer(LexerRestartInfo<YamlTokenId> info) {
+ return new YamlLexer(info);
+ }
+
+ @Override
+ protected LanguageEmbedding<? extends TokenId> embedding(Token<YamlTokenId> token,
+ LanguagePath languagePath, InputAttributes inputAttributes) {
+ switch (token.id()) {
+ case RUBY_EXPR:
+ case RUBY:
+ return findLanguage(YamlLanguage.RUBY_MIME_TYPE);
+ case PHP:
+ return findLanguage(YamlLanguage.PHP_MIME_TYPE);
+ default:
+ return null;
+ }
+ }
+ }.language();
+
+ private static LanguageEmbedding<? extends TokenId> findLanguage(String mimeType) {
+ Language<? extends TokenId> ret = null;
+
+ Collection<? extends LanguageProvider> providers = Lookup.getDefault().lookupAll(LanguageProvider.class);
+ for (LanguageProvider provider : providers) {
+ ret = provider.findLanguage(mimeType);
+ if (ret != null) {
+ break;
+ }
+ }
+
+ return ret != null ? LanguageEmbedding.create(ret, 0, 0, false) : null;
+ }
+
+ /**
+ * MIME type for YAML. Don't change this without also consulting the various
+ * XML files that cannot reference this value directly.
+ */
+ public static final String MIME_TYPE = "text/x-yaml"; // NOI18N
+
+ public static final String RUBY_MIME_TYPE = "text/x-ruby"; // NOI18N
+ public static final String PHP_MIME_TYPE = "text/x-php5"; // NOI18N
+
+
@NbBundle.Messages("Source=&Source")
@MultiViewElement.Registration(
displayName="#Source",
iconBase="org/netbeans/modules/languages/yaml/yaml_files_16.png",
persistenceType=TopComponent.PERSISTENCE_ONLY_OPENED,
- mimeType=YamlTokenId.YAML_MIME_TYPE,
+ mimeType=MIME_TYPE,
preferredID="yaml.source",
position=100
)
diff --git a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlParser.java b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlParser.java
index 653f628..d734c54 100644
--- a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlParser.java
+++ b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlParser.java
@@ -258,7 +258,7 @@
// Construct source by removing <% %> tokens etc.
StringBuilder sb = new StringBuilder();
- TokenHierarchy hi = TokenHierarchy.create(source, YamlTokenId.language());
+ TokenHierarchy hi = TokenHierarchy.create(source, YamlLanguage.language());
TokenSequence ts = hi.tokenSequence();
diff --git a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlStructureItem.java b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlStructureItem.java
index 2fcec4e..339c852 100644
--- a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlStructureItem.java
+++ b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlStructureItem.java
@@ -129,7 +129,7 @@
@Override
public String getMimeType() {
- return YamlTokenId.YAML_MIME_TYPE;
+ return YamlLanguage.MIME_TYPE;
}
@Override
diff --git a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlTokenId.java b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlTokenId.java
index f0fd5f6..dbefca3 100644
--- a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlTokenId.java
+++ b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlTokenId.java
@@ -18,24 +18,7 @@
*/
package org.netbeans.modules.languages.yaml;
-import java.util.Collection;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.Map;
-import org.netbeans.api.editor.mimelookup.MimeRegistration;
-
-import org.netbeans.api.lexer.InputAttributes;
-import org.netbeans.api.lexer.Language;
-import org.netbeans.api.lexer.LanguagePath;
-import org.netbeans.api.lexer.Token;
import org.netbeans.api.lexer.TokenId;
-import org.netbeans.modules.languages.yaml.ruby.RubyEmbeddingProvider;
-import org.netbeans.spi.lexer.LanguageEmbedding;
-import org.netbeans.spi.lexer.LanguageHierarchy;
-import org.netbeans.spi.lexer.LanguageProvider;
-import org.netbeans.spi.lexer.Lexer;
-import org.netbeans.spi.lexer.LexerRestartInfo;
-import org.openide.util.Lookup;
/**
* Token type definitions for YAML
@@ -79,74 +62,5 @@
public static boolean isRuby(TokenId id) {
return id == RUBY || id == RUBY_EXPR || id == RUBYCOMMENT;
}
- private static final Language<YamlTokenId> language =
- new LanguageHierarchy<YamlTokenId>() {
- @Override
- protected String mimeType() {
- return YamlTokenId.YAML_MIME_TYPE;
- }
-
- @Override
- protected Collection<YamlTokenId> createTokenIds() {
- return EnumSet.allOf(YamlTokenId.class);
- }
-
- @Override
- protected Map<String, Collection<YamlTokenId>> createTokenCategories() {
- Map<String, Collection<YamlTokenId>> cats =
- new HashMap<String, Collection<YamlTokenId>>();
- return cats;
- }
-
- @Override
- protected Lexer<YamlTokenId> createLexer(LexerRestartInfo<YamlTokenId> info) {
- return new YamlLexer(info);
- }
-
- @Override
- protected LanguageEmbedding<? extends TokenId> embedding(Token<YamlTokenId> token,
- LanguagePath languagePath, InputAttributes inputAttributes) {
- switch (token.id()) {
- case RUBY_EXPR:
- case RUBY:
- // No dependency on the Ruby module:
- //Language rubyLanguage = RubyTokenId.language();
- Language<? extends TokenId> rubyLanguage = null;
-
- @SuppressWarnings("unchecked") Collection<LanguageProvider> providers = (Collection<LanguageProvider>) Lookup.getDefault().lookupAll(LanguageProvider.class);
- for (LanguageProvider provider : providers) {
- rubyLanguage = (Language<? extends TokenId>) provider.findLanguage(RubyEmbeddingProvider.RUBY_MIME_TYPE);
- if (rubyLanguage != null) {
- break;
- }
- }
-
- return rubyLanguage != null ? LanguageEmbedding.create(rubyLanguage, 0, 0, false) : null;
- case PHP:
- Language<? extends TokenId> phpLanguage = null;
-
- providers = (Collection<LanguageProvider>) Lookup.getDefault().lookupAll(LanguageProvider.class);
- for (LanguageProvider provider : providers) {
- phpLanguage = (Language<? extends TokenId>) provider.findLanguage("text/x-php5");
- if (phpLanguage != null) {
- break;
- }
- }
- return phpLanguage != null ? LanguageEmbedding.create(phpLanguage, 0, 0, false) : null;
- default:
- return null;
- }
- }
- }.language();
-
- @MimeRegistration(mimeType = YAML_MIME_TYPE, service = Language.class)
- public static Language<YamlTokenId> language() {
- return language;
- }
- /**
- * MIME type for YAML. Don't change this without also consulting the various
- * XML files that cannot reference this value directly.
- */
- public static final String YAML_MIME_TYPE = "text/x-yaml"; // NOI18N
}
diff --git a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/ruby/RubyEmbeddingProvider.java b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/ruby/RubyEmbeddingProvider.java
deleted file mode 100644
index ac73ae9..0000000
--- a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/ruby/RubyEmbeddingProvider.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * 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.netbeans.modules.languages.yaml.ruby;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.logging.Logger;
-import javax.swing.text.Document;
-import org.netbeans.api.editor.mimelookup.MimeRegistration;
-import org.netbeans.api.lexer.Token;
-import org.netbeans.api.lexer.TokenHierarchy;
-import org.netbeans.api.lexer.TokenSequence;
-import org.netbeans.editor.BaseDocument;
-import org.netbeans.modules.languages.yaml.YamlTokenId;
-import org.netbeans.modules.parsing.api.Embedding;
-import org.netbeans.modules.parsing.api.Snapshot;
-import org.netbeans.modules.parsing.spi.EmbeddingProvider;
-import org.netbeans.modules.parsing.spi.SchedulerTask;
-import org.netbeans.modules.parsing.spi.TaskFactory;
-
-/**
- *
- * @author Petr Hejl
- */
-public class RubyEmbeddingProvider extends EmbeddingProvider {
-
- public static final String RUBY_MIME_TYPE = "text/x-ruby"; // NOI18N
- private static final Logger LOG = Logger.getLogger(RubyEmbeddingProvider.class.getName());
-
- @Override
- public List<Embedding> getEmbeddings(Snapshot snapshot) {
- if (YamlTokenId.YAML_MIME_TYPE.equals(snapshot.getMimeType())) {
- List<Embedding> embeddings = translate(snapshot);
- if (embeddings.isEmpty()) {
- return Collections.<Embedding>emptyList();
- } else {
- return Collections.singletonList(Embedding.create(embeddings));
- }
- } else {
- LOG.warning("Unexpected snapshot type: '" + snapshot.getMimeType() + "'; expecting '" + YamlTokenId.YAML_MIME_TYPE + "'"); //NOI18N
- return Collections.<Embedding>emptyList();
- }
- }
-
- @Override
- public int getPriority() {
- return Integer.MAX_VALUE;
- }
-
- @Override
- public void cancel() {
- // FIXME parsing API
- }
-
- private List<Embedding> translate(Snapshot snapshot) {
- BaseDocument d = (BaseDocument) snapshot.getSource().getDocument(false);
- if (d == null) {
- return Collections.emptyList();
- }
-
- List<Embedding> embeddings = new ArrayList<Embedding>();
-
- try {
- d.readLock();
- TokenHierarchy<Document> tokenHierarchy = TokenHierarchy.get((Document) d);
- TokenSequence<YamlTokenId> tokenSequence = tokenHierarchy.tokenSequence(YamlTokenId.language()); //get top level token sequence
-
- if (tokenSequence != null) {
- translate(snapshot, tokenHierarchy, tokenSequence, embeddings);
- }
- } finally {
- d.readUnlock();
- }
- return embeddings;
- }
-
- /**
- * Perform eruby translation
- *
- * @param outputBuffer The buffer to emit the translation to
- * @param tokenHierarchy The token hierarchy for the yaml code
- * @param tokenSequence The token sequence for the yaml code
- */
- private void translate(Snapshot snapshot, TokenHierarchy<Document> tokenHierarchy,
- TokenSequence<? extends YamlTokenId> tokenSequence, List<Embedding> embeddings) {
- // Add a super class such that code completion, goto declaration etc.
- // knows where to pull the various link_to etc. methods from
-
- // Erubis uses _buf; I've seen eruby using something else (_erbout?)
- embeddings.add(snapshot.create("_buf='';", RUBY_MIME_TYPE));
-
- boolean skipNewline = false;
- while (tokenSequence.moveNext()) {
- Token<? extends YamlTokenId> token = tokenSequence.token();
-
- if (token.id() == YamlTokenId.TEXT || token.id() == YamlTokenId.COMMENT) {
- int sourceStart = token.offset(tokenHierarchy);
-
- String text = token.text().toString();
-
- // If there is leading whitespace in this token followed by a newline,
- // emit it directly first, then insert my buffer append. Otherwise,
- // insert a semicolon if we're on the same line as the previous output.
- boolean found = false;
- int i = 0;
- for (; i < text.length(); i++) {
- char c = text.charAt(i);
- if (c == '\n') {
- i++; // include it
- found = true;
- break;
- } else if (!Character.isWhitespace(c)) {
- break;
- }
- }
-
- // avoid creating an embedding for the artificial '\n' at the end (which is now there
- // as a result of the fix for #159502
- // XXX: shouldn't this be handled e.g. in token hiearchy creation??
- if (found && tokenSequence.index() < tokenSequence.tokenCount() - 1) {
- embeddings.add(snapshot.create(sourceStart, i, RUBY_MIME_TYPE));
- //buffer.append(text.substring(0, i));
- text = text.substring(i);
- } else {
- embeddings.add(snapshot.create(";", RUBY_MIME_TYPE));
- //buffer.append(';');
- }
- embeddings.add(snapshot.create("_buf << '", RUBY_MIME_TYPE));
-
- if (skipNewline && text.startsWith("\n")) { // NOI18N
- text = text.substring(1);
- }
- // Escape 's in the document so they don't escape out of the ruby code
- // I don't have to do this on lines that are in comments... But no big harm
- text = text.replace("'", "\\'");
-
- // FIXME this escaping should be replaced with
- // proper embeddings from source code
- embeddings.add(snapshot.create(text, RUBY_MIME_TYPE));
-
- // TODO: This "\n" shouldn't be there if the next "<%" is a "<%-" !
- embeddings.add(snapshot.create("';\n", RUBY_MIME_TYPE));
- //buffer.append("';\n"); // NOI18N
-
- skipNewline = false;
- } else if (token.id() == YamlTokenId.RUBY) {
- int sourceStart = token.offset(tokenHierarchy);
-
- String text = token.text().toString();
- skipNewline = false;
- if (text.endsWith("-")) { // NOI18N
- text = text.substring(0, text.length() - 1);
- skipNewline = true;
- }
-
- embeddings.add(snapshot.create(sourceStart, text.length(), RUBY_MIME_TYPE));
-
- skipNewline = false;
- } else if (token.id() == YamlTokenId.RUBY_EXPR) {
- embeddings.add(snapshot.create("_buf << (", RUBY_MIME_TYPE));
-
- int sourceStart = token.offset(tokenHierarchy);
-
- String text = token.text().toString();
- skipNewline = false;
- if (text.endsWith("-")) { // NOI18N
- text = text.substring(0, text.length() - 1);
- skipNewline = true;
- }
- embeddings.add(snapshot.create(sourceStart, text.length(), RUBY_MIME_TYPE));
-
-// Make code sanitizing work better: buffer.append("\n).to_s;"); // NOI18N
- embeddings.add(snapshot.create(").to_s;", RUBY_MIME_TYPE));
- }
- }
-
- // Close off the class
- // eruby also ends with this statement: _buf.to_s
-// String end = "\nend\n"; // NOI18N
-// buffer.append(end);
-// if (doc != null) {
-// codeBlocks.add(new CodeBlockData(doc.getLength(), doc.getLength(), buffer.length()-end.length(), buffer.length()));
-// }
- }
-
- @MimeRegistration(mimeType = YamlTokenId.YAML_MIME_TYPE, service = TaskFactory.class)
- public static final class Factory extends TaskFactory {
-
- public Factory() {
- // no-op
- }
-
- public @Override
- Collection<? extends SchedulerTask> create(Snapshot snapshot) {
- if (!YamlTokenId.YAML_MIME_TYPE.equals(snapshot.getMimeType())) {
- return Collections.<SchedulerTask>emptyList();
- }
-
- return Collections.singleton(new RubyEmbeddingProvider());
- }
- }
-}
diff --git a/ide/languages.yaml/test/unit/src/org/netbeans/modules/languages/yaml/YamlLexerTest.java b/ide/languages.yaml/test/unit/src/org/netbeans/modules/languages/yaml/YamlLexerTest.java
index 18886f1..834dcdc 100644
--- a/ide/languages.yaml/test/unit/src/org/netbeans/modules/languages/yaml/YamlLexerTest.java
+++ b/ide/languages.yaml/test/unit/src/org/netbeans/modules/languages/yaml/YamlLexerTest.java
@@ -42,41 +42,41 @@
public void testInput() throws Exception {
LexerTestUtilities.checkTokenDump(this, "testfiles/input.yaml.txt",
- YamlTokenId.language());
+ YamlLanguage.language());
}
public void testInput2() throws Exception {
LexerTestUtilities.checkTokenDump(this, "testfiles/input2.yaml.txt",
- YamlTokenId.language());
+ YamlLanguage.language());
}
public void testInput3() throws Exception {
LexerTestUtilities.checkTokenDump(this, "testfiles/input3.yaml.txt",
- YamlTokenId.language());
+ YamlLanguage.language());
}
public void testInput4() throws Exception {
LexerTestUtilities.checkTokenDump(this, "testfiles/input4.yaml.txt",
- YamlTokenId.language());
+ YamlLanguage.language());
}
public void testNETBEANS_4167() throws Exception {
LexerTestUtilities.checkTokenDump(this, "testfiles/issue_NETBEANS-4167.yaml.txt",
- YamlTokenId.language());
+ YamlLanguage.language());
}
public void testNETBEANS_4370_1() throws Exception {
LexerTestUtilities.checkTokenDump(this, "testfiles/issue_NETBEANS-4370_1.yaml.txt",
- YamlTokenId.language());
+ YamlLanguage.language());
}
public void testNETBEANS_4370_2() throws Exception {
LexerTestUtilities.checkTokenDump(this, "testfiles/issue_NETBEANS-4370_2.yaml.txt",
- YamlTokenId.language());
+ YamlLanguage.language());
}
public void testIssue246124() throws Exception {
LexerTestUtilities.checkTokenDump(this, "testfiles/issue246124.yaml",
- YamlTokenId.language());
+ YamlLanguage.language());
}
}
diff --git a/ide/languages.yaml/test/unit/src/org/netbeans/modules/languages/yaml/YamlTestBase.java b/ide/languages.yaml/test/unit/src/org/netbeans/modules/languages/yaml/YamlTestBase.java
index 3a907e3..348f1c3 100644
--- a/ide/languages.yaml/test/unit/src/org/netbeans/modules/languages/yaml/YamlTestBase.java
+++ b/ide/languages.yaml/test/unit/src/org/netbeans/modules/languages/yaml/YamlTestBase.java
@@ -40,7 +40,7 @@
@Override
protected String getPreferredMimeType() {
- return YamlTokenId.YAML_MIME_TYPE;
+ return YamlLanguage.MIME_TYPE;
}
@Override
diff --git a/ide/lexer/test/unit/src/org/netbeans/lib/lexer/test/join/JoinMixTest.java b/ide/lexer/test/unit/src/org/netbeans/lib/lexer/test/join/JoinMixTest.java
index 93e04b7..ca11621 100644
--- a/ide/lexer/test/unit/src/org/netbeans/lib/lexer/test/join/JoinMixTest.java
+++ b/ide/lexer/test/unit/src/org/netbeans/lib/lexer/test/join/JoinMixTest.java
@@ -23,7 +23,6 @@
import java.util.List;
import java.util.logging.Level;
import javax.swing.text.AbstractDocument;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.api.lexer.Language;
import org.netbeans.api.lexer.LanguagePath;
import org.netbeans.api.lexer.TokenHierarchy;
diff --git a/ide/libs.freemarker/test/unit/src/org/netbeans/freemarker/templates/ScriptingCreateFromTemplateTest.java b/ide/libs.freemarker/test/unit/src/org/netbeans/freemarker/templates/ScriptingCreateFromTemplateTest.java
index ea2f396..86be52a 100644
--- a/ide/libs.freemarker/test/unit/src/org/netbeans/freemarker/templates/ScriptingCreateFromTemplateTest.java
+++ b/ide/libs.freemarker/test/unit/src/org/netbeans/freemarker/templates/ScriptingCreateFromTemplateTest.java
@@ -28,7 +28,6 @@
import java.util.Map;
import javax.swing.text.DefaultEditorKit;
import javax.swing.text.Document;
-import static junit.framework.Assert.assertEquals;
import org.netbeans.api.editor.mimelookup.MimePath;
import org.netbeans.api.queries.FileEncodingQuery;
import org.netbeans.junit.MockServices;
diff --git a/ide/libs.git/test/unit/src/org/netbeans/libs/git/jgit/commands/CompareCommitTest.java b/ide/libs.git/test/unit/src/org/netbeans/libs/git/jgit/commands/CompareCommitTest.java
index 9aaefff..5b15bcd 100644
--- a/ide/libs.git/test/unit/src/org/netbeans/libs/git/jgit/commands/CompareCommitTest.java
+++ b/ide/libs.git/test/unit/src/org/netbeans/libs/git/jgit/commands/CompareCommitTest.java
@@ -22,7 +22,6 @@
import java.io.File;
import java.io.IOException;
import java.util.Map;
-import static junit.framework.Assert.assertEquals;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.Repository;
import org.netbeans.libs.git.GitClient;
diff --git a/ide/libs.git/test/unit/src/org/netbeans/libs/git/jgit/commands/RebaseTest.java b/ide/libs.git/test/unit/src/org/netbeans/libs/git/jgit/commands/RebaseTest.java
index cedbd0c..d965092 100644
--- a/ide/libs.git/test/unit/src/org/netbeans/libs/git/jgit/commands/RebaseTest.java
+++ b/ide/libs.git/test/unit/src/org/netbeans/libs/git/jgit/commands/RebaseTest.java
@@ -23,10 +23,6 @@
import java.io.IOException;
import java.util.Arrays;
import java.util.Map;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.Repository;
import org.netbeans.libs.git.GitBranch;
diff --git a/ide/libs.git/test/unit/src/org/netbeans/libs/git/jgit/commands/RenameTest.java b/ide/libs.git/test/unit/src/org/netbeans/libs/git/jgit/commands/RenameTest.java
index c711fe7..144510f 100644
--- a/ide/libs.git/test/unit/src/org/netbeans/libs/git/jgit/commands/RenameTest.java
+++ b/ide/libs.git/test/unit/src/org/netbeans/libs/git/jgit/commands/RenameTest.java
@@ -27,7 +27,6 @@
import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.libs.git.GitClient;
import org.netbeans.libs.git.GitException;
import org.netbeans.libs.git.GitStatus;
diff --git a/ide/libs.git/test/unit/src/org/netbeans/libs/git/jgit/commands/StatusTest.java b/ide/libs.git/test/unit/src/org/netbeans/libs/git/jgit/commands/StatusTest.java
index ea9a782..befff67 100644
--- a/ide/libs.git/test/unit/src/org/netbeans/libs/git/jgit/commands/StatusTest.java
+++ b/ide/libs.git/test/unit/src/org/netbeans/libs/git/jgit/commands/StatusTest.java
@@ -24,7 +24,6 @@
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;
-import static junit.framework.Assert.assertFalse;
import org.eclipse.jgit.dircache.DirCache;
import org.eclipse.jgit.dircache.DirCacheBuilder;
import org.eclipse.jgit.dircache.DirCacheEntry;
diff --git a/ide/mercurial/test/unit/src/org/netbeans/modules/mercurial/HgCommandTest.java b/ide/mercurial/test/unit/src/org/netbeans/modules/mercurial/HgCommandTest.java
index e239267..f253e4b 100644
--- a/ide/mercurial/test/unit/src/org/netbeans/modules/mercurial/HgCommandTest.java
+++ b/ide/mercurial/test/unit/src/org/netbeans/modules/mercurial/HgCommandTest.java
@@ -28,8 +28,6 @@
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogRecord;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.junit.MockServices;
import org.netbeans.modules.mercurial.ui.log.HgLogMessage;
import org.netbeans.modules.mercurial.util.HgCommand;
diff --git a/ide/parsing.indexing/test/unit/src/org/netbeans/modules/parsing/impl/indexing/BrokenIndexRecoveryTest.java b/ide/parsing.indexing/test/unit/src/org/netbeans/modules/parsing/impl/indexing/BrokenIndexRecoveryTest.java
index 99c67ce..756fe57 100644
--- a/ide/parsing.indexing/test/unit/src/org/netbeans/modules/parsing/impl/indexing/BrokenIndexRecoveryTest.java
+++ b/ide/parsing.indexing/test/unit/src/org/netbeans/modules/parsing/impl/indexing/BrokenIndexRecoveryTest.java
@@ -29,7 +29,6 @@
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import java.util.logging.Logger;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.api.annotations.common.NonNull;
import org.netbeans.api.editor.mimelookup.MimeLookup;
import org.netbeans.api.editor.mimelookup.MimePath;
diff --git a/ide/parsing.indexing/test/unit/src/org/netbeans/modules/parsing/impl/indexing/ParsinApiInteractionTest.java b/ide/parsing.indexing/test/unit/src/org/netbeans/modules/parsing/impl/indexing/ParsinApiInteractionTest.java
index 07313e5..be80e2a 100644
--- a/ide/parsing.indexing/test/unit/src/org/netbeans/modules/parsing/impl/indexing/ParsinApiInteractionTest.java
+++ b/ide/parsing.indexing/test/unit/src/org/netbeans/modules/parsing/impl/indexing/ParsinApiInteractionTest.java
@@ -42,7 +42,6 @@
import java.util.logging.Logger;
import javax.swing.event.ChangeListener;
import javax.swing.text.StyledDocument;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.api.annotations.common.NonNull;
import org.netbeans.api.annotations.common.NullAllowed;
import org.netbeans.api.editor.mimelookup.MimePath;
diff --git a/ide/parsing.nb/test/unit/src/org/netbeans/modules/parsing/nb/TaskProcessorSuspendTest.java b/ide/parsing.nb/test/unit/src/org/netbeans/modules/parsing/nb/TaskProcessorSuspendTest.java
index 643eccb..3c305ab 100644
--- a/ide/parsing.nb/test/unit/src/org/netbeans/modules/parsing/nb/TaskProcessorSuspendTest.java
+++ b/ide/parsing.nb/test/unit/src/org/netbeans/modules/parsing/nb/TaskProcessorSuspendTest.java
@@ -28,8 +28,6 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.api.annotations.common.NonNull;
import org.netbeans.api.editor.mimelookup.MimePath;
import org.netbeans.api.editor.mimelookup.test.MockMimeLookup;
diff --git a/ide/project.libraries.ui/test/unit/src/org/netbeans/api/project/libraries/LibraryManageTest.java b/ide/project.libraries.ui/test/unit/src/org/netbeans/api/project/libraries/LibraryManageTest.java
index 07c81bd..d952f7f 100644
--- a/ide/project.libraries.ui/test/unit/src/org/netbeans/api/project/libraries/LibraryManageTest.java
+++ b/ide/project.libraries.ui/test/unit/src/org/netbeans/api/project/libraries/LibraryManageTest.java
@@ -24,9 +24,6 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.junit.NbTestCase;
import org.netbeans.modules.project.libraries.LibrariesTestUtil;
import org.netbeans.modules.project.libraries.LibrariesTestUtil.Area;
diff --git a/ide/projectapi/test/unit/src/org/netbeans/api/project/TestUtil.java b/ide/projectapi/test/unit/src/org/netbeans/api/project/TestUtil.java
index 0ce5448..45551ac 100644
--- a/ide/projectapi/test/unit/src/org/netbeans/api/project/TestUtil.java
+++ b/ide/projectapi/test/unit/src/org/netbeans/api/project/TestUtil.java
@@ -32,7 +32,7 @@
import java.util.WeakHashMap;
import java.util.logging.Logger;
import javax.swing.Icon;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.netbeans.junit.NbTestCase;
import org.netbeans.spi.project.ProjectFactory;
import org.netbeans.spi.project.ProjectFactory2;
diff --git a/ide/spellchecker/test/unit/src/org/netbeans/modules/spellchecker/UnitUtilities.java b/ide/spellchecker/test/unit/src/org/netbeans/modules/spellchecker/UnitUtilities.java
index 14c47e1..9b3c411 100644
--- a/ide/spellchecker/test/unit/src/org/netbeans/modules/spellchecker/UnitUtilities.java
+++ b/ide/spellchecker/test/unit/src/org/netbeans/modules/spellchecker/UnitUtilities.java
@@ -22,7 +22,7 @@
import java.beans.PropertyVetoException;
import java.io.File;
import java.io.IOException;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.netbeans.junit.NbTestCase;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil;
diff --git a/ide/spi.debugger.ui/test/unit/src/org/netbeans/api/debugger/IDEInitializer.java b/ide/spi.debugger.ui/test/unit/src/org/netbeans/api/debugger/IDEInitializer.java
index 87420fc..570d3fa 100644
--- a/ide/spi.debugger.ui/test/unit/src/org/netbeans/api/debugger/IDEInitializer.java
+++ b/ide/spi.debugger.ui/test/unit/src/org/netbeans/api/debugger/IDEInitializer.java
@@ -26,7 +26,7 @@
import java.net.URLStreamHandler;
import java.net.URLStreamHandlerFactory;
import java.util.Enumeration;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.netbeans.junit.Manager;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileSystem;
diff --git a/ide/spi.navigator/test/unit/src/org/netbeans/modules/navigator/NavigatorControllerTest.java b/ide/spi.navigator/test/unit/src/org/netbeans/modules/navigator/NavigatorControllerTest.java
index bf28abe..9c696bc 100644
--- a/ide/spi.navigator/test/unit/src/org/netbeans/modules/navigator/NavigatorControllerTest.java
+++ b/ide/spi.navigator/test/unit/src/org/netbeans/modules/navigator/NavigatorControllerTest.java
@@ -23,7 +23,6 @@
import java.util.ArrayList;
import java.util.List;
import javax.swing.JComponent;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.junit.NbTestCase;
import org.netbeans.junit.RandomlyFails;
import org.netbeans.modules.navigator.NavigatorTCTest.GlobalLookup4TestImpl;
diff --git a/ide/spi.navigator/test/unit/src/org/netbeans/modules/navigator/UnitTestUtils.java b/ide/spi.navigator/test/unit/src/org/netbeans/modules/navigator/UnitTestUtils.java
index 267299a..4902c93 100644
--- a/ide/spi.navigator/test/unit/src/org/netbeans/modules/navigator/UnitTestUtils.java
+++ b/ide/spi.navigator/test/unit/src/org/netbeans/modules/navigator/UnitTestUtils.java
@@ -20,15 +20,10 @@
package org.netbeans.modules.navigator;
import java.beans.PropertyVetoException;
-import java.io.File;
import java.io.IOException;
import java.net.URL;
import javax.swing.text.Utilities;
-import junit.framework.Assert;
-import org.netbeans.junit.NbTestCase;
-import org.openide.filesystems.FileObject;
-import org.openide.filesystems.FileUtil;
-import org.openide.filesystems.LocalFileSystem;
+import org.junit.Assert;
import org.openide.filesystems.Repository;
import org.openide.filesystems.XMLFileSystem;
import org.openide.util.Lookup;
diff --git a/ide/spi.palette/test/unit/src/org/netbeans/modules/palette/PaletteItemRegistrationProcessorTest.java b/ide/spi.palette/test/unit/src/org/netbeans/modules/palette/PaletteItemRegistrationProcessorTest.java
index 1b2f428..421e095 100644
--- a/ide/spi.palette/test/unit/src/org/netbeans/modules/palette/PaletteItemRegistrationProcessorTest.java
+++ b/ide/spi.palette/test/unit/src/org/netbeans/modules/palette/PaletteItemRegistrationProcessorTest.java
@@ -21,8 +21,6 @@
import java.awt.GraphicsEnvironment;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.junit.NbTestCase;
import org.openide.util.test.AnnotationProcessorTestUtils;
diff --git a/ide/spi.palette/test/unit/src/org/netbeans/spi/palette/IDEInitializer.java b/ide/spi.palette/test/unit/src/org/netbeans/spi/palette/IDEInitializer.java
index ba5cb99..a53d97f 100644
--- a/ide/spi.palette/test/unit/src/org/netbeans/spi/palette/IDEInitializer.java
+++ b/ide/spi.palette/test/unit/src/org/netbeans/spi/palette/IDEInitializer.java
@@ -26,7 +26,7 @@
import java.net.URLStreamHandler;
import java.net.URLStreamHandlerFactory;
import java.util.Enumeration;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.netbeans.junit.Manager;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileSystem;
diff --git a/ide/spi.tasklist/test/unit/src/org/netbeans/modules/tasklist/trampoline/IDEInitializer.java b/ide/spi.tasklist/test/unit/src/org/netbeans/modules/tasklist/trampoline/IDEInitializer.java
index 3dc2ccf..cddefef 100644
--- a/ide/spi.tasklist/test/unit/src/org/netbeans/modules/tasklist/trampoline/IDEInitializer.java
+++ b/ide/spi.tasklist/test/unit/src/org/netbeans/modules/tasklist/trampoline/IDEInitializer.java
@@ -26,7 +26,7 @@
import java.net.URLStreamHandler;
import java.net.URLStreamHandlerFactory;
import java.util.Enumeration;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.netbeans.junit.Manager;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileSystem;
diff --git a/ide/spi.tasklist/test/unit/src/org/netbeans/spi/tasklist/IDEInitializer.java b/ide/spi.tasklist/test/unit/src/org/netbeans/spi/tasklist/IDEInitializer.java
index 20a24a6..2f4ac07 100644
--- a/ide/spi.tasklist/test/unit/src/org/netbeans/spi/tasklist/IDEInitializer.java
+++ b/ide/spi.tasklist/test/unit/src/org/netbeans/spi/tasklist/IDEInitializer.java
@@ -26,7 +26,7 @@
import java.net.URLStreamHandler;
import java.net.URLStreamHandlerFactory;
import java.util.Enumeration;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.netbeans.junit.Manager;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileSystem;
diff --git a/ide/subversion/test/unit/src/org/netbeans/modules/subversion/client/SvnClientInvocationHandlerTest.java b/ide/subversion/test/unit/src/org/netbeans/modules/subversion/client/SvnClientInvocationHandlerTest.java
index b127458..4b2c6d8 100644
--- a/ide/subversion/test/unit/src/org/netbeans/modules/subversion/client/SvnClientInvocationHandlerTest.java
+++ b/ide/subversion/test/unit/src/org/netbeans/modules/subversion/client/SvnClientInvocationHandlerTest.java
@@ -25,7 +25,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.junit.Test;
import org.tigris.subversion.svnclientadapter.ISVNClientAdapter;
diff --git a/ide/team.commons/test/unit/src/org/netbeans/modules/bugtracking/commons/AutoupdatePluginUCTestCase.java b/ide/team.commons/test/unit/src/org/netbeans/modules/bugtracking/commons/AutoupdatePluginUCTestCase.java
index 9450072..b82411a 100644
--- a/ide/team.commons/test/unit/src/org/netbeans/modules/bugtracking/commons/AutoupdatePluginUCTestCase.java
+++ b/ide/team.commons/test/unit/src/org/netbeans/modules/bugtracking/commons/AutoupdatePluginUCTestCase.java
@@ -26,8 +26,6 @@
import java.io.OutputStream;
import java.net.URL;
import java.text.MessageFormat;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
import org.netbeans.api.autoupdate.UpdateUnitProvider;
import org.netbeans.api.autoupdate.UpdateUnitProviderFactory;
import org.netbeans.junit.NbTestCase;
diff --git a/ide/team.commons/test/unit/src/org/netbeans/modules/bugtracking/commons/AutoupdateSupportTest.java b/ide/team.commons/test/unit/src/org/netbeans/modules/bugtracking/commons/AutoupdateSupportTest.java
index 16dd3e7..5851866 100644
--- a/ide/team.commons/test/unit/src/org/netbeans/modules/bugtracking/commons/AutoupdateSupportTest.java
+++ b/ide/team.commons/test/unit/src/org/netbeans/modules/bugtracking/commons/AutoupdateSupportTest.java
@@ -20,8 +20,6 @@
package org.netbeans.modules.bugtracking.commons;
import java.util.Calendar;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
import junit.framework.TestCase;
/**
diff --git a/ide/utilities/test/unit/src/org/netbeans/modules/url/URLDataObjectTest.java b/ide/utilities/test/unit/src/org/netbeans/modules/url/URLDataObjectTest.java
index 8e4151a..c9ee870 100644
--- a/ide/utilities/test/unit/src/org/netbeans/modules/url/URLDataObjectTest.java
+++ b/ide/utilities/test/unit/src/org/netbeans/modules/url/URLDataObjectTest.java
@@ -20,9 +20,10 @@
import java.io.BufferedReader;
import java.io.StringReader;
-import static junit.framework.Assert.*;
import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+
/**
*
* @author jhavlin
diff --git a/ide/versioning.core/test/unit/src/org/netbeans/modules/versioning/core/spi/VCSVisibilityQueryTest.java b/ide/versioning.core/test/unit/src/org/netbeans/modules/versioning/core/spi/VCSVisibilityQueryTest.java
index d5b3ab3..d772478 100644
--- a/ide/versioning.core/test/unit/src/org/netbeans/modules/versioning/core/spi/VCSVisibilityQueryTest.java
+++ b/ide/versioning.core/test/unit/src/org/netbeans/modules/versioning/core/spi/VCSVisibilityQueryTest.java
@@ -26,7 +26,6 @@
import java.util.ArrayList;
import java.util.List;
import javax.swing.event.ChangeListener;
-import junit.framework.Assert;
import org.netbeans.api.queries.VisibilityQuery;
import org.netbeans.junit.NbTestCase;
import org.netbeans.modules.versioning.core.VersioningManager;
@@ -100,9 +99,9 @@
VisibilityQuery.getDefault().addChangeListener(list = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent ce) {
- Assert.assertTrue(ce instanceof VisibilityQueryChangeEvent);
+ assertTrue(ce instanceof VisibilityQueryChangeEvent);
FileObject[] fos = ((VisibilityQueryChangeEvent)ce).getFileObjects();
- Assert.assertEquals(2, fos.length);
+ assertEquals(2, fos.length);
received.add(fos[0].getName());
received.add(fos[1].getName());
}
diff --git a/ide/versioning/test/unit/src/org/netbeans/modules/versioning/spi/VCSVisibilityQueryTest.java b/ide/versioning/test/unit/src/org/netbeans/modules/versioning/spi/VCSVisibilityQueryTest.java
index d250c44..40abb44 100644
--- a/ide/versioning/test/unit/src/org/netbeans/modules/versioning/spi/VCSVisibilityQueryTest.java
+++ b/ide/versioning/test/unit/src/org/netbeans/modules/versioning/spi/VCSVisibilityQueryTest.java
@@ -27,7 +27,6 @@
import java.util.ArrayList;
import java.util.List;
import javax.swing.event.ChangeListener;
-import junit.framework.Assert;
import org.netbeans.api.queries.VisibilityQuery;
import org.netbeans.junit.NbTestCase;
import org.netbeans.modules.versioning.spi.testvcs.TestVCS;
@@ -98,9 +97,9 @@
VisibilityQuery.getDefault().addChangeListener(list = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent ce) {
- Assert.assertTrue(ce instanceof VisibilityQueryChangeEvent);
+ assertTrue(ce instanceof VisibilityQueryChangeEvent);
FileObject[] fos = ((VisibilityQueryChangeEvent)ce).getFileObjects();
- Assert.assertEquals(2, fos.length);
+ assertEquals(2, fos.length);
received.add(fos[0].getName());
received.add(fos[1].getName());
}
diff --git a/ide/xml.schema.completion/test/unit/src/org/netbeans/modules/xml/schema/completion/util/CompletionContextImplTest.java b/ide/xml.schema.completion/test/unit/src/org/netbeans/modules/xml/schema/completion/util/CompletionContextImplTest.java
index 7c87ad3..e378bbb 100644
--- a/ide/xml.schema.completion/test/unit/src/org/netbeans/modules/xml/schema/completion/util/CompletionContextImplTest.java
+++ b/ide/xml.schema.completion/test/unit/src/org/netbeans/modules/xml/schema/completion/util/CompletionContextImplTest.java
@@ -22,7 +22,6 @@
import java.util.List;
import javax.swing.text.Document;
import javax.xml.namespace.QName;
-import static junit.framework.Assert.assertEquals;
import org.junit.Test;
import org.netbeans.api.lexer.Language;
import org.netbeans.api.xml.lexer.XMLTokenId;
@@ -30,6 +29,8 @@
import org.netbeans.modules.xml.text.api.dom.XMLSyntaxSupport;
import org.openide.filesystems.FileObject;
+import static org.junit.Assert.assertEquals;
+
public class CompletionContextImplTest {
@Test
public void testDetectedPaths() throws Exception {
diff --git a/java/beans/test/qa-functional/src/org/netbeans/test/beans/operators/Navigator.java b/java/beans/test/qa-functional/src/org/netbeans/test/beans/operators/Navigator.java
index 55fa24c..02a71d0 100644
--- a/java/beans/test/qa-functional/src/org/netbeans/test/beans/operators/Navigator.java
+++ b/java/beans/test/qa-functional/src/org/netbeans/test/beans/operators/Navigator.java
@@ -26,7 +26,6 @@
import java.util.Stack;
import javax.swing.tree.TreeNode;
import javax.swing.tree.TreePath;
-import static junit.framework.Assert.fail;
import org.netbeans.jellytools.TopComponentOperator;
import org.netbeans.jemmy.TimeoutExpiredException;
import org.netbeans.jemmy.Waitable;
@@ -38,6 +37,7 @@
import org.openide.explorer.view.Visualizer;
import org.openide.nodes.Node;
+import static org.junit.Assert.fail;
/**
*
diff --git a/java/debugger.jpda/nbproject/org-netbeans-modules-debugger-jpda.sig b/java/debugger.jpda/nbproject/org-netbeans-modules-debugger-jpda.sig
index 5a10587..fb6f2e7 100644
--- a/java/debugger.jpda/nbproject/org-netbeans-modules-debugger-jpda.sig
+++ b/java/debugger.jpda/nbproject/org-netbeans-modules-debugger-jpda.sig
@@ -27,7 +27,6 @@
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitExports(com.sun.source.tree.ExportsTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitExpressionStatement(com.sun.source.tree.ExpressionStatementTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitForLoop(com.sun.source.tree.ForLoopTree,{com.sun.source.tree.TreeVisitor%1})
-meth public abstract {com.sun.source.tree.TreeVisitor%0} visitGuardedPattern(com.sun.source.tree.GuardedPatternTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitIdentifier(com.sun.source.tree.IdentifierTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitIf(com.sun.source.tree.IfTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitImport(com.sun.source.tree.ImportTree,{com.sun.source.tree.TreeVisitor%1})
@@ -108,7 +107,6 @@
meth public {com.sun.source.util.TreeScanner%0} visitExports(com.sun.source.tree.ExportsTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitExpressionStatement(com.sun.source.tree.ExpressionStatementTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitForLoop(com.sun.source.tree.ForLoopTree,{com.sun.source.util.TreeScanner%1})
-meth public {com.sun.source.util.TreeScanner%0} visitGuardedPattern(com.sun.source.tree.GuardedPatternTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitIdentifier(com.sun.source.tree.IdentifierTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitIf(com.sun.source.tree.IfTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitImport(com.sun.source.tree.ImportTree,{com.sun.source.util.TreeScanner%1})
diff --git a/java/debugger.jpda/nbproject/project.properties b/java/debugger.jpda/nbproject/project.properties
index d72f135..a8853bf 100644
--- a/java/debugger.jpda/nbproject/project.properties
+++ b/java/debugger.jpda/nbproject/project.properties
@@ -23,7 +23,7 @@
javadoc.arch=${basedir}/arch.xml
jpda.classes.dir=${build.dir}/jpda/classes/
requires.nb.javac=true
-spec.version.base=1.126.0
+spec.version.base=1.127.0
test-unit-sys-prop.test.dir.src=${basedir}/test/unit/src/
test-unit-sys-prop.netbeans.user=${basedir}/work/nb_user_dir
test.unit.cp.extra=../java.source.nbjavac/build/test-nb-javac/cluster/modules/org-netbeans-modules-java-source-nbjavac-test.jar
diff --git a/java/j2ee.metadata.model.support/test/unit/src/org/netbeans/modules/j2ee/metadata/model/api/support/annotation/PersistentObjectManagerTest.java b/java/j2ee.metadata.model.support/test/unit/src/org/netbeans/modules/j2ee/metadata/model/api/support/annotation/PersistentObjectManagerTest.java
index 4daacdd..fdf97fc 100644
--- a/java/j2ee.metadata.model.support/test/unit/src/org/netbeans/modules/j2ee/metadata/model/api/support/annotation/PersistentObjectManagerTest.java
+++ b/java/j2ee.metadata.model.support/test/unit/src/org/netbeans/modules/j2ee/metadata/model/api/support/annotation/PersistentObjectManagerTest.java
@@ -32,7 +32,6 @@
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.api.java.classpath.ClassPath;
import org.netbeans.api.java.classpath.GlobalPathRegistry;
import org.netbeans.api.java.source.ClassIndex;
diff --git a/java/java.completion/test/unit/data/org/netbeans/modules/java/completion/data/SwitchPatternMatching.java b/java/java.completion/test/unit/data/org/netbeans/modules/java/completion/data/SwitchPatternMatching.java
index 82cc419..9703698 100644
--- a/java/java.completion/test/unit/data/org/netbeans/modules/java/completion/data/SwitchPatternMatching.java
+++ b/java/java.completion/test/unit/data/org/netbeans/modules/java/completion/data/SwitchPatternMatching.java
@@ -28,9 +28,9 @@
String result = switch (obj) {
case null, String ->
"null & String";
- case CharSequence s && s. && obj. && IntStream.of(1).max().->
+ case CharSequence s when s. && obj. && IntStream.of(1).max().->
"CharSequence";
- case (java.util.List list && list. && new StringBuilder().ERROR. && java.util.ArrayList<String>.)->"list";
+ case (java.util.List list when list. && new StringBuilder().ERROR. && java.util.ArrayList<String>.)->"list";
default ->
"default";
};
diff --git a/java/java.completion/test/unit/src/org/netbeans/modules/java/completion/CompletionTestBaseBase.java b/java/java.completion/test/unit/src/org/netbeans/modules/java/completion/CompletionTestBaseBase.java
index 3e71573..a25e9cf 100644
--- a/java/java.completion/test/unit/src/org/netbeans/modules/java/completion/CompletionTestBaseBase.java
+++ b/java/java.completion/test/unit/src/org/netbeans/modules/java/completion/CompletionTestBaseBase.java
@@ -33,8 +33,6 @@
import javax.swing.JEditorPane;
-import junit.framework.Assert;
-
import org.netbeans.api.editor.mimelookup.MimeLookup;
import org.netbeans.api.java.classpath.ClassPath;
import org.netbeans.api.java.classpath.JavaClassPathConstants;
@@ -78,7 +76,7 @@
private static Lkp DEFAULT;
public Lkp() {
- Assert.assertNull(DEFAULT);
+ assertNull(DEFAULT);
DEFAULT = this;
}
@@ -195,7 +193,7 @@
layers.add(en.nextElement());
}
- Assert.assertTrue(paths[cntr], found);
+ assertTrue(paths[cntr], found);
}
return layers.toArray(new URL[0]);
diff --git a/java/java.completion/test/unit/src/org/netbeans/modules/java/completion/JavaCompletionTask117FeaturesTest.java b/java/java.completion/test/unit/src/org/netbeans/modules/java/completion/JavaCompletionTask117FeaturesTest.java
index 4318fb3..a9e7981 100644
--- a/java/java.completion/test/unit/src/org/netbeans/modules/java/completion/JavaCompletionTask117FeaturesTest.java
+++ b/java/java.completion/test/unit/src/org/netbeans/modules/java/completion/JavaCompletionTask117FeaturesTest.java
@@ -58,24 +58,24 @@
public void testClassMembersAutoCompletion_GuardedPattern() throws Exception {
TestCompilerOptionsQueryImplementation.EXTRA_OPTIONS.add("--enable-preview");
- performTest("SwitchPatternMatching", 1085, null, "AutoCompletion_MembersSelect_GuardedPatternMatchingSwitch.pass", getLatestSource());
+ performTest("SwitchPatternMatching", 1087, null, "AutoCompletion_MembersSelect_GuardedPatternMatchingSwitch.pass", getLatestSource());
}
public void testClassMembersAutoCompletion_GuardedPattern_1() throws Exception {
TestCompilerOptionsQueryImplementation.EXTRA_OPTIONS.add("--enable-preview");
- performTest("SwitchPatternMatching", 1093, null, "AutoCompletion_MembersSelect_GuardedPatternMatchingSwitch_1.pass", getLatestSource());
+ performTest("SwitchPatternMatching", 1095, null, "AutoCompletion_MembersSelect_GuardedPatternMatchingSwitch_1.pass", getLatestSource());
}
public void testClassMembersAutoCompletion_GuardedPattern_2() throws Exception {
TestCompilerOptionsQueryImplementation.EXTRA_OPTIONS.add("--enable-preview");
- performTest("SwitchPatternMatching", 1113, null, "AutoCompletion_MembersSelect_GuardedPatternMatchingSwitch_2.pass", getLatestSource());
+ performTest("SwitchPatternMatching", 1115, null, "AutoCompletion_MembersSelect_GuardedPatternMatchingSwitch_2.pass", getLatestSource());
}
public void testClassMembersAutoCompletion_ParanthesizedPattern() throws Exception {
TestCompilerOptionsQueryImplementation.EXTRA_OPTIONS.add("--enable-preview");
- performTest("SwitchPatternMatching", 1200, null, "AutoCompletion_MembersSelect_ParenthesizedPatternMatchingSwitch.pass", getLatestSource());
+ performTest("SwitchPatternMatching", 1204, null, "AutoCompletion_MembersSelect_ParenthesizedPatternMatchingSwitch.pass", getLatestSource());
}
public void testClassMembersAutoCompletion_ParanthesizedPattern_1() throws Exception {
TestCompilerOptionsQueryImplementation.EXTRA_OPTIONS.add("--enable-preview");
- performTest("SwitchPatternMatching", 1224, null, "AutoCompletion_MembersSelect_ParenthesizedPatternMatchingSwitch_1.pass", getLatestSource());
+ performTest("SwitchPatternMatching", 1228, null, "AutoCompletion_MembersSelect_ParenthesizedPatternMatchingSwitch_1.pass", getLatestSource());
}
public void noop() {
}
diff --git a/java/java.editor/src/org/netbeans/modules/editor/java/JavaCodeTemplateFilter.java b/java/java.editor/src/org/netbeans/modules/editor/java/JavaCodeTemplateFilter.java
index c93e2b3..85a6555 100644
--- a/java/java.editor/src/org/netbeans/modules/editor/java/JavaCodeTemplateFilter.java
+++ b/java/java.editor/src/org/netbeans/modules/editor/java/JavaCodeTemplateFilter.java
@@ -19,6 +19,7 @@
package org.netbeans.modules.editor.java;
+import com.sun.source.tree.CaseLabelTree;
import com.sun.source.tree.Tree;
import java.util.ArrayList;
import java.util.Collections;
@@ -112,12 +113,23 @@
}
treeKindCtx = tree.getKind();
switch (treeKindCtx) {
- case CASE:
- if (so < controller.getTrees().getSourcePositions().getEndPosition(controller.getCompilationUnit(), ((CaseTree)tree).getExpression())) {
+ case CASE: {
+ if (((CaseTree)tree).getCaseKind() == CaseTree.CaseKind.RULE) {
treeKindCtx = null;
+ } else {
+ SourcePositions sp = controller.getTrees().getSourcePositions();
+ List<? extends CaseLabelTree> labels = ((CaseTree)tree).getLabels();
+ int startPos = labels.isEmpty() ? (int) sp.getEndPosition(controller.getCompilationUnit(), labels.get(labels.size() - 1))
+ : (int)sp.getStartPosition(controller.getCompilationUnit(), tree);
+ String headerText = controller.getText().substring(startPos, so);
+ int idx = headerText.indexOf(':');
+ if (idx < 0) {
+ treeKindCtx = null;
+ }
}
break;
- case CLASS:
+ }
+ case CLASS: {
SourcePositions sp = controller.getTrees().getSourcePositions();
int startPos = (int)sp.getEndPosition(controller.getCompilationUnit(), ((ClassTree)tree).getModifiers());
if (startPos <= 0) {
@@ -130,6 +142,7 @@
stringCtx = CLASS_HEADER;
}
break;
+ }
case FOR_LOOP:
case ENHANCED_FOR_LOOP:
if (!isRightParenthesisOfLoopPresent(controller, so)) {
diff --git a/java/java.editor/test/qa-functional/src/org/netbeans/test/java/editor/codetemplates/CustomizedLog.java b/java/java.editor/test/qa-functional/src/org/netbeans/test/java/editor/codetemplates/CustomizedLog.java
index 19c079b..8495298 100644
--- a/java/java.editor/test/qa-functional/src/org/netbeans/test/java/editor/codetemplates/CustomizedLog.java
+++ b/java/java.editor/test/qa-functional/src/org/netbeans/test/java/editor/codetemplates/CustomizedLog.java
@@ -35,8 +35,8 @@
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
-import junit.framework.Assert;
import junit.framework.AssertionFailedError;
+import org.junit.Assert;
import org.netbeans.junit.Log;
import org.netbeans.junit.NbTestCase;
diff --git a/java/java.hints/src/org/netbeans/modules/java/hints/bugs/InfiniteRecursion.java b/java/java.hints/src/org/netbeans/modules/java/hints/bugs/InfiniteRecursion.java
index 77d2641..47ab70f 100644
--- a/java/java.hints/src/org/netbeans/modules/java/hints/bugs/InfiniteRecursion.java
+++ b/java/java.hints/src/org/netbeans/modules/java/hints/bugs/InfiniteRecursion.java
@@ -23,6 +23,7 @@
import com.sun.source.tree.CaseTree;
import com.sun.source.tree.ClassTree;
import com.sun.source.tree.ConditionalExpressionTree;
+import com.sun.source.tree.ConstantCaseLabelTree;
import com.sun.source.tree.ContinueTree;
import com.sun.source.tree.DoWhileLoopTree;
import com.sun.source.tree.EnhancedForLoopTree;
@@ -551,6 +552,11 @@
}
@Override
+ public State visitConstantCaseLabel(ConstantCaseLabelTree node, Void p) {
+ return super.scan(node.getConstantExpression(), p);
+ }
+
+ @Override
public State visitEnhancedForLoop(EnhancedForLoopTree node, Void p) {
State s;
diff --git a/java/java.hints/src/org/netbeans/modules/java/hints/suggestions/ExpectedTypeResolver.java b/java/java.hints/src/org/netbeans/modules/java/hints/suggestions/ExpectedTypeResolver.java
index e87f86e..56fd371 100644
--- a/java/java.hints/src/org/netbeans/modules/java/hints/suggestions/ExpectedTypeResolver.java
+++ b/java/java.hints/src/org/netbeans/modules/java/hints/suggestions/ExpectedTypeResolver.java
@@ -34,7 +34,9 @@
import com.sun.source.tree.CompilationUnitTree;
import com.sun.source.tree.CompoundAssignmentTree;
import com.sun.source.tree.ConditionalExpressionTree;
+import com.sun.source.tree.ConstantCaseLabelTree;
import com.sun.source.tree.ContinueTree;
+import com.sun.source.tree.DeconstructionPatternTree;
import com.sun.source.tree.DefaultCaseLabelTree;
import com.sun.source.tree.DoWhileLoopTree;
import com.sun.source.tree.EmptyStatementTree;
@@ -44,7 +46,6 @@
import com.sun.source.tree.ExpressionStatementTree;
import com.sun.source.tree.ExpressionTree;
import com.sun.source.tree.ForLoopTree;
-import com.sun.source.tree.GuardedPatternTree;
import com.sun.source.tree.IdentifierTree;
import com.sun.source.tree.IfTree;
import com.sun.source.tree.ImportTree;
@@ -66,6 +67,7 @@
import com.sun.source.tree.ParameterizedTypeTree;
import com.sun.source.tree.ParenthesizedPatternTree;
import com.sun.source.tree.ParenthesizedTree;
+import com.sun.source.tree.PatternCaseLabelTree;
import com.sun.source.tree.PrimitiveTypeTree;
import com.sun.source.tree.ProvidesTree;
import com.sun.source.tree.RequiresTree;
@@ -110,7 +112,6 @@
import javax.lang.model.type.PrimitiveType;
import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeMirror;
-import javax.lang.model.type.TypeVariable;
import javax.lang.model.type.UnionType;
import javax.lang.model.type.WildcardType;
import javax.lang.model.util.ElementFilter;
@@ -1416,7 +1417,17 @@
}
@Override
- public List<? extends TypeMirror> visitGuardedPattern(GuardedPatternTree node, Object p) {
+ public List<? extends TypeMirror> visitConstantCaseLabel(ConstantCaseLabelTree node, Object p) {
+ return null;
+ }
+
+ @Override
+ public List<? extends TypeMirror> visitPatternCaseLabel(PatternCaseLabelTree node, Object p) {
+ return null;
+ }
+
+ @Override
+ public List<? extends TypeMirror> visitDeconstructionPattern(DeconstructionPatternTree node, Object p) {
return null;
}
diff --git a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/jdk/ConvertSwitchToRuleSwitchTest.java b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/jdk/ConvertSwitchToRuleSwitchTest.java
index b87dc9f..61ff166 100644
--- a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/jdk/ConvertSwitchToRuleSwitchTest.java
+++ b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/jdk/ConvertSwitchToRuleSwitchTest.java
@@ -987,10 +987,10 @@
HintTest.create()
.input("package test;" +
"public class Test {\n" +
- " private void test(int p) {\n" +
+ " private void test(Object p) {\n" +
" String result;\n" +
" switch (p) {\n" +
- " case Integer i && (i > 10): result = \"a\"; break;\n" +
+ " case Integer i when (i > 10): result = \"a\"; break;\n" +
" default: System.err.println(\"No.\"); break;\n" +
" }\n" +
" }\n" +
@@ -1003,10 +1003,10 @@
.assertCompilable()
.assertVerbatimOutput("package test;" +
"public class Test {\n" +
- " private void test(int p) {\n" +
+ " private void test(Object p) {\n" +
" String result;\n" +
" switch (p) {\n" +
- " case Integer i && (i > 10) -> result = \"a\";\n" +
+ " case Integer i when (i > 10) -> result = \"a\";\n" +
" default -> System.err.println(\"No.\");\n" +
" }\n" +
" }\n" +
@@ -1025,7 +1025,7 @@
+ "class Test {\n"
+ " public String test(Object p, Object o1, Object o2) {\n"
+ " switch (p) {\n"
- + " case (Integer i && (i > 10)):\n"
+ + " case (Integer i) when (i > 10):\n"
+ " return (String) o1;\n"
+ " default :\n"
+ " return (String) o2;\n"
@@ -1042,7 +1042,7 @@
+ "class Test {\n"
+ " public String test(Object p, Object o1, Object o2) {\n"
+ " return (String) (switch (p) {\n"
- + " case (Integer i && (i > 10)) -> o1;\n"
+ + " case (Integer i) when (i > 10) -> o1;\n"
+ " default -> o2;\n"
+ " });\n"
+ " }\n"
diff --git a/java/java.j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/api/J2SEProjectPlatformTest.java b/java/java.j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/api/J2SEProjectPlatformTest.java
index 320d488..b51bc6f 100644
--- a/java/java.j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/api/J2SEProjectPlatformTest.java
+++ b/java/java.j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/api/J2SEProjectPlatformTest.java
@@ -29,7 +29,6 @@
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
-import static junit.framework.Assert.assertEquals;
import org.netbeans.api.annotations.common.NonNull;
import org.netbeans.api.java.classpath.ClassPath;
import org.netbeans.api.java.platform.JavaPlatform;
diff --git a/java/java.kit/test/qa-functional/src/org/netbeans/test/ide/WatchProjects.java b/java/java.kit/test/qa-functional/src/org/netbeans/test/ide/WatchProjects.java
index bad7652..be9b02b 100644
--- a/java/java.kit/test/qa-functional/src/org/netbeans/test/ide/WatchProjects.java
+++ b/java/java.kit/test/qa-functional/src/org/netbeans/test/ide/WatchProjects.java
@@ -33,8 +33,8 @@
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;
-import junit.framework.Assert;
import junit.framework.AssertionFailedError;
+import org.junit.Assert;
import org.netbeans.api.java.source.ui.ScanDialog;
import org.netbeans.api.project.Project;
import org.netbeans.api.project.ui.OpenProjects;
diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/project/LspProjectInfo.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/project/LspProjectInfo.java
new file mode 100644
index 0000000..4e267b6
--- /dev/null
+++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/project/LspProjectInfo.java
@@ -0,0 +1,62 @@
+/*
+ * 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.netbeans.modules.java.lsp.server.project;
+
+import java.net.URI;
+
+/**
+ *
+ * @author sdedic
+ */
+public class LspProjectInfo {
+ /**
+ * Project's directory
+ */
+ public URI projectDirectory;
+
+ /**
+ * Project's name.
+ */
+ public String name;
+
+ /**
+ * Project's display name as defined in project file(s)
+ */
+ public String displayName;
+
+ /**
+ * The build system / project type. Ant, Gradle, Maven.
+ */
+ public String projectType;
+
+ /**
+ * URIs of subprojects. Usually children of the project's own directory.
+ */
+ public URI[] subprojects;
+
+ /**
+ * If part of a reactor or multi-project, the URI of the root project.
+ */
+ public URI rootProject;
+
+ /**
+ * Supported project actions. Names.
+ */
+ public String[] projectActionNames;
+}
diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/Server.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/Server.java
index cdcf5cf..df866c4 100644
--- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/Server.java
+++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/Server.java
@@ -749,7 +749,9 @@
JAVA_SUPER_IMPLEMENTATION,
JAVA_SOURCE_FOR,
JAVA_CLEAR_PROJECT_CACHES,
- NATIVE_IMAGE_FIND_DEBUG_PROCESS_TO_ATTACH));
+ NATIVE_IMAGE_FIND_DEBUG_PROCESS_TO_ATTACH,
+ JAVA_PROJECT_INFO
+ ));
for (CodeActionsProvider codeActionsProvider : Lookup.getDefault().lookupAll(CodeActionsProvider.class)) {
commands.addAll(codeActionsProvider.getCommands());
}
@@ -944,6 +946,12 @@
* new project files were generated into workspace subtree.
*/
public static final String JAVA_CLEAR_PROJECT_CACHES = "java.clear.project.caches";
+
+ /**
+ * For a project directory, returns basic project information and structure.
+ * Syntax: nbls.project.info(locations : String | String[], options? : { projectStructure? : boolean; actions? : boolean; recursive? : boolean }) : LspProjectInfo
+ */
+ public static final String JAVA_PROJECT_INFO = "nbls.project.info";
static final String INDEXING_COMPLETED = "Indexing completed.";
static final String NO_JAVA_SUPPORT = "Cannot initialize Java support on JDK ";
diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/WorkspaceServiceImpl.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/WorkspaceServiceImpl.java
index 3529067..2060a45 100644
--- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/WorkspaceServiceImpl.java
+++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/WorkspaceServiceImpl.java
@@ -19,6 +19,7 @@
package org.netbeans.modules.java.lsp.server.protocol;
import com.google.gson.Gson;
+import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
@@ -29,6 +30,7 @@
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URI;
+import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLDecoder;
import java.net.URLEncoder;
@@ -48,6 +50,7 @@
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
@@ -99,6 +102,7 @@
import org.netbeans.api.java.source.ui.ElementOpen;
import org.netbeans.api.project.FileOwnerQuery;
import org.netbeans.api.project.Project;
+import org.netbeans.api.project.ProjectInformation;
import org.netbeans.api.project.ProjectManager;
import org.netbeans.api.project.ProjectUtils;
import org.netbeans.api.project.SourceGroup;
@@ -111,6 +115,7 @@
import org.netbeans.modules.java.lsp.server.Utils;
import org.netbeans.modules.java.lsp.server.debugging.attach.AttachConfigurations;
import org.netbeans.modules.java.lsp.server.debugging.attach.AttachNativeConfigurations;
+import org.netbeans.modules.java.lsp.server.project.LspProjectInfo;
import org.netbeans.modules.java.source.ElementHandleAccessor;
import org.netbeans.modules.java.source.ui.JavaSymbolProvider;
import org.netbeans.modules.java.source.ui.JavaTypeProvider;
@@ -139,8 +144,11 @@
* @author lahvac
*/
public final class WorkspaceServiceImpl implements WorkspaceService, LanguageClientAware {
+
+ private static final Logger LOG = Logger.getLogger(WorkspaceServiceImpl.class.getName());
private static final RequestProcessor WORKER = new RequestProcessor(WorkspaceServiceImpl.class.getName(), 1, false, false);
+ private static final RequestProcessor PROJECT_WORKER = new RequestProcessor(WorkspaceServiceImpl.class.getName(), 5, false, false);
private final Gson gson = new Gson();
private final LspServerState server;
@@ -578,6 +586,56 @@
}
return (CompletableFuture<Object>) (CompletableFuture<?>)result;
}
+
+ case Server.JAVA_PROJECT_INFO: {
+ final CompletableFuture<Object> result = new CompletableFuture<>();
+ List<Object> arguments = params.getArguments();
+ if (arguments.size() < 1) {
+ result.completeExceptionally(new IllegalArgumentException("Expecting URL or URL[] as an argument to " + command));
+ return result;
+ }
+ Object o = arguments.get(0);
+ URL[] locations = null;
+ if (o instanceof JsonArray) {
+ List<URL> locs = new ArrayList<>();
+ JsonArray a = (JsonArray)o;
+ a.forEach((e) -> {
+ if (e instanceof JsonPrimitive) {
+ String s = ((JsonPrimitive)e).getAsString();
+ try {
+ locs.add(new URL(s));
+ } catch (MalformedURLException ex) {
+ throw new IllegalArgumentException("Illegal location: " + s);
+ }
+ }
+ });
+ } else if (o instanceof JsonPrimitive) {
+ String s = ((JsonPrimitive)o).getAsString();
+ try {
+ locations = new URL[] { new URL(s) };
+ } catch (MalformedURLException ex) {
+ throw new IllegalArgumentException("Illegal location: " + s);
+ }
+ }
+ if (locations == null || locations.length == 0) {
+ result.completeExceptionally(new IllegalArgumentException("Expecting URL or URL[] as an argument to " + command));
+ return result;
+ }
+ boolean projectStructure = false;
+ boolean actions = false;
+ boolean recursive = false;
+
+ if (arguments.size() > 1) {
+ Object a2 = arguments.get(1);
+ if (a2 instanceof JsonObject) {
+ JsonObject options = (JsonObject)a2;
+ projectStructure = getOption(options, "projectStructure", false); // NOI18N
+ actions = getOption(options, "actions", false); // NOI18N
+ recursive = getOption(options, "recursive", false); // NOI18N
+ }
+ }
+ return (CompletableFuture<Object>)(CompletableFuture<?>)new ProjectInfoWorker(locations, projectStructure, recursive, actions).process();
+ }
default:
for (CodeActionsProvider codeActionsProvider : Lookup.getDefault().lookupAll(CodeActionsProvider.class)) {
if (codeActionsProvider.getCommands().contains(command)) {
@@ -588,6 +646,133 @@
throw new UnsupportedOperationException("Command not supported: " + params.getCommand());
}
+ private class ProjectInfoWorker {
+ final URL[] locations;
+ final boolean projectStructure;
+ final boolean recursive;
+ final boolean actions;
+
+ Map<FileObject, LspProjectInfo> infos = new HashMap<>();
+ Set<Project> toOpen = new HashSet<>();
+
+ public ProjectInfoWorker(URL[] locations, boolean projectStructure, boolean recursive, boolean actions) {
+ this.locations = locations;
+ this.projectStructure = projectStructure;
+ this.recursive = recursive;
+ this.actions = actions;
+ }
+
+ public CompletableFuture<LspProjectInfo[]> process() {
+ List<FileObject> files = new ArrayList();
+ for (URL u : locations) {
+ FileObject f = URLMapper.findFileObject(u);
+ if (f != null) {
+ files.add(f);
+ }
+ }
+ return server.asyncOpenSelectedProjects(files, false).thenCompose(this::processProjects);
+ }
+
+ LspProjectInfo fillProjectInfo(Project p) {
+ LspProjectInfo info = infos.get(p.getProjectDirectory());
+ if (info != null) {
+ return info;
+ }
+ info = new LspProjectInfo();
+
+ ProjectInformation pi = ProjectUtils.getInformation(p);
+ URL projectURL = URLMapper.findURL(p.getProjectDirectory(), URLMapper.EXTERNAL);
+ if (projectURL != null) {
+ try {
+ info.projectDirectory = projectURL.toURI();
+ } catch (URISyntaxException ex) {
+ // should not happen
+ }
+ }
+ info.name = pi.getName();
+ info.displayName = pi.getDisplayName();
+
+ // attempt to determine the project type
+ ProjectManager.Result r = ProjectManager.getDefault().isProject2(p.getProjectDirectory());
+ info.projectType = r.getProjectType();
+
+ if (actions) {
+ ActionProvider ap = p.getLookup().lookup(ActionProvider.class);
+ if (ap != null) {
+ info.projectActionNames = ap.getSupportedActions();
+ }
+ }
+
+ if (projectStructure) {
+ Set<Project> children = ProjectUtils.getContainedProjects(p, false);
+ List<URI> subprojectDirs = new ArrayList<>();
+ for (Project c : children) {
+ try {
+ subprojectDirs.add(URLMapper.findURL(c.getProjectDirectory(), URLMapper.EXTERNAL).toURI());
+ } catch (URISyntaxException ex) {
+ // should not happen
+ }
+ }
+ info.subprojects = subprojectDirs.toArray(new URI[subprojectDirs.size()]);
+ Project root = ProjectUtils.rootOf(p);
+ if (root != null) {
+ try {
+ info.rootProject = URLMapper.findURL(root.getProjectDirectory(), URLMapper.EXTERNAL).toURI();
+ } catch (URISyntaxException ex) {
+ // should not happen
+ }
+ }
+ if (recursive) {
+ toOpen.addAll(children);
+ }
+ }
+ infos.put(p.getProjectDirectory(), info);
+ return info;
+ }
+
+ CompletableFuture<LspProjectInfo[]> processProjects(Project[] prjs) {
+ for (Project p : prjs) {
+ fillProjectInfo(p);
+ }
+ if (toOpen.isEmpty()) {
+ return finalizeInfos();
+ }
+ List<FileObject> dirs = new ArrayList<>(toOpen.size());
+ for (Project p : toOpen) {
+ dirs.add(p.getProjectDirectory());
+ }
+ toOpen.clear();
+ return server.asyncOpenSelectedProjects(dirs).thenCompose(this::processProjects);
+ }
+
+ CompletableFuture<LspProjectInfo[]> finalizeInfos() {
+ List<LspProjectInfo> list = new ArrayList();
+ for (URL u : locations) {
+ FileObject f = URLMapper.findFileObject(u);
+ Project owner = FileOwnerQuery.getOwner(f);
+ if (owner != null) {
+ list.add(infos.remove(owner.getProjectDirectory()));
+ } else {
+ list.add(null);
+ }
+ }
+ list.addAll(infos.values());
+ LspProjectInfo[] toArray = list.toArray(new LspProjectInfo[list.size()]);
+ return CompletableFuture.completedFuture(toArray);
+ }
+ }
+
+ private static boolean getOption(JsonObject opts, String member, boolean def) {
+ if (!opts.has(member)) {
+ return def;
+ }
+ Object o = opts.get(member);
+ if (!(o instanceof JsonPrimitive)) {
+ return false;
+ }
+ return ((JsonPrimitive)o).getAsBoolean();
+ }
+
private final AtomicReference<BiConsumer<FileObject, Collection<TestMethodController.TestMethod>>> testMethodsListener = new AtomicReference<>();
private final AtomicReference<PropertyChangeListener> openProjectsListener = new AtomicReference<>();
diff --git a/java/java.lsp.server/vscode/src/extension.ts b/java/java.lsp.server/vscode/src/extension.ts
index 4198f42..be5fe62 100644
--- a/java/java.lsp.server/vscode/src/extension.ts
+++ b/java/java.lsp.server/vscode/src/extension.ts
@@ -301,15 +301,19 @@
const id = 'redhat.java';
let e = vscode.extensions.getExtension(id);
if (e && workspace.name) {
- const DISABLE_EXTENSION = `Manually disable extension`;
- const DISABLE_JAVA = `Disable Java in Apache NetBeans Language Server`;
- vscode.window.showInformationMessage(`Another Java support extension is already installed. It is recommended to use only one Java support per workspace.`, DISABLE_EXTENSION, DISABLE_JAVA).then((selected) => {
- if (DISABLE_EXTENSION === selected) {
- vscode.commands.executeCommand('workbench.extensions.action.showInstalledExtensions');
- } else if (DISABLE_JAVA === selected) {
- conf.update("netbeans.javaSupport.enabled", false, true);
- }
- });
+ if (vscode.extensions.getExtension('oracle-labs-graalvm.gcn')) {
+ conf.update("netbeans.javaSupport.enabled", false, true);
+ } else {
+ const DISABLE_EXTENSION = `Manually disable extension`;
+ const DISABLE_JAVA = `Disable Java in Apache NetBeans Language Server`;
+ vscode.window.showInformationMessage(`Another Java support extension is already installed. It is recommended to use only one Java support per workspace.`, DISABLE_EXTENSION, DISABLE_JAVA).then((selected) => {
+ if (DISABLE_EXTENSION === selected) {
+ vscode.commands.executeCommand('workbench.extensions.action.showInstalledExtensions');
+ } else if (DISABLE_JAVA === selected) {
+ conf.update("netbeans.javaSupport.enabled", false, true);
+ }
+ });
+ }
}
}
}
diff --git a/java/java.mx.project/src/org/netbeans/modules/java/mx/project/SuiteProject.java b/java/java.mx.project/src/org/netbeans/modules/java/mx/project/SuiteProject.java
index ee2e8f9..0de2b68 100644
--- a/java/java.mx.project/src/org/netbeans/modules/java/mx/project/SuiteProject.java
+++ b/java/java.mx.project/src/org/netbeans/modules/java/mx/project/SuiteProject.java
@@ -19,9 +19,13 @@
package org.netbeans.modules.java.mx.project;
import java.io.File;
+import java.util.Arrays;
+import java.util.List;
import java.util.concurrent.Future;
+import javax.swing.event.ChangeListener;
import org.netbeans.modules.java.mx.project.suitepy.MxSuite;
import org.netbeans.api.project.Project;
+import org.netbeans.spi.java.queries.CompilerOptionsQueryImplementation;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil;
import org.openide.util.Exceptions;
@@ -46,7 +50,8 @@
new SuiteLogicalView(this),
new SuiteClassPathProvider(this, jdks),
new SuiteProperties(),
- new SuiteActionProvider(this)
+ new SuiteActionProvider(this),
+ new SuiteCompilerOptionsQueryImpl()
);
} catch (RuntimeException ex) {
throw Exceptions.attachMessage(ex, "Error parsing " + suitePy);
@@ -104,4 +109,24 @@
return null;
}
+ private class SuiteCompilerOptionsQueryImpl implements CompilerOptionsQueryImplementation {
+
+ private CompilerOptionsQueryImplementation.Result RESULT = new Result() {
+ @Override
+ public List<? extends String> getArguments() {
+ return Arrays.asList("--add-modules", "ALL-MODULE-PATH");
+ }
+
+ @Override
+ public void addChangeListener(ChangeListener listener) {}
+
+ @Override
+ public void removeChangeListener(ChangeListener listener) {}
+ };
+
+ @Override
+ public CompilerOptionsQueryImplementation.Result getOptions(FileObject file) {
+ return RESULT;
+ }
+ }
}
diff --git a/java/java.platform.ui/test/unit/src/org/netbeans/modules/java/platform/DefaultJavaPlatformProviderTest.java b/java/java.platform.ui/test/unit/src/org/netbeans/modules/java/platform/DefaultJavaPlatformProviderTest.java
index a99f49e..e16f5b1 100644
--- a/java/java.platform.ui/test/unit/src/org/netbeans/modules/java/platform/DefaultJavaPlatformProviderTest.java
+++ b/java/java.platform.ui/test/unit/src/org/netbeans/modules/java/platform/DefaultJavaPlatformProviderTest.java
@@ -23,7 +23,6 @@
import java.beans.PropertyChangeListener;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
-import junit.framework.Assert;
import org.netbeans.junit.NbTestCase;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileSystem;
@@ -52,7 +51,7 @@
fs.getRoot();
rp = new Repository(fs);
System.setProperty("org.openide.util.Lookup", DefaultJavaPlatformProviderTest.Lkp.class.getName()); //NOI18N
- Assert.assertEquals(DefaultJavaPlatformProviderTest.Lkp.class, Lookup.getDefault().getClass());
+ assertEquals(DefaultJavaPlatformProviderTest.Lkp.class, Lookup.getDefault().getClass());
}
public void testMissingLayer202479() throws Exception {
diff --git a/java/java.source.base/nbproject/org-netbeans-modules-java-source-base.sig b/java/java.source.base/nbproject/org-netbeans-modules-java-source-base.sig
index cc7a583..335dc64 100644
--- a/java/java.source.base/nbproject/org-netbeans-modules-java-source-base.sig
+++ b/java/java.source.base/nbproject/org-netbeans-modules-java-source-base.sig
@@ -27,7 +27,6 @@
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitExports(com.sun.source.tree.ExportsTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitExpressionStatement(com.sun.source.tree.ExpressionStatementTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitForLoop(com.sun.source.tree.ForLoopTree,{com.sun.source.tree.TreeVisitor%1})
-meth public abstract {com.sun.source.tree.TreeVisitor%0} visitGuardedPattern(com.sun.source.tree.GuardedPatternTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitIdentifier(com.sun.source.tree.IdentifierTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitIf(com.sun.source.tree.IfTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitImport(com.sun.source.tree.ImportTree,{com.sun.source.tree.TreeVisitor%1})
@@ -108,7 +107,6 @@
meth public {com.sun.source.util.TreeScanner%0} visitExports(com.sun.source.tree.ExportsTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitExpressionStatement(com.sun.source.tree.ExpressionStatementTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitForLoop(com.sun.source.tree.ForLoopTree,{com.sun.source.util.TreeScanner%1})
-meth public {com.sun.source.util.TreeScanner%0} visitGuardedPattern(com.sun.source.tree.GuardedPatternTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitIdentifier(com.sun.source.tree.IdentifierTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitIf(com.sun.source.tree.IfTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitImport(com.sun.source.tree.ImportTree,{com.sun.source.util.TreeScanner%1})
diff --git a/java/java.source.base/nbproject/project.properties b/java/java.source.base/nbproject/project.properties
index bb2801c..9d0e680 100644
--- a/java/java.source.base/nbproject/project.properties
+++ b/java/java.source.base/nbproject/project.properties
@@ -23,7 +23,7 @@
javadoc.title=Java Source Base
javadoc.arch=${basedir}/arch.xml
javadoc.apichanges=${basedir}/apichanges.xml
-spec.version.base=2.58.0
+spec.version.base=2.59.0
test.qa-functional.cp.extra=${refactoring.java.dir}/modules/ext/nb-javac-api.jar
test.unit.run.cp.extra=${o.n.core.dir}/core/core.jar:\
${o.n.core.dir}/lib/boot.jar:\
diff --git a/java/java.source.base/src/org/netbeans/api/java/source/TranslateIdentifier.java b/java/java.source.base/src/org/netbeans/api/java/source/TranslateIdentifier.java
index c9247e3..c1f498e 100644
--- a/java/java.source.base/src/org/netbeans/api/java/source/TranslateIdentifier.java
+++ b/java/java.source.base/src/org/netbeans/api/java/source/TranslateIdentifier.java
@@ -21,6 +21,7 @@
import com.sun.source.tree.CaseTree;
import com.sun.source.tree.CompilationUnitTree;
+import com.sun.source.tree.ConstantCaseLabelTree;
import com.sun.source.tree.IdentifierTree;
import com.sun.source.tree.MemberSelectTree;
import com.sun.source.tree.MethodTree;
@@ -79,7 +80,7 @@
|| (element.getKind().isField() && ((Symbol) element).isStatic())) {
Tree parent = path.getParentPath() != null ? path.getParentPath().getLeaf() : null;
- if ( (parent != null && parent.getKind() == Kind.CASE && ((CaseTree) parent).getExpression() == node && element.getKind() == ElementKind.ENUM_CONSTANT)
+ if ( (parent != null && parent.getKind() == Kind.CONSTANT_CASE_LABEL && ((ConstantCaseLabelTree) parent).getConstantExpression() == node && element.getKind() == ElementKind.ENUM_CONSTANT)
|| (path.getCompilationUnit() != null && ((Symbol) element).enclClass() != null && path.getCompilationUnit().getSourceFile() == ((Symbol) element).enclClass().sourcefile)) {
translateMap.put(node, make.Identifier(element.getSimpleName()));
} else {
diff --git a/java/java.source.base/src/org/netbeans/api/java/source/TreeMaker.java b/java/java.source.base/src/org/netbeans/api/java/source/TreeMaker.java
index b7667a4..cb830c6 100644
--- a/java/java.source.base/src/org/netbeans/api/java/source/TreeMaker.java
+++ b/java/java.source.base/src/org/netbeans/api/java/source/TreeMaker.java
@@ -276,7 +276,7 @@
* @since 2.39
*/
public CaseTree CasePatterns(List<? extends Tree> patterns, Tree body) {
- return delegate.CaseMultiplePatterns(patterns.stream().map(p -> (CaseLabelTree) p).collect(Collectors.toList()), body);
+ return delegate.CaseMultiplePatterns(toCaseLabelTrees(patterns), body);
}
/**
@@ -288,7 +288,22 @@
* @since 2.39
*/
public CaseTree CasePatterns(List<? extends Tree> patterns, List<? extends StatementTree> statements) {
- return delegate.CaseMultiplePatterns(patterns.stream().map(p -> (CaseLabelTree) p).collect(Collectors.toList()), statements);
+ return delegate.CaseMultiplePatterns(toCaseLabelTrees(patterns), statements);
+ }
+
+ private List<? extends CaseLabelTree> toCaseLabelTrees(List<? extends Tree> patterns) {
+ return patterns.stream().map(p -> {
+ if (p instanceof CaseLabelTree) {
+ return (CaseLabelTree) p;
+ }
+ if (p instanceof ExpressionTree) {
+ return delegate.ConstantCaseLabel((ExpressionTree) p);
+ }
+ if (p instanceof PatternTree) {
+ return delegate.PatternCaseLabel((PatternTree) p, null);
+ }
+ throw new IllegalArgumentException("Invalid pattern kind: " + p.getKind()); //NOI18N
+ }).collect(Collectors.toList());
}
/**
diff --git a/java/java.source.base/src/org/netbeans/modules/java/source/NoJavacHelper.java b/java/java.source.base/src/org/netbeans/modules/java/source/NoJavacHelper.java
index 2085580..727e20c 100644
--- a/java/java.source.base/src/org/netbeans/modules/java/source/NoJavacHelper.java
+++ b/java/java.source.base/src/org/netbeans/modules/java/source/NoJavacHelper.java
@@ -34,7 +34,7 @@
*/
public class NoJavacHelper {
- public static final int REQUIRED_JAVAC_VERSION = 18; // <- TODO: increment on every release
+ public static final int REQUIRED_JAVAC_VERSION = 19; // <- TODO: increment on every release
private static final boolean HAS_WORKING_JAVAC;
static {
diff --git a/java/java.source.base/src/org/netbeans/modules/java/source/builder/TreeFactory.java b/java/java.source.base/src/org/netbeans/modules/java/source/builder/TreeFactory.java
index 568e8952..102544c 100644
--- a/java/java.source.base/src/org/netbeans/modules/java/source/builder/TreeFactory.java
+++ b/java/java.source.base/src/org/netbeans/modules/java/source/builder/TreeFactory.java
@@ -77,6 +77,7 @@
import java.util.Collections;
import java.util.List;
import java.util.Set;
+import java.util.stream.Collectors;
import javax.lang.model.element.*;
import javax.lang.model.type.ArrayType;
import javax.lang.model.type.TypeKind;
@@ -210,16 +211,31 @@
return make.at(NOPOS).DefaultCaseLabel();
}
+ public ConstantCaseLabelTree ConstantCaseLabel(ExpressionTree expr) {
+ return make.at(NOPOS).ConstantCaseLabel((JCExpression) expr);
+ }
+
+ public PatternCaseLabelTree PatternCaseLabel(PatternTree pat, ExpressionTree guard) {
+ return make.at(NOPOS).PatternCaseLabel((JCPattern) pat, (JCExpression) guard);
+ }
+
+ public DeconstructionPatternTree DeconstructionPattern(ExpressionTree deconstructor, List<? extends PatternTree> nested, VariableTree var) {
+ ListBuffer<JCPattern> pats = new ListBuffer<>();
+ for (PatternTree t : nested)
+ pats.append((JCPattern)t);
+ return make.at(NOPOS).RecordPattern((JCExpression) deconstructor, pats.toList(), (JCVariableDecl) var);
+ }
+
public CaseTree Case(ExpressionTree expression, List<? extends StatementTree> statements) {
return Case(expression != null ? Collections.singletonList(expression) : Collections.emptyList(), statements);
}
public CaseTree Case(List<? extends ExpressionTree> expressions, List<? extends StatementTree> statements) {
- return CaseMultiplePatterns(expressions.isEmpty() ? Collections.singletonList(DefaultCaseLabel()) : expressions, statements);
+ return CaseMultiplePatterns(expressions.isEmpty() ? Collections.singletonList(DefaultCaseLabel()) : expressions.stream().map(e -> ConstantCaseLabel(e)).collect(Collectors.toList()), statements);
}
public CaseTree Case(List<? extends ExpressionTree> expressions, Tree body) {
- return CaseMultiplePatterns(expressions.isEmpty() ? Collections.singletonList(DefaultCaseLabel()) : expressions, body);
+ return CaseMultiplePatterns(expressions.isEmpty() ? Collections.singletonList(DefaultCaseLabel()) : expressions.stream().map(e -> ConstantCaseLabel(e)).collect(Collectors.toList()), body);
}
public CaseTree CaseMultiplePatterns(List<? extends CaseLabelTree> expressions, Tree body) {
@@ -906,10 +922,6 @@
return make.at(NOPOS).BindingPattern((JCVariableDecl) vt);
}
- public GuardedPatternTree GuardedPattern(PatternTree pattern, ExpressionTree guard) {
- return make.at(NOPOS).GuardPattern((JCPattern) pattern, (JCExpression) guard);
- }
-
public ParenthesizedPatternTree ParenthesizedPattern(PatternTree pattern) {
return make.at(NOPOS).ParenthesizedPattern((JCPattern) pattern);
}
diff --git a/java/java.source.base/src/org/netbeans/modules/java/source/pretty/VeryPretty.java b/java/java.source.base/src/org/netbeans/modules/java/source/pretty/VeryPretty.java
index 8c8867f..5a76b60 100644
--- a/java/java.source.base/src/org/netbeans/modules/java/source/pretty/VeryPretty.java
+++ b/java/java.source.base/src/org/netbeans/modules/java/source/pretty/VeryPretty.java
@@ -2061,11 +2061,25 @@
}
@Override
- public void visitDefaultCaseLabel(JCDefaultCaseLabel that) {
+ public void visitDefaultCaseLabel(JCDefaultCaseLabel tree) {
print("default");
}
@Override
+ public void visitConstantCaseLabel(JCConstantCaseLabel tree) {
+ printExpr(tree.expr);
+ }
+
+ @Override
+ public void visitPatternCaseLabel(JCPatternCaseLabel tree) {
+ print(tree.pat);
+ if (tree.guard != null) {
+ print(" when ");
+ printExpr(tree.guard);
+ }
+ }
+
+ @Override
public void visitLetExpr(LetExpr tree) {
print("(let " + tree.defs + " in " + tree.expr + ")");
}
diff --git a/java/java.source.base/src/org/netbeans/modules/java/source/save/CasualDiff.java b/java/java.source.base/src/org/netbeans/modules/java/source/save/CasualDiff.java
index 3441ee9..3bc2d5d 100644
--- a/java/java.source.base/src/org/netbeans/modules/java/source/save/CasualDiff.java
+++ b/java/java.source.base/src/org/netbeans/modules/java/source/save/CasualDiff.java
@@ -76,6 +76,7 @@
import com.sun.tools.javac.tree.JCTree.JCClassDecl;
import com.sun.tools.javac.tree.JCTree.JCCompilationUnit;
import com.sun.tools.javac.tree.JCTree.JCConditional;
+import com.sun.tools.javac.tree.JCTree.JCConstantCaseLabel;
import com.sun.tools.javac.tree.JCTree.JCContinue;
import com.sun.tools.javac.tree.JCTree.JCDoWhileLoop;
import com.sun.tools.javac.tree.JCTree.JCEnhancedForLoop;
@@ -1965,23 +1966,14 @@
return diffTree((JCTree) oldT.var, (JCTree) newT.var, bounds);
}
+ protected int diffConstantCaseLabel(JCConstantCaseLabel oldT, JCConstantCaseLabel newT, int[] bounds) {
+ return diffTree((JCTree) oldT.expr, (JCTree) newT.expr, bounds);
+ }
+
protected int diffCase(JCCase oldT, JCCase newT, int[] bounds) {
int localPointer = bounds[0];
- List<? extends JCTree> oldPatterns;
- List<? extends JCTree> newPatterns;
-
- if(!(oldT.getLabels().size()==1 && oldT.getLabels().get(0).getKind().toString().equals("DEFAULT_CASE_LABEL"))){
- oldPatterns = oldT.getLabels();
- }else{
- oldPatterns = oldT.getExpressions();
- }
-
- if(!(newT.getLabels().size() == 1 && newT.getLabels().get(0).getKind().toString().equals("DEFAULT_CASE_LABEL"))){
- newPatterns = newT.getLabels();
- }else{
- newPatterns = newT.getExpressions();
- }
-
+ List<? extends JCTree.JCCaseLabel> oldPatterns = oldT.getLabels();
+ List<? extends JCTree.JCCaseLabel> newPatterns = newT.getLabels();
PositionEstimator patternEst = EstimatorFactory.casePatterns(
oldPatterns,
newPatterns,
@@ -1990,24 +1982,13 @@
int posHint;
int endpos;
int copyTo;
- if (oldPatterns.isEmpty()) {
- moveFwdToOneOfTokens(tokenSequence, bounds[0], EnumSet.of(JavaTokenId.DEFAULT));
- tokenSequence.moveNext();
+ if (JavaTokenId.DEFAULT == moveFwdToOneOfTokens(tokenSequence, bounds[0], EnumSet.of(JavaTokenId.CASE, JavaTokenId.DEFAULT))) {
copyTo = endpos = posHint = tokenSequence.offset();
-
- if (!newPatterns.isEmpty()) {
- copyTo = getOldPos(oldT);
- }
} else {
copyTo = posHint = oldPatterns.iterator().next().getStartPosition();
endpos = endPos(oldPatterns.get(oldPatterns.size() - 1));
-
- if (newPatterns.isEmpty()) {
- moveFwdToOneOfTokens(tokenSequence, bounds[0], EnumSet.of(JavaTokenId.CASE));
+ if (newPatterns.size() == 1 && newPatterns.get(0).getKind() == Kind.DEFAULT_CASE_LABEL) {
copyTo = tokenSequence.offset();
- copyTo(localPointer, copyTo);
- localPointer = copyTo = posHint = endpos;
- printer.print("default");
}
}
copyTo(localPointer, copyTo);
@@ -5439,8 +5420,10 @@
if (oldT == null && newT != null)
throw new IllegalArgumentException("Null is not allowed in parameters.");
- if (oldT == newT)
- return elementBounds[0];
+ if (oldT == newT) {
+ copyTo(elementBounds[0], elementBounds[1]);
+ return elementBounds[1];
+ }
if (newT == null) {
tokenSequence.move(elementBounds[1]);
@@ -5730,6 +5713,13 @@
case BINDINGPATTERN:
retVal = diffBindingPattern((JCBindingPattern) oldT, (JCBindingPattern) newT, elementBounds);
break;
+ case DEFAULTCASELABEL:
+ copyTo(elementBounds[0], elementBounds[1]);
+ retVal = elementBounds[1];
+ break;
+ case CONSTANTCASELABEL:
+ retVal = diffConstantCaseLabel((JCConstantCaseLabel) oldT, (JCConstantCaseLabel) newT, elementBounds);
+ break;
default:
// handle special cases like field groups and enum constants
if (oldT.getKind() == Kind.OTHER) {
diff --git a/java/java.source.base/src/org/netbeans/modules/java/source/save/Reformatter.java b/java/java.source.base/src/org/netbeans/modules/java/source/save/Reformatter.java
index 434d2cd..35b1f39 100644
--- a/java/java.source.base/src/org/netbeans/modules/java/source/save/Reformatter.java
+++ b/java/java.source.base/src/org/netbeans/modules/java/source/save/Reformatter.java
@@ -2801,20 +2801,46 @@
}
@Override
- public Boolean visitGuardedPattern(GuardedPatternTree node, Void p) {
+ public Boolean visitDefaultCaseLabel(DefaultCaseLabelTree node, Void p) {
+ accept(DEFAULT);
+ return true;
+ }
+
+ @Override
+ public Boolean visitConstantCaseLabel(ConstantCaseLabelTree node, Void p) {
+ scan(node.getConstantExpression(), p);
+ return true;
+ }
+
+ @Override
+ public Boolean visitPatternCaseLabel(PatternCaseLabelTree node, Void p) {
scan(node.getPattern(), p);
space();
- accept(AMPAMP);
+ accept(IDENTIFIER);
space();
- scan(node.getExpression(), p);
+ scan(node.getGuard(), p);
+ return true;
+ }
+ @Override
+ public Boolean visitDeconstructionPattern(DeconstructionPatternTree node, Void p) {
+ scan(node.getDeconstructor(), p);
+ accept(LPAREN);
+ scan(node.getNestedPatterns(), p);
+ accept(RPAREN);
+ if (node.getVariable() != null) {
+ space();
+ accept(IDENTIFIER);
+ }
return true;
}
@Override
public Boolean visitParenthesizedPattern(ParenthesizedPatternTree node, Void p) {
accept(LPAREN);
+ spaces(0);
scan(node.getPattern(), p);
+ spaces(0);
accept(RPAREN);
return true;
}
@@ -2933,36 +2959,24 @@
@Override
public Boolean visitCase(CaseTree node, Void p) {
- List<? extends Tree> labels = node.getLabels();
- if (labels != null && labels.size() > 0) {
+ List<? extends CaseLabelTree> labels = node.getLabels();
+ if (labels != null && !labels.isEmpty()) {
if (tokens.token().id() == JavaTokenId.DEFAULT && labels.get(0).getKind() == Kind.DEFAULT_CASE_LABEL) {
accept(DEFAULT);
} else {
accept(CASE);
space();
- for (Tree label : labels) {
- switch (label.getKind()) {
- case DEFAULT_CASE_LABEL:
- removeWhiteSpace(JavaTokenId.DEFAULT);
- accept(DEFAULT);
- break;
- case BINDING_PATTERN:
- case PARENTHESIZED_PATTERN:
- case GUARDED_PATTERN:
- removeWhiteSpace(JavaTokenId.IDENTIFIER);
- scan(label, p);
- break;
- case NULL_LITERAL:
- removeWhiteSpace(JavaTokenId.NULL);
- scan(label, p);
- break;
- default:
- scan(label, p);
- break;
+ for (Iterator<? extends CaseLabelTree> it = labels.iterator(); it.hasNext();) {
+ CaseLabelTree label = it.next();
+ scan(label, p);
+ if (it.hasNext()) {
+ spaces(0);
+ accept(COMMA);
+ space();
}
}
}
- } else if (node.getExpressions().size() > 0) {
+ } else if (!node.getExpressions().isEmpty()) {
List<? extends ExpressionTree> exprs = node.getExpressions();
accept(CASE);
space();
@@ -3016,15 +3030,14 @@
if (tokens.offset() >= endPos) {
break;
}
- if (tokens.token().id() == forToken) {
- break;
- }
if (tokens.token().id() == WHITESPACE) {
String text = tokens.token().text().toString();
String ind = getIndent();
if (!ind.equals(text)) {
addDiff(new Diff(tokens.offset(), tokens.offset() + tokens.token().length(), " "));
}
+ } else if (forToken == null || tokens.token().id() == forToken) {
+ break;
}
} while (tokens.moveNext());
}
diff --git a/java/java.source.base/src/org/netbeans/modules/java/source/save/Reindenter.java b/java/java.source.base/src/org/netbeans/modules/java/source/save/Reindenter.java
index e6be578..1632cf2 100644
--- a/java/java.source.base/src/org/netbeans/modules/java/source/save/Reindenter.java
+++ b/java/java.source.base/src/org/netbeans/modules/java/source/save/Reindenter.java
@@ -709,9 +709,9 @@
}
if (t != null) {
int i = getCurrentIndent(t, path);
- currentIndent = i < 0 ? getStmtIndent(startOffset, endOffset, EnumSet.of(tokenId), getEndPosition(((CaseTree) last).getExpression()), currentIndent) : i;
+ currentIndent = i < 0 ? getStmtIndent(startOffset, endOffset, EnumSet.of(tokenId), getEndPosition(((CaseTree) last).getExpression()), currentIndent) : i; // TODO
} else {
- currentIndent = getStmtIndent(startOffset, endOffset, EnumSet.of(tokenId), getEndPosition(((CaseTree) last).getExpression()), currentIndent);
+ currentIndent = getStmtIndent(startOffset, endOffset, EnumSet.of(tokenId), getEndPosition(((CaseTree) last).getExpression()), currentIndent); // TODO
}
break;
@@ -881,10 +881,10 @@
}
if (t != null) {
int i = getCurrentIndent(t, path);
- currentIndent = i < 0 ? getStmtIndent(startOffset, endOffset, EnumSet.of(JavaTokenId.COLON), getEndPosition(ct.getExpression()), currentIndent) : i;
+ currentIndent = i < 0 ? getStmtIndent(startOffset, endOffset, EnumSet.of(JavaTokenId.COLON), getEndPosition(ct.getExpression()), currentIndent) : i; // TODO
} else {
int i = getCurrentIndent(ct, path);
- currentIndent = i < 0 ? getStmtIndent(startOffset, endOffset, EnumSet.of(JavaTokenId.COLON), getEndPosition(ct.getExpression()), currentIndent) : i;
+ currentIndent = i < 0 ? getStmtIndent(startOffset, endOffset, EnumSet.of(JavaTokenId.COLON), getEndPosition(ct.getExpression()), currentIndent) : i; // TODO
currentIndent += cs.getIndentSize();
}
} else {
diff --git a/java/java.source.base/src/org/netbeans/modules/java/source/transform/ImmutableTreeTranslator.java b/java/java.source.base/src/org/netbeans/modules/java/source/transform/ImmutableTreeTranslator.java
index 7844e18..63c21fa 100644
--- a/java/java.source.base/src/org/netbeans/modules/java/source/transform/ImmutableTreeTranslator.java
+++ b/java/java.source.base/src/org/netbeans/modules/java/source/transform/ImmutableTreeTranslator.java
@@ -318,16 +318,20 @@
* Visitor methods
****************************************************************************/
+ @Override
public Tree visitCompilationUnit(CompilationUnitTree tree, Object p) {
CompilationUnitTree result = rewriteChildren(tree);
return result;
}
+ @Override
public Tree visitPackage(PackageTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitImport(ImportTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitClass(ClassTree tree, Object p) {
Element oldSym = currentSym;
importAnalysis.classEntered(tree);
@@ -337,6 +341,7 @@
currentSym = oldSym;
return result;
}
+ @Override
public Tree visitMethod(MethodTree tree, Object p) {
Element oldSym = currentSym;
currentSym = model.getElement(tree);
@@ -345,6 +350,7 @@
return result;
}
+ @Override
public Tree visitVariable(VariableTree tree, Object p) {
Element oldSym = currentSym;
currentSym = model.getElement(tree);
@@ -353,105 +359,139 @@
return result;
}
+ @Override
public Tree visitEmptyStatement(EmptyStatementTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitBlock(BlockTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitUnionType(UnionTypeTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitDoWhileLoop(DoWhileLoopTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitWhileLoop(WhileLoopTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitForLoop(ForLoopTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitEnhancedForLoop(EnhancedForLoopTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitLabeledStatement(LabeledStatementTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitLambdaExpression(LambdaExpressionTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitSwitch(SwitchTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitCase(CaseTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitSynchronized(SynchronizedTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitTry(TryTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitCatch(CatchTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitConditionalExpression(ConditionalExpressionTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitIf(IfTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitExpressionStatement(ExpressionStatementTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitBreak(BreakTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitContinue(ContinueTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitReturn(ReturnTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitThrow(ThrowTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitAssert(AssertTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitMethodInvocation(MethodInvocationTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitNewClass(NewClassTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitNewArray(NewArrayTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitParenthesized(ParenthesizedTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitAssignment(AssignmentTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitCompoundAssignment(CompoundAssignmentTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitUnary(UnaryTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitBinary(BinaryTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitTypeCast(TypeCastTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitInstanceOf(InstanceOfTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitIntersectionType(IntersectionTypeTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitArrayAccess(ArrayAccessTree tree, Object p) {
return rewriteChildren(tree);
}
@@ -459,6 +499,7 @@
public Tree visitMemberReference(MemberReferenceTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitMemberSelect(MemberSelectTree tree, Object p) {
if (tree instanceof QualIdentTree) {
QualIdentTree qit = (QualIdentTree) tree;
@@ -477,75 +518,107 @@
return rewriteChildren(tree);
}
}
+ @Override
public Tree visitIdentifier(IdentifierTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitLiteral(LiteralTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitPrimitiveType(PrimitiveTypeTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitArrayType(ArrayTypeTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitParameterizedType(ParameterizedTypeTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitTypeParameter(TypeParameterTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitWildcard(WildcardTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitAnnotatedType(AnnotatedTypeTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitAnnotation(AnnotationTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitModifiers(ModifiersTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitErroneous(ErroneousTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitModule(ModuleTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitExports(ExportsTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitOpens(OpensTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitProvides(ProvidesTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitRequires(RequiresTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitUses(UsesTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitBindingPattern(BindingPatternTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitDefaultCaseLabel(DefaultCaseLabelTree tree, Object p) {
return rewriteChildren(tree);
}
- public Tree visitGuardedPattern(GuardedPatternTree tree, Object p) {
+ @Override
+ public Tree visitConstantCaseLabel(ConstantCaseLabelTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
+ public Tree visitPatternCaseLabel(PatternCaseLabelTree tree, Object p) {
+ return rewriteChildren(tree);
+ }
+ @Override
+ public Tree visitDeconstructionPattern(DeconstructionPatternTree tree, Object p) {
+ return rewriteChildren(tree);
+ }
+ @Override
public Tree visitParenthesizedPattern(ParenthesizedPatternTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitSwitchExpression(SwitchExpressionTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitYield(YieldTree tree, Object p) {
return rewriteChildren(tree);
}
+ @Override
public Tree visitOther(Tree tree, Object p) {
throw new Error("Tree not overloaded: "+tree);
}
@@ -1429,15 +1502,40 @@
return tree;
}
- private GuardedPatternTree rewriteChildren(GuardedPatternTree tree) {
- PatternTree newPattern = (PatternTree) translate(tree.getPattern());
- ExpressionTree newGuard = (ExpressionTree) translate(tree.getExpression());
- if (newPattern != tree.getPattern() ||
- newGuard != tree.getExpression()) {
- GuardedPatternTree n = make.GuardedPattern(newPattern, newGuard);
+ private ConstantCaseLabelTree rewriteChildren(ConstantCaseLabelTree tree) {
+ ExpressionTree newExpression = (ExpressionTree) translate(tree.getConstantExpression());
+ if (newExpression != tree.getConstantExpression()) {
+ ConstantCaseLabelTree n = make.ConstantCaseLabel(newExpression);
model.setType(n, model.getType(tree));
- copyCommentTo(tree,n);
- copyPosTo(tree,n);
+ copyCommentTo(tree, n);
+ copyPosTo(tree, n);
+ tree = n;
+ }
+ return tree;
+ }
+
+ private PatternCaseLabelTree rewriteChildren(PatternCaseLabelTree tree) {
+ ExpressionTree newGuard = (ExpressionTree) translate(tree.getGuard());
+ PatternTree newPattern = (PatternTree) translate(tree.getPattern());
+ if (newGuard != tree.getGuard() || newPattern != tree.getPattern()) {
+ PatternCaseLabelTree n = make.PatternCaseLabel(newPattern, newGuard);
+ model.setType(n, model.getType(tree));
+ copyCommentTo(tree, n);
+ copyPosTo(tree, n);
+ tree = n;
+ }
+ return tree;
+ }
+
+ private DeconstructionPatternTree rewriteChildren(DeconstructionPatternTree tree) {
+ ExpressionTree newDeconstructor = (ExpressionTree) translate(tree.getDeconstructor());
+ List<? extends PatternTree> newNestedPatterns = translate(tree.getNestedPatterns());
+ VariableTree newVariable = (VariableTree) translate(tree.getVariable());
+ if (newDeconstructor != tree.getDeconstructor() || newVariable != tree.getVariable() || !Objects.equals(newNestedPatterns, tree.getNestedPatterns())) {
+ DeconstructionPatternTree n = make.DeconstructionPattern(newDeconstructor, newNestedPatterns, newVariable);
+ model.setType(n, model.getType(tree));
+ copyCommentTo(tree, n);
+ copyPosTo(tree, n);
tree = n;
}
return tree;
diff --git a/java/java.source.base/src/org/netbeans/modules/java/source/transform/TreeDuplicator.java b/java/java.source.base/src/org/netbeans/modules/java/source/transform/TreeDuplicator.java
index 39c5743..35646e2 100644
--- a/java/java.source.base/src/org/netbeans/modules/java/source/transform/TreeDuplicator.java
+++ b/java/java.source.base/src/org/netbeans/modules/java/source/transform/TreeDuplicator.java
@@ -34,7 +34,9 @@
import com.sun.source.tree.CompilationUnitTree;
import com.sun.source.tree.CompoundAssignmentTree;
import com.sun.source.tree.ConditionalExpressionTree;
+import com.sun.source.tree.ConstantCaseLabelTree;
import com.sun.source.tree.ContinueTree;
+import com.sun.source.tree.DeconstructionPatternTree;
import com.sun.source.tree.DefaultCaseLabelTree;
import com.sun.source.tree.DoWhileLoopTree;
import com.sun.source.tree.EmptyStatementTree;
@@ -44,7 +46,6 @@
import com.sun.source.tree.ExpressionStatementTree;
import com.sun.source.tree.ExpressionTree;
import com.sun.source.tree.ForLoopTree;
-import com.sun.source.tree.GuardedPatternTree;
import com.sun.source.tree.IdentifierTree;
import com.sun.source.tree.IfTree;
import com.sun.source.tree.ImportTree;
@@ -66,6 +67,7 @@
import com.sun.source.tree.ParameterizedTypeTree;
import com.sun.source.tree.ParenthesizedPatternTree;
import com.sun.source.tree.ParenthesizedTree;
+import com.sun.source.tree.PatternCaseLabelTree;
import com.sun.source.tree.PrimitiveTypeTree;
import com.sun.source.tree.ProvidesTree;
import com.sun.source.tree.RequiresTree;
@@ -192,7 +194,9 @@
@Override
public Tree visitCase(CaseTree tree, Void p) {
- CaseTree n = make.Case(tree.getExpression(), tree.getStatements());
+ CaseTree n = tree.getCaseKind() == CaseTree.CaseKind.STATEMENT
+ ? make.Case(tree.getExpressions(), tree.getStatements())
+ : make.Case(tree.getExpressions(), tree.getBody());
model.setType(n, model.getType(tree));
comments.copyComments(tree, n);
model.setPos(n, model.getPos(tree));
@@ -678,8 +682,26 @@
}
@Override
- public Tree visitGuardedPattern(GuardedPatternTree tree, Void p) {
- GuardedPatternTree n = make.GuardedPattern(tree.getPattern(), tree.getExpression());
+ public Tree visitConstantCaseLabel(ConstantCaseLabelTree tree, Void p) {
+ ConstantCaseLabelTree n = make.ConstantCaseLabel(tree.getConstantExpression());
+ model.setType(n, model.getType(tree));
+ comments.copyComments(tree, n);
+ model.setPos(n, model.getPos(tree));
+ return n;
+ }
+
+ @Override
+ public Tree visitPatternCaseLabel(PatternCaseLabelTree tree, Void p) {
+ PatternCaseLabelTree n = make.PatternCaseLabel(tree.getPattern(), tree.getGuard());
+ model.setType(n, model.getType(tree));
+ comments.copyComments(tree, n);
+ model.setPos(n, model.getPos(tree));
+ return n;
+ }
+
+ @Override
+ public Tree visitDeconstructionPattern(DeconstructionPatternTree tree, Void p) {
+ DeconstructionPatternTree n = make.DeconstructionPattern(tree.getDeconstructor(), tree.getNestedPatterns(), tree.getVariable());
model.setType(n, model.getType(tree));
comments.copyComments(tree, n);
model.setPos(n, model.getPos(tree));
diff --git a/java/java.source.base/test/unit/src/org/netbeans/api/java/source/SourceUtilsTestUtil.java b/java/java.source.base/test/unit/src/org/netbeans/api/java/source/SourceUtilsTestUtil.java
index a77c3bd..430ba45 100644
--- a/java/java.source.base/test/unit/src/org/netbeans/api/java/source/SourceUtilsTestUtil.java
+++ b/java/java.source.base/test/unit/src/org/netbeans/api/java/source/SourceUtilsTestUtil.java
@@ -31,7 +31,7 @@
import java.util.stream.Collectors;
import javax.swing.event.ChangeListener;
import javax.swing.text.Document;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.netbeans.api.editor.mimelookup.MimePath;
import org.netbeans.api.java.classpath.ClassPath;
import org.netbeans.api.java.classpath.JavaClassPathConstants;
diff --git a/java/java.source.base/test/unit/src/org/netbeans/api/java/source/TranslateIdentifierTest.java b/java/java.source.base/test/unit/src/org/netbeans/api/java/source/TranslateIdentifierTest.java
index 7c569d2..04f5bb9 100644
--- a/java/java.source.base/test/unit/src/org/netbeans/api/java/source/TranslateIdentifierTest.java
+++ b/java/java.source.base/test/unit/src/org/netbeans/api/java/source/TranslateIdentifierTest.java
@@ -19,17 +19,7 @@
package org.netbeans.api.java.source;
import com.sun.source.tree.CompilationUnitTree;
-import com.sun.source.tree.IdentifierTree;
-import com.sun.source.tree.MemberSelectTree;
-import com.sun.source.tree.MethodTree;
import java.io.File;
-import static junit.framework.Assert.assertNotNull;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import static org.junit.Assert.*;
import org.netbeans.api.java.source.JavaSource.Phase;
import org.netbeans.junit.NbTestCase;
import org.openide.filesystems.FileObject;
diff --git a/java/java.source.base/test/unit/src/org/netbeans/api/java/source/gen/SwitchRuleFormattingTest.java b/java/java.source.base/test/unit/src/org/netbeans/api/java/source/gen/SwitchRuleFormattingTest.java
index 0ef62ee..16d92c0 100644
--- a/java/java.source.base/test/unit/src/org/netbeans/api/java/source/gen/SwitchRuleFormattingTest.java
+++ b/java/java.source.base/test/unit/src/org/netbeans/api/java/source/gen/SwitchRuleFormattingTest.java
@@ -205,46 +205,42 @@
SwitchTree switchBlock = (SwitchTree) ((BlockTree) method.getBody()).getStatements().get(0);
List<? extends CaseTree> cases;
List<ExpressionTree> patterns = new ArrayList<>();
- if(switchBlock!=null){
+ if(switchBlock != null){
boolean switchExpressionFlag = switchBlock.getKind() == Kind.SWITCH_EXPRESSION;
- if (switchExpressionFlag) {
- cases = ((SwitchExpressionTree) switchBlock).getCases();
- } else {
- cases = ((SwitchTree) switchBlock).getCases();
- }
- for (Iterator<? extends CaseTree> it = cases.iterator(); it.hasNext();) {
- CaseTree ct = it.next();
- patterns.addAll(ct.getExpressions());
- List<StatementTree> statements;
- if (ct.getStatements() == null) {
- statements = new ArrayList<>(((JCTree.JCCase) ct).stats);
+ if (switchExpressionFlag) {
+ cases = ((SwitchExpressionTree) switchBlock).getCases();
} else {
- statements = new ArrayList<>(ct.getStatements());
- if(!statements.isEmpty() && statements.get(statements.size()-1) instanceof JCTree.JCBreak){
- statements.remove(statements.size()-1);
- }
+ cases = ((SwitchTree) switchBlock).getCases();
}
- if (statements.isEmpty()) {
- if (it.hasNext()) {
- continue;
- }
- }
- Set<Element> seenVariables = new HashSet<>();
- int idx = 0;
- for (StatementTree statement : new ArrayList<>(statements)) {
- Tree body = make.Block(statements, false);
- if (statements.size() == 1) {
- if (statements.get(0).getKind() == Tree.Kind.EXPRESSION_STATEMENT
- || statements.get(0).getKind() == Tree.Kind.THROW
- || statements.get(0).getKind() == Tree.Kind.BLOCK) {
- body = statements.get(0);
+ for (Iterator<? extends CaseTree> it = cases.iterator(); it.hasNext();) {
+ CaseTree ct = it.next();
+ patterns.addAll(ct.getExpressions());
+ List<StatementTree> statements;
+ if (ct.getStatements() == null) {
+ statements = new ArrayList<>(((JCTree.JCCase) ct).stats);
+ } else {
+ statements = new ArrayList<>(ct.getStatements());
+ if(!statements.isEmpty() && statements.get(statements.size()-1) instanceof JCTree.JCBreak){
+ statements.remove(statements.size()-1);
}
}
- newCases.add(make.Case(patterns, body));
- patterns = new ArrayList<>();
+ if (statements.isEmpty()) {
+ if (it.hasNext()) {
+ continue;
+ }
+ } else {
+ Tree body = make.Block(statements, false);
+ if (statements.size() == 1) {
+ if (statements.get(0).getKind() == Tree.Kind.EXPRESSION_STATEMENT
+ || statements.get(0).getKind() == Tree.Kind.THROW
+ || statements.get(0).getKind() == Tree.Kind.BLOCK) {
+ body = statements.get(0);
+ }
+ }
+ newCases.add(make.Case(patterns, body));
+ patterns = new ArrayList<>();
+ }
}
- }
-
workingCopy.rewrite((SwitchTree) switchBlock , make.Switch(((SwitchTree) switchBlock).getExpression(), newCases));
}
}
diff --git a/java/java.source.base/test/unit/src/org/netbeans/api/java/source/gen/SwitchTest.java b/java/java.source.base/test/unit/src/org/netbeans/api/java/source/gen/SwitchTest.java
index ae896dbd..252714d 100644
--- a/java/java.source.base/test/unit/src/org/netbeans/api/java/source/gen/SwitchTest.java
+++ b/java/java.source.base/test/unit/src/org/netbeans/api/java/source/gen/SwitchTest.java
@@ -289,7 +289,7 @@
labels.remove(0);
return copy.getTreeMaker().CaseMultipleLabels(labels, tree.getStatements());
},
- "case " + /*XXX: too many spaces:*/ " " + "0, 1:"),
+ "case 0, 1:"),
new TestCase("case -1, 0, 1:",
(copy, tree) -> {
List<ExpressionTree> labels = new ArrayList<>(tree.getExpressions());
diff --git a/java/java.source.base/test/unit/src/org/netbeans/api/java/source/gen/WrappingTest.java b/java/java.source.base/test/unit/src/org/netbeans/api/java/source/gen/WrappingTest.java
index 4e13560..a4d0a47 100644
--- a/java/java.source.base/test/unit/src/org/netbeans/api/java/source/gen/WrappingTest.java
+++ b/java/java.source.base/test/unit/src/org/netbeans/api/java/source/gen/WrappingTest.java
@@ -36,7 +36,6 @@
import java.util.Map.Entry;
import java.util.prefs.Preferences;
import javax.lang.model.element.Modifier;
-import static junit.framework.Assert.assertEquals;
import org.netbeans.api.editor.mimelookup.MimeLookup;
import org.netbeans.api.java.lexer.JavaTokenId;
import org.netbeans.api.java.source.CodeStyle;
diff --git a/java/java.source.base/test/unit/src/org/netbeans/modules/java/source/parsing/ClassParserTest.java b/java/java.source.base/test/unit/src/org/netbeans/modules/java/source/parsing/ClassParserTest.java
index 292b53e..bed8787 100644
--- a/java/java.source.base/test/unit/src/org/netbeans/modules/java/source/parsing/ClassParserTest.java
+++ b/java/java.source.base/test/unit/src/org/netbeans/modules/java/source/parsing/ClassParserTest.java
@@ -22,7 +22,6 @@
import java.io.IOException;
import java.net.URI;
import javax.lang.model.element.TypeElement;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.api.editor.mimelookup.MimePath;
import org.netbeans.api.editor.mimelookup.test.MockMimeLookup;
import org.netbeans.api.java.classpath.ClassPath;
diff --git a/java/java.source.base/test/unit/src/org/netbeans/modules/java/source/save/FormatingTest.java b/java/java.source.base/test/unit/src/org/netbeans/modules/java/source/save/FormatingTest.java
index d2ebd92..a55ea97 100644
--- a/java/java.source.base/test/unit/src/org/netbeans/modules/java/source/save/FormatingTest.java
+++ b/java/java.source.base/test/unit/src/org/netbeans/modules/java/source/save/FormatingTest.java
@@ -2853,7 +2853,7 @@
+ " Object str = \"pattern matching switch\";\n"
+ " switch (str) {\n"
+ "case \n"
- + " String s && s.length() == 1\n"
+ + " String s when s.length() == 1\n"
+ " \n"
+ " ->\n"
+ " System.out.println(\"case with guarded pattern formatting\");\n"
@@ -2871,7 +2871,7 @@
+ " void testSwitchCaseGuardedPattern() {\n"
+ " Object str = \"pattern matching switch\";\n"
+ " switch (str) {\n"
- + " case String s && s.length() == 1 ->\n"
+ + " case String s when s.length() == 1 ->\n"
+ " System.out.println(\"case with guarded pattern formatting\");\n"
+ " default ->\n"
+ " System.out.println(\"default formatting\");\n"
@@ -2903,7 +2903,7 @@
+ " switch (str) {\n"
+ "case \n"
+ " null,\n"
- + " String s && s.length() == 1\n"
+ + " String s when s.length() == 1\n"
+ " \n"
+ " ->\n"
+ " System.out.println(\"case with null and guarded pattern formatting\");\n"
@@ -2921,7 +2921,7 @@
+ " void testSwitchCaseNullAndGuardedPattern() {\n"
+ " Object str = \"pattern matching switch\";\n"
+ " switch (str) {\n"
- + " case null, String s && s.length() == 1 ->\n"
+ + " case null, String s when s.length() == 1 ->\n"
+ " System.out.println(\"case with null and guarded pattern formatting\");\n"
+ " default ->\n"
+ " System.out.println(\"default formatting\");\n"
@@ -3052,9 +3052,8 @@
+ " switch (str) {\n"
+ "case \n"
+ " (String \n"
- + " s &&\n"
+ + " s) when\n"
+ " s.length() == 1\n"
- + " )\n"
+ " \n"
+ " ->\n"
+ " System.out.println(\"case with Parenthesized Guarded Pattern formatting\");default ->\n"
@@ -3071,7 +3070,7 @@
+ " void testSwitchCaseParenthesizedGuardedPattern() {\n"
+ " Object str = \"pattern matching switch\";\n"
+ " switch (str) {\n"
- + " case (String s && s.length() == 1) ->\n"
+ + " case (String s) when s.length() == 1 ->\n"
+ " System.out.println(\"case with Parenthesized Guarded Pattern formatting\");\n"
+ " default ->\n"
+ " System.out.println(\"default formatting\");\n"
@@ -3103,9 +3102,9 @@
+ " switch (str) {\n"
+ "case \n"
+ " (String \n"
- + " s &&\n"
+ + " s) when\n"
+ " s.length() == 1\n"
- + " ) , \n"
+ + " , \n"
+ " null\n"
+ " \n"
+ " ->\n"
@@ -3123,7 +3122,7 @@
+ " void testSwitchCaseParenthesizedGuardedPatternAndNull() {\n"
+ " Object str = \"pattern matching switch\";\n"
+ " switch (str) {\n"
- + " case (String s && s.length() == 1) , null ->\n"
+ + " case (String s) when s.length() == 1, null ->\n"
+ " System.out.println(\"case with Parenthesized Binding Pattern formatting\");\n"
+ " default ->\n"
+ " System.out.println(\"default formatting\");\n"
@@ -3134,58 +3133,6 @@
reformat(doc, content, golden);
}
- public void testSwitchCaseGuardedPatternNestedParenthesizedPatternWithNull() throws Exception {
- try {
- SourceVersion.valueOf("RELEASE_17"); //NOI18N
- } catch (IllegalArgumentException ex) {
- //OK, no RELEASE_17, skip test
- return;
- }
- testFile = new File(getWorkDir(), "Test.java");
- TestUtilities.copyStringToFile(testFile, "");
- FileObject testSourceFO = FileUtil.toFileObject(testFile);
- DataObject testSourceDO = DataObject.find(testSourceFO);
- EditorCookie ec = (EditorCookie) testSourceDO.getCookie(EditorCookie.class);
- final Document doc = ec.openDocument();
- doc.putProperty(Language.class, JavaTokenId.language());
- String content = "package p;"
- + "public class Test{ \n"
- + "void testSwitchCaseGuardedPatternNestedParenthesizedPattern() {\n"
- + " Object str = \"pattern matching switch\";\n"
- + " switch (str) {\n"
- + "case \n"
- + " (String \n"
- + " s ) &&\n"
- + " s.length() == 1\n"
- + " , \n"
- + " null\n"
- + " \n"
- + " ->\n"
- + " System.out.println(\"SwitchCaseGuardedPatternNestedParenthesizedPattern\");default ->\n"
- + " System.out.println(\"default formatting\");\n"
- + " }\n"
- + " }"
- + "}";
-
- String golden
- = "package p;\n"
- + "\n"
- + "public class Test {\n"
- + "\n"
- + " void testSwitchCaseGuardedPatternNestedParenthesizedPattern() {\n"
- + " Object str = \"pattern matching switch\";\n"
- + " switch (str) {\n"
- + " case (String s) && s.length() == 1 , null ->\n"
- + " System.out.println(\"SwitchCaseGuardedPatternNestedParenthesizedPattern\");\n"
- + " default ->\n"
- + " System.out.println(\"default formatting\");\n"
- + " }\n"
- + " }\n"
- + "}\n"
- + "";
- reformat(doc, content, golden);
- }
-
public void testSwitchCaseGuardedPatternNestedParenthesizedPattern() throws Exception {
try {
SourceVersion.valueOf("RELEASE_17"); //NOI18N
@@ -3206,7 +3153,7 @@
+ " Object str = \"pattern matching switch\";\n"
+ " switch (str) {\n"
+ "case ( \n"
- + " String s) && s.length() >= 2 && \n"
+ + " String s) when s.length() >= 2 && \n"
+ " \n"
+ " (s.contains(\"@\") || s.contains(\"!\")) \n"
+ " \n"
@@ -3225,7 +3172,7 @@
+ " void testSwitchCaseGuardedPatternNestedParenthesizedPattern() {\n"
+ " Object str = \"pattern matching switch\";\n"
+ " switch (str) {\n"
- + " case ( String s) && s.length() >= 2\n"
+ + " case (String s) when s.length() >= 2\n"
+ " && (s.contains(\"@\") || s.contains(\"!\")) ->\n"
+ " String.format(\"Valid string value is %s\", s);\n"
+ " default ->\n"
@@ -3260,11 +3207,11 @@
+ "case null ->\n"
+ " System.out.println(\"case with null formatting\");\n"
+ " case String string\n"
- + " && (string.length()== iso.filter(i -> i / 2 == 0).count() || string.length() == 0)\n"
+ + " when (string.length()== iso.filter(i -> i / 2 == 0).count() || string.length() == 0)\n"
+ " ->\n"
+ " System.out.println(\"case with pattern matching + condition + lambda expression formatting\");\n"
- + " case String s && s.length() == 1 ->System.out.println(\"case with pattern matching + condition formatting\");\n"
- + " case (String s && true )-> \n"
+ + " case String s when s.length() == 1 ->System.out.println(\"case with pattern matching + condition formatting\");\n"
+ + " case (String s )-> \n"
+ " System.out.println(\"case with pattern matching + condition formatting\");\n"
+ " case CharSequence\n"
+ " s ->\n"
@@ -3288,11 +3235,11 @@
+ " switch (str) {\n"
+ " case null ->\n"
+ " System.out.println(\"case with null formatting\");\n"
- + " case String string && (string.length() == iso.filter(i -> i / 2 == 0).count() || string.length() == 0) ->\n"
+ + " case String string when (string.length() == iso.filter(i -> i / 2 == 0).count() || string.length() == 0) ->\n"
+ " System.out.println(\"case with pattern matching + condition + lambda expression formatting\");\n"
- + " case String s && s.length() == 1 ->\n"
+ + " case String s when s.length() == 1 ->\n"
+ " System.out.println(\"case with pattern matching + condition formatting\");\n"
- + " case (String s && true) ->\n"
+ + " case (String s) ->\n"
+ " System.out.println(\"case with pattern matching + condition formatting\");\n"
+ " case CharSequence s ->\n"
+ " System.out.println(\"case with pattern matching formatting\");\n"
@@ -3329,11 +3276,11 @@
+ "case null ->\n"
+ " \"case with null formatting\";\n"
+ " case String string\n"
- + " && (string.length()== iso.filter(i -> i / 2 == 0).count() || string.length() == 0)\n"
+ + " when (string.length()== iso.filter(i -> i / 2 == 0).count() || string.length() == 0)\n"
+ " ->\n"
+ " \"case with pattern matching + condition + lambda expression formatting\";\n"
- + " case String s && s.length() == 1 ->\"case with pattern matching + condition formatting\";\n"
- + " case (String s && true )-> \n"
+ + " case String s when s.length() == 1 ->\"case with pattern matching + condition formatting\";\n"
+ + " case (String s )-> \n"
+ " \"case with pattern matching + condition formatting\";\n"
+ " case CharSequence\n"
+ " s ->\n"
@@ -3357,11 +3304,11 @@
+ " String retVal = switch (str) {\n"
+ " case null ->\n"
+ " \"case with null formatting\";\n"
- + " case String string && (string.length() == iso.filter(i -> i / 2 == 0).count() || string.length() == 0) ->\n"
+ + " case String string when (string.length() == iso.filter(i -> i / 2 == 0).count() || string.length() == 0) ->\n"
+ " \"case with pattern matching + condition + lambda expression formatting\";\n"
- + " case String s && s.length() == 1 ->\n"
+ + " case String s when s.length() == 1 ->\n"
+ " \"case with pattern matching + condition formatting\";\n"
- + " case (String s && true) ->\n"
+ + " case (String s) ->\n"
+ " \"case with pattern matching + condition formatting\";\n"
+ " case CharSequence s ->\n"
+ " \"case with pattern matching formatting\";\n"
diff --git a/java/java.source/nbproject/org-netbeans-modules-java-source.sig b/java/java.source/nbproject/org-netbeans-modules-java-source.sig
index 05ec978..95f3426 100644
--- a/java/java.source/nbproject/org-netbeans-modules-java-source.sig
+++ b/java/java.source/nbproject/org-netbeans-modules-java-source.sig
@@ -27,7 +27,6 @@
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitExports(com.sun.source.tree.ExportsTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitExpressionStatement(com.sun.source.tree.ExpressionStatementTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitForLoop(com.sun.source.tree.ForLoopTree,{com.sun.source.tree.TreeVisitor%1})
-meth public abstract {com.sun.source.tree.TreeVisitor%0} visitGuardedPattern(com.sun.source.tree.GuardedPatternTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitIdentifier(com.sun.source.tree.IdentifierTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitIf(com.sun.source.tree.IfTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitImport(com.sun.source.tree.ImportTree,{com.sun.source.tree.TreeVisitor%1})
@@ -108,7 +107,6 @@
meth public {com.sun.source.util.TreeScanner%0} visitExports(com.sun.source.tree.ExportsTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitExpressionStatement(com.sun.source.tree.ExpressionStatementTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitForLoop(com.sun.source.tree.ForLoopTree,{com.sun.source.util.TreeScanner%1})
-meth public {com.sun.source.util.TreeScanner%0} visitGuardedPattern(com.sun.source.tree.GuardedPatternTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitIdentifier(com.sun.source.tree.IdentifierTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitIf(com.sun.source.tree.IfTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitImport(com.sun.source.tree.ImportTree,{com.sun.source.util.TreeScanner%1})
diff --git a/java/java.source/nbproject/project.properties b/java/java.source/nbproject/project.properties
index 627e2cd..b9bdb14 100644
--- a/java/java.source/nbproject/project.properties
+++ b/java/java.source/nbproject/project.properties
@@ -22,7 +22,7 @@
javadoc.title=Java Source
javadoc.arch=${basedir}/arch.xml
javadoc.apichanges=${basedir}/apichanges.xml
-spec.version.base=0.182.0
+spec.version.base=0.183.0
test.qa-functional.cp.extra=${refactoring.java.dir}/modules/ext/nb-javac-api.jar
test.unit.run.cp.extra=${o.n.core.dir}/core/core.jar:\
${o.n.core.dir}/lib/boot.jar:\
diff --git a/java/libs.javacapi/external/binaries-list b/java/libs.javacapi/external/binaries-list
index cb152e0..b42feac 100644
--- a/java/libs.javacapi/external/binaries-list
+++ b/java/libs.javacapi/external/binaries-list
@@ -14,5 +14,5 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-ECA15E615777CE6E7550F71EF312B8CEEBCBE0BD com.dukescript.nbjavac:nb-javac:jdk-18.0.1+10:api
-3AD512FBC8830D89AC70D0CA59397C4868789DCC com.dukescript.nbjavac:nb-javac:jdk-18.0.1+10
+DBA592C75DD52B97EC88A6B06ADF71D4F3C3DED9 com.dukescript.nbjavac:nb-javac:jdk-19+33:api
+A36688EDA1DE51508A039AED3518771C6F75E416 com.dukescript.nbjavac:nb-javac:jdk-19+33
diff --git a/java/libs.javacapi/external/nb-javac-jdk-18.0.1+10-license.txt b/java/libs.javacapi/external/nb-javac-jdk-19+33-license.txt
similarity index 98%
rename from java/libs.javacapi/external/nb-javac-jdk-18.0.1+10-license.txt
rename to java/libs.javacapi/external/nb-javac-jdk-19+33-license.txt
index 2329bc0..8123b5f 100644
--- a/java/libs.javacapi/external/nb-javac-jdk-18.0.1+10-license.txt
+++ b/java/libs.javacapi/external/nb-javac-jdk-19+33-license.txt
@@ -1,10 +1,10 @@
Name: Javac Compiler Implementation
Description: Javac Compiler Implementation
-Version: 18.0.1+10
-Files: nb-javac-jdk-18.0.1+10-api.jar nb-javac-jdk-18.0.1+10.jar
+Version: jdk-19+33
+Files: nb-javac-jdk-19+33-api.jar nb-javac-jdk-19+33.jar
License: GPL-2-CP
-Origin: OpenJDK (https://github.com/openjdk/jdk18)
-Source: https://github.com/openjdk/jdk18
+Origin: OpenJDK (https://github.com/openjdk/jdk19)
+Source: https://github.com/openjdk/jdk19
Type: optional,reviewed
Comment: The binary has been reviewed to be under the Classpath Exception as a whole. Optional at runtime, but used by default.
diff --git a/java/libs.javacapi/nbproject/org-netbeans-libs-javacapi.sig b/java/libs.javacapi/nbproject/org-netbeans-libs-javacapi.sig
index e3a6abe..8082273 100644
--- a/java/libs.javacapi/nbproject/org-netbeans-libs-javacapi.sig
+++ b/java/libs.javacapi/nbproject/org-netbeans-libs-javacapi.sig
@@ -1,5 +1,5 @@
#Signature file v4.1
-#Version 8.39.0
+#Version 8.41.0
CLSS public abstract interface com.sun.source.doctree.AttributeTree
innr public final static !enum ValueKind
@@ -380,10 +380,20 @@
meth public abstract com.sun.source.tree.ExpressionTree getFalseExpression()
meth public abstract com.sun.source.tree.ExpressionTree getTrueExpression()
+CLSS public abstract interface com.sun.source.tree.ConstantCaseLabelTree
+intf com.sun.source.tree.CaseLabelTree
+meth public abstract com.sun.source.tree.ExpressionTree getConstantExpression()
+
CLSS public abstract interface com.sun.source.tree.ContinueTree
intf com.sun.source.tree.StatementTree
meth public abstract javax.lang.model.element.Name getLabel()
+CLSS public abstract interface com.sun.source.tree.DeconstructionPatternTree
+intf com.sun.source.tree.PatternTree
+meth public abstract com.sun.source.tree.ExpressionTree getDeconstructor()
+meth public abstract com.sun.source.tree.VariableTree getVariable()
+meth public abstract java.util.List<? extends com.sun.source.tree.PatternTree> getNestedPatterns()
+
CLSS public abstract interface com.sun.source.tree.DefaultCaseLabelTree
intf com.sun.source.tree.CaseLabelTree
@@ -418,7 +428,6 @@
meth public abstract com.sun.source.tree.ExpressionTree getExpression()
CLSS public abstract interface com.sun.source.tree.ExpressionTree
-intf com.sun.source.tree.CaseLabelTree
intf com.sun.source.tree.Tree
CLSS public abstract interface com.sun.source.tree.ForLoopTree
@@ -428,11 +437,6 @@
meth public abstract java.util.List<? extends com.sun.source.tree.ExpressionStatementTree> getUpdate()
meth public abstract java.util.List<? extends com.sun.source.tree.StatementTree> getInitializer()
-CLSS public abstract interface com.sun.source.tree.GuardedPatternTree
-intf com.sun.source.tree.PatternTree
-meth public abstract com.sun.source.tree.ExpressionTree getExpression()
-meth public abstract com.sun.source.tree.PatternTree getPattern()
-
CLSS public abstract interface com.sun.source.tree.IdentifierTree
intf com.sun.source.tree.ExpressionTree
meth public abstract javax.lang.model.element.Name getName()
@@ -587,8 +591,12 @@
intf com.sun.source.tree.ExpressionTree
meth public abstract com.sun.source.tree.ExpressionTree getExpression()
-CLSS public abstract interface com.sun.source.tree.PatternTree
+CLSS public abstract interface com.sun.source.tree.PatternCaseLabelTree
intf com.sun.source.tree.CaseLabelTree
+meth public abstract com.sun.source.tree.ExpressionTree getGuard()
+meth public abstract com.sun.source.tree.PatternTree getPattern()
+
+CLSS public abstract interface com.sun.source.tree.PatternTree
intf com.sun.source.tree.Tree
CLSS public abstract interface com.sun.source.tree.PrimitiveTypeTree
@@ -667,7 +675,9 @@
fld public final static com.sun.source.tree.Tree$Kind CONDITIONAL_AND
fld public final static com.sun.source.tree.Tree$Kind CONDITIONAL_EXPRESSION
fld public final static com.sun.source.tree.Tree$Kind CONDITIONAL_OR
+fld public final static com.sun.source.tree.Tree$Kind CONSTANT_CASE_LABEL
fld public final static com.sun.source.tree.Tree$Kind CONTINUE
+fld public final static com.sun.source.tree.Tree$Kind DECONSTRUCTION_PATTERN
fld public final static com.sun.source.tree.Tree$Kind DEFAULT_CASE_LABEL
fld public final static com.sun.source.tree.Tree$Kind DIVIDE
fld public final static com.sun.source.tree.Tree$Kind DIVIDE_ASSIGNMENT
@@ -685,7 +695,6 @@
fld public final static com.sun.source.tree.Tree$Kind FOR_LOOP
fld public final static com.sun.source.tree.Tree$Kind GREATER_THAN
fld public final static com.sun.source.tree.Tree$Kind GREATER_THAN_EQUAL
-fld public final static com.sun.source.tree.Tree$Kind GUARDED_PATTERN
fld public final static com.sun.source.tree.Tree$Kind IDENTIFIER
fld public final static com.sun.source.tree.Tree$Kind IF
fld public final static com.sun.source.tree.Tree$Kind IMPORT
@@ -723,6 +732,7 @@
fld public final static com.sun.source.tree.Tree$Kind PARAMETERIZED_TYPE
fld public final static com.sun.source.tree.Tree$Kind PARENTHESIZED
fld public final static com.sun.source.tree.Tree$Kind PARENTHESIZED_PATTERN
+fld public final static com.sun.source.tree.Tree$Kind PATTERN_CASE_LABEL
fld public final static com.sun.source.tree.Tree$Kind PLUS
fld public final static com.sun.source.tree.Tree$Kind PLUS_ASSIGNMENT
fld public final static com.sun.source.tree.Tree$Kind POSTFIX_DECREMENT
@@ -783,7 +793,9 @@
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitCompilationUnit(com.sun.source.tree.CompilationUnitTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitCompoundAssignment(com.sun.source.tree.CompoundAssignmentTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitConditionalExpression(com.sun.source.tree.ConditionalExpressionTree,{com.sun.source.tree.TreeVisitor%1})
+meth public abstract {com.sun.source.tree.TreeVisitor%0} visitConstantCaseLabel(com.sun.source.tree.ConstantCaseLabelTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitContinue(com.sun.source.tree.ContinueTree,{com.sun.source.tree.TreeVisitor%1})
+meth public abstract {com.sun.source.tree.TreeVisitor%0} visitDeconstructionPattern(com.sun.source.tree.DeconstructionPatternTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitDefaultCaseLabel(com.sun.source.tree.DefaultCaseLabelTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitDoWhileLoop(com.sun.source.tree.DoWhileLoopTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitEmptyStatement(com.sun.source.tree.EmptyStatementTree,{com.sun.source.tree.TreeVisitor%1})
@@ -792,7 +804,6 @@
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitExports(com.sun.source.tree.ExportsTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitExpressionStatement(com.sun.source.tree.ExpressionStatementTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitForLoop(com.sun.source.tree.ForLoopTree,{com.sun.source.tree.TreeVisitor%1})
-meth public abstract {com.sun.source.tree.TreeVisitor%0} visitGuardedPattern(com.sun.source.tree.GuardedPatternTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitIdentifier(com.sun.source.tree.IdentifierTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitIf(com.sun.source.tree.IfTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitImport(com.sun.source.tree.ImportTree,{com.sun.source.tree.TreeVisitor%1})
@@ -815,6 +826,7 @@
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitParameterizedType(com.sun.source.tree.ParameterizedTypeTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitParenthesized(com.sun.source.tree.ParenthesizedTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitParenthesizedPattern(com.sun.source.tree.ParenthesizedPatternTree,{com.sun.source.tree.TreeVisitor%1})
+meth public abstract {com.sun.source.tree.TreeVisitor%0} visitPatternCaseLabel(com.sun.source.tree.PatternCaseLabelTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitPrimitiveType(com.sun.source.tree.PrimitiveTypeTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitProvides(com.sun.source.tree.ProvidesTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitRequires(com.sun.source.tree.RequiresTree,{com.sun.source.tree.TreeVisitor%1})
@@ -1117,7 +1129,9 @@
meth public {com.sun.source.util.SimpleTreeVisitor%0} visitCompilationUnit(com.sun.source.tree.CompilationUnitTree,{com.sun.source.util.SimpleTreeVisitor%1})
meth public {com.sun.source.util.SimpleTreeVisitor%0} visitCompoundAssignment(com.sun.source.tree.CompoundAssignmentTree,{com.sun.source.util.SimpleTreeVisitor%1})
meth public {com.sun.source.util.SimpleTreeVisitor%0} visitConditionalExpression(com.sun.source.tree.ConditionalExpressionTree,{com.sun.source.util.SimpleTreeVisitor%1})
+meth public {com.sun.source.util.SimpleTreeVisitor%0} visitConstantCaseLabel(com.sun.source.tree.ConstantCaseLabelTree,{com.sun.source.util.SimpleTreeVisitor%1})
meth public {com.sun.source.util.SimpleTreeVisitor%0} visitContinue(com.sun.source.tree.ContinueTree,{com.sun.source.util.SimpleTreeVisitor%1})
+meth public {com.sun.source.util.SimpleTreeVisitor%0} visitDeconstructionPattern(com.sun.source.tree.DeconstructionPatternTree,{com.sun.source.util.SimpleTreeVisitor%1})
meth public {com.sun.source.util.SimpleTreeVisitor%0} visitDefaultCaseLabel(com.sun.source.tree.DefaultCaseLabelTree,{com.sun.source.util.SimpleTreeVisitor%1})
meth public {com.sun.source.util.SimpleTreeVisitor%0} visitDoWhileLoop(com.sun.source.tree.DoWhileLoopTree,{com.sun.source.util.SimpleTreeVisitor%1})
meth public {com.sun.source.util.SimpleTreeVisitor%0} visitEmptyStatement(com.sun.source.tree.EmptyStatementTree,{com.sun.source.util.SimpleTreeVisitor%1})
@@ -1126,7 +1140,6 @@
meth public {com.sun.source.util.SimpleTreeVisitor%0} visitExports(com.sun.source.tree.ExportsTree,{com.sun.source.util.SimpleTreeVisitor%1})
meth public {com.sun.source.util.SimpleTreeVisitor%0} visitExpressionStatement(com.sun.source.tree.ExpressionStatementTree,{com.sun.source.util.SimpleTreeVisitor%1})
meth public {com.sun.source.util.SimpleTreeVisitor%0} visitForLoop(com.sun.source.tree.ForLoopTree,{com.sun.source.util.SimpleTreeVisitor%1})
-meth public {com.sun.source.util.SimpleTreeVisitor%0} visitGuardedPattern(com.sun.source.tree.GuardedPatternTree,{com.sun.source.util.SimpleTreeVisitor%1})
meth public {com.sun.source.util.SimpleTreeVisitor%0} visitIdentifier(com.sun.source.tree.IdentifierTree,{com.sun.source.util.SimpleTreeVisitor%1})
meth public {com.sun.source.util.SimpleTreeVisitor%0} visitIf(com.sun.source.tree.IfTree,{com.sun.source.util.SimpleTreeVisitor%1})
meth public {com.sun.source.util.SimpleTreeVisitor%0} visitImport(com.sun.source.tree.ImportTree,{com.sun.source.util.SimpleTreeVisitor%1})
@@ -1149,6 +1162,7 @@
meth public {com.sun.source.util.SimpleTreeVisitor%0} visitParameterizedType(com.sun.source.tree.ParameterizedTypeTree,{com.sun.source.util.SimpleTreeVisitor%1})
meth public {com.sun.source.util.SimpleTreeVisitor%0} visitParenthesized(com.sun.source.tree.ParenthesizedTree,{com.sun.source.util.SimpleTreeVisitor%1})
meth public {com.sun.source.util.SimpleTreeVisitor%0} visitParenthesizedPattern(com.sun.source.tree.ParenthesizedPatternTree,{com.sun.source.util.SimpleTreeVisitor%1})
+meth public {com.sun.source.util.SimpleTreeVisitor%0} visitPatternCaseLabel(com.sun.source.tree.PatternCaseLabelTree,{com.sun.source.util.SimpleTreeVisitor%1})
meth public {com.sun.source.util.SimpleTreeVisitor%0} visitPrimitiveType(com.sun.source.tree.PrimitiveTypeTree,{com.sun.source.util.SimpleTreeVisitor%1})
meth public {com.sun.source.util.SimpleTreeVisitor%0} visitProvides(com.sun.source.tree.ProvidesTree,{com.sun.source.util.SimpleTreeVisitor%1})
meth public {com.sun.source.util.SimpleTreeVisitor%0} visitRequires(com.sun.source.tree.RequiresTree,{com.sun.source.util.SimpleTreeVisitor%1})
@@ -1247,7 +1261,9 @@
meth public {com.sun.source.util.TreeScanner%0} visitCompilationUnit(com.sun.source.tree.CompilationUnitTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitCompoundAssignment(com.sun.source.tree.CompoundAssignmentTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitConditionalExpression(com.sun.source.tree.ConditionalExpressionTree,{com.sun.source.util.TreeScanner%1})
+meth public {com.sun.source.util.TreeScanner%0} visitConstantCaseLabel(com.sun.source.tree.ConstantCaseLabelTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitContinue(com.sun.source.tree.ContinueTree,{com.sun.source.util.TreeScanner%1})
+meth public {com.sun.source.util.TreeScanner%0} visitDeconstructionPattern(com.sun.source.tree.DeconstructionPatternTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitDefaultCaseLabel(com.sun.source.tree.DefaultCaseLabelTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitDoWhileLoop(com.sun.source.tree.DoWhileLoopTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitEmptyStatement(com.sun.source.tree.EmptyStatementTree,{com.sun.source.util.TreeScanner%1})
@@ -1256,7 +1272,6 @@
meth public {com.sun.source.util.TreeScanner%0} visitExports(com.sun.source.tree.ExportsTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitExpressionStatement(com.sun.source.tree.ExpressionStatementTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitForLoop(com.sun.source.tree.ForLoopTree,{com.sun.source.util.TreeScanner%1})
-meth public {com.sun.source.util.TreeScanner%0} visitGuardedPattern(com.sun.source.tree.GuardedPatternTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitIdentifier(com.sun.source.tree.IdentifierTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitIf(com.sun.source.tree.IfTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitImport(com.sun.source.tree.ImportTree,{com.sun.source.util.TreeScanner%1})
@@ -1279,6 +1294,7 @@
meth public {com.sun.source.util.TreeScanner%0} visitParameterizedType(com.sun.source.tree.ParameterizedTypeTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitParenthesized(com.sun.source.tree.ParenthesizedTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitParenthesizedPattern(com.sun.source.tree.ParenthesizedPatternTree,{com.sun.source.util.TreeScanner%1})
+meth public {com.sun.source.util.TreeScanner%0} visitPatternCaseLabel(com.sun.source.tree.PatternCaseLabelTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitPrimitiveType(com.sun.source.tree.PrimitiveTypeTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitProvides(com.sun.source.tree.ProvidesTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitRequires(com.sun.source.tree.RequiresTree,{com.sun.source.util.TreeScanner%1})
@@ -1584,6 +1600,7 @@
fld public final static javax.lang.model.SourceVersion RELEASE_16
fld public final static javax.lang.model.SourceVersion RELEASE_17
fld public final static javax.lang.model.SourceVersion RELEASE_18
+fld public final static javax.lang.model.SourceVersion RELEASE_19
fld public final static javax.lang.model.SourceVersion RELEASE_2
fld public final static javax.lang.model.SourceVersion RELEASE_3
fld public final static javax.lang.model.SourceVersion RELEASE_4
@@ -1676,8 +1693,12 @@
fld public final static javax.lang.model.element.ElementKind STATIC_INIT
fld public final static javax.lang.model.element.ElementKind TYPE_PARAMETER
meth public boolean isClass()
+meth public boolean isDeclaredType()
+meth public boolean isExecutable()
meth public boolean isField()
+meth public boolean isInitializer()
meth public boolean isInterface()
+meth public boolean isVariable()
meth public static javax.lang.model.element.ElementKind valueOf(java.lang.String)
meth public static javax.lang.model.element.ElementKind[] values()
supr java.lang.Enum<javax.lang.model.element.ElementKind>
@@ -2024,7 +2045,7 @@
meth public abstract javax.lang.model.type.TypeMirror getSuperBound()
CLSS public abstract javax.lang.model.util.AbstractAnnotationValueVisitor14<%0 extends java.lang.Object, %1 extends java.lang.Object>
- anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_18)
+ anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_19)
cons protected init()
supr javax.lang.model.util.AbstractAnnotationValueVisitor9<{javax.lang.model.util.AbstractAnnotationValueVisitor14%0},{javax.lang.model.util.AbstractAnnotationValueVisitor14%1}>
@@ -2055,7 +2076,7 @@
supr javax.lang.model.util.AbstractAnnotationValueVisitor8<{javax.lang.model.util.AbstractAnnotationValueVisitor9%0},{javax.lang.model.util.AbstractAnnotationValueVisitor9%1}>
CLSS public abstract javax.lang.model.util.AbstractElementVisitor14<%0 extends java.lang.Object, %1 extends java.lang.Object>
- anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_18)
+ anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_19)
cons protected init()
meth public abstract {javax.lang.model.util.AbstractElementVisitor14%0} visitRecordComponent(javax.lang.model.element.RecordComponentElement,{javax.lang.model.util.AbstractElementVisitor14%1})
supr javax.lang.model.util.AbstractElementVisitor9<{javax.lang.model.util.AbstractElementVisitor14%0},{javax.lang.model.util.AbstractElementVisitor14%1}>
@@ -2090,7 +2111,7 @@
supr javax.lang.model.util.AbstractElementVisitor8<{javax.lang.model.util.AbstractElementVisitor9%0},{javax.lang.model.util.AbstractElementVisitor9%1}>
CLSS public abstract javax.lang.model.util.AbstractTypeVisitor14<%0 extends java.lang.Object, %1 extends java.lang.Object>
- anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_18)
+ anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_19)
cons protected init()
supr javax.lang.model.util.AbstractTypeVisitor9<{javax.lang.model.util.AbstractTypeVisitor14%0},{javax.lang.model.util.AbstractTypeVisitor14%1}>
@@ -2148,7 +2169,7 @@
hfds CONSTRUCTOR_KIND,FIELD_KINDS,METHOD_KIND,MODULE_KIND,PACKAGE_KIND,RECORD_COMPONENT_KIND,TYPE_KINDS
CLSS public javax.lang.model.util.ElementKindVisitor14<%0 extends java.lang.Object, %1 extends java.lang.Object>
- anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_18)
+ anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_19)
cons protected init()
cons protected init({javax.lang.model.util.ElementKindVisitor14%0})
meth public {javax.lang.model.util.ElementKindVisitor14%0} visitRecordComponent(javax.lang.model.element.RecordComponentElement,{javax.lang.model.util.ElementKindVisitor14%1})
@@ -2208,7 +2229,7 @@
supr javax.lang.model.util.ElementKindVisitor8<{javax.lang.model.util.ElementKindVisitor9%0},{javax.lang.model.util.ElementKindVisitor9%1}>
CLSS public javax.lang.model.util.ElementScanner14<%0 extends java.lang.Object, %1 extends java.lang.Object>
- anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_18)
+ anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_19)
cons protected init()
cons protected init({javax.lang.model.util.ElementScanner14%0})
meth public {javax.lang.model.util.ElementScanner14%0} visitExecutable(javax.lang.model.element.ExecutableElement,{javax.lang.model.util.ElementScanner14%1})
@@ -2299,7 +2320,7 @@
supr java.lang.Enum<javax.lang.model.util.Elements$Origin>
CLSS public javax.lang.model.util.SimpleAnnotationValueVisitor14<%0 extends java.lang.Object, %1 extends java.lang.Object>
- anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_18)
+ anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_19)
cons protected init()
cons protected init({javax.lang.model.util.SimpleAnnotationValueVisitor14%0})
supr javax.lang.model.util.SimpleAnnotationValueVisitor9<{javax.lang.model.util.SimpleAnnotationValueVisitor14%0},{javax.lang.model.util.SimpleAnnotationValueVisitor14%1}>
@@ -2348,7 +2369,7 @@
supr javax.lang.model.util.SimpleAnnotationValueVisitor8<{javax.lang.model.util.SimpleAnnotationValueVisitor9%0},{javax.lang.model.util.SimpleAnnotationValueVisitor9%1}>
CLSS public javax.lang.model.util.SimpleElementVisitor14<%0 extends java.lang.Object, %1 extends java.lang.Object>
- anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_18)
+ anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_19)
cons protected init()
cons protected init({javax.lang.model.util.SimpleElementVisitor14%0})
meth public {javax.lang.model.util.SimpleElementVisitor14%0} visitRecordComponent(javax.lang.model.element.RecordComponentElement,{javax.lang.model.util.SimpleElementVisitor14%1})
@@ -2392,7 +2413,7 @@
supr javax.lang.model.util.SimpleElementVisitor8<{javax.lang.model.util.SimpleElementVisitor9%0},{javax.lang.model.util.SimpleElementVisitor9%1}>
CLSS public javax.lang.model.util.SimpleTypeVisitor14<%0 extends java.lang.Object, %1 extends java.lang.Object>
- anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_18)
+ anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_19)
cons protected init()
cons protected init({javax.lang.model.util.SimpleTypeVisitor14%0})
supr javax.lang.model.util.SimpleTypeVisitor9<{javax.lang.model.util.SimpleTypeVisitor14%0},{javax.lang.model.util.SimpleTypeVisitor14%1}>
@@ -2439,7 +2460,7 @@
supr javax.lang.model.util.SimpleTypeVisitor8<{javax.lang.model.util.SimpleTypeVisitor9%0},{javax.lang.model.util.SimpleTypeVisitor9%1}>
CLSS public javax.lang.model.util.TypeKindVisitor14<%0 extends java.lang.Object, %1 extends java.lang.Object>
- anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_18)
+ anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_19)
cons protected init()
cons protected init({javax.lang.model.util.TypeKindVisitor14%0})
supr javax.lang.model.util.TypeKindVisitor9<{javax.lang.model.util.TypeKindVisitor14%0},{javax.lang.model.util.TypeKindVisitor14%1}>
diff --git a/java/libs.javacapi/nbproject/project.properties b/java/libs.javacapi/nbproject/project.properties
index a988ae1..f7f3deb 100644
--- a/java/libs.javacapi/nbproject/project.properties
+++ b/java/libs.javacapi/nbproject/project.properties
@@ -20,6 +20,6 @@
javadoc.title=Javac API
nbm.homepage=http://jackpot.netbeans.org/
nbm.module.author=Petr Hrebejk
-spec.version.base=8.40.0
+spec.version.base=8.41.0
javadoc.arch=${basedir}/arch.xml
module.javadoc.packages=com.sun.source.tree,com.sun.source.util
diff --git a/java/libs.javacapi/nbproject/project.xml b/java/libs.javacapi/nbproject/project.xml
index 905d81b..35901e2 100644
--- a/java/libs.javacapi/nbproject/project.xml
+++ b/java/libs.javacapi/nbproject/project.xml
@@ -40,11 +40,11 @@
</public-packages>
<class-path-extension>
<runtime-relative-path />
- <binary-origin>external/nb-javac-jdk-18.0.1+10-api.jar</binary-origin>
+ <binary-origin>external/nb-javac-jdk-19+33-api.jar</binary-origin>
</class-path-extension>
<class-path-extension>
<runtime-relative-path />
- <binary-origin>external/nb-javac-jdk-18.0.1+10.jar</binary-origin>
+ <binary-origin>external/nb-javac-jdk-19+33.jar</binary-origin>
</class-path-extension>
</data>
</configuration>
diff --git a/java/libs.nbjavacapi/external/binaries-list b/java/libs.nbjavacapi/external/binaries-list
index cb152e0..b42feac 100644
--- a/java/libs.nbjavacapi/external/binaries-list
+++ b/java/libs.nbjavacapi/external/binaries-list
@@ -14,5 +14,5 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-ECA15E615777CE6E7550F71EF312B8CEEBCBE0BD com.dukescript.nbjavac:nb-javac:jdk-18.0.1+10:api
-3AD512FBC8830D89AC70D0CA59397C4868789DCC com.dukescript.nbjavac:nb-javac:jdk-18.0.1+10
+DBA592C75DD52B97EC88A6B06ADF71D4F3C3DED9 com.dukescript.nbjavac:nb-javac:jdk-19+33:api
+A36688EDA1DE51508A039AED3518771C6F75E416 com.dukescript.nbjavac:nb-javac:jdk-19+33
diff --git a/java/libs.nbjavacapi/external/nb-javac-jdk-18.0.1+10-license.txt b/java/libs.nbjavacapi/external/nb-javac-jdk-19+33-license.txt
similarity index 98%
rename from java/libs.nbjavacapi/external/nb-javac-jdk-18.0.1+10-license.txt
rename to java/libs.nbjavacapi/external/nb-javac-jdk-19+33-license.txt
index 6d324e9..770d20b 100644
--- a/java/libs.nbjavacapi/external/nb-javac-jdk-18.0.1+10-license.txt
+++ b/java/libs.nbjavacapi/external/nb-javac-jdk-19+33-license.txt
@@ -1,10 +1,10 @@
Name: Javac Compiler Implementation
Description: Javac Compiler Implementation
-Files: nb-javac-jdk-18.0.1+10-api.jar nb-javac-jdk-18.0.1+10.jar
-Version: jdk-18.0.1+10
+Files: nb-javac-jdk-19+33-api.jar nb-javac-jdk-19+33.jar
+Version: jdk-19+33
License: GPL-2-CP
-Origin: OpenJDK (https://github.com/openjdk/jdk18)
-Source: https://github.com/openjdk/jdk18
+Origin: OpenJDK (https://github.com/openjdk/jdk19)
+Source: https://github.com/openjdk/jdk19
Type: compile-time,optional
Comment: Used at compile and design time to compile against; optional at runtime.
diff --git a/java/libs.nbjavacapi/manifest.mf b/java/libs.nbjavacapi/manifest.mf
index 5debd3f..3310a0f 100644
--- a/java/libs.nbjavacapi/manifest.mf
+++ b/java/libs.nbjavacapi/manifest.mf
@@ -2,7 +2,7 @@
AutoUpdate-Show-In-Client: true
OpenIDE-Module: org.netbeans.libs.nbjavacapi
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/nbjavac/api/Bundle.properties
-OpenIDE-Module-Specification-Version: 18.2
+OpenIDE-Module-Specification-Version: 19.0
OpenIDE-Module-Hide-Classpath-Packages: com.sun.javadoc.**, com.sun.source.**, javax.annotation.processing.**, javax.lang.model.**, javax.tools.**, com.sun.tools.javac.** com.sun.tools.javac.**, com.sun.tools.javadoc.**, com.sun.tools.javap.**, com.sun.tools.classfile.**, com.sun.tools.doclint.**
OpenIDE-Module-Fragment-Host: org.netbeans.libs.javacapi
OpenIDE-Module-Provides: org.netbeans.libs.nbjavac
diff --git a/java/libs.nbjavacapi/nbproject/project.properties b/java/libs.nbjavacapi/nbproject/project.properties
index 1bd61ee..f48dd15 100644
--- a/java/libs.nbjavacapi/nbproject/project.properties
+++ b/java/libs.nbjavacapi/nbproject/project.properties
@@ -18,5 +18,5 @@
javac.source=1.7
javac.compilerargs=-Xlint -Xlint:-serial
license.file.override=${nb_all}/nbbuild/licenses/GPL-2-CP
-release.external/nb-javac-jdk-18.0.1+10-api.jar=modules/ext/nb-javac-jdk-18-api.jar
-release.external/nb-javac-jdk-18.0.1+10.jar=modules/ext/nb-javac-jdk-18.jar
+release.external/nb-javac-jdk-19+33-api.jar=modules/ext/nb-javac-jdk-19-api.jar
+release.external/nb-javac-jdk-19+33.jar=modules/ext/nb-javac-jdk-19.jar
diff --git a/java/libs.nbjavacapi/nbproject/project.xml b/java/libs.nbjavacapi/nbproject/project.xml
index 7dc8a08..5b801b8 100644
--- a/java/libs.nbjavacapi/nbproject/project.xml
+++ b/java/libs.nbjavacapi/nbproject/project.xml
@@ -36,12 +36,12 @@
</module-dependencies>
<public-packages/>
<class-path-extension>
- <runtime-relative-path>ext/nb-javac-jdk-18-api.jar</runtime-relative-path>
- <binary-origin>external/nb-javac-jdk-18.0.1+10-api.jar</binary-origin>
+ <runtime-relative-path>ext/nb-javac-jdk-19-api.jar</runtime-relative-path>
+ <binary-origin>external/nb-javac-jdk-19+33-api.jar</binary-origin>
</class-path-extension>
<class-path-extension>
- <runtime-relative-path>ext/nb-javac-jdk-18.jar</runtime-relative-path>
- <binary-origin>external/nb-javac-jdk-18.0.1+10.jar</binary-origin>
+ <runtime-relative-path>ext/nb-javac-jdk-19.jar</runtime-relative-path>
+ <binary-origin>external/nb-javac-jdk-19+33.jar</binary-origin>
</class-path-extension>
</data>
</configuration>
diff --git a/java/libs.nbjavacapi/src/org/netbeans/modules/nbjavac/api/Bundle.properties b/java/libs.nbjavacapi/src/org/netbeans/modules/nbjavac/api/Bundle.properties
index c5c441a..e9a4b6b 100644
--- a/java/libs.nbjavacapi/src/org/netbeans/modules/nbjavac/api/Bundle.properties
+++ b/java/libs.nbjavacapi/src/org/netbeans/modules/nbjavac/api/Bundle.properties
@@ -18,6 +18,6 @@
OpenIDE-Module-Display-Category=Java
OpenIDE-Module-Long-Description=\
This library provides a Java language parser for the IDE. \
- Supports JDK-18 features.
+ Supports JDK-19 features.
OpenIDE-Module-Name=The nb-javac Java editing support library
OpenIDE-Module-Short-Description=The nb-javac Java editing support library
diff --git a/java/maven/src/org/netbeans/modules/maven/NbMavenProjectFactory.java b/java/maven/src/org/netbeans/modules/maven/NbMavenProjectFactory.java
index 3346cae..69f1f94 100644
--- a/java/maven/src/org/netbeans/modules/maven/NbMavenProjectFactory.java
+++ b/java/maven/src/org/netbeans/modules/maven/NbMavenProjectFactory.java
@@ -24,6 +24,7 @@
import java.util.concurrent.atomic.AtomicBoolean;
import org.netbeans.api.project.Project;
import org.netbeans.api.project.ProjectManager;
+import org.netbeans.modules.maven.api.NbMavenProject;
import org.netbeans.spi.project.ProjectFactory;
import org.netbeans.spi.project.ProjectFactory2;
import org.netbeans.spi.project.ProjectState;
@@ -77,7 +78,9 @@
public @Override ProjectManager.Result isProject2(FileObject projectDirectory) {
if (isProject(projectDirectory)) {
- return new ProjectManager.Result(ImageUtilities.loadImageIcon("org/netbeans/modules/maven/resources/Maven2Icon.gif", true)); //NOI18N
+ return new ProjectManager.Result(
+ null, NbMavenProject.TYPE,
+ ImageUtilities.loadImageIcon("org/netbeans/modules/maven/resources/Maven2Icon.gif", true)); //NOI18N
}
return null;
}
diff --git a/java/maven/test/unit/src/org/netbeans/modules/maven/output/TestOutputListenerProviderTest.java b/java/maven/test/unit/src/org/netbeans/modules/maven/output/TestOutputListenerProviderTest.java
index 0cfd9cc..5faa6a2 100644
--- a/java/maven/test/unit/src/org/netbeans/modules/maven/output/TestOutputListenerProviderTest.java
+++ b/java/maven/test/unit/src/org/netbeans/modules/maven/output/TestOutputListenerProviderTest.java
@@ -19,11 +19,6 @@
package org.netbeans.modules.maven.output;
import junit.framework.*;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.modules.maven.api.output.OutputVisitor;
/**
diff --git a/java/maven/test/unit/src/org/netbeans/modules/maven/queries/MavenSourceLevelImplTest.java b/java/maven/test/unit/src/org/netbeans/modules/maven/queries/MavenSourceLevelImplTest.java
index 7bea36a..e7ff907 100644
--- a/java/maven/test/unit/src/org/netbeans/modules/maven/queries/MavenSourceLevelImplTest.java
+++ b/java/maven/test/unit/src/org/netbeans/modules/maven/queries/MavenSourceLevelImplTest.java
@@ -20,7 +20,6 @@
package org.netbeans.modules.maven.queries;
import java.util.regex.Matcher;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.api.java.queries.SourceLevelQuery;
import org.netbeans.api.project.ProjectManager;
import org.netbeans.junit.NbTestCase;
diff --git a/java/performance.java/test/qa-functional/src/org/netbeans/performance/j2se/actions/CountingSecurityManager.java b/java/performance.java/test/qa-functional/src/org/netbeans/performance/j2se/actions/CountingSecurityManager.java
index e5ad6a7..3e9bcba 100644
--- a/java/performance.java/test/qa-functional/src/org/netbeans/performance/j2se/actions/CountingSecurityManager.java
+++ b/java/performance.java/test/qa-functional/src/org/netbeans/performance/j2se/actions/CountingSecurityManager.java
@@ -31,7 +31,7 @@
import java.util.Map;
import java.util.TreeSet;
import java.util.concurrent.atomic.AtomicLong;
-import junit.framework.Assert;
+import org.junit.Assert;
/**
*
diff --git a/java/performance/benchmarks/test/perf/src/org/netbeans/performance/platform/RunnableMethod.java b/java/performance/benchmarks/test/perf/src/org/netbeans/performance/platform/RunnableMethod.java
index 5faa2f1..09fe4d0 100644
--- a/java/performance/benchmarks/test/perf/src/org/netbeans/performance/platform/RunnableMethod.java
+++ b/java/performance/benchmarks/test/perf/src/org/netbeans/performance/platform/RunnableMethod.java
@@ -158,7 +158,7 @@
mtd.invoke( obj, args );
} catch( Throwable t ) {
t.printStackTrace();
- junit.framework.Assert.fail( "Exception: " + t.getMessage() );
+ org.junit.Assert.fail( "Exception: " + t.getMessage() );
}
}
}
diff --git a/java/performance/cnd/test/unit/src/org/netbeans/performance/cnd/Utilities.java b/java/performance/cnd/test/unit/src/org/netbeans/performance/cnd/Utilities.java
index 11b9499..fbea413 100644
--- a/java/performance/cnd/test/unit/src/org/netbeans/performance/cnd/Utilities.java
+++ b/java/performance/cnd/test/unit/src/org/netbeans/performance/cnd/Utilities.java
@@ -23,7 +23,7 @@
import java.util.logging.*;
import java.util.zip.*;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.openide.filesystems.*;
import org.openide.util.*;
diff --git a/java/performance/enterprise/test/qa-functional/src/org/netbeans/performance/enterprise/actions/WatchProjectsTest.java b/java/performance/enterprise/test/qa-functional/src/org/netbeans/performance/enterprise/actions/WatchProjectsTest.java
index 636fecd..76f1c60 100644
--- a/java/performance/enterprise/test/qa-functional/src/org/netbeans/performance/enterprise/actions/WatchProjectsTest.java
+++ b/java/performance/enterprise/test/qa-functional/src/org/netbeans/performance/enterprise/actions/WatchProjectsTest.java
@@ -24,7 +24,6 @@
import java.lang.reflect.Method;
import java.util.logging.Level;
import java.util.logging.Logger;
-import junit.framework.Assert;
import org.netbeans.jellytools.JellyTestCase;
import org.netbeans.jellytools.ProjectsTabOperator;
import org.netbeans.jemmy.EventTool;
@@ -64,7 +63,7 @@
Log.enableInstances(Logger.getLogger("TIMER"), "Project", Level.FINEST);
final ClassLoader loader = Lookup.getDefault().lookup(ClassLoader.class);
- Assert.assertNotNull("Classloader must exists", loader);
+ assertNotNull("Classloader must exists", loader);
LOG.fine("Classloader: " + loader);
Class pmClass = Class.forName(
"org.netbeans.api.project.ui.OpenProjects", false, loader); //NOI18N
diff --git a/java/performance/src/org/netbeans/modules/performance/utilities/MeasureStartupTimeTestCase.java b/java/performance/src/org/netbeans/modules/performance/utilities/MeasureStartupTimeTestCase.java
index 6c9b319..536610e 100644
--- a/java/performance/src/org/netbeans/modules/performance/utilities/MeasureStartupTimeTestCase.java
+++ b/java/performance/src/org/netbeans/modules/performance/utilities/MeasureStartupTimeTestCase.java
@@ -29,7 +29,6 @@
import java.util.TreeSet;
import java.util.logging.Level;
import java.util.logging.Logger;
-import junit.framework.Assert;
/**
* Measure startup time by org.netbeans.core.perftool.StartLog. Number of starts
@@ -366,24 +365,24 @@
try {
Class<?> lookup = Class.forName("org.openide.util.Lookup"); // NOI18N
File util = new File(lookup.getProtectionDomain().getCodeSource().getLocation().toURI());
- Assert.assertTrue("Util exists: " + util, util.exists());
+ assertTrue("Util exists: " + util, util.exists());
return util.getParentFile().getParentFile();
} catch (Exception ex) {
try {
File nbjunit = new File(MeasureStartupTimeTestCase.class.getProtectionDomain().getCodeSource().getLocation().toURI());
File harness = nbjunit.getParentFile().getParentFile();
- Assert.assertEquals("NbJUnit is in harness", "harness", harness.getName());
+ assertEquals("NbJUnit is in harness", "harness", harness.getName());
TreeSet<File> sorted = new TreeSet<>();
for (File p : harness.getParentFile().listFiles()) {
if (p.getName().startsWith("platform")) {
sorted.add(p);
}
}
- Assert.assertFalse("Platform shall be found in " + harness.getParent(), sorted.isEmpty());
+ assertFalse("Platform shall be found in " + harness.getParent(), sorted.isEmpty());
return sorted.last();
} catch (Exception ex2) {
- Assert.fail("Cannot find utilities JAR: " + ex + " and: " + ex2);
+ fail("Cannot find utilities JAR: " + ex + " and: " + ex2);
}
return null;
}
diff --git a/java/performance/test/qa-functional/src/org/netbeans/test/ide/PerfCountingSecurityManager.java b/java/performance/test/qa-functional/src/org/netbeans/test/ide/PerfCountingSecurityManager.java
index 7eaf822..ac6a135 100644
--- a/java/performance/test/qa-functional/src/org/netbeans/test/ide/PerfCountingSecurityManager.java
+++ b/java/performance/test/qa-functional/src/org/netbeans/test/ide/PerfCountingSecurityManager.java
@@ -40,7 +40,7 @@
import java.util.concurrent.Callable;
import java.util.logging.Level;
import java.util.logging.Logger;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.openide.util.Utilities;
import sun.security.util.SecurityConstants;
diff --git a/java/performance/test/qa-functional/src/org/netbeans/test/ide/PerfWatchProjects.java b/java/performance/test/qa-functional/src/org/netbeans/test/ide/PerfWatchProjects.java
index 28ae8b0..7d02ce7 100644
--- a/java/performance/test/qa-functional/src/org/netbeans/test/ide/PerfWatchProjects.java
+++ b/java/performance/test/qa-functional/src/org/netbeans/test/ide/PerfWatchProjects.java
@@ -34,8 +34,8 @@
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;
-import junit.framework.Assert;
import junit.framework.AssertionFailedError;
+import org.junit.Assert;
import org.netbeans.api.java.source.ui.ScanDialog;
import org.netbeans.api.project.Project;
import org.netbeans.api.project.ui.OpenProjects;
diff --git a/java/performance/test/unit/src/org/netbeans/performance/scalability/CountingSecurityManager.java b/java/performance/test/unit/src/org/netbeans/performance/scalability/CountingSecurityManager.java
index b63d542..0534af0 100644
--- a/java/performance/test/unit/src/org/netbeans/performance/scalability/CountingSecurityManager.java
+++ b/java/performance/test/unit/src/org/netbeans/performance/scalability/CountingSecurityManager.java
@@ -31,7 +31,7 @@
import java.util.Map;
import java.util.TreeSet;
import java.util.concurrent.atomic.AtomicLong;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.openide.util.Exceptions;
/**
diff --git a/java/refactoring.java/nbproject/org-netbeans-modules-refactoring-java.sig b/java/refactoring.java/nbproject/org-netbeans-modules-refactoring-java.sig
index bc7ee9e..26adf5a 100644
--- a/java/refactoring.java/nbproject/org-netbeans-modules-refactoring-java.sig
+++ b/java/refactoring.java/nbproject/org-netbeans-modules-refactoring-java.sig
@@ -66,7 +66,6 @@
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitExports(com.sun.source.tree.ExportsTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitExpressionStatement(com.sun.source.tree.ExpressionStatementTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitForLoop(com.sun.source.tree.ForLoopTree,{com.sun.source.tree.TreeVisitor%1})
-meth public abstract {com.sun.source.tree.TreeVisitor%0} visitGuardedPattern(com.sun.source.tree.GuardedPatternTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitIdentifier(com.sun.source.tree.IdentifierTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitIf(com.sun.source.tree.IfTree,{com.sun.source.tree.TreeVisitor%1})
meth public abstract {com.sun.source.tree.TreeVisitor%0} visitImport(com.sun.source.tree.ImportTree,{com.sun.source.tree.TreeVisitor%1})
@@ -147,7 +146,6 @@
meth public {com.sun.source.util.TreeScanner%0} visitExports(com.sun.source.tree.ExportsTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitExpressionStatement(com.sun.source.tree.ExpressionStatementTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitForLoop(com.sun.source.tree.ForLoopTree,{com.sun.source.util.TreeScanner%1})
-meth public {com.sun.source.util.TreeScanner%0} visitGuardedPattern(com.sun.source.tree.GuardedPatternTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitIdentifier(com.sun.source.tree.IdentifierTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitIf(com.sun.source.tree.IfTree,{com.sun.source.util.TreeScanner%1})
meth public {com.sun.source.util.TreeScanner%0} visitImport(com.sun.source.tree.ImportTree,{com.sun.source.util.TreeScanner%1})
diff --git a/java/refactoring.java/nbproject/project.properties b/java/refactoring.java/nbproject/project.properties
index bc377cf..e21b31a 100644
--- a/java/refactoring.java/nbproject/project.properties
+++ b/java/refactoring.java/nbproject/project.properties
@@ -18,7 +18,7 @@
javadoc.arch=${basedir}/arch.xml
javadoc.apichanges=${basedir}/apichanges.xml
-spec.version.base=1.79.0
+spec.version.base=1.80.0
#test configs
test.config.find.includes=\
**/FindUsagesSuite.class
diff --git a/java/refactoring.java/test/unit/src/org/netbeans/modules/refactoring/java/test/Utilities.java b/java/refactoring.java/test/unit/src/org/netbeans/modules/refactoring/java/test/Utilities.java
index 2d43f2d..272d576 100644
--- a/java/refactoring.java/test/unit/src/org/netbeans/modules/refactoring/java/test/Utilities.java
+++ b/java/refactoring.java/test/unit/src/org/netbeans/modules/refactoring/java/test/Utilities.java
@@ -34,7 +34,7 @@
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.openide.filesystems.*;
import org.openide.util.*;
diff --git a/java/refactoring.java/test/unit/src/org/netbeans/modules/refactoring/java/ui/IntroduceParameterActionTest.java b/java/refactoring.java/test/unit/src/org/netbeans/modules/refactoring/java/ui/IntroduceParameterActionTest.java
index b7d4418..8f15229 100644
--- a/java/refactoring.java/test/unit/src/org/netbeans/modules/refactoring/java/ui/IntroduceParameterActionTest.java
+++ b/java/refactoring.java/test/unit/src/org/netbeans/modules/refactoring/java/ui/IntroduceParameterActionTest.java
@@ -20,8 +20,6 @@
import com.sun.source.tree.Tree;
import java.util.concurrent.atomic.AtomicInteger;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.api.java.source.TreePathHandle;
import org.netbeans.modules.refactoring.java.test.RefactoringTestBase;
import org.netbeans.modules.refactoring.spi.ui.RefactoringUI;
diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/Utilities.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/Utilities.java
index dab12e1..b0accad 100644
--- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/Utilities.java
+++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/Utilities.java
@@ -74,6 +74,7 @@
import com.sun.tools.javac.tree.JCTree.JCCase;
import com.sun.tools.javac.tree.JCTree.JCCatch;
import com.sun.tools.javac.tree.JCTree.JCCompilationUnit;
+import com.sun.tools.javac.tree.JCTree.JCConstantCaseLabel;
import com.sun.tools.javac.tree.JCTree.JCExpression;
import com.sun.tools.javac.tree.JCTree.JCFieldAccess;
import com.sun.tools.javac.tree.JCTree.JCIdent;
@@ -1444,9 +1445,9 @@
}
JCIdent identTree = F.at(pos).Ident(name);
-
+ JCConstantCaseLabel labelTree = F.at(pos).ConstantCaseLabel(identTree);
return com.sun.tools.javac.util.List.of(
- new JackpotTrees.CaseWildcard(name, identTree, STATEMENT, com.sun.tools.javac.util.List.of(identTree), com.sun.tools.javac.util.List.nil(), null)
+ new JackpotTrees.CaseWildcard(name, identTree, STATEMENT, com.sun.tools.javac.util.List.of(labelTree), com.sun.tools.javac.util.List.nil(), null)
);
}
}
diff --git a/javafx/javafx2.editor/test/unit/src/org/netbeans/modules/javafx2/editor/FXMLCompletionTestBase.java b/javafx/javafx2.editor/test/unit/src/org/netbeans/modules/javafx2/editor/FXMLCompletionTestBase.java
index 2ab69aa..da11e98 100644
--- a/javafx/javafx2.editor/test/unit/src/org/netbeans/modules/javafx2/editor/FXMLCompletionTestBase.java
+++ b/javafx/javafx2.editor/test/unit/src/org/netbeans/modules/javafx2/editor/FXMLCompletionTestBase.java
@@ -28,7 +28,6 @@
import java.util.regex.Pattern;
import javax.swing.JEditorPane;
import javax.swing.text.Document;
-import junit.framework.Assert;
import org.netbeans.ModuleManager;
import org.netbeans.api.editor.mimelookup.MimePath;
import org.netbeans.api.java.classpath.ClassPath;
@@ -83,7 +82,7 @@
static {
FXMLCompletionTestBase.class.getClassLoader().setDefaultAssertionStatus(true);
System.setProperty("org.openide.util.Lookup", Lkp.class.getName());
- Assert.assertEquals(Lkp.class, Lookup.getDefault().getClass());
+ assertEquals(Lkp.class, Lookup.getDefault().getClass());
SourceUtilsTestUtil2.disableArtificalParameterNames();
}
@@ -100,7 +99,7 @@
@SuppressWarnings("LeakingThisInConstructor")
public Lkp() {
- Assert.assertNull(DEFAULT);
+ assertNull(DEFAULT);
DEFAULT = this;
}
diff --git a/javafx/javafx2.project/test/unit/src/org/netbeans/modules/javafx2/project/JFXConfigsTest.java b/javafx/javafx2.project/test/unit/src/org/netbeans/modules/javafx2/project/JFXConfigsTest.java
index 9e39d9a..690741e 100644
--- a/javafx/javafx2.project/test/unit/src/org/netbeans/modules/javafx2/project/JFXConfigsTest.java
+++ b/javafx/javafx2.project/test/unit/src/org/netbeans/modules/javafx2/project/JFXConfigsTest.java
@@ -22,8 +22,6 @@
import java.io.IOException;
import java.util.Arrays;
import java.util.Set;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.netbeans.api.project.Project;
diff --git a/nb/welcome/test/unit/src/org/netbeans/modules/welcome/MemoryURL.java b/nb/welcome/test/unit/src/org/netbeans/modules/welcome/MemoryURL.java
index b961541..518a98a 100644
--- a/nb/welcome/test/unit/src/org/netbeans/modules/welcome/MemoryURL.java
+++ b/nb/welcome/test/unit/src/org/netbeans/modules/welcome/MemoryURL.java
@@ -30,7 +30,7 @@
import java.net.URLStreamHandlerFactory;
import java.util.HashMap;
import java.util.Map;
-import junit.framework.Assert;
+import org.junit.Assert;
/**
*
diff --git a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ignored-overlaps b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ignored-overlaps
index 9553042..07ff8af 100644
--- a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ignored-overlaps
+++ b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ignored-overlaps
@@ -118,8 +118,8 @@
harness/apisupport.harness/external/launcher-12.5-distribution.zip platform/o.n.bootstrap/external/launcher-12.5-distribution.zip
# only one is part of the product:
-java/libs.javacapi/external/nb-javac-jdk-18.0.1+10-api.jar java/libs.nbjavacapi/external/nb-javac-jdk-18.0.1+10-api.jar
-java/libs.javacapi/external/nb-javac-jdk-18.0.1+10.jar java/libs.nbjavacapi/external/nb-javac-jdk-18.0.1+10.jar
+java/libs.javacapi/external/nb-javac-jdk-19+33-api.jar java/libs.nbjavacapi/external/nb-javac-jdk-19+33-api.jar
+java/libs.javacapi/external/nb-javac-jdk-19+33.jar java/libs.nbjavacapi/external/nb-javac-jdk-19+33.jar
# Maven and Gradle are self-contained distributions - ignoring overlaps
platform/o.apache.commons.lang3/external/commons-lang3-3.8.1.jar java/maven.embedder/external/apache-maven-3.8.6-bin.zip
diff --git a/php/php.atoum/test/unit/src/org/netbeans/modules/php/atoum/coverage/CloverLogParserTest.java b/php/php.atoum/test/unit/src/org/netbeans/modules/php/atoum/coverage/CloverLogParserTest.java
index db4b255..b2a9c6a 100644
--- a/php/php.atoum/test/unit/src/org/netbeans/modules/php/atoum/coverage/CloverLogParserTest.java
+++ b/php/php.atoum/test/unit/src/org/netbeans/modules/php/atoum/coverage/CloverLogParserTest.java
@@ -28,14 +28,10 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
-import java.util.regex.Matcher;
import org.netbeans.junit.NbTestCase;
import org.netbeans.modules.php.spi.testing.coverage.Coverage;
import org.netbeans.modules.php.spi.testing.coverage.FileMetrics;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
public class CloverLogParserTest extends NbTestCase {
diff --git a/php/php.code.analysis/test/unit/src/org/netbeans/modules/php/analysis/parsers/MessDetectorReportParserTest.java b/php/php.code.analysis/test/unit/src/org/netbeans/modules/php/analysis/parsers/MessDetectorReportParserTest.java
index cba0345..f22f069 100644
--- a/php/php.code.analysis/test/unit/src/org/netbeans/modules/php/analysis/parsers/MessDetectorReportParserTest.java
+++ b/php/php.code.analysis/test/unit/src/org/netbeans/modules/php/analysis/parsers/MessDetectorReportParserTest.java
@@ -20,7 +20,6 @@
import java.io.File;
import java.util.List;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.junit.NbTestCase;
import org.netbeans.modules.php.analysis.results.Result;
diff --git a/php/php.composer/test/unit/src/org/netbeans/modules/php/composer/output/parsers/CliParserTest.java b/php/php.composer/test/unit/src/org/netbeans/modules/php/composer/output/parsers/CliParserTest.java
index 2790ec5..a144d9f 100644
--- a/php/php.composer/test/unit/src/org/netbeans/modules/php/composer/output/parsers/CliParserTest.java
+++ b/php/php.composer/test/unit/src/org/netbeans/modules/php/composer/output/parsers/CliParserTest.java
@@ -22,8 +22,6 @@
import java.io.File;
import java.io.FileReader;
import java.util.List;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.junit.NbTestCase;
import org.netbeans.modules.php.composer.output.model.SearchResult;
diff --git a/php/php.latte/test/unit/src/org/netbeans/modules/php/latte/actions/ToggleBlockCommentActionTest.java b/php/php.latte/test/unit/src/org/netbeans/modules/php/latte/actions/ToggleBlockCommentActionTest.java
index acc2b5f..b0b9fc9 100644
--- a/php/php.latte/test/unit/src/org/netbeans/modules/php/latte/actions/ToggleBlockCommentActionTest.java
+++ b/php/php.latte/test/unit/src/org/netbeans/modules/php/latte/actions/ToggleBlockCommentActionTest.java
@@ -22,7 +22,6 @@
import javax.swing.Action;
import javax.swing.JEditorPane;
import javax.swing.text.Caret;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.editor.BaseDocument;
import org.openide.filesystems.FileObject;
diff --git a/php/php.latte/test/unit/src/org/netbeans/modules/php/latte/indent/LatteIndenterTestBase.java b/php/php.latte/test/unit/src/org/netbeans/modules/php/latte/indent/LatteIndenterTestBase.java
index 4e4eaba..e851988 100644
--- a/php/php.latte/test/unit/src/org/netbeans/modules/php/latte/indent/LatteIndenterTestBase.java
+++ b/php/php.latte/test/unit/src/org/netbeans/modules/php/latte/indent/LatteIndenterTestBase.java
@@ -21,8 +21,6 @@
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import javax.swing.text.Document;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.fail;
import org.netbeans.api.editor.mimelookup.MimePath;
import org.netbeans.api.editor.mimelookup.test.MockMimeLookup;
import org.netbeans.api.html.lexer.HTMLTokenId;
diff --git a/php/php.project/test/unit/src/org/netbeans/modules/php/project/util/TestUtils.java b/php/php.project/test/unit/src/org/netbeans/modules/php/project/util/TestUtils.java
index 3ddc85c..5297847 100644
--- a/php/php.project/test/unit/src/org/netbeans/modules/php/project/util/TestUtils.java
+++ b/php/php.project/test/unit/src/org/netbeans/modules/php/project/util/TestUtils.java
@@ -26,7 +26,7 @@
import java.util.concurrent.Callable;
import java.util.logging.Level;
import java.util.logging.Logger;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.netbeans.api.project.Project;
import org.netbeans.api.project.ProjectManager;
import org.netbeans.modules.php.api.PhpVersion;
diff --git a/php/php.twig/test/unit/src/org/netbeans/modules/php/twig/editor/embedding/TwigHtmlEmbeddingProviderTest.java b/php/php.twig/test/unit/src/org/netbeans/modules/php/twig/editor/embedding/TwigHtmlEmbeddingProviderTest.java
index 92f6093..2da4f74 100644
--- a/php/php.twig/test/unit/src/org/netbeans/modules/php/twig/editor/embedding/TwigHtmlEmbeddingProviderTest.java
+++ b/php/php.twig/test/unit/src/org/netbeans/modules/php/twig/editor/embedding/TwigHtmlEmbeddingProviderTest.java
@@ -19,7 +19,6 @@
package org.netbeans.modules.php.twig.editor.embedding;
import java.util.List;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.modules.parsing.api.Embedding;
import org.netbeans.modules.parsing.api.Source;
import org.netbeans.modules.parsing.spi.EmbeddingProvider;
diff --git a/php/php.twig/test/unit/src/org/netbeans/modules/php/twig/editor/format/TwigIndenterTestBase.java b/php/php.twig/test/unit/src/org/netbeans/modules/php/twig/editor/format/TwigIndenterTestBase.java
index 9eee8c3..2c8f1f4 100644
--- a/php/php.twig/test/unit/src/org/netbeans/modules/php/twig/editor/format/TwigIndenterTestBase.java
+++ b/php/php.twig/test/unit/src/org/netbeans/modules/php/twig/editor/format/TwigIndenterTestBase.java
@@ -19,8 +19,6 @@
package org.netbeans.modules.php.twig.editor.format;
import javax.swing.text.Document;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.fail;
import org.netbeans.api.editor.mimelookup.MimePath;
import org.netbeans.api.editor.mimelookup.test.MockMimeLookup;
import org.netbeans.api.html.lexer.HTMLTokenId;
diff --git a/php/php.zend2/test/unit/src/org/netbeans/modules/php/zend2/util/Zend2UtilsTest.java b/php/php.zend2/test/unit/src/org/netbeans/modules/php/zend2/util/Zend2UtilsTest.java
index 534e8ab..a43de4f 100644
--- a/php/php.zend2/test/unit/src/org/netbeans/modules/php/zend2/util/Zend2UtilsTest.java
+++ b/php/php.zend2/test/unit/src/org/netbeans/modules/php/zend2/util/Zend2UtilsTest.java
@@ -19,9 +19,6 @@
package org.netbeans.modules.php.zend2.util;
import java.io.File;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.junit.NbTestCase;
import org.netbeans.modules.php.api.editor.PhpClass;
import org.openide.filesystems.FileObject;
diff --git a/platform/autoupdate.services/test/unit/src/org/netbeans/api/autoupdate/IDEInitializer.java b/platform/autoupdate.services/test/unit/src/org/netbeans/api/autoupdate/IDEInitializer.java
index 91847cc..9b327e2 100644
--- a/platform/autoupdate.services/test/unit/src/org/netbeans/api/autoupdate/IDEInitializer.java
+++ b/platform/autoupdate.services/test/unit/src/org/netbeans/api/autoupdate/IDEInitializer.java
@@ -26,7 +26,7 @@
import java.net.URLStreamHandler;
import java.net.URLStreamHandlerFactory;
import java.util.Enumeration;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.netbeans.junit.Manager;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileStateInvalidException;
diff --git a/platform/autoupdate.ui/test/unit/src/org/netbeans/modules/autoupdate/ui/MockUpdateProvider.java b/platform/autoupdate.ui/test/unit/src/org/netbeans/modules/autoupdate/ui/MockUpdateProvider.java
index a2b2a55..1695dbd 100644
--- a/platform/autoupdate.ui/test/unit/src/org/netbeans/modules/autoupdate/ui/MockUpdateProvider.java
+++ b/platform/autoupdate.ui/test/unit/src/org/netbeans/modules/autoupdate/ui/MockUpdateProvider.java
@@ -21,7 +21,7 @@
import java.io.IOException;
import java.util.Map;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.netbeans.api.autoupdate.UpdateUnitProvider.CATEGORY;
import org.netbeans.spi.autoupdate.UpdateItem;
import org.netbeans.spi.autoupdate.UpdateProvider;
diff --git a/platform/core.netigso/test/unit/src/org/netbeans/core/netigso/NetigsoDuplicatedClassForNameTest.java b/platform/core.netigso/test/unit/src/org/netbeans/core/netigso/NetigsoDuplicatedClassForNameTest.java
index f787e46..4662b28 100644
--- a/platform/core.netigso/test/unit/src/org/netbeans/core/netigso/NetigsoDuplicatedClassForNameTest.java
+++ b/platform/core.netigso/test/unit/src/org/netbeans/core/netigso/NetigsoDuplicatedClassForNameTest.java
@@ -24,7 +24,6 @@
import java.util.Arrays;
import java.util.HashSet;
import java.util.Locale;
-import static junit.framework.Assert.assertEquals;
import org.netbeans.MockEvents;
import org.netbeans.MockModuleInstaller;
import org.netbeans.Module;
diff --git a/platform/core.netigso/test/unit/src/org/netbeans/core/netigso/NetigsoUtil.java b/platform/core.netigso/test/unit/src/org/netbeans/core/netigso/NetigsoUtil.java
index e9eaca5..1eb4d08 100644
--- a/platform/core.netigso/test/unit/src/org/netbeans/core/netigso/NetigsoUtil.java
+++ b/platform/core.netigso/test/unit/src/org/netbeans/core/netigso/NetigsoUtil.java
@@ -19,8 +19,7 @@
package org.netbeans.core.netigso;
import java.lang.reflect.Method;
-import java.util.regex.Pattern;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.netbeans.Module;
import org.netbeans.ModuleManager;
import org.osgi.framework.Bundle;
diff --git a/platform/core.osgi/test/unit/src/org/netbeans/core/osgi/OSGiProcess.java b/platform/core.osgi/test/unit/src/org/netbeans/core/osgi/OSGiProcess.java
index 4c29efd..289208d 100644
--- a/platform/core.osgi/test/unit/src/org/netbeans/core/osgi/OSGiProcess.java
+++ b/platform/core.osgi/test/unit/src/org/netbeans/core/osgi/OSGiProcess.java
@@ -33,7 +33,6 @@
import java.util.ServiceLoader;
import java.util.Set;
import java.util.jar.JarFile;
-import static junit.framework.Assert.*;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.FileSet;
import org.apache.tools.ant.types.resources.FileResource;
@@ -48,6 +47,8 @@
import org.osgi.framework.launch.Framework;
import org.osgi.framework.launch.FrameworkFactory;
+import static org.junit.Assert.assertTrue;
+
class OSGiProcess {
private static final File platformDir = new File(System.getProperty("platform.dir"));
diff --git a/platform/core.startup/test/unit/src/org/netbeans/core/startup/CountingSecurityManager.java b/platform/core.startup/test/unit/src/org/netbeans/core/startup/CountingSecurityManager.java
index aef32d3..fd6ac88 100644
--- a/platform/core.startup/test/unit/src/org/netbeans/core/startup/CountingSecurityManager.java
+++ b/platform/core.startup/test/unit/src/org/netbeans/core/startup/CountingSecurityManager.java
@@ -23,7 +23,7 @@
import java.io.PrintWriter;
import java.io.StringWriter;
import java.security.Permission;
-import junit.framework.Assert;
+import org.junit.Assert;
/**
*
diff --git a/platform/core.startup/test/unit/src/org/netbeans/core/startup/IsDirCntSecurityManager.java b/platform/core.startup/test/unit/src/org/netbeans/core/startup/IsDirCntSecurityManager.java
index 31efa72..12a02eb 100644
--- a/platform/core.startup/test/unit/src/org/netbeans/core/startup/IsDirCntSecurityManager.java
+++ b/platform/core.startup/test/unit/src/org/netbeans/core/startup/IsDirCntSecurityManager.java
@@ -19,7 +19,7 @@
package org.netbeans.core.startup;
import java.security.Permission;
-import junit.framework.Assert;
+import org.junit.Assert;
/**
* Counts the number of File.isDirectory() calls.
diff --git a/platform/core.startup/test/unit/src/org/netbeans/core/startup/UpdateAllResourcesTest.java b/platform/core.startup/test/unit/src/org/netbeans/core/startup/UpdateAllResourcesTest.java
index aea47db..a38a3ab 100644
--- a/platform/core.startup/test/unit/src/org/netbeans/core/startup/UpdateAllResourcesTest.java
+++ b/platform/core.startup/test/unit/src/org/netbeans/core/startup/UpdateAllResourcesTest.java
@@ -21,7 +21,6 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.JarClassLoader;
import org.netbeans.Stamps;
import org.netbeans.junit.NbTestCase;
diff --git a/platform/core.startup/test/unit/src/org/netbeans/core/startup/layers/CountingSecurityManager.java b/platform/core.startup/test/unit/src/org/netbeans/core/startup/layers/CountingSecurityManager.java
index 007e982..67de8f6 100644
--- a/platform/core.startup/test/unit/src/org/netbeans/core/startup/layers/CountingSecurityManager.java
+++ b/platform/core.startup/test/unit/src/org/netbeans/core/startup/layers/CountingSecurityManager.java
@@ -37,7 +37,7 @@
import java.util.concurrent.Callable;
import java.util.logging.Level;
import java.util.logging.Logger;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.netbeans.core.startup.InstalledFileLocatorImpl;
import org.openide.modules.Places;
import org.openide.util.Exceptions;
diff --git a/platform/core.windows/test/unit/src/org/netbeans/core/windows/IDEInitializer.java b/platform/core.windows/test/unit/src/org/netbeans/core/windows/IDEInitializer.java
index e5a0871..dfb49bb 100644
--- a/platform/core.windows/test/unit/src/org/netbeans/core/windows/IDEInitializer.java
+++ b/platform/core.windows/test/unit/src/org/netbeans/core/windows/IDEInitializer.java
@@ -19,25 +19,9 @@
package org.netbeans.core.windows;
-import java.beans.PropertyVetoException;
-import java.io.File;
-import java.io.IOException;
import java.net.URL;
-import java.net.URLStreamHandler;
-import java.net.URLStreamHandlerFactory;
-import java.util.Enumeration;
-import junit.framework.Assert;
import org.netbeans.core.startup.MainLookup;
-import org.netbeans.junit.Manager;
-import org.openide.filesystems.FileObject;
-import org.openide.filesystems.FileSystem;
-import org.openide.filesystems.FileUtil;
-import org.openide.filesystems.MultiFileSystem;
-import org.openide.filesystems.Repository;
import org.openide.filesystems.XMLFileSystem;
-import org.openide.util.Lookup;
-import org.openide.util.lookup.Lookups;
-import org.openide.util.lookup.ProxyLookup;
/**
diff --git a/platform/editor.mimelookup.impl/test/unit/src/org/netbeans/modules/editor/mimelookup/impl/EditorTestLookup.java b/platform/editor.mimelookup.impl/test/unit/src/org/netbeans/modules/editor/mimelookup/impl/EditorTestLookup.java
index 66c1733..7b19c15 100644
--- a/platform/editor.mimelookup.impl/test/unit/src/org/netbeans/modules/editor/mimelookup/impl/EditorTestLookup.java
+++ b/platform/editor.mimelookup.impl/test/unit/src/org/netbeans/modules/editor/mimelookup/impl/EditorTestLookup.java
@@ -25,7 +25,7 @@
import java.io.IOException;
import java.net.URL;
import java.util.Set;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileSystem;
import org.openide.filesystems.LocalFileSystem;
diff --git a/platform/editor.mimelookup/test/unit/src/org/netbeans/modules/editor/mimelookup/EditorTestLookup.java b/platform/editor.mimelookup/test/unit/src/org/netbeans/modules/editor/mimelookup/EditorTestLookup.java
index 6c70c0c..c8283cd 100644
--- a/platform/editor.mimelookup/test/unit/src/org/netbeans/modules/editor/mimelookup/EditorTestLookup.java
+++ b/platform/editor.mimelookup/test/unit/src/org/netbeans/modules/editor/mimelookup/EditorTestLookup.java
@@ -25,7 +25,7 @@
import java.io.IOException;
import java.net.URL;
import java.util.Set;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileSystem;
import org.openide.filesystems.LocalFileSystem;
diff --git a/platform/masterfs/test/unit/src/org/netbeans/modules/masterfs/filebasedfs/RecursiveValidityTest.java b/platform/masterfs/test/unit/src/org/netbeans/modules/masterfs/filebasedfs/RecursiveValidityTest.java
index 6363956..e8f70bc 100644
--- a/platform/masterfs/test/unit/src/org/netbeans/modules/masterfs/filebasedfs/RecursiveValidityTest.java
+++ b/platform/masterfs/test/unit/src/org/netbeans/modules/masterfs/filebasedfs/RecursiveValidityTest.java
@@ -18,15 +18,10 @@
*/
package org.netbeans.modules.masterfs.filebasedfs;
-import java.awt.Image;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Set;
-import java.util.logging.Level;
-import javax.swing.Action;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.junit.MockServices;
import org.netbeans.junit.NbTestCase;
import org.netbeans.modules.masterfs.providers.BaseAnnotationProvider;
diff --git a/platform/masterfs/test/unit/src/org/netbeans/modules/masterfs/filebasedfs/fileobjects/TestUtils.java b/platform/masterfs/test/unit/src/org/netbeans/modules/masterfs/filebasedfs/fileobjects/TestUtils.java
index b1ea691..720c93f 100644
--- a/platform/masterfs/test/unit/src/org/netbeans/modules/masterfs/filebasedfs/fileobjects/TestUtils.java
+++ b/platform/masterfs/test/unit/src/org/netbeans/modules/masterfs/filebasedfs/fileobjects/TestUtils.java
@@ -25,8 +25,8 @@
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
-import junit.framework.Assert;
import junit.framework.AssertionFailedError;
+import org.junit.Assert;
import org.netbeans.junit.NbTestCase;
import org.netbeans.modules.masterfs.watcher.Watcher;
import org.openide.filesystems.FileObject;
diff --git a/platform/masterfs/test/unit/src/org/netbeans/modules/masterfs/filebasedfs/utils/FileChangedManagerDeadlockTest.java b/platform/masterfs/test/unit/src/org/netbeans/modules/masterfs/filebasedfs/utils/FileChangedManagerDeadlockTest.java
index 3a0dc67..21a62d1 100644
--- a/platform/masterfs/test/unit/src/org/netbeans/modules/masterfs/filebasedfs/utils/FileChangedManagerDeadlockTest.java
+++ b/platform/masterfs/test/unit/src/org/netbeans/modules/masterfs/filebasedfs/utils/FileChangedManagerDeadlockTest.java
@@ -23,7 +23,6 @@
import java.util.concurrent.Callable;
import java.util.concurrent.Semaphore;
import java.util.concurrent.atomic.AtomicBoolean;
-import static junit.framework.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
import org.netbeans.junit.MockServices;
@@ -33,6 +32,8 @@
import org.openide.util.Exceptions;
import org.openide.util.Lookup;
+import static org.junit.Assert.assertTrue;
+
/**
*
* @author jhavlin
diff --git a/platform/netbinox/nbproject/project.properties b/platform/netbinox/nbproject/project.properties
index dfa06c9..dc24e53 100644
--- a/platform/netbinox/nbproject/project.properties
+++ b/platform/netbinox/nbproject/project.properties
@@ -17,7 +17,7 @@
is.autoload=true
release.external/org.eclipse.osgi_3.9.1.nb9.jar=modules/ext/org.eclipse.osgi_3.9.1.nb9.jar
-javac.source=1.6
+javac.source=1.8
javac.target=1.8
javac.compilerargs=-Xlint -Xlint:-serial
diff --git a/platform/netbinox/nbproject/project.xml b/platform/netbinox/nbproject/project.xml
index e123c78..da9a30a 100644
--- a/platform/netbinox/nbproject/project.xml
+++ b/platform/netbinox/nbproject/project.xml
@@ -92,6 +92,11 @@
<recursive/>
<compile-dependency/>
</test-dependency>
+ <test-dependency>
+ <code-name-base>org.openide.util.ui</code-name-base>
+ <compile-dependency/>
+ <test/>
+ </test-dependency>
</test-type>
</test-dependencies>
<public-packages>
diff --git a/platform/netbinox/src/org/netbeans/modules/netbinox/JarBundleFile.java b/platform/netbinox/src/org/netbeans/modules/netbinox/JarBundleFile.java
index eb916cc..077ccf2 100644
--- a/platform/netbinox/src/org/netbeans/modules/netbinox/JarBundleFile.java
+++ b/platform/netbinox/src/org/netbeans/modules/netbinox/JarBundleFile.java
@@ -30,17 +30,21 @@
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.jar.Attributes.Name;
+import java.util.jar.Manifest;
import java.util.logging.Level;
import org.eclipse.osgi.baseadaptor.BaseData;
import org.eclipse.osgi.baseadaptor.bundlefile.BundleEntry;
import org.eclipse.osgi.baseadaptor.bundlefile.BundleFile;
import org.eclipse.osgi.baseadaptor.bundlefile.DirBundleFile;
-import org.eclipse.osgi.baseadaptor.bundlefile.DirZipBundleEntry;
import org.eclipse.osgi.baseadaptor.bundlefile.MRUBundleFileList;
import org.eclipse.osgi.baseadaptor.bundlefile.ZipBundleFile;
import org.netbeans.core.netigso.spi.BundleContent;
import org.netbeans.core.netigso.spi.NetigsoArchive;
import org.openide.modules.ModuleInfo;
+import org.openide.util.Exceptions;
import org.openide.util.Lookup;
/** This is fake bundle. It is created by the Netbinox infrastructure to
@@ -49,14 +53,36 @@
* @author Jaroslav Tulach <jtulach@netbeans.org>
*/
final class JarBundleFile extends BundleFile implements BundleContent {
- private BundleFile delegate;
-
+ //
+ // When making changes to this file, check if
+ // platform/o.n.bootstrap/src/org/netbeans/JarClassLoader.java (JarClassLoader/JarSource)
+ // should also be adjusted. At least the multi-release handling is similar.
+ //
+ private static final String META_INF = "META-INF/";
+ private static final Name MULTI_RELEASE = new Name("Multi-Release");
+ private static final int BASE_VERSION = 8;
+ private static final int RUNTIME_VERSION;
private static Map<Long,File> usedIds;
+ static {
+ int version;
+ try {
+ Object runtimeVersion = Runtime.class.getMethod("version").invoke(null);
+ version = (int) runtimeVersion.getClass().getMethod("major").invoke(runtimeVersion);
+ } catch (ReflectiveOperationException ex) {
+ version = BASE_VERSION;
+ }
+ RUNTIME_VERSION = version;
+ }
+
+ private BundleFile delegate;
+
private final MRUBundleFileList mru;
private final BaseData data;
private final NetigsoArchive archive;
-
+ private int[] versions;
+ private Boolean isMultiRelease;
+
JarBundleFile(
File base, BaseData data, NetigsoArchive archive,
MRUBundleFileList mru, boolean isBase
@@ -171,6 +197,18 @@
@Override
public File getFile(String file, boolean bln) {
+ if (((! file.startsWith(META_INF)) ) && isMultiRelease()) {
+ for (int version : getVersions()) {
+ File f = getFile0("META-INF/versions/" + version + "/" + file, bln);
+ if (f != null) {
+ return f;
+ }
+ }
+ }
+ return getFile0(file, bln);
+ }
+
+ private File getFile0(String file, boolean bln) {
byte[] exists = getCachedEntry(file);
if (exists == null) {
return null;
@@ -181,6 +219,18 @@
@Override
public byte[] resource(String name) throws IOException {
+ if ((! name.startsWith(META_INF)) && isMultiRelease()) {
+ for (int version : getVersions()) {
+ byte[] b = resource0("META-INF/versions/" + version + "/" + name);
+ if (b != null) {
+ return b;
+ }
+ }
+ }
+ return resource0(name);
+ }
+
+ private byte[] resource0(String name) throws IOException {
BundleEntry u = findEntry("resource", name);
if (u == null) {
return null;
@@ -262,6 +312,18 @@
@Override
public BundleEntry getEntry(final String name) {
+ if ((! name.startsWith(META_INF)) && isMultiRelease()) {
+ for (int version : getVersions()) {
+ BundleEntry be = getEntry0("META-INF/versions/" + version + "/" + name);
+ if(be != null) {
+ return be;
+ }
+ }
+ }
+ return getEntry0(name);
+ }
+
+ private BundleEntry getEntry0(final String name) {
if (!archive.isActive()) {
return delegate("inactive", name).getEntry(name); // NOI18N
}
@@ -351,4 +413,50 @@
return findEntry("getFileURL", name).getFileURL(); // NOI18N
}
}
+
+ /**
+ * @return versions for which a {@code META-INF/versions/NUMBER} entry exists.
+ * The order is from largest version to lowest. Only versions supported by
+ * the runtime VM are reported.
+ */
+ private int[] getVersions() {
+ if (versions != null) {
+ return versions;
+ }
+
+ Set<Integer> vers = new TreeSet<>(Collections.reverseOrder());
+ for(int i = BASE_VERSION; i <= RUNTIME_VERSION; i++) {
+ String directory = "META-INF/versions/" + i;
+ BundleEntry be = delegate("getVersions", directory).getEntry(directory);
+ if (be != null) {
+ vers.add(i);
+ }
+ }
+ int[] ret = new int[vers.size()];
+ int i = 0;
+ for (Integer ver : vers) {
+ ret[i++] = ver;
+ }
+ versions = ret;
+ return versions;
+ }
+
+ private boolean isMultiRelease() {
+ if(isMultiRelease != null) {
+ return isMultiRelease;
+ }
+ BundleEntry be = delegate("isMultiRelease", "META-INF/MANIFEST.MF").getEntry("META-INF/MANIFEST.MF");
+ if(be == null) {
+ isMultiRelease = false;
+ } else {
+ try {
+ Manifest manifest = new Manifest(be.getInputStream());
+ isMultiRelease = Boolean.valueOf(manifest.getMainAttributes().getValue(MULTI_RELEASE));
+ } catch (IOException ex) {
+ Exceptions.printStackTrace(ex);
+ }
+
+ }
+ return isMultiRelease;
+ }
}
diff --git a/platform/netbinox/src/org/netbeans/modules/netbinox/NetbinoxLoader.java b/platform/netbinox/src/org/netbeans/modules/netbinox/NetbinoxLoader.java
index bfeefde..34c0fae 100644
--- a/platform/netbinox/src/org/netbeans/modules/netbinox/NetbinoxLoader.java
+++ b/platform/netbinox/src/org/netbeans/modules/netbinox/NetbinoxLoader.java
@@ -20,8 +20,6 @@
import java.io.File;
import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
import java.net.URI;
import java.net.URISyntaxException;
import java.security.ProtectionDomain;
@@ -34,7 +32,6 @@
import org.eclipse.osgi.baseadaptor.loader.ClasspathManager;
import org.eclipse.osgi.framework.adaptor.ClassLoaderDelegate;
import org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader;
-import org.openide.util.Exceptions;
import org.osgi.framework.FrameworkEvent;
/** Classloader that eliminates some unnecessary disk touches.
diff --git a/platform/netbinox/test/unit/src/org/netbeans/modules/netbinox/CountingSecurityManager.java b/platform/netbinox/test/unit/src/org/netbeans/modules/netbinox/CountingSecurityManager.java
index b73f929..ca5d0d7 100644
--- a/platform/netbinox/test/unit/src/org/netbeans/modules/netbinox/CountingSecurityManager.java
+++ b/platform/netbinox/test/unit/src/org/netbeans/modules/netbinox/CountingSecurityManager.java
@@ -35,7 +35,7 @@
import java.util.concurrent.Callable;
import java.util.logging.Level;
import java.util.logging.Logger;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.openide.modules.Places;
import org.openide.util.Utilities;
diff --git a/platform/netbinox/test/unit/src/org/netbeans/modules/netbinox/NetbinoxDuplicatedBuddyForNameTest.java b/platform/netbinox/test/unit/src/org/netbeans/modules/netbinox/NetbinoxDuplicatedBuddyForNameTest.java
index 81f5df8..37a1cb6 100644
--- a/platform/netbinox/test/unit/src/org/netbeans/modules/netbinox/NetbinoxDuplicatedBuddyForNameTest.java
+++ b/platform/netbinox/test/unit/src/org/netbeans/modules/netbinox/NetbinoxDuplicatedBuddyForNameTest.java
@@ -19,18 +19,13 @@
package org.netbeans.modules.netbinox;
import java.io.File;
-import java.io.IOException;
-import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Locale;
-import static junit.framework.Assert.assertEquals;
import org.netbeans.MockEvents;
import org.netbeans.MockModuleInstaller;
import org.netbeans.Module;
import org.netbeans.ModuleManager;
-import org.netbeans.SetupHid;
-import static org.netbeans.SetupHid.createTestJAR;
/**
*
diff --git a/platform/netbinox/test/unit/src/org/netbeans/modules/netbinox/NetbinoxDuplicatedClassForNameTest.java b/platform/netbinox/test/unit/src/org/netbeans/modules/netbinox/NetbinoxDuplicatedClassForNameTest.java
index 8dcbdae..25f7f0d 100644
--- a/platform/netbinox/test/unit/src/org/netbeans/modules/netbinox/NetbinoxDuplicatedClassForNameTest.java
+++ b/platform/netbinox/test/unit/src/org/netbeans/modules/netbinox/NetbinoxDuplicatedClassForNameTest.java
@@ -19,18 +19,13 @@
package org.netbeans.modules.netbinox;
import java.io.File;
-import java.io.IOException;
-import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Locale;
-import static junit.framework.Assert.assertEquals;
import org.netbeans.MockEvents;
import org.netbeans.MockModuleInstaller;
import org.netbeans.Module;
import org.netbeans.ModuleManager;
-import org.netbeans.SetupHid;
-import static org.netbeans.SetupHid.createTestJAR;
/**
*
diff --git a/platform/netbinox/test/unit/src/org/netbeans/modules/netbinox/NetbinoxMultiversionJarTest.java b/platform/netbinox/test/unit/src/org/netbeans/modules/netbinox/NetbinoxMultiversionJarTest.java
new file mode 100644
index 0000000..f186ea4
--- /dev/null
+++ b/platform/netbinox/test/unit/src/org/netbeans/modules/netbinox/NetbinoxMultiversionJarTest.java
@@ -0,0 +1,175 @@
+/*
+ * 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.netbeans.modules.netbinox;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.lang.reflect.Method;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.ToolProvider;
+import org.netbeans.MockEvents;
+import org.netbeans.MockModuleInstaller;
+import org.netbeans.ModuleManager;
+import org.openide.util.test.TestFileUtils;
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+import static junit.framework.TestCase.assertEquals;
+
+public class NetbinoxMultiversionJarTest extends NetigsoHid {
+
+ public NetbinoxMultiversionJarTest(String name) {
+ super(name);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ Locale.setDefault(new Locale("te", "ST"));
+ clearWorkDir();
+ File ud = new File(getWorkDir(), "ud");
+ ud.mkdirs();
+ System.setProperty("netbeans.user", ud.getPath());
+
+ data = new File(getDataDir(), "jars");
+ jars = new File(getWorkDir(), "space in path");
+ jars.mkdirs();
+
+ File classes = new File(getWorkDir(), "classes");
+ classes.mkdirs();
+ ToolProvider.getSystemJavaCompiler()
+ .getTask(null, null, d -> {
+ throw new IllegalStateException(d.toString());
+ }, Arrays.asList("-d", classes.getAbsolutePath()), null,
+ Arrays.asList(new SourceFileObject("test/Impl.java", "package test; public class Impl { public static String get() { return \"base\"; } }"),
+ new SourceFileObject("api/API.java", "package api; public class API { public static String run() { return test.Impl.get(); } }")))
+ .call();
+ File classes9 = new File(new File(new File(classes, "META-INF"), "versions"), "9");
+ classes9.mkdirs();
+ ToolProvider.getSystemJavaCompiler()
+ .getTask(null, null, d -> {
+ throw new IllegalStateException(d.toString());
+ }, Arrays.asList("-d", classes9.getAbsolutePath(), "-classpath", classes.getAbsolutePath()), null,
+ Arrays.asList(new SourceFileObject("test/Impl.java", "package test; public class Impl { public static String get() { return \"9\"; } }")))
+ .call();
+ Map<String, byte[]> jarContent = new LinkedHashMap<>();
+ String manifest
+ = "Manifest-Version: 1.0\n"
+ + "Bundle-SymbolicName: test.module\n"
+ + "Bundle-Version: 1.0\n"
+ + "Multi-Release: true\n"
+ + "";
+ jarContent.put("META-INF/MANIFEST.MF", manifest.getBytes(UTF_8));
+ Path classesPath = classes.toPath();
+ Files.walk(classesPath)
+ .filter(p -> Files.isRegularFile(p))
+ .forEach(p -> {
+ try {
+ jarContent.put(classesPath.relativize(p).toString(), TestFileUtils.readFileBin(p.toFile()));
+ } catch (IOException ex) {
+ throw new IllegalStateException(ex);
+ }
+ });
+ jarContent.put("test/dummy.txt", "base".getBytes(UTF_8));
+ jarContent.put("META-INF/versions/9/test/dummy.txt", "9".getBytes(UTF_8));
+ simpleModule = new File(jars, "multi-release.jar");
+ try ( OutputStream out = new FileOutputStream(simpleModule)) {
+ TestFileUtils.writeZipFile(out, jarContent);
+ }
+ }
+
+ public void testMultiReleaseJar() throws Exception {
+ MockModuleInstaller installer = new MockModuleInstaller();
+ MockEvents ev = new MockEvents();
+ ModuleManager mgr = new ModuleManager(installer, ev);
+ mgr.mutexPrivileged().enterWriteAccess();
+ Set<org.netbeans.Module> all = null;
+ try {
+ org.netbeans.Module m1 = mgr.create(simpleModule, null, false, false, false);
+ all = Collections.singleton(m1);
+
+ mgr.enable(all);
+
+ // Check multi release class loading
+ Class<?> impl = m1.getClassLoader().loadClass("test.Impl");
+ Method get = impl.getMethod("get");
+ String output = (String) get.invoke(null);
+
+ String expected;
+ try {
+ Class.forName("java.lang.Runtime$Version");
+ expected = "9";
+ } catch (ClassNotFoundException ex) {
+ expected = "base";
+ }
+ assertEquals(expected, output);
+
+ // Check multi release resource loading
+ try(InputStream is = m1.getClassLoader().getResourceAsStream("test/dummy.txt")) {
+ assertEquals(expected, loadUTF8(is));
+ }
+
+ } finally {
+ if (all != null) {
+ mgr.disable(all);
+ }
+ mgr.mutexPrivileged().exitWriteAccess();
+ }
+
+ }
+
+ private static String loadUTF8(InputStream is) throws IOException {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ byte[] buffer = new byte[2048];
+ int read;
+ while ((read = is.read(buffer)) > 0) {
+ baos.write(buffer, 0, read);
+ }
+ return baos.toString("UTF-8");
+ }
+
+ private static final class SourceFileObject extends SimpleJavaFileObject {
+
+ private final String content;
+
+ public SourceFileObject(String path, String content) throws URISyntaxException {
+ super(new URI("mem://" + path), JavaFileObject.Kind.SOURCE);
+ this.content = content;
+ }
+
+ @Override
+ public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
+ return content;
+ }
+
+ }
+}
diff --git a/platform/o.n.bootstrap/src/org/netbeans/JarClassLoader.java b/platform/o.n.bootstrap/src/org/netbeans/JarClassLoader.java
index 33a1399..7a238bc 100644
--- a/platform/o.n.bootstrap/src/org/netbeans/JarClassLoader.java
+++ b/platform/o.n.bootstrap/src/org/netbeans/JarClassLoader.java
@@ -30,6 +30,7 @@
import java.lang.instrument.IllegalClassFormatException;
import java.lang.ref.Reference;
import java.lang.ref.SoftReference;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.JarURLConnection;
import java.net.MalformedURLException;
@@ -53,12 +54,14 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.TreeSet;
import java.util.Vector;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;
import java.util.jar.Attributes;
+import java.util.jar.Attributes.Name;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
@@ -76,7 +79,29 @@
* @author Petr Nejedly
*/
public class JarClassLoader extends ProxyClassLoader {
+ //
+ // When making changes to this file, check if
+ // platform/netbinox/src/org/netbeans/modules/netbinox/JarBundleFile.java
+ // should also be adjusted. At least the multi-release handling is similar.
+ //
+
private static Stamps cache;
+ private static final String META_INF = "META-INF/";
+ private static final Name MULTI_RELEASE = new Name("Multi-Release");
+ private static final int BASE_VERSION = 8;
+ private static final int RUNTIME_VERSION;
+
+ static {
+ int version;
+ try {
+ Object runtimeVersion = Runtime.class.getMethod("version").invoke(null);
+ version = (int) runtimeVersion.getClass().getMethod("major").invoke(runtimeVersion);
+ } catch (ReflectiveOperationException ex) {
+ version = BASE_VERSION;
+ }
+ RUNTIME_VERSION = version;
+ }
+
static Archive archive = new Archive();
static void initializeCache() {
@@ -272,6 +297,7 @@
}
}
Manifest man = new DelayedManifest();
+
try {
definePackage(pkgName, man, src.getURL());
} catch (IllegalArgumentException x) {
@@ -336,6 +362,7 @@
private ProtectionDomain pd;
protected JarClassLoader jcl;
private static Map<String,Source> sources = new HashMap<String, Source>();
+ private Boolean multiRelease;
public Source(URL url) {
this.url = url;
@@ -412,6 +439,23 @@
return url.toString();
}
+ protected boolean isMultiRelease() {
+ Manifest man = getManifest();
+ if(man == null) {
+ return false;
+ }
+ if(multiRelease != null) {
+ return multiRelease;
+ }
+ if (man.getMainAttributes().containsKey(MULTI_RELEASE)) {
+ String multiReleaseString = (String) man.getMainAttributes().get(MULTI_RELEASE);
+ multiRelease = Boolean.valueOf(multiReleaseString);
+ } else {
+ multiRelease = false;
+ }
+ return multiRelease;
+ }
+
}
static void dumpFiles(File f, int retry) {
@@ -442,6 +486,7 @@
private boolean dead;
private int requests;
private int used;
+ private volatile int[] versions;
private volatile Reference<Manifest> manifest;
/** #141110: expensive to repeatedly look for them */
private final Set<String> nonexistentResources = Collections.synchronizedSet(new HashSet<String>());
@@ -574,13 +619,56 @@
@Override
protected byte[] readClass(String path) throws IOException {
try {
+ if ((! path.startsWith(META_INF)) && isMultiRelease() && RUNTIME_VERSION > BASE_VERSION) {
+ int[] vers = getVersions();
+ for (int version: vers) {
+ byte[] data = archive.getData(this, "META-INF/versions/" + version + "/" + path);
+ if (data != null) {
+ return data;
+ }
+ }
+ }
return archive.getData(this, path);
} catch (ZipException ex) {
dumpFiles(file, -1);
throw ex;
}
}
-
+
+ /**
+ * @return versions for which a {@code META-INF/versions/NUMBER} entry exists.
+ * The order is from largest version to lowest. Only versions supported by
+ * the runtime VM are reported.
+ */
+ private int[] getVersions() {
+ if (versions != null) {
+ return versions;
+ }
+ try {
+ Set<Integer> vers = new TreeSet<>(Collections.reverseOrder());
+ for(int i = BASE_VERSION; i <= RUNTIME_VERSION; i++) {
+ String directory = "META-INF/versions/" + i;
+ byte[] data = archive.getData(this, directory);
+ if (data != null && data.length == 0) {
+ vers.add(i);
+ }
+ }
+ int[] ret = new int[vers.size()];
+ int i = 0;
+ for (Integer ver : vers) {
+ ret[i++] = ver;
+ }
+ versions = ret;
+ return ret;
+ } catch (IOException ioe) {
+ if (warnedFiles.add(file)) {
+ LOGGER.log(Level.WARNING, "problems with " + file, ioe);
+ dumpFiles(file, -1);
+ }
+ }
+ return new int[0];
+ }
+
@Override
public byte[] resource(String path) throws IOException {
if (nonexistentResources.contains(path)) {
diff --git a/platform/o.n.bootstrap/test/unit/src/org/netbeans/JarClassLoaderTest.java b/platform/o.n.bootstrap/test/unit/src/org/netbeans/JarClassLoaderTest.java
index 2306cba..cc6e36f 100644
--- a/platform/o.n.bootstrap/test/unit/src/org/netbeans/JarClassLoaderTest.java
+++ b/platform/o.n.bootstrap/test/unit/src/org/netbeans/JarClassLoaderTest.java
@@ -18,15 +18,23 @@
*/
package org.netbeans;
+import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.File;
+import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.OutputStream;
import java.io.Serializable;
+import java.lang.reflect.Method;
import java.net.JarURLConnection;
+import java.net.URI;
+import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLClassLoader;
import java.net.URLConnection;
+import java.nio.file.Files;
+import java.nio.file.Path;
import java.util.Collections;
import java.util.Enumeration;
import java.util.List;
@@ -37,13 +45,19 @@
import java.util.logging.Level;
import java.util.logging.Logger;
import java.security.Permission;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
import java.util.Map;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.ToolProvider;
import junit.framework.AssertionFailedError;
import org.netbeans.junit.NbTestCase;
import org.openide.util.Utilities;
import org.openide.util.lookup.Lookups;
import org.openide.util.test.TestFileUtils;
+import static java.nio.charset.StandardCharsets.UTF_8;
+
/** Tests that cover some basic aspects of a Proxy/JarClassLoader.
*
* @author Petr Nejedly
@@ -414,4 +428,86 @@
public @Override void checkPermission(Permission perm, Object ctx) {}
}
+
+ public void testMultiReleaseJar() throws Exception {
+ clearWorkDir();
+
+ // Prepare multi-release jar file
+ File classes = new File(getWorkDir(), "classes");
+ classes.mkdirs();
+ ToolProvider.getSystemJavaCompiler()
+ .getTask(null, null, d -> { throw new IllegalStateException(d.toString()); }, Arrays.asList("-d", classes.getAbsolutePath()), null,
+ Arrays.asList(new SourceFileObject("test/Impl.java", "package test; public class Impl { public static String get() { return \"base\"; } }"),
+ new SourceFileObject("api/API.java", "package api; public class API { public static String run() { return test.Impl.get(); } }")))
+ .call();
+ File classes9 = new File(new File(new File(classes, "META-INF"), "versions"), "9");
+ classes9.mkdirs();
+ ToolProvider.getSystemJavaCompiler()
+ .getTask(null, null, d -> { throw new IllegalStateException(d.toString()); }, Arrays.asList("-d", classes9.getAbsolutePath(), "-classpath", classes.getAbsolutePath()), null,
+ Arrays.asList(new SourceFileObject("test/Impl.java", "package test; public class Impl { public static String get() { return \"9\"; } }")))
+ .call();
+ Map<String, byte[]> jarContent = new LinkedHashMap<>();
+ jarContent.put("META-INF/MANIFEST.MF", "Manifest-Version: 1.0\nMulti-Release: true\n\n".getBytes());
+ Path classesPath = classes.toPath();
+ Files.walk(classesPath)
+ .filter(p -> Files.isRegularFile(p))
+ .forEach(p -> {
+ try {
+ jarContent.put(classesPath.relativize(p).toString(), TestFileUtils.readFileBin(p.toFile()));
+ } catch (IOException ex) {
+ throw new IllegalStateException(ex);
+ }
+ });
+ jarContent.put("test/dummy.txt", "base".getBytes(UTF_8));
+ jarContent.put("META-INF/versions/9/test/dummy.txt", "9".getBytes(UTF_8));
+ File jar = new File(getWorkDir(), "multi-release.jar");
+ try (OutputStream out = new FileOutputStream(jar)) {
+ TestFileUtils.writeZipFile(out, jarContent);
+ }
+
+ // Check multi release class loading
+ JarClassLoader jcl = new JarClassLoader(Arrays.asList(jar), new ProxyClassLoader[0]);
+ Class<?> api = jcl.loadClass("api.API");
+ Method run = api.getDeclaredMethod("run");
+ String output = (String) run.invoke(null);
+ String expected;
+ try {
+ Class.forName("java.lang.Runtime$Version");
+ expected = "9";
+ } catch (ClassNotFoundException ex) {
+ expected = "base";
+ }
+ assertEquals(expected, output);
+
+ // Check multi release resource loading
+ try(InputStream is = jcl.getResourceAsStream("test/dummy.txt")) {
+ assertEquals(expected, loadUTF8(is));
+ }
+ }
+
+ private static String loadUTF8(InputStream is) throws IOException {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ byte[] buffer = new byte[2048];
+ int read;
+ while ((read = is.read(buffer)) > 0) {
+ baos.write(buffer, 0, read);
+ }
+ return baos.toString("UTF-8");
+ }
+
+ private static final class SourceFileObject extends SimpleJavaFileObject {
+
+ private final String content;
+
+ public SourceFileObject(String path, String content) throws URISyntaxException {
+ super(new URI("mem://" + path), Kind.SOURCE);
+ this.content = content;
+ }
+
+ @Override
+ public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
+ return content;
+ }
+
+ }
}
diff --git a/platform/openide.awt/test/unit/src/org/openide/awt/ActionsInfraHid.java b/platform/openide.awt/test/unit/src/org/openide/awt/ActionsInfraHid.java
index 7aa70dc..80083c0 100644
--- a/platform/openide.awt/test/unit/src/org/openide/awt/ActionsInfraHid.java
+++ b/platform/openide.awt/test/unit/src/org/openide/awt/ActionsInfraHid.java
@@ -23,7 +23,7 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.lang.reflect.InvocationTargetException;
-import junit.framework.Assert;
+import org.junit.Assert;
/** Utilities for actions tests.
* @author Jesse Glick
diff --git a/platform/openide.dialogs/test/unit/src/org/openide/AsynchronousValidatingPanelTest.java b/platform/openide.dialogs/test/unit/src/org/openide/AsynchronousValidatingPanelTest.java
index 2d7de3e..483e0b0 100644
--- a/platform/openide.dialogs/test/unit/src/org/openide/AsynchronousValidatingPanelTest.java
+++ b/platform/openide.dialogs/test/unit/src/org/openide/AsynchronousValidatingPanelTest.java
@@ -24,7 +24,6 @@
import javax.swing.*;
import javax.swing.JLabel;
import javax.swing.event.ChangeListener;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.junit.RandomlyFails;
import org.openide.util.*;
import org.openide.util.HelpCtx;
diff --git a/platform/openide.execution/test/unit/src/org/openide/execution/ExecutionCompatibilityTest.java b/platform/openide.execution/test/unit/src/org/openide/execution/ExecutionCompatibilityTest.java
index a0637e7..dce3055 100644
--- a/platform/openide.execution/test/unit/src/org/openide/execution/ExecutionCompatibilityTest.java
+++ b/platform/openide.execution/test/unit/src/org/openide/execution/ExecutionCompatibilityTest.java
@@ -19,9 +19,9 @@
package org.openide.execution;
-import junit.framework.Assert;
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.junit.Assert;
import org.openide.util.Lookup;
import org.openide.util.lookup.AbstractLookup;
import org.openide.util.lookup.InstanceContent;
diff --git a/platform/openide.filesystems/test/unit/src/org/openide/filesystems/MIMESupportHid.java b/platform/openide.filesystems/test/unit/src/org/openide/filesystems/MIMESupportHid.java
index bac74c3..f13249d 100644
--- a/platform/openide.filesystems/test/unit/src/org/openide/filesystems/MIMESupportHid.java
+++ b/platform/openide.filesystems/test/unit/src/org/openide/filesystems/MIMESupportHid.java
@@ -21,7 +21,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.netbeans.modules.openide.filesystems.declmime.MIMEResolverImpl;
/**
diff --git a/platform/openide.filesystems/test/unit/src/org/openide/filesystems/test/StatFiles.java b/platform/openide.filesystems/test/unit/src/org/openide/filesystems/test/StatFiles.java
index 349601b..715df25 100644
--- a/platform/openide.filesystems/test/unit/src/org/openide/filesystems/test/StatFiles.java
+++ b/platform/openide.filesystems/test/unit/src/org/openide/filesystems/test/StatFiles.java
@@ -26,7 +26,7 @@
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
-import junit.framework.Assert;
+import org.junit.Assert;
/**
*
diff --git a/platform/openide.loaders/test/unit/src/org/openide/loaders/DefaultDataObjectTest.java b/platform/openide.loaders/test/unit/src/org/openide/loaders/DefaultDataObjectTest.java
index c18f07d..05d30ca 100644
--- a/platform/openide.loaders/test/unit/src/org/openide/loaders/DefaultDataObjectTest.java
+++ b/platform/openide.loaders/test/unit/src/org/openide/loaders/DefaultDataObjectTest.java
@@ -31,8 +31,6 @@
import javax.swing.JEditorPane;
import javax.swing.SwingUtilities;
import javax.swing.text.StyledDocument;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.junit.MockServices;
import org.netbeans.junit.NbTestCase;
import org.netbeans.junit.RandomlyFails;
diff --git a/platform/openide.loaders/test/unit/src/org/openide/loaders/XMLDataObjectSubclassTest.java b/platform/openide.loaders/test/unit/src/org/openide/loaders/XMLDataObjectSubclassTest.java
index 9909a89..30ead57 100644
--- a/platform/openide.loaders/test/unit/src/org/openide/loaders/XMLDataObjectSubclassTest.java
+++ b/platform/openide.loaders/test/unit/src/org/openide/loaders/XMLDataObjectSubclassTest.java
@@ -22,29 +22,11 @@
import java.util.Enumeration;
import org.openide.filesystems.*;
import java.io.*;
-import java.lang.ref.Reference;
-import java.lang.ref.WeakReference;
-import java.security.Permission;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
import java.util.logging.Level;
-import junit.framework.Assert;
import org.netbeans.junit.Log;
import org.netbeans.junit.MockServices;
-import org.netbeans.junit.RandomlyFails;
import org.openide.cookies.*;
-import org.openide.loaders.MultiDataObject.Entry;
-import org.openide.nodes.Node;
import org.openide.util.Enumerations;
-import org.openide.util.RequestProcessor;
-import org.openide.xml.XMLUtil;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXParseException;
/**
*
diff --git a/platform/openide.loaders/test/unit/src/org/openide/loaders/XMLDataObjectTest.java b/platform/openide.loaders/test/unit/src/org/openide/loaders/XMLDataObjectTest.java
index 27d8762..7d33b5d 100644
--- a/platform/openide.loaders/test/unit/src/org/openide/loaders/XMLDataObjectTest.java
+++ b/platform/openide.loaders/test/unit/src/org/openide/loaders/XMLDataObjectTest.java
@@ -23,16 +23,8 @@
import java.io.*;
import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
-import java.security.Permission;
-import java.util.Arrays;
import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
import java.util.logging.Level;
-import junit.framework.Assert;
import org.netbeans.junit.Log;
import org.netbeans.junit.RandomlyFails;
import org.netbeans.modules.openide.util.NbMutexEventProvider;
diff --git a/platform/openide.nodes/test/unit/src/org/openide/util/actions/NodeActionsInfraHid.java b/platform/openide.nodes/test/unit/src/org/openide/util/actions/NodeActionsInfraHid.java
index 6ca1fd4..d5d74c2 100644
--- a/platform/openide.nodes/test/unit/src/org/openide/util/actions/NodeActionsInfraHid.java
+++ b/platform/openide.nodes/test/unit/src/org/openide/util/actions/NodeActionsInfraHid.java
@@ -24,7 +24,7 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.openide.nodes.Node;
import org.openide.util.ContextGlobalProvider;
import org.openide.util.Lookup;
diff --git a/platform/openide.text/test/unit/src/org/openide/text/CloneableEditorSupportOpenCloseTest.java b/platform/openide.text/test/unit/src/org/openide/text/CloneableEditorSupportOpenCloseTest.java
index aae4e0f..9f18c90 100644
--- a/platform/openide.text/test/unit/src/org/openide/text/CloneableEditorSupportOpenCloseTest.java
+++ b/platform/openide.text/test/unit/src/org/openide/text/CloneableEditorSupportOpenCloseTest.java
@@ -27,8 +27,6 @@
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.logging.Level;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNull;
import org.netbeans.junit.Filter;
import org.netbeans.junit.NbTestCase;
import org.openide.cookies.EditorCookie;
diff --git a/platform/openide.util.lookup/test/unit/src/org/openide/util/test/AnnotationProcessorTestUtils.java b/platform/openide.util.lookup/test/unit/src/org/openide/util/test/AnnotationProcessorTestUtils.java
index af69412..a61f690 100644
--- a/platform/openide.util.lookup/test/unit/src/org/openide/util/test/AnnotationProcessorTestUtils.java
+++ b/platform/openide.util.lookup/test/unit/src/org/openide/util/test/AnnotationProcessorTestUtils.java
@@ -33,7 +33,7 @@
import java.util.regex.Pattern;
import javax.tools.JavaCompiler;
import javax.tools.ToolProvider;
-import junit.framework.Assert;
+import org.junit.Assert;
/**
* Utilities useful to those testing JSR 269 annotation processors.
diff --git a/platform/openide.util.lookup/test/unit/src/org/openide/util/test/MockLookup.java b/platform/openide.util.lookup/test/unit/src/org/openide/util/test/MockLookup.java
index e3ab365..159de77 100644
--- a/platform/openide.util.lookup/test/unit/src/org/openide/util/test/MockLookup.java
+++ b/platform/openide.util.lookup/test/unit/src/org/openide/util/test/MockLookup.java
@@ -21,11 +21,14 @@
import java.lang.reflect.Field;
import java.util.Collection;
-import static junit.framework.Assert.*;
import org.openide.util.Lookup;
import org.openide.util.lookup.Lookups;
import org.openide.util.lookup.ProxyLookup;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
/**
* Mock implementation of system default lookup suitable for use in unit tests.
* The initial value just contains classpath services.
diff --git a/platform/openide.util.ui/test/unit/src/org/openide/util/UtilitiesTest.java b/platform/openide.util.ui/test/unit/src/org/openide/util/UtilitiesTest.java
index 6963024..9bada3d 100644
--- a/platform/openide.util.ui/test/unit/src/org/openide/util/UtilitiesTest.java
+++ b/platform/openide.util.ui/test/unit/src/org/openide/util/UtilitiesTest.java
@@ -101,7 +101,6 @@
import javax.swing.JPopupMenu;
import javax.swing.JSeparator;
import javax.swing.KeyStroke;
-import junit.framework.Assert;
import org.netbeans.junit.NbTestCase;
import org.openide.util.actions.Presenter;
import org.openide.util.lookup.AbstractLookup;
@@ -542,7 +541,7 @@
InstanceContent.Convertor<Boolean, JSeparator> separatorConvertor = new InstanceContent.Convertor<Boolean, JSeparator>() {
public JSeparator convert(Boolean obj) {
- Assert.fail("should not be creating the JSeparator yet");
+ fail("should not be creating the JSeparator yet");
return new JSeparator();
}
diff --git a/platform/openide.util.ui/test/unit/src/org/openide/util/actions/ActionsInfraHid.java b/platform/openide.util.ui/test/unit/src/org/openide/util/actions/ActionsInfraHid.java
index 6f0ac01..655466e 100644
--- a/platform/openide.util.ui/test/unit/src/org/openide/util/actions/ActionsInfraHid.java
+++ b/platform/openide.util.ui/test/unit/src/org/openide/util/actions/ActionsInfraHid.java
@@ -24,7 +24,7 @@
import java.util.Collections;
import java.util.HashSet;
import javax.swing.ActionMap;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.openide.util.ContextGlobalProvider;
import org.openide.util.Lookup;
import org.openide.util.Utilities;
diff --git a/platform/openide.util.ui/test/unit/src/org/openide/util/test/MockChangeListener.java b/platform/openide.util.ui/test/unit/src/org/openide/util/test/MockChangeListener.java
index 2881350..7832d56 100644
--- a/platform/openide.util.ui/test/unit/src/org/openide/util/test/MockChangeListener.java
+++ b/platform/openide.util.ui/test/unit/src/org/openide/util/test/MockChangeListener.java
@@ -23,7 +23,7 @@
import java.util.List;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
-import static junit.framework.Assert.*;
+import static junit.framework.TestCase.*;
import junit.framework.AssertionFailedError;
/**
diff --git a/platform/openide.util.ui/test/unit/src/org/openide/util/test/MockChangeListenerTest.java b/platform/openide.util.ui/test/unit/src/org/openide/util/test/MockChangeListenerTest.java
index b26e7a6..bb8ee4e 100644
--- a/platform/openide.util.ui/test/unit/src/org/openide/util/test/MockChangeListenerTest.java
+++ b/platform/openide.util.ui/test/unit/src/org/openide/util/test/MockChangeListenerTest.java
@@ -24,6 +24,7 @@
import org.netbeans.junit.RandomlyFails;
import org.openide.util.ChangeSupport;
+// copy of openide.util
public class MockChangeListenerTest extends NbTestCase {
public MockChangeListenerTest(String n) {
diff --git a/platform/openide.util.ui/test/unit/src/org/openide/util/test/MockPropertyChangeListener.java b/platform/openide.util.ui/test/unit/src/org/openide/util/test/MockPropertyChangeListener.java
index 1fc36a6..10a1c0b 100644
--- a/platform/openide.util.ui/test/unit/src/org/openide/util/test/MockPropertyChangeListener.java
+++ b/platform/openide.util.ui/test/unit/src/org/openide/util/test/MockPropertyChangeListener.java
@@ -29,7 +29,7 @@
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
-import static junit.framework.Assert.*;
+import static junit.framework.TestCase.*;
import junit.framework.AssertionFailedError;
/**
diff --git a/platform/openide.util.ui/test/unit/src/org/openide/util/test/MockPropertyChangeListenerTest.java b/platform/openide.util.ui/test/unit/src/org/openide/util/test/MockPropertyChangeListenerTest.java
index ce87b8d..ebedcf3 100644
--- a/platform/openide.util.ui/test/unit/src/org/openide/util/test/MockPropertyChangeListenerTest.java
+++ b/platform/openide.util.ui/test/unit/src/org/openide/util/test/MockPropertyChangeListenerTest.java
@@ -24,6 +24,7 @@
import junit.framework.AssertionFailedError;
import junit.framework.TestCase;
+// copy of openide.util
public class MockPropertyChangeListenerTest extends TestCase {
public MockPropertyChangeListenerTest(String n) {
diff --git a/platform/openide.util.ui/test/unit/src/org/openide/util/test/TestFileUtils.java b/platform/openide.util.ui/test/unit/src/org/openide/util/test/TestFileUtils.java
index a3702d9..f19877a 100644
--- a/platform/openide.util.ui/test/unit/src/org/openide/util/test/TestFileUtils.java
+++ b/platform/openide.util.ui/test/unit/src/org/openide/util/test/TestFileUtils.java
@@ -38,7 +38,7 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream;
-import junit.framework.Assert;
+import org.junit.Assert;
/**
* Common utility methods for massaging and inspecting files from tests.
diff --git a/platform/openide.util.ui/test/unit/src/org/openide/xml/XMLUtilReflectionTest.java b/platform/openide.util.ui/test/unit/src/org/openide/xml/XMLUtilReflectionTest.java
index bf87a69..7caedcf 100644
--- a/platform/openide.util.ui/test/unit/src/org/openide/xml/XMLUtilReflectionTest.java
+++ b/platform/openide.util.ui/test/unit/src/org/openide/xml/XMLUtilReflectionTest.java
@@ -27,7 +27,7 @@
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.xml.sax.InputSource;
import org.xml.sax.SAXParseException;
diff --git a/platform/openide.util/test/unit/src/org/openide/util/RequestProcessor226051Test.java b/platform/openide.util/test/unit/src/org/openide/util/RequestProcessor226051Test.java
index da25867..ceab7c2 100644
--- a/platform/openide.util/test/unit/src/org/openide/util/RequestProcessor226051Test.java
+++ b/platform/openide.util/test/unit/src/org/openide/util/RequestProcessor226051Test.java
@@ -23,11 +23,12 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
-import static junit.framework.Assert.assertTrue;
import org.junit.Test;
import org.openide.util.Exceptions;
import org.openide.util.RequestProcessor;
+import static org.junit.Assert.assertTrue;
+
/**
*
* @author Tim Boudreau
diff --git a/platform/openide.util/test/unit/src/org/openide/util/test/MockChangeListener.java b/platform/openide.util/test/unit/src/org/openide/util/test/MockChangeListener.java
index 2881350..7832d56 100644
--- a/platform/openide.util/test/unit/src/org/openide/util/test/MockChangeListener.java
+++ b/platform/openide.util/test/unit/src/org/openide/util/test/MockChangeListener.java
@@ -23,7 +23,7 @@
import java.util.List;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
-import static junit.framework.Assert.*;
+import static junit.framework.TestCase.*;
import junit.framework.AssertionFailedError;
/**
diff --git a/platform/openide.util/test/unit/src/org/openide/util/test/MockChangeListenerTest.java b/platform/openide.util/test/unit/src/org/openide/util/test/MockChangeListenerTest.java
index b26e7a6..5de00cd 100644
--- a/platform/openide.util/test/unit/src/org/openide/util/test/MockChangeListenerTest.java
+++ b/platform/openide.util/test/unit/src/org/openide/util/test/MockChangeListenerTest.java
@@ -24,6 +24,7 @@
import org.netbeans.junit.RandomlyFails;
import org.openide.util.ChangeSupport;
+// copy of openide.util.ui
public class MockChangeListenerTest extends NbTestCase {
public MockChangeListenerTest(String n) {
diff --git a/platform/openide.util/test/unit/src/org/openide/util/test/MockPropertyChangeListener.java b/platform/openide.util/test/unit/src/org/openide/util/test/MockPropertyChangeListener.java
index 1fc36a6..10a1c0b 100644
--- a/platform/openide.util/test/unit/src/org/openide/util/test/MockPropertyChangeListener.java
+++ b/platform/openide.util/test/unit/src/org/openide/util/test/MockPropertyChangeListener.java
@@ -29,7 +29,7 @@
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
-import static junit.framework.Assert.*;
+import static junit.framework.TestCase.*;
import junit.framework.AssertionFailedError;
/**
diff --git a/platform/openide.util/test/unit/src/org/openide/util/test/MockPropertyChangeListenerTest.java b/platform/openide.util/test/unit/src/org/openide/util/test/MockPropertyChangeListenerTest.java
index ce87b8d..a2cee41 100644
--- a/platform/openide.util/test/unit/src/org/openide/util/test/MockPropertyChangeListenerTest.java
+++ b/platform/openide.util/test/unit/src/org/openide/util/test/MockPropertyChangeListenerTest.java
@@ -24,6 +24,7 @@
import junit.framework.AssertionFailedError;
import junit.framework.TestCase;
+// copy of openide.util.ui
public class MockPropertyChangeListenerTest extends TestCase {
public MockPropertyChangeListenerTest(String n) {
diff --git a/platform/openide.util/test/unit/src/org/openide/util/test/TestFileUtils.java b/platform/openide.util/test/unit/src/org/openide/util/test/TestFileUtils.java
index a3702d9..f19877a 100644
--- a/platform/openide.util/test/unit/src/org/openide/util/test/TestFileUtils.java
+++ b/platform/openide.util/test/unit/src/org/openide/util/test/TestFileUtils.java
@@ -38,7 +38,7 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream;
-import junit.framework.Assert;
+import org.junit.Assert;
/**
* Common utility methods for massaging and inspecting files from tests.
diff --git a/platform/options.api/test/unit/src/org/netbeans/api/options/IDEInitializer.java b/platform/options.api/test/unit/src/org/netbeans/api/options/IDEInitializer.java
index b865045..1293491 100644
--- a/platform/options.api/test/unit/src/org/netbeans/api/options/IDEInitializer.java
+++ b/platform/options.api/test/unit/src/org/netbeans/api/options/IDEInitializer.java
@@ -26,7 +26,7 @@
import java.net.URLStreamHandler;
import java.net.URLStreamHandlerFactory;
import java.util.Enumeration;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.netbeans.junit.Manager;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileSystem;
diff --git a/platform/sendopts/test/unit/src/org/netbeans/api/sendopts/Provider.java b/platform/sendopts/test/unit/src/org/netbeans/api/sendopts/Provider.java
index 753171e..1a48bec 100644
--- a/platform/sendopts/test/unit/src/org/netbeans/api/sendopts/Provider.java
+++ b/platform/sendopts/test/unit/src/org/netbeans/api/sendopts/Provider.java
@@ -22,7 +22,7 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.netbeans.spi.sendopts.OptionGroups;
import org.netbeans.spi.sendopts.Env;
import org.netbeans.spi.sendopts.Option;
diff --git a/platform/spi.quicksearch/test/unit/src/org/netbeans/modules/quicksearch/UnitTestUtils.java b/platform/spi.quicksearch/test/unit/src/org/netbeans/modules/quicksearch/UnitTestUtils.java
index 083b36b..b8b1b96 100644
--- a/platform/spi.quicksearch/test/unit/src/org/netbeans/modules/quicksearch/UnitTestUtils.java
+++ b/platform/spi.quicksearch/test/unit/src/org/netbeans/modules/quicksearch/UnitTestUtils.java
@@ -22,7 +22,7 @@
import java.beans.PropertyVetoException;
import java.io.IOException;
import java.net.URL;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.openide.filesystems.Repository;
import org.openide.filesystems.XMLFileSystem;
import org.openide.util.Lookup;
diff --git a/platform/templatesui/test/unit/src/org/netbeans/modules/templatesui/HTMLTemplateTest.java b/platform/templatesui/test/unit/src/org/netbeans/modules/templatesui/HTMLTemplateTest.java
index d7e92da..5d5f874 100644
--- a/platform/templatesui/test/unit/src/org/netbeans/modules/templatesui/HTMLTemplateTest.java
+++ b/platform/templatesui/test/unit/src/org/netbeans/modules/templatesui/HTMLTemplateTest.java
@@ -25,9 +25,10 @@
import java.util.Set;
import java.util.concurrent.CountDownLatch;
import javafx.application.Platform;
-import static junit.framework.Assert.*;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import org.junit.Test;
import org.netbeans.api.templates.TemplateRegistration;
import static org.netbeans.modules.templatesui.HTMLJavaTemplateTest.assertCurrentStep;
diff --git a/platform/uihandler/test/unit/src/org/netbeans/modules/uihandler/MemoryURL.java b/platform/uihandler/test/unit/src/org/netbeans/modules/uihandler/MemoryURL.java
index 8390143..f394268 100644
--- a/platform/uihandler/test/unit/src/org/netbeans/modules/uihandler/MemoryURL.java
+++ b/platform/uihandler/test/unit/src/org/netbeans/modules/uihandler/MemoryURL.java
@@ -30,7 +30,7 @@
import java.net.URLStreamHandlerFactory;
import java.util.HashMap;
import java.util.Map;
-import junit.framework.Assert;
+import org.junit.Assert;
/**
*
diff --git a/profiler/profiler.j2se/test/unit/src/org/netbeans/modules/profiler/categories/j2se/TestUtilities.java b/profiler/profiler.j2se/test/unit/src/org/netbeans/modules/profiler/categories/j2se/TestUtilities.java
index e757e95..7d4e388 100644
--- a/profiler/profiler.j2se/test/unit/src/org/netbeans/modules/profiler/categories/j2se/TestUtilities.java
+++ b/profiler/profiler.j2se/test/unit/src/org/netbeans/modules/profiler/categories/j2se/TestUtilities.java
@@ -25,9 +25,7 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
-
-import junit.framework.Assert;
-
+import org.junit.Assert;
import org.netbeans.api.editor.mimelookup.MimePath;
import org.netbeans.modules.java.source.indexing.JavaCustomIndexer;
import org.netbeans.modules.java.source.parsing.JavacParser;
diff --git a/profiler/profiler.nbimpl/test/unit/src/org/netbeans/modules/profiler/nbimpl/TestUtilities.java b/profiler/profiler.nbimpl/test/unit/src/org/netbeans/modules/profiler/nbimpl/TestUtilities.java
index 0d6781d..fa488a9 100644
--- a/profiler/profiler.nbimpl/test/unit/src/org/netbeans/modules/profiler/nbimpl/TestUtilities.java
+++ b/profiler/profiler.nbimpl/test/unit/src/org/netbeans/modules/profiler/nbimpl/TestUtilities.java
@@ -25,9 +25,7 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
-
-import junit.framework.Assert;
-
+import org.junit.Assert;
import org.netbeans.api.editor.mimelookup.MimePath;
import org.netbeans.modules.java.source.indexing.JavaCustomIndexer;
import org.netbeans.modules.java.source.parsing.ClassParser;
diff --git a/webcommon/html.angular/test/qa-functional/src/org/netbeans/modules/html/angular/cc/CtrlAsModuleTest.java b/webcommon/html.angular/test/qa-functional/src/org/netbeans/modules/html/angular/cc/CtrlAsModuleTest.java
index 9a29ee7..f684fb5 100644
--- a/webcommon/html.angular/test/qa-functional/src/org/netbeans/modules/html/angular/cc/CtrlAsModuleTest.java
+++ b/webcommon/html.angular/test/qa-functional/src/org/netbeans/modules/html/angular/cc/CtrlAsModuleTest.java
@@ -21,7 +21,6 @@
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import javax.swing.KeyStroke;
-import static junit.framework.Assert.assertTrue;
import junit.framework.Test;
import org.netbeans.jellytools.EditorOperator;
import org.netbeans.jemmy.JemmyProperties;
diff --git a/webcommon/html.angular/test/qa-functional/src/org/netbeans/modules/html/angular/cc/CtrlModuleArrayETest.java b/webcommon/html.angular/test/qa-functional/src/org/netbeans/modules/html/angular/cc/CtrlModuleArrayETest.java
index 485d4bf..ff4484c 100644
--- a/webcommon/html.angular/test/qa-functional/src/org/netbeans/modules/html/angular/cc/CtrlModuleArrayETest.java
+++ b/webcommon/html.angular/test/qa-functional/src/org/netbeans/modules/html/angular/cc/CtrlModuleArrayETest.java
@@ -22,7 +22,6 @@
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import javax.swing.KeyStroke;
-import static junit.framework.Assert.assertTrue;
import junit.framework.Test;
import org.netbeans.jellytools.EditorOperator;
import org.netbeans.jemmy.JemmyProperties;
diff --git a/webcommon/html.angular/test/qa-functional/src/org/netbeans/modules/html/angular/cc/CtrlModuleArrayTest.java b/webcommon/html.angular/test/qa-functional/src/org/netbeans/modules/html/angular/cc/CtrlModuleArrayTest.java
index fd4e8c6..7bb63b4 100644
--- a/webcommon/html.angular/test/qa-functional/src/org/netbeans/modules/html/angular/cc/CtrlModuleArrayTest.java
+++ b/webcommon/html.angular/test/qa-functional/src/org/netbeans/modules/html/angular/cc/CtrlModuleArrayTest.java
@@ -21,7 +21,6 @@
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import javax.swing.KeyStroke;
-import static junit.framework.Assert.assertTrue;
import junit.framework.Test;
import org.netbeans.jellytools.EditorOperator;
import org.netbeans.jemmy.JemmyProperties;
diff --git a/webcommon/html.angular/test/qa-functional/src/org/netbeans/modules/html/angular/cc/CtrlModuleTest.java b/webcommon/html.angular/test/qa-functional/src/org/netbeans/modules/html/angular/cc/CtrlModuleTest.java
index 2c63ad3..061809e 100644
--- a/webcommon/html.angular/test/qa-functional/src/org/netbeans/modules/html/angular/cc/CtrlModuleTest.java
+++ b/webcommon/html.angular/test/qa-functional/src/org/netbeans/modules/html/angular/cc/CtrlModuleTest.java
@@ -22,7 +22,6 @@
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import javax.swing.KeyStroke;
-import static junit.framework.Assert.assertTrue;
import junit.framework.Test;
import org.netbeans.jellytools.EditorOperator;
import org.netbeans.jemmy.JemmyProperties;
diff --git a/webcommon/html.angular/test/qa-functional/src/org/netbeans/modules/html/angular/navigate/CtrlAsModuleNav2Test.java b/webcommon/html.angular/test/qa-functional/src/org/netbeans/modules/html/angular/navigate/CtrlAsModuleNav2Test.java
index 60f457a..bb34d86 100644
--- a/webcommon/html.angular/test/qa-functional/src/org/netbeans/modules/html/angular/navigate/CtrlAsModuleNav2Test.java
+++ b/webcommon/html.angular/test/qa-functional/src/org/netbeans/modules/html/angular/navigate/CtrlAsModuleNav2Test.java
@@ -20,7 +20,6 @@
import java.awt.event.KeyEvent;
import javax.swing.KeyStroke;
-import static junit.framework.Assert.assertTrue;
import junit.framework.Test;
import org.netbeans.jellytools.EditorOperator;
import org.netbeans.jemmy.JemmyProperties;
diff --git a/webcommon/html.angular/test/qa-functional/src/org/netbeans/modules/html/angular/navigate/NavigationAsTest.java b/webcommon/html.angular/test/qa-functional/src/org/netbeans/modules/html/angular/navigate/NavigationAsTest.java
index e744467..be94b3c 100644
--- a/webcommon/html.angular/test/qa-functional/src/org/netbeans/modules/html/angular/navigate/NavigationAsTest.java
+++ b/webcommon/html.angular/test/qa-functional/src/org/netbeans/modules/html/angular/navigate/NavigationAsTest.java
@@ -20,8 +20,6 @@
import java.awt.event.KeyEvent;
import javax.swing.KeyStroke;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
import junit.framework.Test;
import org.netbeans.jellytools.EditorOperator;
import org.netbeans.jemmy.JemmyProperties;
diff --git a/webcommon/html.angular/test/unit/src/org/netbeans/modules/html/angular/editor/AngularJsDeclarationFinder2Test.java b/webcommon/html.angular/test/unit/src/org/netbeans/modules/html/angular/editor/AngularJsDeclarationFinder2Test.java
index 05c2b19..466cb6f 100644
--- a/webcommon/html.angular/test/unit/src/org/netbeans/modules/html/angular/editor/AngularJsDeclarationFinder2Test.java
+++ b/webcommon/html.angular/test/unit/src/org/netbeans/modules/html/angular/editor/AngularJsDeclarationFinder2Test.java
@@ -25,7 +25,6 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.api.java.classpath.ClassPath;
import org.netbeans.api.project.Project;
import org.netbeans.modules.csl.api.DeclarationFinder;
diff --git a/webcommon/html.angular/test/unit/src/org/netbeans/modules/html/angular/editor/AngularJsDelcarationFinderTest.java b/webcommon/html.angular/test/unit/src/org/netbeans/modules/html/angular/editor/AngularJsDelcarationFinderTest.java
index a02257a..38e744f 100644
--- a/webcommon/html.angular/test/unit/src/org/netbeans/modules/html/angular/editor/AngularJsDelcarationFinderTest.java
+++ b/webcommon/html.angular/test/unit/src/org/netbeans/modules/html/angular/editor/AngularJsDelcarationFinderTest.java
@@ -27,7 +27,6 @@
import java.util.Map;
import javax.swing.Icon;
import javax.swing.event.ChangeListener;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.api.editor.mimelookup.MimePath;
import org.netbeans.api.editor.mimelookup.test.MockMimeLookup;
import org.netbeans.api.html.lexer.HTMLTokenId;
diff --git a/webcommon/html.knockout/test/qa-functional/src/org/netbeans/modules/html/knockout/GeneralKnockout.java b/webcommon/html.knockout/test/qa-functional/src/org/netbeans/modules/html/knockout/GeneralKnockout.java
index ce6602b..4b86351 100644
--- a/webcommon/html.knockout/test/qa-functional/src/org/netbeans/modules/html/knockout/GeneralKnockout.java
+++ b/webcommon/html.knockout/test/qa-functional/src/org/netbeans/modules/html/knockout/GeneralKnockout.java
@@ -29,7 +29,6 @@
import java.util.logging.Logger;
import javax.swing.JEditorPane;
import javax.swing.text.BadLocationException;
-import static junit.framework.Assert.fail;
import org.netbeans.jellytools.EditorOperator;
import org.netbeans.jellytools.JellyTestCase;
import org.netbeans.jellytools.NewProjectWizardOperator;
@@ -47,8 +46,6 @@
import org.netbeans.jemmy.operators.Operator;
import org.openide.util.Exceptions;
import javax.swing.JTextField;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
import org.netbeans.jellytools.MainWindowOperator;
import org.netbeans.jellytools.ProjectsTabOperator;
import org.netbeans.jellytools.nodes.Node;
diff --git a/webcommon/html.knockout/test/qa-functional/src/org/netbeans/modules/html/knockout/cc/CustomComponentTest.java b/webcommon/html.knockout/test/qa-functional/src/org/netbeans/modules/html/knockout/cc/CustomComponentTest.java
index e7d0881..2a7565b 100644
--- a/webcommon/html.knockout/test/qa-functional/src/org/netbeans/modules/html/knockout/cc/CustomComponentTest.java
+++ b/webcommon/html.knockout/test/qa-functional/src/org/netbeans/modules/html/knockout/cc/CustomComponentTest.java
@@ -23,7 +23,6 @@
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
-import static junit.framework.Assert.assertTrue;
import junit.framework.Test;
import org.netbeans.jellytools.EditorOperator;
import org.netbeans.jellytools.modules.editor.CompletionJListOperator;
diff --git a/webcommon/javascript.bower/test/unit/src/org/netbeans/modules/javascript/bower/file/BowerJsonTest.java b/webcommon/javascript.bower/test/unit/src/org/netbeans/modules/javascript/bower/file/BowerJsonTest.java
index ebeecfd..62131db 100644
--- a/webcommon/javascript.bower/test/unit/src/org/netbeans/modules/javascript/bower/file/BowerJsonTest.java
+++ b/webcommon/javascript.bower/test/unit/src/org/netbeans/modules/javascript/bower/file/BowerJsonTest.java
@@ -40,12 +40,6 @@
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
public class BowerJsonTest extends NbTestCase {
diff --git a/webcommon/javascript2.editor/test/qa-functional/src/org/netbeans/modules/javascript2/editor/qaf/cc/TestCCInsideWith.java b/webcommon/javascript2.editor/test/qa-functional/src/org/netbeans/modules/javascript2/editor/qaf/cc/TestCCInsideWith.java
index 88be9be..f1ccd91 100644
--- a/webcommon/javascript2.editor/test/qa-functional/src/org/netbeans/modules/javascript2/editor/qaf/cc/TestCCInsideWith.java
+++ b/webcommon/javascript2.editor/test/qa-functional/src/org/netbeans/modules/javascript2/editor/qaf/cc/TestCCInsideWith.java
@@ -19,8 +19,6 @@
package org.netbeans.modules.javascript2.editor.qaf.cc;
import java.awt.event.InputEvent;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
import junit.framework.Test;
import org.netbeans.jellytools.EditorOperator;
import org.netbeans.jellytools.modules.editor.CompletionJListOperator;
diff --git a/webcommon/javascript2.editor/test/unit/src/org/netbeans/modules/javascript2/editor/JsFindLogicalRangesTest.java b/webcommon/javascript2.editor/test/unit/src/org/netbeans/modules/javascript2/editor/JsFindLogicalRangesTest.java
index e071e22..6beed81 100644
--- a/webcommon/javascript2.editor/test/unit/src/org/netbeans/modules/javascript2/editor/JsFindLogicalRangesTest.java
+++ b/webcommon/javascript2.editor/test/unit/src/org/netbeans/modules/javascript2/editor/JsFindLogicalRangesTest.java
@@ -22,7 +22,6 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.modules.csl.api.OffsetRange;
import org.netbeans.modules.csl.spi.ParserResult;
import org.netbeans.modules.parsing.api.ParserManager;
diff --git a/webcommon/javascript2.editor/test/unit/src/org/netbeans/modules/javascript2/editor/JsWithBase.java b/webcommon/javascript2.editor/test/unit/src/org/netbeans/modules/javascript2/editor/JsWithBase.java
index 9cada5b..7540c7a 100644
--- a/webcommon/javascript2.editor/test/unit/src/org/netbeans/modules/javascript2/editor/JsWithBase.java
+++ b/webcommon/javascript2.editor/test/unit/src/org/netbeans/modules/javascript2/editor/JsWithBase.java
@@ -23,9 +23,6 @@
import java.util.Map;
import java.util.Set;
import javax.swing.text.Document;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.modules.csl.api.ColoringAttributes;
import org.netbeans.modules.csl.api.DeclarationFinder;
import org.netbeans.modules.csl.api.OccurrencesFinder;
diff --git a/webcommon/javascript2.jade/test/unit/src/org/netbeans/modules/javascript2/jade/editor/JadeJsEmbeddingProviderPluginTest.java b/webcommon/javascript2.jade/test/unit/src/org/netbeans/modules/javascript2/jade/editor/JadeJsEmbeddingProviderPluginTest.java
index 4b2cc8f..3da29fb 100644
--- a/webcommon/javascript2.jade/test/unit/src/org/netbeans/modules/javascript2/jade/editor/JadeJsEmbeddingProviderPluginTest.java
+++ b/webcommon/javascript2.jade/test/unit/src/org/netbeans/modules/javascript2/jade/editor/JadeJsEmbeddingProviderPluginTest.java
@@ -19,7 +19,6 @@
package org.netbeans.modules.javascript2.jade.editor;
import java.util.Collections;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.modules.csl.api.test.CslTestBase;
import org.netbeans.modules.parsing.api.Embedding;
import org.netbeans.modules.parsing.api.ParserManager;
diff --git a/webcommon/javascript2.jade/test/unit/src/org/netbeans/modules/javascript2/jade/editor/indent/JadeIndenterTest.java b/webcommon/javascript2.jade/test/unit/src/org/netbeans/modules/javascript2/jade/editor/indent/JadeIndenterTest.java
index 4903174..e070b3e 100644
--- a/webcommon/javascript2.jade/test/unit/src/org/netbeans/modules/javascript2/jade/editor/indent/JadeIndenterTest.java
+++ b/webcommon/javascript2.jade/test/unit/src/org/netbeans/modules/javascript2/jade/editor/indent/JadeIndenterTest.java
@@ -21,7 +21,6 @@
import javax.swing.JEditorPane;
import javax.swing.text.Caret;
import javax.swing.text.DefaultEditorKit;
-import static junit.framework.Assert.assertNotNull;
import org.netbeans.editor.BaseDocument;
import org.netbeans.lib.lexer.test.TestLanguageProvider;
import org.netbeans.modules.csl.api.Formatter;
diff --git a/webcommon/javascript2.jade/test/unit/src/org/netbeans/modules/javascript2/jade/editor/lexer/JadeCompletionContextTest.java b/webcommon/javascript2.jade/test/unit/src/org/netbeans/modules/javascript2/jade/editor/lexer/JadeCompletionContextTest.java
index 22681d0..a265eb4 100644
--- a/webcommon/javascript2.jade/test/unit/src/org/netbeans/modules/javascript2/jade/editor/lexer/JadeCompletionContextTest.java
+++ b/webcommon/javascript2.jade/test/unit/src/org/netbeans/modules/javascript2/jade/editor/lexer/JadeCompletionContextTest.java
@@ -19,7 +19,6 @@
package org.netbeans.modules.javascript2.jade.editor.lexer;
import java.util.Collections;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.modules.csl.spi.ParserResult;
import org.netbeans.modules.javascript2.jade.editor.JadeCompletionContext;
import org.netbeans.modules.javascript2.jade.editor.JadeTestBase;
diff --git a/webcommon/javascript2.jquery/test/unit/src/org/netbeans/modules/javascript2/jquery/Goto218102Test.java b/webcommon/javascript2.jquery/test/unit/src/org/netbeans/modules/javascript2/jquery/Goto218102Test.java
index 96575b1..9414bcb 100644
--- a/webcommon/javascript2.jquery/test/unit/src/org/netbeans/modules/javascript2/jquery/Goto218102Test.java
+++ b/webcommon/javascript2.jquery/test/unit/src/org/netbeans/modules/javascript2/jquery/Goto218102Test.java
@@ -19,7 +19,6 @@
package org.netbeans.modules.javascript2.jquery;
import java.util.Collections;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.modules.csl.api.DeclarationFinder;
import org.netbeans.modules.csl.api.OffsetRange;
import static org.netbeans.modules.csl.api.test.CslTestBase.getCaretOffset;
diff --git a/webcommon/javascript2.nodejs/test/qa-functional/src/org/netbeans/modules/javascript2/nodejs/GeneralNodeJs.java b/webcommon/javascript2.nodejs/test/qa-functional/src/org/netbeans/modules/javascript2/nodejs/GeneralNodeJs.java
index 6f91f71..95aa7c4 100644
--- a/webcommon/javascript2.nodejs/test/qa-functional/src/org/netbeans/modules/javascript2/nodejs/GeneralNodeJs.java
+++ b/webcommon/javascript2.nodejs/test/qa-functional/src/org/netbeans/modules/javascript2/nodejs/GeneralNodeJs.java
@@ -34,8 +34,6 @@
import javax.swing.JTextField;
import javax.swing.KeyStroke;
import javax.swing.text.BadLocationException;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
import org.netbeans.jellytools.EditorOperator;
import org.netbeans.jellytools.JellyTestCase;
import org.netbeans.jellytools.NavigatorOperator;
diff --git a/webcommon/javascript2.requirejs/test/qa-functional/src/org/netbeans/modules/javascript2/requirejs/GeneralRequire.java b/webcommon/javascript2.requirejs/test/qa-functional/src/org/netbeans/modules/javascript2/requirejs/GeneralRequire.java
index da0a2d2..09364b8 100644
--- a/webcommon/javascript2.requirejs/test/qa-functional/src/org/netbeans/modules/javascript2/requirejs/GeneralRequire.java
+++ b/webcommon/javascript2.requirejs/test/qa-functional/src/org/netbeans/modules/javascript2/requirejs/GeneralRequire.java
@@ -32,8 +32,6 @@
import javax.swing.JEditorPane;
import javax.swing.KeyStroke;
import javax.swing.text.BadLocationException;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
import org.netbeans.jellytools.*;
import org.netbeans.jellytools.modules.editor.CompletionJListOperator;
import org.netbeans.jellytools.nodes.Node;
diff --git a/webcommon/javascript2.requirejs/test/qa-functional/src/org/netbeans/modules/javascript2/requirejs/navigate/DefineTest.java b/webcommon/javascript2.requirejs/test/qa-functional/src/org/netbeans/modules/javascript2/requirejs/navigate/DefineTest.java
index 57089f0..9805077 100644
--- a/webcommon/javascript2.requirejs/test/qa-functional/src/org/netbeans/modules/javascript2/requirejs/navigate/DefineTest.java
+++ b/webcommon/javascript2.requirejs/test/qa-functional/src/org/netbeans/modules/javascript2/requirejs/navigate/DefineTest.java
@@ -20,8 +20,6 @@
import java.awt.event.KeyEvent;
import javax.swing.KeyStroke;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
import junit.framework.Test;
import org.netbeans.jellytools.EditorOperator;
import org.netbeans.jemmy.JemmyProperties;
diff --git a/webcommon/javascript2.requirejs/test/qa-functional/src/org/netbeans/modules/javascript2/requirejs/navigate/ExternalFileNavTest.java b/webcommon/javascript2.requirejs/test/qa-functional/src/org/netbeans/modules/javascript2/requirejs/navigate/ExternalFileNavTest.java
index ed2af94..9f15598 100644
--- a/webcommon/javascript2.requirejs/test/qa-functional/src/org/netbeans/modules/javascript2/requirejs/navigate/ExternalFileNavTest.java
+++ b/webcommon/javascript2.requirejs/test/qa-functional/src/org/netbeans/modules/javascript2/requirejs/navigate/ExternalFileNavTest.java
@@ -20,8 +20,6 @@
import java.awt.event.KeyEvent;
import javax.swing.KeyStroke;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
import junit.framework.Test;
import org.netbeans.jellytools.EditorOperator;
import org.netbeans.jemmy.JemmyProperties;
diff --git a/webcommon/javascript2.requirejs/test/qa-functional/src/org/netbeans/modules/javascript2/requirejs/navigate/NavigateRequireTest.java b/webcommon/javascript2.requirejs/test/qa-functional/src/org/netbeans/modules/javascript2/requirejs/navigate/NavigateRequireTest.java
index 81020c5..1bd0b11 100644
--- a/webcommon/javascript2.requirejs/test/qa-functional/src/org/netbeans/modules/javascript2/requirejs/navigate/NavigateRequireTest.java
+++ b/webcommon/javascript2.requirejs/test/qa-functional/src/org/netbeans/modules/javascript2/requirejs/navigate/NavigateRequireTest.java
@@ -20,8 +20,6 @@
import java.awt.event.KeyEvent;
import javax.swing.KeyStroke;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
import junit.framework.Test;
import org.netbeans.jellytools.EditorOperator;
import org.netbeans.jemmy.JemmyProperties;
diff --git a/webcommon/javascript2.requirejs/test/qa-functional/src/org/netbeans/modules/javascript2/requirejs/navigate/NavigateTest.java b/webcommon/javascript2.requirejs/test/qa-functional/src/org/netbeans/modules/javascript2/requirejs/navigate/NavigateTest.java
index a6059b4..bad8719 100644
--- a/webcommon/javascript2.requirejs/test/qa-functional/src/org/netbeans/modules/javascript2/requirejs/navigate/NavigateTest.java
+++ b/webcommon/javascript2.requirejs/test/qa-functional/src/org/netbeans/modules/javascript2/requirejs/navigate/NavigateTest.java
@@ -20,8 +20,6 @@
import java.awt.event.KeyEvent;
import javax.swing.KeyStroke;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
import junit.framework.Test;
import org.netbeans.jellytools.EditorOperator;
import org.netbeans.jemmy.JemmyProperties;
diff --git a/webcommon/javascript2.requirejs/test/unit/src/org/netbeans/modules/javascript2/requirejs/editor/RequireFileCodeCompletionBaseUrlTest.java b/webcommon/javascript2.requirejs/test/unit/src/org/netbeans/modules/javascript2/requirejs/editor/RequireFileCodeCompletionBaseUrlTest.java
index c62513b..380ab98 100644
--- a/webcommon/javascript2.requirejs/test/unit/src/org/netbeans/modules/javascript2/requirejs/editor/RequireFileCodeCompletionBaseUrlTest.java
+++ b/webcommon/javascript2.requirejs/test/unit/src/org/netbeans/modules/javascript2/requirejs/editor/RequireFileCodeCompletionBaseUrlTest.java
@@ -29,9 +29,6 @@
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import javax.swing.text.Position;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.api.java.classpath.ClassPath;
import org.netbeans.api.project.Project;
import org.netbeans.editor.BaseDocument;
diff --git a/webcommon/javascript2.requirejs/test/unit/src/org/netbeans/modules/javascript2/requirejs/editor/RequireFileCodeCompletionTest.java b/webcommon/javascript2.requirejs/test/unit/src/org/netbeans/modules/javascript2/requirejs/editor/RequireFileCodeCompletionTest.java
index 6f22200..c7ecab4 100644
--- a/webcommon/javascript2.requirejs/test/unit/src/org/netbeans/modules/javascript2/requirejs/editor/RequireFileCodeCompletionTest.java
+++ b/webcommon/javascript2.requirejs/test/unit/src/org/netbeans/modules/javascript2/requirejs/editor/RequireFileCodeCompletionTest.java
@@ -30,9 +30,6 @@
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import javax.swing.text.Position;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
import org.netbeans.api.java.classpath.ClassPath;
import org.netbeans.api.project.Project;
import org.netbeans.editor.BaseDocument;
diff --git a/webcommon/selenium2.webclient/test/unit/src/org/netbeans/modules/selenium2/webclient/api/TestRunnerReporterTest.java b/webcommon/selenium2.webclient/test/unit/src/org/netbeans/modules/selenium2/webclient/api/TestRunnerReporterTest.java
index a4a8741..1dbb497 100644
--- a/webcommon/selenium2.webclient/test/unit/src/org/netbeans/modules/selenium2/webclient/api/TestRunnerReporterTest.java
+++ b/webcommon/selenium2.webclient/test/unit/src/org/netbeans/modules/selenium2/webclient/api/TestRunnerReporterTest.java
@@ -20,8 +20,6 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
import junit.framework.TestCase;
import org.junit.Test;
diff --git a/webcommon/web.clientproject/test/qa-functional/src/org/netbeans/test/html5/debug/XHRDebuggerTest.java b/webcommon/web.clientproject/test/qa-functional/src/org/netbeans/test/html5/debug/XHRDebuggerTest.java
index a459bba..822c206 100644
--- a/webcommon/web.clientproject/test/qa-functional/src/org/netbeans/test/html5/debug/XHRDebuggerTest.java
+++ b/webcommon/web.clientproject/test/qa-functional/src/org/netbeans/test/html5/debug/XHRDebuggerTest.java
@@ -19,7 +19,6 @@
package org.netbeans.test.html5.debug;
import java.util.logging.Level;
-import static junit.framework.Assert.assertEquals;
import junit.framework.Test;
import org.netbeans.jellytools.EditorOperator;
import org.netbeans.jellytools.EditorWindowOperator;