Skip to content

Commit

Permalink
Drop isMalformed tests on pre JLS 8
Browse files Browse the repository at this point in the history
Now that Java 8 is the minimum supported testing that construct valid on
Java 8 is invalid on older(unsupported) JLS is useless exercise.
  • Loading branch information
akurtakov committed Jan 27, 2025
1 parent 5a22a10 commit ca77e4c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 132 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10321,72 +10321,6 @@ public void test0720() throws JavaModelException {
assertTrue("A constructor", !declaration.isConstructor());
checkSourceRange(declaration, "public void method(final int parameter) { }", source, true/*expectMalformed*/);
}
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=339864
*/
public void test0721() throws JavaModelException {
ICompilationUnit workingCopy = null;
try {
String contents =
"public class X {\n" +
" public static void main(String[] args) {\n" +
" File file = new File(args[0]);\n" +
" /*start*/try {\n" +
" FileInputStream fis = new FileInputStream(file);\n" +
" fis.read();\n" +
" } catch (FileNotFoundException | IOException e) {\n" +
" e.printStackTrace();\n" +
" }/*end*/\n" +
" }\n" +
"}";
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
TryStatement statement = (TryStatement) buildAST(
getJLS3(),
contents,
workingCopy,
false,
true,
true);
CatchClause catchClause = (CatchClause) statement.catchClauses().get(0);
assertTrue("Should be malformed", isMalformed(catchClause.getException().getType()));
} finally {
if (workingCopy != null) {
workingCopy.discardWorkingCopy();
}
}
}
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=339864
*/
public void test0722() throws JavaModelException {
ICompilationUnit workingCopy = null;
try {
String contents =
"public class X {\n" +
" public static void main(String[] args) {\n" +
" File file = new File(args[0]);\n" +
" /*start*/try (FileInputStream fis = new FileInputStream(file);) {\n" +
" fis.read();\n" +
" } catch (IOException e) {\n" +
" e.printStackTrace();\n" +
" }/*end*/\n" +
" }\n" +
"}";
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
TryStatement statement = (TryStatement) buildAST(
getJLS3(),
contents,
workingCopy,
false,
true,
true);
assertTrue("Should be malformed", isMalformed(statement));
} finally {
if (workingCopy != null) {
workingCopy.discardWorkingCopy();
}
}
}
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=347396
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10486,72 +10486,6 @@ public void test0720() throws JavaModelException {
assertTrue("A constructor", !declaration.isConstructor());
checkSourceRange(declaration, "public void method(final int parameter) { }", source, true/*expectMalformed*/);
}
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=339864
*/
public void test0721() throws JavaModelException {
ICompilationUnit workingCopy = null;
try {
String contents =
"public class X {\n" +
" public static void main(String[] args) {\n" +
" File file = new File(args[0]);\n" +
" /*start*/try {\n" +
" FileInputStream fis = new FileInputStream(file);\n" +
" fis.read();\n" +
" } catch (FileNotFoundException | IOException e) {\n" +
" e.printStackTrace();\n" +
" }/*end*/\n" +
" }\n" +
"}";
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
TryStatement statement = (TryStatement) buildAST(
getJLS3(),
contents,
workingCopy,
false,
true,
true);
CatchClause catchClause = (CatchClause) statement.catchClauses().get(0);
assertTrue("Should be malformed", isMalformed(catchClause.getException().getType()));
} finally {
if (workingCopy != null) {
workingCopy.discardWorkingCopy();
}
}
}
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=339864
*/
public void test0722() throws JavaModelException {
ICompilationUnit workingCopy = null;
try {
String contents =
"public class X {\n" +
" public static void main(String[] args) {\n" +
" File file = new File(args[0]);\n" +
" /*start*/try (FileInputStream fis = new FileInputStream(file);) {\n" +
" fis.read();\n" +
" } catch (IOException e) {\n" +
" e.printStackTrace();\n" +
" }/*end*/\n" +
" }\n" +
"}";
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
TryStatement statement = (TryStatement) buildAST(
getJLS3(),
contents,
workingCopy,
false,
true,
true);
assertTrue("Should be malformed", isMalformed(statement));
} finally {
if (workingCopy != null) {
workingCopy.discardWorkingCopy();
}
}
}
/**
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=347396
*/
Expand Down

0 comments on commit ca77e4c

Please sign in to comment.