Skip to content

Commit

Permalink
Merge remote-tracking branch 'sparsick/9727-jakarta-servlet-support' …
Browse files Browse the repository at this point in the history
…into 9727-jakarta-javadoc-tweaks-test
  • Loading branch information
niloc132 committed Jul 16, 2023
2 parents d7f7f4b + 784ad49 commit 195c749
Show file tree
Hide file tree
Showing 28 changed files with 181 additions and 154 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/full-check.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Run all tests and builds all aspects of GWT using Java 8 and 11. Runs nightly
# (plus or minus timzeones) on the main branch, and will also run right away on
# a push to a release branch. Release zips are uploaded as part of the build,
# though maven snapshots are not yet deployed.
# Run all tests and builds all aspects of GWT using Java 8, 11, and 17. Runs
# nightly (plus or minus timzeones) on the main branch, and will also run right
# away on a push to a release branch. Release zips are uploaded as part of the
# build, though maven snapshots are not yet deployed.
name: Full build
on:
schedule:
Expand All @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ '8', '11' ]
java-version: [ '8', '11', '17' ]
steps:
- name: Checkout GWT itself into one directory
uses: actions/checkout@v2
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
- name: Set up sonatype credentials
# Using the same java version as above, set up a settings.xml file
uses: actions/setup-java@v3
if: ${{ github.event_name == 'schedule' && github.repository_owner == 'gwtproject' && matrix.java-version == '11' }}
if: ${{ github.event_name == 'schedule' && github.repository_owner == 'gwtproject' && matrix.java-version == '17' }}
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
Expand All @@ -94,7 +94,7 @@ jobs:
server-password: SONATYPE_PASSWORD

- name: Nightly builds should be deployed as snapshots to sonatype
if: ${{ github.event_name == 'schedule' && github.repository_owner == 'gwtproject' && matrix.java-version == '11' }}
if: ${{ github.event_name == 'schedule' && github.repository_owner == 'gwtproject' && matrix.java-version == '17' }}
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/quick-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: ['8', '11']
java-version: ['8', '11', '17']
steps:
- name: Checkout GWT itself into one directory
uses: actions/checkout@v2
Expand All @@ -23,7 +23,7 @@ jobs:
path: 'tools'
ref: '9727-jakarta-servlet-support'
- name: Set up JDK ${{ matrix.java-version }}
# GWT presently requires Java8 to build just the SDK and some tests, or 11 to build everything, but can run on newer Java versions
# GWT presently requires Java8 to build just the SDK and some tests, or 11+ to build everything, and can run on newer Java versions
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java-version }}
Expand All @@ -45,8 +45,8 @@ jobs:
ANT_OPTS=-Xmx2g
ant clean dist doc checkstyle apicheck
- name: Create pull request comments/annotations for checkstyle from the java 11 build, even on failure
if: ${{ always() && github.event_name == 'pull_request' && matrix.java-version == '11' }}
- name: Create pull request comments/annotations for checkstyle from the java 17 build, even on failure
if: ${{ always() && github.event_name == 'pull_request' && matrix.java-version == '17' }}
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand All @@ -59,7 +59,7 @@ jobs:
done
- name: Upload checkstyle xml for manual review
uses: actions/upload-artifact@v2
if: ${{ matrix.java-version == '11' }}
if: ${{ matrix.java-version == '17' }}
with:
name: checkstyle-reports-java${{ matrix.java-version }}
path: 'gwt/build/out/**/checkstyle*.xml'
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
- To compile everything including examples you have to run

`$ ant clean dist`

- To create maven artifacts (after building .jar using ant), use [following guide](./maven/README.txt).

