File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed
Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ public class IntegrationTests
1717 [ InlineData ( "Resources/ArrayField.java" ) ]
1818 [ InlineData ( "Resources/SimilarityBase.java" ) ]
1919 [ InlineData ( "Resources/TestNumericDocValuesUpdates.java" ) ]
20+ [ InlineData ( "Resources/Java9DiamondOperatorInnerClass.java" ) ]
2021 public void GeneralSuccessfulConversionTest ( string filePath )
2122 {
2223 var options = new JavaConversionOptions ( ) ;
Original file line number Diff line number Diff line change 1+ // NOTE: This example when transformed to C# does not successfully compile yet, however we can somewhat successfully
2+ // parse it. Anonymous types always need a little bit of hand-holding after conversion anyways.
3+ package example ;
4+
5+ public class Program {
6+ public static void main (String [] args ) {
7+ Handler <Integer > intHandler = new Handler <>(1 ) {
8+ @ Override
9+ public void handle () {
10+ System .out .println (content );
11+ }
12+ };
13+ intHandler .handle ();
14+ Handler <? extends Number > intHandler1 = new Handler <>(2 ) {
15+ @ Override
16+ public void handle () {
17+ System .out .println (content );
18+ }
19+ };
20+ intHandler1 .handle ();
21+ Handler <?> handler = new Handler <>("test" ) {
22+ @ Override
23+ public void handle () {
24+ System .out .println (content );
25+ }
26+ };
27+
28+ handler .handle ();
29+ }
30+ }
31+
32+ abstract class Handler <T > {
33+ public T content ;
34+
35+ public Handler (T content ) {
36+ this .content = content ;
37+ }
38+
39+ abstract void handle ();
40+ }
You can’t perform that action at this time.
0 commit comments