Skip to content

Commit

Permalink
jclMin1.8.jar is not complete for 1.8 JLS target tests
Browse files Browse the repository at this point in the history
+ update jclMin1.8
+ also fixes NullAnnotationModelTests.testBug565246 error reporting

Fixes eclipse-jdt#2756
  • Loading branch information
stephan-herrmann committed Nov 3, 2024
1 parent 1150dc0 commit df3c94a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
7 changes: 7 additions & 0 deletions JCL/jclMin1.8/src/java/lang/Iterable.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package java.lang;

import java.util.Iterator;

public interface Iterable<T> {
Iterator<T> iterator();
}
2 changes: 1 addition & 1 deletion JCL/jclMin1.8/src/java/util/Collection.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*******************************************************************************/
package java.util;

public interface Collection<T> {
public interface Collection<T> extends Iterable<T> {
public Iterator<T> iterator();
public int size();
public T get(int index);
Expand Down
Binary file modified org.eclipse.jdt.core.tests.model/JCL/jclMin1.8.jar
Binary file not shown.
Binary file modified org.eclipse.jdt.core.tests.model/JCL/jclMin1.8src.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ public void testBug479389() throws CoreException, IOException {
deleteProject(project);
}
}
public void _2551_testBug565246() throws CoreException {
public void testBug565246() throws CoreException {
IJavaProject project = createJavaProject("Bug565246", new String[] {"src"}, new String[] {"JCL18_LIB", this.ANNOTATION_LIB_V1}, "bin", CompilerOptions.getFirstSupportedJavaVersion());
try {
project.setOption(JavaCore.COMPILER_ANNOTATION_NULL_ANALYSIS, JavaCore.ENABLED);
Expand All @@ -1126,7 +1126,7 @@ public void _2551_testBug565246() throws CoreException {
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);

String testSourcePath = "Bug565246/src/Test.java";
createFile(testSourcePath,
String testSourceContent =
"import org.eclipse.jdt.annotation.NonNull;\n" +
"import java.util.Collection;\n" +
"public class Test {\n" +
Expand All @@ -1135,7 +1135,9 @@ public void _2551_testBug565246() throws CoreException {
" bar(s);\n" +
" }\n" +
" void bar(@NonNull String s) {}\n" +
"}\n");
"}\n";
createFile(testSourcePath, testSourceContent);
this.problemRequestor.initialize(testSourceContent.toCharArray());

getCompilationUnit(testSourcePath).getWorkingCopy(this.wcOwner, null);
assertProblems("", "----------\n----------\n");
Expand Down

0 comments on commit df3c94a

Please sign in to comment.