Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/full-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ '11', '17', '21', '22' ]
java-version: [ '17', '21', '25' ]
steps:
- name: Checkout GWT itself into one directory
uses: actions/checkout@v6
Expand All @@ -33,7 +33,8 @@ jobs:
- name: Checkout GWT tools into a sibling directory
uses: actions/checkout@v6
with:
repository: 'gwtproject/tools'
repository: 'Vertispan/tools'
ref: 'errorprone-2.42'
path: 'tools'
- name: Set up JDK ${{ matrix.java-version }}
# GWT requires Java 11+ to build
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/quick-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java-version: ['11', '17', '21', '22']
java-version: ['17', '21', '25']
steps:
- name: Checkout GWT itself into one directory
uses: actions/checkout@v6
Expand All @@ -20,7 +20,8 @@ jobs:
- name: Checkout GWT tools into a sibling directory
uses: actions/checkout@v6
with:
repository: 'gwtproject/tools'
repository: 'Vertispan/tools'
ref: 'errorprone-2.42'
path: 'tools'
- name: Set up JDK ${{ matrix.java-version }}
# GWT presently requires Java 11+ to build
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
description=This is the wrong issue, but these methods are still preview, and we need an issue.
members=java.util.List#ofLazy(int, IntFunction)\
java.util.Map#ofLazy(Set, Function)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
members=java.util.Comparator#min(Object, Object)\
java.util.Comparator#max(Object, Object)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
members=java.lang.CharSequence#getChars(int, int, char[], int)
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
members=java.lang.Math#unsignedMultiplyExact(int, int)\
java.lang.Math#unsignedMultiplyExact(long, long)\
java.lang.Math#unsignedMultiplyExact(long, int)\
java.lang.Math#powExact(int, int)\
java.lang.Math#powExact(long, int)\
java.lang.Math#unsignedPowExact(long, int)\
java.lang.Math#unsignedPowExact(int, int)\
java.lang.StrictMath#unsignedMultiplyExact(long, int)\
java.lang.StrictMath#unsignedMultiplyExact(long, long)\
java.lang.StrictMath#unsignedMultiplyExact(int, int)\
java.lang.StrictMath#powExact(long, int)\
java.lang.StrictMath#powExact(int, int)\
java.lang.StrictMath#unsignedPowExact(long, int)\
java.lang.StrictMath#unsignedPowExact(int, int)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
members=java.io.Reader#of(CharSequence)\
java.io.Reader#readAllLines()\
java.io.Reader#readAllAsString()
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
members=java.math.BigInteger#rootn(int)\
java.math.BigInteger#rootnAndRemainder(int)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
members=java.lang.String#equalsFoldCase(String)\
java.lang.String#compareToFoldCase(String)\
java.lang.String#UNICODE_CASEFOLD_ORDER
7 changes: 4 additions & 3 deletions common.ant.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@
<property name="javac.debug" value="true"/>
<property name="javac.debuglevel" value="lines,vars,source"/>
<property name="javac.encoding" value="utf-8"/>
<property name="javac.release" value="11"/>
<property name="javac.release" value="17"/>
<property name="javac.nowarn" value="true"/>

<!-- javac and errorprone instructions from https://errorprone.info/docs/installation#ant -->
<path id="errorprone.processorpath.ref">
<pathelement location="${gwt.tools.lib}/errorprone/error_prone_core-2.23.0-with-dependencies.jar"/>
<pathelement location="${gwt.tools.lib}/errorprone/dataflow-errorprone-3.34.0-eisop1.jar"/>
<pathelement location="${gwt.tools.lib}/errorprone/error_prone_core-2.42.0-with-dependencies.jar"/>
<pathelement location="${gwt.tools.lib}/errorprone/dataflow-errorprone-3.41.0-eisop1.jar"/>
</path>

