-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Most are working, still a few odd failures, but much better off than before.
- Loading branch information
Showing
22 changed files
with
374 additions
and
7 deletions.
There are no files selected for viewing
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
12 changes: 12 additions & 0 deletions
12
translator-core/src/testFixtures/java/sample/EmptyCatchBlock.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,12 @@ | ||
package sample; | ||
|
||
public class EmptyCatchBlock { | ||
public static void foo(int i) { | ||
try { | ||
if (i > 0) | ||
throw new Exception(); | ||
} catch (Exception ignored) { | ||
// empty, no code at all | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
translator-core/src/testFixtures/java/sample/MultiCatchInCatchInCatch.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 @@ | ||
package sample; | ||
|
||
public class MultiCatchInCatchInCatch { | ||
public static void foo(int i) { | ||
try { | ||
try { | ||
try { | ||
if (i > 0) | ||
throw new Exception(); | ||
} catch (Exception ex) { | ||
System.out.println("fail ex"); | ||
} catch (Throwable t) { | ||
System.out.println("fail t"); | ||
} | ||
} catch (Exception ignored) { | ||
// empty | ||
} | ||
} catch (Throwable t) { | ||
System.out.println("fail outer"); | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
translator-core/src/testFixtures/java/sample/MultiCatchInUnusedCatch.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,17 @@ | ||
package sample; | ||
|
||
public class MultiCatchInUnusedCatch { | ||
public static void foo() { | ||
try { | ||
try { | ||
throw new Exception(); | ||
} catch (Exception ex) { | ||
System.out.println("fail ex"); | ||
} catch (Throwable t) { | ||
System.out.println("fail t"); | ||
} | ||
} catch (Exception ignored) { | ||
// empty | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
translator-core/src/testFixtures/java/sample/MultiCatchInUsedCatch.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,17 @@ | ||
package sample; | ||
|
||
public class MultiCatchInUsedCatch { | ||
public static void foo() { | ||
try { | ||
try { | ||
throw new Exception(); | ||
} catch (Exception ex) { | ||
System.out.println("fail ex"); | ||
} catch (Throwable t) { | ||
System.out.println("fail t"); | ||
} | ||
} catch (Exception ex) { | ||
ex.printStackTrace(); | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
translator-core/src/testFixtures/java/sample/RethrownCatchEx1Block.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,14 @@ | ||
package sample; | ||
|
||
import java.io.IOException; | ||
|
||
public class RethrownCatchEx1Block { | ||
public static void foo(int i) throws IOException { | ||
try { | ||
if (i > 0) | ||
throw new IOException(); | ||
} catch (IOException e) { | ||
throw e; | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
translator-core/src/testFixtures/java/sample/RethrownCatchEx2Block.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,18 @@ | ||
package sample; | ||
|
||
import java.io.IOException; | ||
|
||
public class RethrownCatchEx2Block { | ||
public static void foo(int i) throws IOException { | ||
try { | ||
if (i > 1) | ||
throw new UnsupportedOperationException(); | ||
if (i > 0) | ||
throw new IOException(); | ||
} catch (UnsupportedOperationException e) { | ||
throw e; | ||
} catch (IOException e) { | ||
throw e; | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
translator-core/src/testFixtures/java/sample/RethrownTryInUnusedTry.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 sample; | ||
|
||
import java.io.IOException; | ||
|
||
public class RethrownTryInUnusedTry { | ||
public static void foo(int i) { | ||
try { | ||
try { | ||
Class.forName(""); | ||
if (i > 0) | ||
throw new IOException(); | ||
} catch (ClassNotFoundException e) { | ||
throw new IOException(e); | ||
} | ||
} catch (IOException e) { | ||
System.out.println("fail io"); | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
translator-core/src/testFixtures/java/sample/RethrownTryInUnusedTryOfSameType.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,17 @@ | ||
package sample; | ||
|
||
import java.io.IOException; | ||
|
||
public class RethrownTryInUnusedTryOfSameType { | ||
public static void foo() { | ||
try { | ||
try { | ||
throw new IOException(); | ||
} catch (IOException e) { | ||
throw new IOException(e); | ||
} | ||
} catch (IOException e) { | ||
foo(); | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
translator-core/src/testFixtures/java/sample/RethrownTryInUsedTryOfSameType.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,17 @@ | ||
package sample; | ||
|
||
import java.io.IOException; | ||
|
||
public class RethrownTryInUsedTryOfSameType { | ||
public static void foo() { | ||
try { | ||
try { | ||
throw new IOException(); | ||
} catch (IOException e) { | ||
throw new IOException(e); | ||
} | ||
} catch (IOException e) { | ||
System.out.println("fail " + e.getMessage()); | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
translator-core/src/testFixtures/java/sample/UnusedCatchEx.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,13 @@ | ||
package sample; | ||
|
||
import java.io.IOException; | ||
|
||
public class UnusedCatchEx { | ||
public static void foo() { | ||
try { | ||
throw new IOException(); | ||
} catch (IOException e) { | ||
foo(); | ||
} | ||
} | ||
} |
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
14 changes: 14 additions & 0 deletions
14
translator-core/src/testFixtures/java/sample/UnusedMultiCatch.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,14 @@ | ||
package sample; | ||
|
||
public class UnusedMultiCatch { | ||
public static void foo(int i) { | ||
try { | ||
if (i > 0) | ||
throw new Exception(); | ||
} catch (Exception ex) { | ||
System.out.println("fail ex"); | ||
} catch (Throwable t) { | ||
System.out.println("fail t"); | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
translator-core/src/testFixtures/java/sample/UnusedTryInUnusedTry.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 sample; | ||
|
||
import java.io.IOException; | ||
|
||
public class UnusedTryInUnusedTry { | ||
public static void foo(int i) { | ||
try { | ||
try { | ||
Class.forName(""); | ||
if (i > 0) | ||
throw new IOException(); | ||
} catch (ClassNotFoundException e) { | ||
System.out.println("fail class"); | ||
} | ||
} catch (IOException e) { | ||
System.out.println("fail io"); | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
translator-core/src/testFixtures/java/sample/UnusedTryInUsedTry.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 sample; | ||
|
||
import java.io.IOException; | ||
|
||
public class UnusedTryInUsedTry { | ||
public static void foo(int i) { | ||
try { | ||
try { | ||
Class.forName(""); | ||
if (i > 0) | ||
throw new IOException(); | ||
} catch (ClassNotFoundException e) { | ||
System.out.println("fail class"); | ||
} | ||
} catch (IOException e) { | ||
System.out.println("fail io " + e.getMessage()); | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
translator-core/src/testFixtures/java/sample/UsedCatchEx2Block.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,18 @@ | ||
package sample; | ||
|
||
import java.io.IOException; | ||
|
||
public class UsedCatchEx2Block { | ||
public static void foo(int i) { | ||
try { | ||
if (i > 1) | ||
throw new UnsupportedOperationException(); | ||
if (i > 0) | ||
throw new IOException(); | ||
} catch (UnsupportedOperationException e) { | ||
System.out.println("fail 1" + e.getMessage()); | ||
} catch (IOException e) { | ||
System.out.println("fail 2" + e.getMessage()); | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
translator-core/src/testFixtures/java/sample/UsedCatchEx3Block.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 @@ | ||
package sample; | ||
|
||
import java.io.IOException; | ||
|
||
public class UsedCatchEx3Block { | ||
public static void foo(int i) { | ||
try { | ||
if (i > 2) | ||
throw new IllegalArgumentException(); | ||
if (i > 1) | ||
throw new UnsupportedOperationException(); | ||
if (i > 0) | ||
throw new IOException(); | ||
} catch (IllegalArgumentException e) { | ||
System.out.println("fail 1" + e.getMessage()); | ||
} catch (UnsupportedOperationException e) { | ||
System.out.println("fail 2" + e.getMessage()); | ||
} catch (IOException e) { | ||
System.out.println("fail 3" + e.getMessage()); | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
translator-core/src/testFixtures/java/sample/UsedMultiCatchBoth.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,14 @@ | ||
package sample; | ||
|
||
public class UsedMultiCatchBoth { | ||
public static void foo(int i) { | ||
try { | ||
if (i > 0) | ||
throw new Exception(); | ||
} catch (Exception ex) { | ||
System.out.println("fail ex " + ex.getMessage()); | ||
} catch (Throwable t) { | ||
System.out.println("fail t" + t.getMessage()); | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
translator-core/src/testFixtures/java/sample/UsedMultiCatchFirst.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,14 @@ | ||
package sample; | ||
|
||
public class UsedMultiCatchFirst { | ||
public static void foo(int i) { | ||
try { | ||
if (i > 0) | ||
throw new Exception(); | ||
} catch (Exception ex) { | ||
System.out.println("fail ex " + ex.getMessage()); | ||
} catch (Throwable t) { | ||
System.out.println("fail t"); | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
translator-core/src/testFixtures/java/sample/UsedMultiCatchSecond.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,14 @@ | ||
package sample; | ||
|
||
public class UsedMultiCatchSecond { | ||
public static void foo(int i) { | ||
try { | ||
if (i > 0) | ||
throw new Exception(); | ||
} catch (Exception ex) { | ||
System.out.println("fail ex "); | ||
} catch (Throwable t) { | ||
System.out.println("fail t" + t.getMessage()); | ||
} | ||
} | ||
} |
Oops, something went wrong.