Skip to content

Commit 6b2a991

Browse files
committed
Merge branch 'master' of https://github.com/typetools/checker-framework into 6990
2 parents 137224c + 93ec262 commit 6b2a991

42 files changed

Lines changed: 563 additions & 319 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build.gradle

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ plugins {
1515
// Code formatting; defines targets "spotlessApply" and "spotlessCheck".
1616
// https://github.com/diffplug/spotless/tags ; see tags starting "gradle/"
1717
// Only works on JDK 11+ (even including the plugin crashes Gradle on JDK 8).
18-
id 'com.diffplug.spotless' version '6.25.0'
18+
id 'com.diffplug.spotless' version '7.0.2'
1919
}
2020

2121
// There is another `repositories { ... }` block below; if you change this one, change that one as well.
@@ -51,7 +51,8 @@ ext {
5151

5252
versions = [
5353
autoValue : '1.11.0',
54-
googleJavaFormat : '1.19.2',
54+
// NOTE: Google Java Format requires JDK 17 or higher as of version 1.25.0.
55+
googleJavaFormat : '1.25.2',
5556
lombok : '1.18.36',
5657
hashmapUtil : '0.0.1',
5758
reflectionUtil : '1.1.4',
@@ -62,7 +63,7 @@ ext {
6263
// * Temporarily comment out "-Werror" elsewhere in this file
6364
// * Repeatedly run `./gradlew clean compileJava` and fix all errors
6465
// * Uncomment "-Werror"
65-
errorprone : '2.36.0',
66+
errorprone : '2.37.0',
6667
]
6768
}
6869

@@ -256,7 +257,7 @@ allprojects { currentProj ->
256257
target '*.md', '*.tex', '.gitignore', 'Makefile'
257258
targetExclude doNotFormat
258259
// define the steps to apply to those files
259-
indentWithSpaces(2)
260+
leadingTabsToSpaces(2)
260261
trimTrailingWhitespace()
261262
// endWithNewline() // Don't want to end empty files with a newline
262263
}
@@ -298,9 +299,9 @@ allprojects { currentProj ->
298299
targetExclude doNotFormat
299300
greclipse() // which formatter Spotless should use to format .gradle files.
300301
if (project.hasProperty('eisopFormatting')) {
301-
indentWithSpaces(4)
302+
leadingTabsToSpaces(4)
302303
} else {
303-
indentWithSpaces(2)
304+
leadingTabsToSpaces(2)
304305
}
305306
trimTrailingWhitespace()
306307
// endWithNewline() // Don't want to end empty files with a newline
@@ -313,7 +314,7 @@ allprojects { currentProj ->
313314
// removes semicolons at the end of lines
314315
removeSemicolons()
315316
greclipse()
316-
indentWithSpaces(2)
317+
leadingTabsToSpaces(2)
317318
trimTrailingWhitespace()
318319
}
319320
}

checker/bin-devel/test-misc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ status=0
1616

1717
## Code style and formatting
1818
JAVA_VER=$(java -version 2>&1 | head -1 | cut -d'"' -f2 | sed '/^1\./s///' | cut -d'.' -f1 | sed 's/-ea//')
19-
if [ "${JAVA_VER}" != "8" ] ; then
19+
if [ "${JAVA_VER}" != "8" ] && [ "${JAVA_VER}" != "11" ] ; then
2020
./gradlew spotlessCheck --console=plain --warning-mode=all
2121
fi
2222
if grep -n -r --exclude-dir=build --exclude-dir=examples --exclude-dir=jtreg --exclude-dir=tests --exclude="*.astub" --exclude="*.tex" '^\(import static \|import .*\*;$\)'; then

checker/src/main/java/org/checkerframework/checker/formatter/FormatterVisitor.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ public Void visitMethodInvocation(MethodInvocationTree tree, Void p) {
127127
if (!isWrappedFormatCall(fc, enclosingMethod)) {
128128
ftu.warning(invc, "format.indirect.arguments");
129129
}
130-
// TODO: If it is explict array construction, such as "new Object[] {
131-
// ... }", then we could treat it like the VARARGS case, analyzing each
132-
// argument. "new array" is probably rare, in the varargs position.
133-
// fall through
130+
// TODO: If it is explict array construction, such as "new Object[] {
131+
// ... }", then we could treat it like the VARARGS case, analyzing each
132+
// argument. "new array" is probably rare, in the varargs position.
133+
// fall through
134134
case NULLARRAY:
135135
for (ConversionCategory cat : formatCats) {
136136
if (cat == ConversionCategory.NULL) {

checker/src/main/java/org/checkerframework/checker/i18nformatter/I18nFormatterVisitor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ private void checkInvocationFormatFor(I18nFormatCall fc) {
101101
}
102102
break;
103103
case NULLARRAY:
104-
// fall-through
104+
// fall-through
105105
case ARRAY:
106106
for (I18nConversionCategory cat : formatCats) {
107107
if (cat == I18nConversionCategory.UNUSED) {

checker/src/main/java/org/checkerframework/checker/index/upperbound/UpperBoundTransfer.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,7 @@ public TransferResult<CFValue, CFStore> visitAssignment(
141141
(expNode instanceof TypeCastNode) ? ((TypeCastNode) expNode).getOperand() : expNode;
142142
// null if right-hand-side is not an array creation expression
143143
ArrayCreationNode acNode =
144-
(expNodeSansCast instanceof ArrayCreationNode)
145-
? acNode = (ArrayCreationNode) expNodeSansCast
146-
: null;
144+
(expNodeSansCast instanceof ArrayCreationNode) ? (ArrayCreationNode) expNodeSansCast : null;
147145

148146
if (acNode != null) {
149147
// Right-hand side of assignment is an array creation expression

checker/src/main/java/org/checkerframework/checker/mustcall/MustCallAnnotatedTypeFactory.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,15 @@ public ExecutableElement getMustCallValueElement() {
346346
return mustCallValueElement;
347347
}
348348

349+
/**
350+
* Returns the {@link InheritableMustCall#value} element.
351+
*
352+
* @return the {@link InheritableMustCall#value} element
353+
*/
354+
public ExecutableElement getInheritableMustCallValueElement() {
355+
return inheritableMustCallValueElement;
356+
}
357+
349358
/** Support @InheritableMustCall meaning @MustCall on all subtype elements. */
350359
private class MustCallDefaultQualifierForUseTypeAnnotator
351360
extends DefaultQualifierForUseTypeAnnotator {

checker/src/main/java/org/checkerframework/checker/nullness/NullnessVisitor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ protected boolean commonAssignmentCheck(
191191
|| !((IdentifierTree) receiver).getName().contentEquals("this")) {
192192
return null;
193193
}
194-
// fallthrough
194+
// fallthrough
195195
case IDENTIFIER:
196196
TreePath path = getCurrentPath();
197197
if (TreePathUtil.inConstructor(path)) {

0 commit comments

Comments
 (0)