<property name="junit.out" location="${project.build}/test"/>
Expand Down Expand Up @@ -187,6 +187,7 @@
<compilerarg value="-XDcompilePolicy=simple"/>
<compilerarg value="-processorpath"/>
<compilerarg pathref="mergedprocessorpath.ref"/>
<compilerarg value="--should-stop=ifError=FLOW"/>
<compilerarg value="-Xplugin:ErrorProne @{errorprone.args}" />
<javaccontents />
</javac>
Expand Down
1 change: 1 addition & 0 deletions dev/core/test/com/google/gwt/dev/GwtVersionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public void testCompareTo() {
/**
* Test that GwtVersion.compareTo produced expected results.
*/
@SuppressWarnings("SelfAssertion")
public void testEquals() {
GwtVersion v1 = new GwtVersion("0.0.0");
assertEquals(v1, v1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ protected void validateCompilationState(String... generatedTypeNames) {
// Not always true due to caching! A source unit for FOO can b
// identical to the generated FOO and already be cached.
// assertTrue(unit.isGenerated());
assertNotNull(generatedTypes.remove(className));
assertTrue(generatedTypes.remove(className));
} else {
String partialPath = className.replace('.', '/') + ".java";
assertTrue(resourcePathNames.contains(partialPath));
// TODO: Validate the source file matches the resource.
assertNotNull(resourcePathNames.remove(partialPath));
assertTrue(resourcePathNames.remove(partialPath));
}
}
// The mutable sets should be empty now.
Expand Down
2 changes: 2 additions & 0 deletions dev/core/test/com/google/gwt/dev/util/StringKeyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ private static <T extends Comparable<T>> void assertLT(T a, T b) {
assertTrue(a.compareTo(b) < 0);
}

@SuppressWarnings("SelfAssertion")
public void test() {
StringKey a = new KeyA("hello");
StringKey b = new KeyB("world");
Expand All @@ -64,6 +65,7 @@ public void test() {
assertGT(b, a);
}

@SuppressWarnings("SelfAssertion")
public void testNull() {
StringKey a = new KeyA(null);
StringKey b = new KeyB(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public boolean isEqualsCheckable() {
}

//-----------------------------------------------------------------------
@SuppressWarnings("SelfAssertion")
public void testObjectEqualsSelf() {
Object obj = makeObject();
assertEquals("A Object should equal itself", obj, obj);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeMap;
Expand Down Expand Up @@ -931,7 +932,7 @@ private void initReplacements(TreeLogger logger, ResourceContext context,
* be be worth the effort to simplify this.
*/

if (context.getCachedData(KEY_HAS_CACHED_DATA, Boolean.class) != Boolean.TRUE) {
if (!Objects.equals(context.getCachedData(KEY_HAS_CACHED_DATA, Boolean.class), Boolean.TRUE)) {

ConfigurationProperty prop;
TreeSet<String> reservedPrefixes = new TreeSet<String>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
Expand Down Expand Up @@ -695,7 +696,7 @@ public void init(TreeLogger logger, ResourceContext context) throws UnableToComp

@SuppressWarnings("unchecked")
private void initReplacement(ResourceContext context) {
if (context.getCachedData(KEY_HAS_CACHED_DATA, Boolean.class) != Boolean.TRUE) {
if (!Objects.equals(context.getCachedData(KEY_HAS_CACHED_DATA, Boolean.class), Boolean.TRUE)) {

context.putCachedData(KEY_SHARED_METHODS, new IdentityHashMap<JMethod, String>());
context.putCachedData(KEY_BY_CLASS_AND_METHOD, new IdentityHashMap<JClassType, Map<String,
Expand Down
3 changes: 2 additions & 1 deletion user/src/com/google/gwt/uibinder/rebind/BundleWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import com.google.gwt.uibinder.rebind.model.ImplicitImageResource;

import java.util.Collection;
import java.util.Objects;
import java.util.Set;

/**
Expand Down Expand Up @@ -117,7 +118,7 @@ private void writeBundleClass() {
for (ImplicitDataResource data : bundleClass.getDataMethods()) {
writer.write("@Source(\"%s\")", data.getSource());
writer.newline();
if (data.getDoNotEmbed() == Boolean.TRUE) {
if (Objects.equals(data.getDoNotEmbed(), Boolean.TRUE)) {
writer.write("@DoNotEmbed");
writer.newline();
}
Expand Down
1 change: 1 addition & 0 deletions user/test/com/google/gwt/core/interop/JsExportTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ public void testClinit_staticField() {
namespace = "$global.woo.StaticInitializerStaticField.InterfaceWithField", name = "STATIC")
private static native Object getStaticInitializerStaticFieldInterfaceStatic();

@SuppressWarnings("ImpossibleNullComparison")
public void testClinit_staticMethod() {
assertNotNull(getStaticInitializerStaticMethod());
}
Expand Down
1 change: 1 addition & 0 deletions user/test/com/google/gwt/dev/jjs/test/JsoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ public final boolean equalMethod(Object o) {
}
}

@SuppressWarnings("SelfAssertion")
public void testEquality() {
JavaScriptObject jso = makeJSO();
assertEquals(jso, jso);
Expand Down
1 change: 1 addition & 0 deletions user/test/com/google/gwt/dev/jjs/test/NativeLongTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public void testCasts() {
assertEquals(0x1234, (short) LONG_1234);
}

@SuppressWarnings("SelfAssertion")
public void testConstants() {
assertEquals(LONG_5DEECE66D, LONG_5DEECE66D);
assertTrue(LONG_5DEECE66D > 0L);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public void testCharAt() {
assertEquals('b', "abc".charAt(1));
}

@SuppressWarnings("SelfAssertion")
public void testConcat() {
assertEquals("abcdef", "abc" + "def");
assertEquals("abcdef", "abc".concat("def"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public int getCompatibilityVersion() {
/** Return a new, empty {@link Object} to used for testing. */
public abstract Object makeObject();

@SuppressWarnings("SelfAssertion")
public void testObjectEqualsSelf() {
Object obj = makeObject();
assertEquals("A Object should equal itself", obj, obj);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public String getModuleName() {
return "com.google.gwt.emultest.EmulSuite";
}

@SuppressWarnings("StringJoin")
public void testJoin() {
assertEquals("", String.join("", ""));
assertEquals("", String.join(",", ""));
Expand Down
4 changes: 4 additions & 0 deletions user/test/com/google/gwt/junit/client/GWTTestCaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,10 @@
throw throwable;
}
testThrowsNonSerializableException();
}

Check warning on line 117 in user/test/com/google/gwt/junit/client/GWTTestCaseTest.java

View workflow job for this annotation

GitHub Actions / build (21)

[checkstyle] reported by reviewdog 🐶 Line matches the illegal pattern 'more than one blank line'. Raw Output: /home/runner/work/gwt/gwt/gwt/user/test/com/google/gwt/junit/client/GWTTestCaseTest.java:117:0: info: Line matches the illegal pattern 'more than one blank line'. (com.puppycrawl.tools.checkstyle.checks.regexp.RegexpCheck)


@SuppressWarnings("SelfAssertion")
public void testAssertEqualsDouble() {
assertEquals(0.0, 0.0, 0.0);
assertEquals(1.1, 1.1, 0.0);
Expand All @@ -134,6 +135,7 @@
assertNotEquals(-2.0, -1.0, 0.1);
}

@SuppressWarnings("SelfAssertion")
public void testAssertEqualsFloat() {
assertEquals(0.0f, 0.0f, 0.0f);
assertEquals(1.1f, 1.1f, 0.0f);
Expand All @@ -151,6 +153,7 @@
assertNotEquals(-2.0f, -1.0f, 0.1f);
}

@SuppressWarnings("SelfAssertion")
public void testAssertEqualsIntInt() {
assertEquals(5, 5);
assertEquals("msg", 5, 5);
Expand All @@ -166,6 +169,7 @@
assertEquals("msg", 5, 4);
}

@SuppressWarnings("SelfAssertion")
public void testAssertEqualsObjectObject() {
assertEquals(obj1, obj1Equal);
assertEquals("msg", obj1, obj1);
Expand Down
2 changes: 2 additions & 0 deletions user/test/com/google/gwt/storage/client/MapInterfaceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,7 @@ public void testEntrySetSetValueSameValue() {
assertInvariants(map);
}

@SuppressWarnings("SelfAssertion")
public void testEqualsForEqualMap() {
final Map<K, V> map;
try {
Expand Down Expand Up @@ -841,6 +842,7 @@ public void disabled_testEqualsForSmallerMap() {
assertFalse(map.equals(smallerMap));
}

@SuppressWarnings("SelfAssertion")
public void testEqualsForEmptyMap() {
final Map<K, V> map;
try {
Expand Down