forked from eclipse-jdt/eclipse.jdt.core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
550bc72
commit 7312c76
Showing
41 changed files
with
577 additions
and
12 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
org.eclipse.jdt.core.javac/examples/diagnostics/Ambiguous/Ambiguous.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package Ambiguous; | ||
|
||
import Ambiguous.pkg1.*; | ||
import Ambiguous.pkg2.*; | ||
|
||
public class Ambiguous { | ||
private void testAmbiguous1() { | ||
// compiler.err.ref.ambiguous -> AmbiguousType(16777220) | ||
A a; | ||
// compiler.err.ref.ambiguous -> AmbiguousMethod(67108966) | ||
method(1, 2); | ||
} | ||
|
||
void method(int i, double d) { | ||
} | ||
|
||
void method(double d, int m) { | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
org.eclipse.jdt.core.javac/examples/diagnostics/Ambiguous/pkg1/A.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package Ambiguous.pkg1; | ||
|
||
public class A { | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
org.eclipse.jdt.core.javac/examples/diagnostics/Ambiguous/pkg2/A.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package Ambiguous.pkg2; | ||
|
||
public class A { | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
org.eclipse.jdt.core.javac/examples/diagnostics/AnnotationMember.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
|
||
// compiler.err.annotation.value.must.be.name.value -> UndefinedAnnotationMember(67109475) | ||
@Retention(RetentionPolicy.RUNTIME, "error") | ||
public @interface AnnotationMember { | ||
} |
7 changes: 7 additions & 0 deletions
7
org.eclipse.jdt.core.javac/examples/diagnostics/BodyForAbstractMethod.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
public abstract class BodyForAbstractMethod { | ||
// compiler.err.abstract.meth.cant.have.body -> BodyForAbstractMethod(603979889) | ||
abstract void testBodyForAbstractMethod() { | ||
|
||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
org.eclipse.jdt.core.javac/examples/diagnostics/CodeCannotBeReached.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
public class CodeCannotBeReached { | ||
public void testCodeCannotBeReached() { | ||
return; | ||
// compiler.err.unreachable.stmt -> CodeCannotBeReached(536871073) | ||
String reach = ""; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import java.io.File; | ||
// compiler.err.already.defined.this.unit -> ConflictingImport(268435841) | ||
public class File { | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
org.eclipse.jdt.core.javac/examples/diagnostics/FileNameAndClassName.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
// compiler.err.class.public.should.be.in.file -> PublicClassMustMatchFileName(16777541) | ||
public class ClassName { | ||
} |
9 changes: 9 additions & 0 deletions
9
org.eclipse.jdt.core.javac/examples/diagnostics/IncompatibleExpInThrow/Sub.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package IncompatibleExpInThrow; | ||
|
||
// compiler.err.override.meth.doesnt.throw -> IncompatibleExceptionInThrowsClause(67109266) | ||
public class Sub extends Super { | ||
@Override | ||
void foo() throws Exception { | ||
|
||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
org.eclipse.jdt.core.javac/examples/diagnostics/IncompatibleExpInThrow/Super.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package IncompatibleExpInThrow; | ||
|
||
import java.io.IOException; | ||
|
||
public class Super { | ||
void foo() throws IOException { | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
org.eclipse.jdt.core.javac/examples/diagnostics/IncompatibleReturnType/Sub.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package IncompatibleReturnType; | ||
|
||
// compiler.err.override.incompatible.ret -> UndefinedAnnotationMember(67109475) | ||
public class Sub extends Super { | ||
@Override | ||
void foo() { | ||
|
||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
org.eclipse.jdt.core.javac/examples/diagnostics/IncompatibleReturnType/Super.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package IncompatibleReturnType; | ||
|
||
import java.io.IOException; | ||
|
||
public class Super { | ||
String foo() { | ||
return "foo"; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
org.eclipse.jdt.core.javac/examples/diagnostics/InvalidUnionTypeReferenceSequenceCatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.io.FileNotFoundException; | ||
|
||
public class InvalidUnionTypeReferenceSequenceCatch { | ||
public void testInvalidUnionTypeReferenceSequence() { | ||
try { | ||
boolean success = new File("f").createNewFile(); | ||
} catch (FileNotFoundException | IOException e) { | ||
// compiler.err.multicatch.types.must.be.disjoint -> InvalidUnionTypeReferenceSequence(553649001) | ||
|
||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
org.eclipse.jdt.core.javac/examples/diagnostics/MethodReturnsVoid.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
public class MethodReturnsVoid { | ||
public void testVoidMethod() { | ||
|
||
} | ||
|
||
public String testMethodReturnsVoid() { | ||
// compiler.err.prob.found.req -> MethodReturnsVoid(67108969) | ||
return testVoidMethod(); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
org.eclipse.jdt.core.javac/examples/diagnostics/MissingReturnType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
public class MissingReturnType { | ||
// compiler.err.invalid.meth.decl.ret.type.req -> MissingReturnType(16777327) | ||
public testMissingReturnType() { | ||
|
||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
org.eclipse.jdt.core.javac/examples/diagnostics/MissingValueForAnnotationMember/A.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package MissingValueForAnnotationMember; | ||
|
||
// compiler.err.annotation.missing.default.value -> MissingValueForAnnotationMember(16777825) | ||
public class A { | ||
@CustomAnnotation | ||
public void testMissingValueForAnnotationMember() { | ||
|
||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...jdt.core.javac/examples/diagnostics/MissingValueForAnnotationMember/CustomAnnotation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package MissingValueForAnnotationMember; | ||
|
||
public @interface CustomAnnotation { | ||
String name(); | ||
} |
8 changes: 8 additions & 0 deletions
8
org.eclipse.jdt.core.javac/examples/diagnostics/NoMessageSendOnArrayType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
public class NoMessageSendOnArrayType { | ||
public void testNoMessageSendOnArrayType() { | ||
String[] test = {"1", "2"}; | ||
// compiler.err.cant.resolve.location.args -> NoMessageSendOnArrayType(67108980) | ||
int size = test.size(); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
org.eclipse.jdt.core.javac/examples/diagnostics/NotVisibleConstructor/A.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package NotVisibleConstructor; | ||
|
||
public class A { | ||
private String a; | ||
private A(String a) { | ||
this.a = a; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
org.eclipse.jdt.core.javac/examples/diagnostics/NotVisibleConstructor/B.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package NotVisibleConstructor; | ||
|
||
public class B { | ||
public void testNotVisibleConstructor() { | ||
// compiler.err.report.access -> NotVisibleConstructor(134217859) | ||
A a = new A("a"); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...se.jdt.core.javac/examples/diagnostics/NotVisibleConstructorInDefaultConstructor/Sub.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package NotVisibleConstructorInDefaultConstructor; | ||
|
||
// compiler.err.report.access -> NotVisibleConstructorInDefaultConstructor(134217869) | ||
public class Sub extends Super { | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
....jdt.core.javac/examples/diagnostics/NotVisibleConstructorInDefaultConstructor/Super.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package NotVisibleConstructorInDefaultConstructor; | ||
|
||
public class Super { | ||
private Super() { | ||
|
||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
org.eclipse.jdt.core.javac/examples/diagnostics/NotVisibleMethod/A.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package NotVisibleMethod; | ||
|
||
public class A { | ||
private void a() { | ||
|
||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
org.eclipse.jdt.core.javac/examples/diagnostics/NotVisibleMethod/B.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package NotVisibleMethod; | ||
|
||
public class B { | ||
public void testNotVisibleMethod() { | ||
A a = new A(); | ||
// compiler.err.report.access -> NotVisibleMethod(67108965) | ||
a.a(); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
org.eclipse.jdt.core.javac/examples/diagnostics/NotVisibleType/A.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package NotVisibleType; | ||
|
||
public class A { | ||
private class Inner { | ||
|
||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
org.eclipse.jdt.core.javac/examples/diagnostics/NotVisibleType/B.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package NotVisibleType; | ||
|
||
public class B { | ||
public void testNotVisibleType() { | ||
// compiler.err.report.access -> NotVisibleType(16777219) | ||
A.Inner i = new A.Inner(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
org.eclipse.jdt.core.javac/examples/diagnostics/ParameterMismatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
public class ParameterMismatch { | ||
|
||
private String message; | ||
|
||
private void setMessage(String message) { | ||
this.message = message; | ||
} | ||
|
||
private void testMethodParameterMatch() { | ||
// compiler.err.cant.apply.symbol -> ParameterMismatch(67108979) | ||
this.setMessage(); | ||
} | ||
|
||
void m(int i1) {} | ||
void m(int i1, int i2) {} | ||
|
||
ParameterMismatch() { | ||
// compiler.err.cant.apply.symbols -> ParameterMismatch(67108979) | ||
this.m(); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
org.eclipse.jdt.core.javac/examples/diagnostics/TypeMismatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
import java.util.List; | ||
import java.util.ArrayList; | ||
|
||
public class TypeMismatch { | ||
private void testTypeMismatch() { | ||
// compiler.err.illegal.initializer.for.type -> TypeMismatch(16777233) | ||
String a = { "a", "b" }; | ||
} | ||
|
||
private void testTypeMismatch1() { | ||
// compiler.err.prob.found.req -> TypeMismatch(16777233) | ||
String a = new String[] { "a", "b" }; | ||
} | ||
|
||
private String testReturnTypeMismatch() { | ||
// compiler.err.prob.found.req -> ReturnTypeMismatch(16777235) | ||
return new String[] { "a", "b" }; | ||
} | ||
|
||
|
||
private void testIncompatibleTypesInForeach() { | ||
List<Integer> intList = new ArrayList<>(); | ||
// compiler.err.prob.found.req -> IncompatibleTypesInForeach(16777796) | ||
for (String s : intList) { | ||
s.hashCode(); | ||
} | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
org.eclipse.jdt.core.javac/examples/diagnostics/Undefined.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
import java.util.List; | ||
|
||
public class Undefined { | ||
Undefined(Integer x) {} | ||
|
||
private void testUndefinedConstructor1() { | ||
// compiler.err.cant.apply.symbols -> UndefinedConstructor(134217858) | ||
String l = new String("s", "t"); | ||
} | ||
|
||
void testUndefinedConstructor2() { | ||
// compiler.err.cant.resolve.args -> UndefinedConstructor(134217858) | ||
new Undefined(""){}; | ||
} | ||
|
||
private void testUndefinedType() { | ||
// compiler.err.cant.resolve.location -> UndefinedType(16777218) | ||
UndefinedType a = new UndefinedType(); | ||
} | ||
|
||
private void testUndefinedMethod1() { | ||
// compiler.err.cant.resolve.location.args -> UndefinedMethod(67108964) | ||
test(); | ||
} | ||
|
||
private void testUndefinedMethod2() { | ||
// compiler.err.cant.resolve.args.params -> UndefinedMethod(67108964) | ||
Object o = new Object() { | ||
{ this.<Integer,Double>m2(1, ""); } | ||
}; | ||
} | ||
|
||
private void testUndefinedMethod3() { | ||
// compiler.err.cant.resolve.args -> UndefinedMethod(67108964) | ||
new Runnable() { | ||
{ unknown(); } | ||
public void run() { } | ||
}; | ||
} | ||
|
||
private void testUndefinedMethod4() { | ||
// compiler.err.cant.resolve.location.args.params -> UndefinedMethod(67108964) | ||
Object o = List.<String>unknown(); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...pse.jdt.core.javac/examples/diagnostics/UndefinedConstructorInDefaultConstructor/Sub.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package UndefinedConstructorInDefaultConstructor; | ||
|
||
// compiler.err.cant.apply.symbol -> UndefinedConstructorInDefaultConstructor(134217868) | ||
public class Sub extends Super { | ||
} |
7 changes: 7 additions & 0 deletions
7
...e.jdt.core.javac/examples/diagnostics/UndefinedConstructorInDefaultConstructor/Super.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package UndefinedConstructorInDefaultConstructor; | ||
|
||
public class Super { | ||
Super(int a) { | ||
|
||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
org.eclipse.jdt.core.javac/examples/diagnostics/UnhandledException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
import java.io.IOException; | ||
|
||
public class UnhandledException { | ||
public void testUnhandledException() { | ||
throw new IOException("IOExp"); | ||
} | ||
|
||
public static class AutoCloseableClass implements AutoCloseable { | ||
@Override | ||
public void close() throws Exception { | ||
System.out.println("close"); | ||
} | ||
} | ||
|
||
// compiler.err.unreported.exception.implicit.close -> UnhandledExceptionOnAutoClose(16778098) | ||
public void testUnhandledExceptionOnAutoClose() { | ||
try (AutoCloseableClass a = new AutoCloseableClass()) { | ||
System.out.println("try-with-resource AutoCloseableClass"); | ||
} | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...lipse.jdt.core.javac/examples/diagnostics/UnhandledExceptionInDefaultConstructor/Sub.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package UnhandledExceptionInDefaultConstructor; | ||
|
||
// compiler.err.unreported.exception.default.constructor -> UnhandledExceptionInDefaultConstructor(16777362) | ||
public class Sub extends Super { | ||
} |
7 changes: 7 additions & 0 deletions
7
...pse.jdt.core.javac/examples/diagnostics/UnhandledExceptionInDefaultConstructor/Super.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package UnhandledExceptionInDefaultConstructor; | ||
|
||
public class Super { | ||
Super() throws Exception { | ||
throw new Exception("Exp"); | ||
} | ||
} |
Oops, something went wrong.