Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
leibnitz27 committed Mar 22, 2020
1 parent f4228fd commit c2ed955
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src_14/org/benf/cfr/tests/InstanceOfPatternTest1.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
public class InstanceOfPatternTest1 {
public static void test(Object obj) {

// Pre JDK 14
// Pre JDK 14
if (obj instanceof Person) {
int age = ((Person) obj).getAge();
// use age to perform business logic
Expand Down
13 changes: 13 additions & 0 deletions src_6/org/benf/cfr/tests/AnnotatedPackage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.benf.cfr.tests;

import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

@Retention(RUNTIME)
@Target({ElementType.PACKAGE})
@interface AnnotatedPackage {

}
7 changes: 7 additions & 0 deletions src_6/org/benf/cfr/tests/FieldNameClashTestDerivedPriv.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.benf.cfr.tests;

// from ovf
public class FieldNameClashTestDerivedPriv extends FieldNameClashTestPriv {
public static void main(String[]a){
FieldNameClashTestPriv.greet();}
}
9 changes: 9 additions & 0 deletions src_6/org/benf/cfr/tests/FieldNameClashTestPriv.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package org.benf.cfr.tests;

// from ovf
public class FieldNameClashTestPriv {
private static String FieldNameClashTestPriv ="hello, world";
public static void greet(){System.out.println(FieldNameClashTestPriv);}
public static void main(String[]a){
org.benf.cfr.tests.FieldNameClashTestPriv.greet();}
}
7 changes: 7 additions & 0 deletions src_6/org/benf/cfr/tests/Package_Info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.benf.cfr.tests;

public interface Package_Info {
// Fake file.

int x = 1;
}
17 changes: 17 additions & 0 deletions src_6/org/benf/cfr/tests/SwitchExpressionLocalClass.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.benf.cfr.tests;

public class SwitchExpressionLocalClass {
void test() {
switch(0) {
default: {
class Test {
Test(int i) { }
}

new Test(1);
}
};
class Test { }
new Test();
}
}
19 changes: 19 additions & 0 deletions src_6/org/benf/cfr/tests/SwitchExpressionLocalClass2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.benf.cfr.tests;

public class SwitchExpressionLocalClass2 {
void test() {
switch(0) {
default: {
}
};
{
class Test {
Test(int i) { }
}

new Test(1);
}
class Test { }
new Test();
}
}
10 changes: 10 additions & 0 deletions src_6/org/benf/cfr/tests/ThrowsClauseExact2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.benf.cfr.tests;

// bug#92
class ThrowsClauseExact2<EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE extends Exception> {
public void testThrow() throws EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE { }

public static void main(String... args) throws Exception{
new ThrowsClauseExact2().testThrow();
}
}
2 changes: 2 additions & 0 deletions src_8/org/benf/cfr/tests/package-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@AnnotatedPackage
package org.benf.cfr.tests;

0 comments on commit c2ed955

Please sign in to comment.