Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating fork #6

Merged
merged 27 commits into from
Jul 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0c00b3f
Reorder changelog
mernst Jul 21, 2020
cb8e74a
Add predicate support to accumulation checker (#3476)
kelloggm Jul 21, 2020
fb533f7
Update makefile targets for Daikon type-checking
mernst Jul 21, 2020
7c5bf4b
Reduce duplication in comments
mernst Jul 21, 2020
213e2bd
Remove needless method argument
mernst Jul 21, 2020
13261ea
Alphabetize dependencies
mernst Jul 21, 2020
8ec9df3
Another example of a method that throws if its argument is null
mernst Jul 21, 2020
c44ded4
Support unique classes (Fixes #3313) (#3336)
aditya3434 Jul 21, 2020
eafe915
Improve the documentation of Receiver (#3473)
mernst Jul 21, 2020
bc3f109
Fix grammar
DmitriyShepelev Jul 22, 2020
15cc1c9
Documentation tweaks
mernst Jul 22, 2020
f358863
Bump biz.aQute.bnd.gradle from 5.1.1 to 5.1.2
dependabot-preview[bot] Jul 22, 2020
11d7bca
Updated the number of developers
NITIN23329 Jul 22, 2020
5d8457b
Turn URLs into links
mernst Jul 23, 2020
4ad676e
Documentation tweaks
mernst Jul 23, 2020
90cdd5e
Avoid more unnecessary computation
mernst Jul 23, 2020
bc9a120
Correct the logic of dataflow framework. (#3414)
xingweitian Jul 23, 2020
d8e7924
Don't permit bottom to be null (#3497)
mernst Jul 23, 2020
90f4053
Expand information about contributing
mernst Jul 24, 2020
076e281
Contributing annotations for non-JDK libraries
mernst Jul 24, 2020
25d045f
Add a TypeHierarchy for the Signedness Checker
mernst Jul 24, 2020
6369565
Correct/Improve UpperboundFor documentation
smillst Jul 24, 2020
7b683dc
Improve DefaultTypeHierarchy documentation
mernst Jul 24, 2020
013ff9a
make mergeStubsIntoType protected
kelloggm Jul 24, 2020
941fd23
Enhance message for argument.type.incompatible
mernst Jul 24, 2020
53b4d51
Retreive @MinLen annotations from ArrayAccess receivers (#3502)
PRITI1999 Jul 24, 2020
79f0c7c
Fix spelling
mernst Jul 25, 2020
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
22 changes: 17 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Contributing to the Checker Framework

Thank you for contributing to the Checker Framework! This project is a
community effort of [more than 90
community effort of [more than 110
developers](https://checkerframework.org/manual/#credits), plus countless
more people who have contributed bug reports and feature suggestions. We
couldn't do it without your help.
Expand All @@ -19,18 +19,30 @@ bug, and we want to fix it. Please report it.

## Submitting changes

Please see the [pull requests](https://rawgit.com/typetools/checker-framework/master/docs/developer/developer-manual.html#pull-requests) section of the Developer Manual.
Please see the [pull
requests](https://rawgit.com/typetools/checker-framework/master/docs/developer/developer-manual.html#pull-requests)
section of the Developer Manual.

Submit changes to the annotated JDK at https://github.com/typetools/jdk/pulls .
Annotations for other libraries can be contributed as stub files in this
repository, in a fork of the library in https://github.com/typetools/, or
in the library's own repository.

Do you want to contribute to the project, but you are not sure what issue
to fix or what feature to add? Use the tool in your daily work, and when
you encounter a limitation that bothers you, fix that one.
you encounter a limitation that bothers you, fix that one. The ["help
wanted"](https://github.com/typetools/checker-framework/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)
label marks issues that require less deep knowledge and may be appropriate
for a newcomer to the codebase.


## License

By contributing, you agree that your contributions will be licensed under the existing [license](LICENSE.txt), usually GPL2 or MIT License.
By contributing, you agree that your contributions will be licensed under the
existing [license](LICENSE.txt), usually GPL2 or MIT License.


## Code of conduct

In interactions with other people, please abide by the [Contributor Covenant](https://www.contributor-covenant.org/version/2/0/code_of_conduct).
When interacting with other people, please abide by the [Contributor
Covenant](https://www.contributor-covenant.org/version/2/0/code_of_conduct).
2 changes: 2 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
- job: junit_tests_jdk8
dependsOn:
- junit_tests_jdk11
- nonjunit_tests_jdk11
- misc_jdk11
pool:
vmImage: 'ubuntu-latest'
Expand All @@ -33,6 +34,7 @@ jobs:
displayName: test-cftests-junit.sh
- job: nonjunit_tests_jdk8
dependsOn:
- junit_tests_jdk11
- nonjunit_tests_jdk11
- misc_jdk11
pool:
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,7 @@ subprojects {

if (project.name.is('dataflow')) {
dependsOn('liveVariableTest')
dependsOn('issue3447Test')
}
}

Expand Down
4 changes: 2 additions & 2 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Version 3.6.0, August 3, 2020

Added a new option `-Aversion` to print the version of the Checker Framework.

The Interning Checker supports method annotations @EqualsMethod and
@CompareToMethod. Place them on methods like equals(), compareTo(), and
compare() to permit certain uses of == on non-interned values.

Added an overloaded version of NullnessUtil.castNonNull that takes an error message.

Added a new option `-Aversion` to print the version of the Checker Framework.

Implementation details:

commonAssignmentCheck() now takes an additional argument. Type system
Expand Down
2 changes: 1 addition & 1 deletion checker-qual/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
}
dependencies {
// Create OSGI bundles
classpath "biz.aQute.bnd:biz.aQute.bnd.gradle:5.1.1"
classpath "biz.aQute.bnd:biz.aQute.bnd.gradle:5.1.2"
}
}

Expand Down
4 changes: 2 additions & 2 deletions checker/bin-devel/test-daikon-part1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ git log | head -n 5
make compile
if [ "$TRAVIS" = "true" ] ; then
# Travis kills a job if it runs 10 minutes without output
time make JAVACHECK_EXTRA_ARGS=-Afilenames -C java check-part1
time make JAVACHECK_EXTRA_ARGS=-Afilenames -C java typecheck-part1
else
time make -C java check-part1
time make -C java typecheck-part1
fi
4 changes: 2 additions & 2 deletions checker/bin-devel/test-daikon-part2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ git log | head -n 5
make compile
if [ "$TRAVIS" = "true" ] ; then
# Travis kills a job if it runs 10 minutes without output
time make JAVACHECK_EXTRA_ARGS=-Afilenames -C java check-part2
time make JAVACHECK_EXTRA_ARGS=-Afilenames -C java typecheck-part2
else
time make -C java check-part2
time make -C java typecheck-part2
fi
56 changes: 28 additions & 28 deletions checker/jtreg/sortwarnings/ErrorOrders.out
Original file line number Diff line number Diff line change
Expand Up @@ -26,46 +26,46 @@ ErrorOrders.java:24:47: compiler.err.proc.messager: [expression.unparsable.type.
ErrorOrders.java:24:55: compiler.err.proc.messager: [assignment.type.incompatible] incompatible types in assignment.
found : @LTLengthOf(value="p2") int
required: @LTLengthOf(value="[error for expression: This isn't an expression; error: Invalid 'This isn't an expression' because is an invalid expression]") int
ErrorOrders.java:29:15: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:29:15: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p1 of test4.
found : @LowerBoundUnknown int
required: @GTENegativeOne int
ErrorOrders.java:29:15: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:29:15: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p1 of test4.
found : @UpperBoundUnknown int
required: @UpperBoundBottom int
ErrorOrders.java:29:24: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:29:24: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p2 of test4.
found : @LowerBoundUnknown int
required: @GTENegativeOne int
ErrorOrders.java:29:24: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:29:24: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p2 of test4.
found : @UpperBoundUnknown int
required: @UpperBoundBottom int
ErrorOrders.java:29:25: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:29:25: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p1 of test4.
found : @LowerBoundUnknown int
required: @GTENegativeOne int
ErrorOrders.java:29:25: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:29:25: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p1 of test4.
found : @UpperBoundUnknown int
required: @UpperBoundBottom int
ErrorOrders.java:29:29: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:29:29: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p2 of test4.
found : @LowerBoundUnknown int
required: @GTENegativeOne int
ErrorOrders.java:29:29: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:29:29: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p2 of test4.
found : @UpperBoundUnknown int
required: @UpperBoundBottom int
ErrorOrders.java:29:33: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:29:33: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p3 of test4.
found : @UnknownVal int @UnknownVal []
required: @UnknownVal int []
ErrorOrders.java:29:37: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:29:37: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p4 of test4.
found : @SameLenUnknown int @SameLen("p4") []
required: @SameLenUnknown int @SameLenBottom []
ErrorOrders.java:29:41: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:29:41: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p5 of test4.
found : @UnknownVal int
required: int
ErrorOrders.java:29:46: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:29:46: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p3 of test4.
found : @UnknownVal int @UnknownVal []
required: @UnknownVal int []
ErrorOrders.java:29:50: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:29:50: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p4 of test4.
found : @SameLenUnknown int @SameLen("p4") []
required: @SameLenUnknown int @SameLenBottom []
ErrorOrders.java:29:54: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:29:54: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p5 of test4.
found : @UnknownVal int
required: int
ErrorOrders.java:33:47: compiler.err.proc.messager: [expression.unparsable.type.invalid] Expression invalid in dependent type annotation: [error for expression: This isn't an expression; error: Invalid 'This isn't an expression' because is an invalid expression]
Expand Down Expand Up @@ -95,46 +95,46 @@ ErrorOrders.java:56:47: compiler.err.proc.messager: [expression.unparsable.type.
ErrorOrders.java:56:55: compiler.err.proc.messager: [assignment.type.incompatible] incompatible types in assignment.
found : @LTLengthOf(value="p2") int
required: @LTLengthOf(value="[error for expression: This isn't an expression; error: Invalid 'This isn't an expression' because is an invalid expression]") int
ErrorOrders.java:61:15: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:61:15: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p1 of test4.
found : @LowerBoundUnknown int
required: @GTENegativeOne int
ErrorOrders.java:61:15: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:61:15: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p1 of test4.
found : @UpperBoundUnknown int
required: @UpperBoundBottom int
ErrorOrders.java:61:24: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:61:24: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p2 of test4.
found : @LowerBoundUnknown int
required: @GTENegativeOne int
ErrorOrders.java:61:24: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:61:24: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p2 of test4.
found : @UpperBoundUnknown int
required: @UpperBoundBottom int
ErrorOrders.java:61:25: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:61:25: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p1 of test4.
found : @LowerBoundUnknown int
required: @GTENegativeOne int
ErrorOrders.java:61:25: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:61:25: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p1 of test4.
found : @UpperBoundUnknown int
required: @UpperBoundBottom int
ErrorOrders.java:61:29: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:61:29: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p2 of test4.
found : @LowerBoundUnknown int
required: @GTENegativeOne int
ErrorOrders.java:61:29: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:61:29: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p2 of test4.
found : @UpperBoundUnknown int
required: @UpperBoundBottom int
ErrorOrders.java:61:33: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:61:33: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p3 of test4.
found : @UnknownVal int @UnknownVal []
required: @UnknownVal int []
ErrorOrders.java:61:37: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:61:37: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p4 of test4.
found : @SameLenUnknown int @SameLen("p4") []
required: @SameLenUnknown int @SameLenBottom []
ErrorOrders.java:61:41: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:61:41: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p5 of test4.
found : @UnknownVal int
required: int
ErrorOrders.java:61:46: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:61:46: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p3 of test4.
found : @UnknownVal int @UnknownVal []
required: @UnknownVal int []
ErrorOrders.java:61:50: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:61:50: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p4 of test4.
found : @SameLenUnknown int @SameLen("p4") []
required: @SameLenUnknown int @SameLenBottom []
ErrorOrders.java:61:54: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
ErrorOrders.java:61:54: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter p5 of test4.
found : @UnknownVal int
required: int
49 errors
2 changes: 1 addition & 1 deletion checker/jtreg/stubs/issue2147/WithStub.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
EnumStubTest.java:16:31: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
EnumStubTest.java:16:31: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter sEnum of requireEnum.
found : @Tainted SampleEnum
required: @Untainted SampleEnum
1 error
4 changes: 2 additions & 2 deletions checker/jtreg/stubs/issue2147/WithoutStub.out
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
EnumStubTest.java:15:31: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
EnumStubTest.java:15:31: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter sEnum of requireEnum.
found : @Tainted SampleEnum
required: @Untainted SampleEnum
EnumStubTest.java:16:31: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
EnumStubTest.java:16:31: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter sEnum of requireEnum.
found : @Tainted SampleEnum
required: @Untainted SampleEnum
2 errors
2 changes: 1 addition & 1 deletion checker/jtreg/tainting/NewClass.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NewClass.java:18:49: compiler.err.proc.messager: [argument.type.incompatible] incompatible types in argument.
NewClass.java:18:49: compiler.err.proc.messager: [argument.type.incompatible] incompatible argument for parameter o of get.
found : @Tainted Object
required: @Untainted Object
1 error
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,9 @@ private static char conversionCharFromFormat(@Regex(6) Matcher m) {
/**
* Return the conversion character that is in the given format specifier.
*
* @param formatSpecifier a format specifier; see
* https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Formatter.html#syntax}
* @param formatSpecifier a <a
* href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Formatter.html#syntax">format
* specifier</a>
* @return the conversion character that is in the given format specifier
* @deprecated This method is public only for testing. Use {@link
* #conversionCharFromFormat(Matcher)}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.List;
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.Name;
import javax.lang.model.element.VariableElement;
import javax.lang.model.type.TypeMirror;
import org.checkerframework.checker.compilermsgs.qual.CompilerMessageKey;
Expand Down Expand Up @@ -88,9 +89,14 @@ public Void visitMethodInvocation(MethodInvocationTree node, Void p) {
default:
if (!fc.isValidParameter(formatCat, paramType)) {
// II.3
ExecutableElement method =
TreeUtils.elementFromUse(node);
Name methodName = method.getSimpleName();
tu.failure(
param,
"argument.type.incompatible",
"", // parameter name is not useful
methodName,
paramType,
formatCat);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
import java.util.Set;
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.Name;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
import javax.lang.model.type.DeclaredType;
import org.checkerframework.checker.guieffect.qual.AlwaysSafe;
import org.checkerframework.checker.guieffect.qual.PolyUI;
Expand Down Expand Up @@ -487,6 +489,9 @@ private void scanUp(TreePath path) {
List<? extends ExpressionTree> args = invocationTree.getArguments();
ParameterizedExecutableType mType = atypeFactory.methodFromUse(invocationTree);
AnnotatedExecutableType invokedMethod = mType.executableType;
ExecutableElement method = invokedMethod.getElement();
Name methodName = method.getSimpleName();
List<? extends VariableElement> methodParams = method.getParameters();
List<AnnotatedTypeMirror> argsTypes =
AnnotatedTypes.expandVarArgs(
atypeFactory, invokedMethod, invocationTree.getArguments());
Expand All @@ -497,7 +502,9 @@ private void scanUp(TreePath path) {
argsTypes.get(i),
atypeFactory.getAnnotatedType(args.get(i)),
args.get(i),
"argument.type.incompatible");
"argument.type.incompatible",
methodParams.get(i),
methodName);
}
}
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,15 @@ public I18nFormatCall(
initialCheck(theargs, method, node, methodAnno);
}

/**
* Returns the AST node for the call.
*
* @return the AST node for the call
*/
public MethodInvocationTree getTree() {
return tree;
}

@Override
public String toString() {
return this.tree.toString();
Expand Down
Loading