Skip to content

Commit

Permalink
Run commit validation on JDK11 and JDK15
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaroslav Tulach committed Mar 25, 2021
1 parent e3c163b commit 29a20c9
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 22 deletions.
40 changes: 29 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,6 @@ matrix:
- ant $OPTS build
- ant $OPTS test -Dtest.includes=NoTestsJustBuild

- name: Compile all modules with OpenJDK11
jdk: openjdk11
env:
- OPTS="-Dmetabuild.jsonurl=https://raw.githubusercontent.com/apache/netbeans-jenkins-lib/master/meta/netbeansrelease.json -quiet -Dcluster.config=full -Djavac.compilerargs=-nowarn -Dbuild.compiler.deprecation=false"
before_script:
- ant $OPTS clean
script:
- ant $OPTS build
- ant $OPTS test -Dtest.includes=NoTestsJustBuild
- ant $OPTS -f platform/o.n.core/ test -Dtest.includes=**/ValidateClassFilesTest.class

- name: Test harness modules
jdk: openjdk8
env:
Expand Down Expand Up @@ -884,3 +873,32 @@ matrix:
- ant $OPTS build
script:
- hide-logs.sh ant $OPTS commit-validation

- name: commit-validation on Java 11
jdk: openjdk11
env:
- OPTS="-quiet -Dcluster.config=release -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`
- export JAVA_HOME=$TEST_JDK
- export OPTS="-Dmetabuild.jsonurl=https://raw.githubusercontent.com/apache/netbeans-jenkins-lib/master/meta/netbeansrelease.json $OPTS -Dnbjdk.home=$TEST_JDK -Dtest.use.jdk.javac=true"
- ant $OPTS clean
- ant $OPTS build
- ant $OPTS test -Dtest.includes=NoTestsJustBuild
script:
- hide-logs.sh ant $OPTS commit-validation

- name: commit-validation on Java 15
jdk: openjdk8
env:
- OPTS="-quiet -Dcluster.config=release -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 15 --license GPL --emit-java-home --silent | tail -1`
- export OPTS="-Dmetabuild.jsonurl=https://raw.githubusercontent.com/apache/netbeans-jenkins-lib/master/meta/netbeansrelease.json $OPTS -Dtest.nbjdk.home=$TEST_JDK -Dtest.use.jdk.javac=true"
- ant $OPTS clean
- ant $OPTS build
script:
- export JAVA_HOME=$TEST_JDK
- hide-logs.sh ant $OPTS commit-validation
4 changes: 2 additions & 2 deletions ergonomics/ide.ergonomics/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
</depend>
<javac srcdir="src-ant" destdir="${src-ant.build}"
deprecation="${build.compiler.deprecation}"
debug="true"
source="1.6" target="1.6" includeantruntime="false">
debug="true" release="8"
source="${javac.source}" target="${javac.target}" includeantruntime="false">
<classpath>
<path path="${src-ant.cp}"/>
</classpath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,19 @@
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Spliterator;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.function.Consumer;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
import java.util.regex.Pattern;
import java.util.stream.Stream;
import javax.imageio.ImageIO;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
Expand Down Expand Up @@ -527,11 +531,46 @@ private Source createSource(JarFile jf, java.util.zip.ZipEntry entry) {
}
}