### How to verify GWT code conventions:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
public class JavaEmulSummaryDoclet implements Doclet {

public static final String OPT_OUTFILE = "-outfile";
private static final String JAVADOC_URL = "https://docs.oracle.com/javase/8/docs/api/";
private static final String JAVADOC_URL = "https://docs.oracle.com/en/java/javase/11/docs/api/";

private Reporter reporter;
private String outputFile;
Expand Down
1 change: 1 addition & 0 deletions common.ant.xml
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@
<jvmarg value="-Demma.coverage.out.merge=true"/>
<jvmarg value="-Dcom.google.gwt.junit.reportPath=reports"/>
<jvmarg line="@{test.jvmargs}"/>
<jvmarg line="--add-opens=java.base/java.lang=ALL-UNNAMED" unless:true="${isJava8}"/>
<sysproperty key="gwt.args" value="@{test.args}"/>
<sysproperty key="java.awt.headless" value="true"/>
<classpath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private static class CompileDependencyVisitor extends ClassVisitor {
private Map<String, String> methods = new HashMap<String, String>();

public CompileDependencyVisitor() {
super(Opcodes.ASM7);
super(Opcodes.ASM9);
}

public String getSignature() {
Expand Down
2 changes: 1 addition & 1 deletion dev/core/src/com/google/gwt/dev/javac/CompilationUnit.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private static class AnonymousClassVisitor extends EmptyVisitor {

public AnonymousClassVisitor() {

this.mv = new org.objectweb.asm.MethodVisitor(Opcodes.ASM7, this.mv) {
this.mv = new org.objectweb.asm.MethodVisitor(Opcodes.ASM9, this.mv) {
@Override
public void visitCode() {
++sawCode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static class MyAnnotationArrayVisitor extends AnnotationVisitor {
private final List<Object> values = new ArrayList<Object>();

public MyAnnotationArrayVisitor(Callback<Object> callback) {
super(Opcodes.ASM7);
super(Opcodes.ASM9);
this.callback = callback;
}

Expand Down Expand Up @@ -158,7 +158,7 @@ public CollectAnnotationData(String desc, boolean visible) {
*/
CollectAnnotationData(String desc, boolean visible,
Callback<CollectAnnotationData.AnnotationData> callback) {
super(Opcodes.ASM7);
super(Opcodes.ASM9);
annotation = new AnnotationData(desc, visible);
this.callback = callback;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class CollectFieldData extends FieldVisitor {

public CollectFieldData(int access, String name, String desc,
String signature, Object value) {
super(Opcodes.ASM7);
super(Opcodes.ASM9);
this.access = access;
this.name = name;
this.desc = desc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class CollectMethodData extends MethodVisitor {
// for new List[]
public CollectMethodData(CollectClassData.ClassType classType, int access,
String name, String desc, String signature, String[] exceptions) {
super(Opcodes.ASM7);
super(Opcodes.ASM9);
this.access = access;
this.name = name;
this.desc = desc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class CollectReferencesVisitor extends EmptyVisitor {
private class CollectGenericTypes extends SignatureVisitor {

public CollectGenericTypes() {
super(Opcodes.ASM7);
super(Opcodes.ASM9);
}

@Override
Expand Down Expand Up @@ -121,7 +121,7 @@ public void visitTypeVariable(String name) {
}

CollectReferencesVisitor() {
this.av = new AnnotationVisitor(Opcodes.ASM7, this.av) {
this.av = new AnnotationVisitor(Opcodes.ASM9, this.av) {
@Override
public void visitEnum(String name, String desc, String value) {
addTypeIfClass(desc);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class EmptySignatureVisitor extends SignatureVisitor {
protected static EmptySignatureVisitor ignore = new EmptySignatureVisitor();

public EmptySignatureVisitor() {
super(Opcodes.ASM7);
super(Opcodes.ASM9);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*/
public class EmptyVisitor extends ClassVisitor {

protected AnnotationVisitor av = new AnnotationVisitor(Opcodes.ASM7) {
protected AnnotationVisitor av = new AnnotationVisitor(Opcodes.ASM9) {

@Override
public AnnotationVisitor visitAnnotation(String name, String desc) {
Expand All @@ -41,10 +41,10 @@ public AnnotationVisitor visitArray(String name) {
};

public EmptyVisitor() {
super(Opcodes.ASM7);
super(Opcodes.ASM9);
}

protected MethodVisitor mv = new MethodVisitor(Opcodes.ASM7) {
protected MethodVisitor mv = new MethodVisitor(Opcodes.ASM9) {

@Override
public AnnotationVisitor visitAnnotationDefault() {
Expand All @@ -63,7 +63,7 @@ public AnnotationVisitor visitParameterAnnotation(
}
};

protected FieldVisitor fv = new FieldVisitor(Opcodes.ASM7) {
protected FieldVisitor fv = new FieldVisitor(Opcodes.ASM9) {

@Override
public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
class ForceClassVersion15 extends ClassVisitor {

public ForceClassVersion15(ClassVisitor v) {
super(Opcodes.ASM7, v);
super(Opcodes.ASM9, v);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static boolean hasAnnotation(byte[] classBytes,
private final String targetDesc;

public HasAnnotation(ClassVisitor v, Class<? extends Annotation> annotation) {
super(Opcodes.ASM7, v);
super(Opcodes.ASM9, v);
targetDesc = Type.getDescriptor(annotation);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ private class MyMethodAdapter extends GeneratorAdapter {

public MyMethodAdapter(MethodVisitor mv, int access, String name,
String desc) {
super(Opcodes.ASM7, mv, access, name, desc);
super(Opcodes.ASM9, mv, access, name, desc);
this.descriptor = desc;
this.name = name;
isStatic = (access & Opcodes.ACC_STATIC) != 0;
Expand Down Expand Up @@ -329,7 +329,7 @@ private void loadClassArray() {

public RewriteJsniMethods(ClassVisitor v,
Map<String, String> anonymousClassMap) {
super(Opcodes.ASM7, v);
super(Opcodes.ASM9, v);
this.anonymousClassMap = anonymousClassMap;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public String map(String typeName) {
};

public MyMethodAdapter(MethodVisitor mv) {
super(Opcodes.ASM7, mv);
super(Opcodes.ASM9, mv);
}

@Override
Expand Down Expand Up @@ -132,7 +132,7 @@ public void visitTypeInsn(int opcode, String type) {
*/
public RewriteRefsToJsoClasses(ClassVisitor cv, Set<String> jsoDescriptors,
InstanceMethodOracle mapper) {
super(Opcodes.ASM7, cv);
super(Opcodes.ASM9, cv);
this.jsoDescriptors = jsoDescriptors;
this.mapper = mapper;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
public class RewriteSingleJsoImplDispatches extends ClassVisitor {
private class MyMethodVisitor extends MethodVisitor {
public MyMethodVisitor(MethodVisitor mv) {
super(Opcodes.ASM7, mv);
super(Opcodes.ASM9, mv);
}

/*
Expand Down Expand Up @@ -133,7 +133,7 @@ public void visitMethodInsn(int opcode, String owner, String name,

public RewriteSingleJsoImplDispatches(ClassVisitor v, TypeOracle typeOracle,
SingleJsoImplData jsoData) {
super(Opcodes.ASM7, v);
super(Opcodes.ASM9, v);
this.typeOracle = typeOracle;
this.jsoData = jsoData;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private static class MethodInterceptor extends MethodVisitor {
private String className;

protected MethodInterceptor(MethodVisitor mv, String className) {
super(Opcodes.ASM7, mv);
super(Opcodes.ASM9, mv);
this.className = className;
}

Expand Down Expand Up @@ -144,7 +144,7 @@ public void visitMethodInsn(int opcode, String owner, String name,
private String className;

public UseMirroredClasses(ClassVisitor cv, String className) {
super(Opcodes.ASM7, cv);
super(Opcodes.ASM9, cv);
this.className = className;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public static ClassVisitor create(ClassVisitor cv, String classDescriptor,
* @param mapper maps methods to the class in which they are declared
*/
private WriteJsoImpl(ClassVisitor cv, InstanceMethodOracle mapper) {
super(Opcodes.ASM7, cv);
super(Opcodes.ASM9, cv);
this.mapper = mapper;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,30 @@
import com.google.gwt.dev.jjs.ast.JTypeOracle;
import com.google.gwt.thirdparty.guava.common.collect.ImmutableMap;
import com.google.gwt.thirdparty.guava.common.collect.Sets;
import com.google.gwt.thirdparty.guava.common.io.Files;

import junit.framework.TestCase;

import java.io.File;
import org.apache.commons.io.FileUtils;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Map;

/**
* Tests for {@link MinimalRebuildCacheManager}.
*/
public class MinimalRebuildCacheManagerTest extends TestCase {

public void testCacheChange() throws InterruptedException {
public void testCacheChange() throws InterruptedException, IOException {
String moduleName = "com.google.FooModule";
Map<String, String> initialCompilerOptions = ImmutableMap.of("option", "oldvalue");
PermutationDescription permutationDescription = new PermutationDescription();
File cacheDir = Files.createTempDir();
Path cacheDir = Files.createTempDirectory(null);

MinimalRebuildCacheManager minimalRebuildCacheManager =
new MinimalRebuildCacheManager(
TreeLogger.NULL, cacheDir, initialCompilerOptions);
TreeLogger.NULL, cacheDir.toFile(), initialCompilerOptions);

// Make sure we start with a blank slate.
minimalRebuildCacheManager.deleteCaches();
Expand All @@ -65,7 +68,7 @@ public void testCacheChange() throws InterruptedException {
Map<String, String> newCompilerOptions = ImmutableMap.of("option", "newvalue");
minimalRebuildCacheManager =
new MinimalRebuildCacheManager(
TreeLogger.NULL, cacheDir, newCompilerOptions);
TreeLogger.NULL, cacheDir.toFile(), newCompilerOptions);

// Now get the cache for FooModule under different compiler flags
MinimalRebuildCache fooCacheNew = minimalRebuildCacheManager.getCache(moduleName,
Expand All @@ -84,7 +87,7 @@ public void testCacheChange() throws InterruptedException {
// Switch back to the initial option values and verify you get the same old cache.
minimalRebuildCacheManager =
new MinimalRebuildCacheManager(
TreeLogger.NULL, cacheDir, initialCompilerOptions);
TreeLogger.NULL, cacheDir.toFile(), initialCompilerOptions);

// Now get the cache for FooModule under different under initial options values.
MinimalRebuildCache fooCacheResetOptions = minimalRebuildCacheManager.getCache(
Expand All @@ -96,16 +99,16 @@ public void testCacheChange() throws InterruptedException {
assertTrue(fooCacheOld.hasSameContent(fooCacheResetOptions));
minimalRebuildCacheManager.deleteCaches();
minimalRebuildCacheManager.shutdown();
cacheDir.delete();
FileUtils.deleteDirectory(cacheDir.toFile());
}

public void testReload() throws InterruptedException {
File cacheDir = Files.createTempDir();
public void testReload() throws InterruptedException, IOException {
Path cacheDir = Files.createTempDirectory(null);

String moduleName = "com.google.FooModule";
MinimalRebuildCacheManager minimalRebuildCacheManager =
new MinimalRebuildCacheManager(
TreeLogger.NULL, cacheDir, ImmutableMap.<String, String>of());
TreeLogger.NULL, cacheDir.toFile(), ImmutableMap.<String, String>of());
PermutationDescription permutationDescription = new PermutationDescription();

// Make sure we start with a blank slate.
Expand Down Expand Up @@ -149,7 +152,7 @@ public void testReload() throws InterruptedException {
// Start a new cache manager in the same folder.
MinimalRebuildCacheManager reloadedMinimalRebuildCacheManager =
new MinimalRebuildCacheManager(
TreeLogger.NULL, cacheDir, ImmutableMap.<String, String>of());
TreeLogger.NULL, cacheDir.toFile(), ImmutableMap.<String, String>of());

// Reread the previously saved cache.
MinimalRebuildCache reloadedCache =
Expand Down
Loading

0 comments on commit 195c749

Please sign in to comment.