private static final class ResArray extends ArrayList<Resource>
implements ResourceCollection {
private static final class ResArray implements ResourceCollection {
private final List<Resource> delegate = new ArrayList<>();

public boolean isFilesystemOnly() {
return false;
}

@Override
public int size() {
return delegate.size();
}

@Override
public Stream<? extends Resource> stream() {
return delegate.stream();
}

@Override
public boolean isEmpty() {
return delegate.isEmpty();
}

@Override
public Iterator<Resource> iterator() {
return delegate.iterator();
}

@Override
public void forEach(Consumer<? super Resource> action) {
delegate.forEach(action);
}

@Override
public Spliterator<Resource> spliterator() {
return delegate.spliterator();
}

public boolean add(Resource r) {
return delegate.add(r);
}
}

private class DuplKeys extends BaseFilterReader
Expand Down
2 changes: 1 addition & 1 deletion extra/libs.javafx.linux/manifest.mf
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/javafx/linux/Bundle.properti
OpenIDE-Module-Fragment-Host: org.netbeans.libs.javafx
OpenIDE-Module-Specification-Version: 13.7
OpenIDE-Module-Java-Dependencies: Java > 11
OpenIDE-Module-Needs: org.openide.modules.os.Linux
OpenIDE-Module-Requires: org.openide.modules.os.Linux
OpenIDE-Module-Provides: org.openide.modules.jre.JavaFX
2 changes: 1 addition & 1 deletion extra/libs.javafx.macosx/manifest.mf
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/javafx/macosx/Bundle.propert
OpenIDE-Module-Fragment-Host: org.netbeans.libs.javafx
OpenIDE-Module-Specification-Version: 13.7
OpenIDE-Module-Java-Dependencies: Java > 11
OpenIDE-Module-Needs: org.openide.modules.os.MacOSX
OpenIDE-Module-Requires: org.openide.modules.os.MacOSX
OpenIDE-Module-Provides: org.openide.modules.jre.JavaFX
2 changes: 1 addition & 1 deletion extra/libs.javafx.win/manifest.mf
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/javafx/win/Bundle.properties
OpenIDE-Module-Fragment-Host: org.netbeans.libs.javafx
OpenIDE-Module-Specification-Version: 13.7
OpenIDE-Module-Java-Dependencies: Java > 11
OpenIDE-Module-Needs: org.openide.modules.os.Windows
OpenIDE-Module-Requires: org.openide.modules.os.Windows
OpenIDE-Module-Provides: org.openide.modules.jre.JavaFX
2 changes: 0 additions & 2 deletions java/form/src/org/netbeans/modules/form/resources/layer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,6 @@
<attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
<attr name="instantiatingWizardURL" urlvalue="nbresloc:/org/netbeans/modules/form/resources/FormJApplet.html"/>
<attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/form/resources/palette/applet.gif"/>
<attr name="SystemFileSystem.icon32" urlvalue="nbresloc:/javax/swing/beaninfo/images/JAppletColor32.gif"/>
<attr name="instantiatingIterator" methodvalue="org.netbeans.modules.java.source.queries.api.TemplateWizardFactory.create"/>
<attr name="templateCategory" stringvalue="java-forms"/>
<attr name="weight" intvalue="100"/>
Expand Down Expand Up @@ -584,7 +583,6 @@
<attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
<attr name="instantiatingWizardURL" urlvalue="nbresloc:/org/netbeans/modules/form/resources/FormApplet.html"/>
<attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/form/resources/palette/applet.gif"/>
<attr name="SystemFileSystem.icon32" urlvalue="nbresloc:/javax/swing/beaninfo/images/JAppletColor32.gif"/>
<attr name="instantiatingIterator" methodvalue="org.netbeans.modules.java.source.queries.api.TemplateWizardFactory.create"/>
<attr name="templateCategory" stringvalue="java-forms,java-awt-forms"/>
<attr name="weight" intvalue="100"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import com.sun.tools.javac.comp.AttrContext;
import com.sun.tools.javac.comp.Enter;
import com.sun.tools.javac.comp.Env;
import com.sun.tools.javac.jvm.Pool;
import com.sun.tools.javac.tree.JCTree;
import com.sun.tools.javac.tree.JCTree.JCClassDecl;
import com.sun.tools.javac.tree.JCTree.JCFieldAccess;
Expand Down Expand Up @@ -231,8 +230,9 @@ private void outerThisDef(Symbol owner) {
outerThisStack = outerThisStack.prepend(outerThis);
}

private static final int MAX_STRING_LENGTH = 65535;
private void checkStringConstant(DiagnosticPosition pos, Object constValue) {
if (constValue instanceof String && ((String)constValue).length() >= Pool.MAX_STRING_LENGTH)
if (constValue instanceof String && ((String)constValue).length() >= MAX_STRING_LENGTH)
log.error(pos, new Error("compiler", "limit.string")); //NOI18N
}

Expand Down

0 comments on commit 29a20c9

Please sign in to comment.