-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
c3f4101
commit 2f5b010
Showing
13 changed files
with
1,035 additions
and
794 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
83 changes: 83 additions & 0 deletions
83
...e-testing/src/test/resources/com/github/javaparser/printer/JavaConceptsBase_prettyprinted
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,83 @@ | ||
/* | ||
* Copyright (C) 2007-2010 Júlio Vilmar Gesser. | ||
* Copyright (C) 2011, 2013-2016 The JavaParser Team. | ||
* | ||
* This file is part of JavaParser. | ||
* | ||
* JavaParser can be used either under the terms of | ||
* a) the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* b) the terms of the Apache License | ||
* | ||
* You should have received a copy of both licenses in LICENCE.LGPL and | ||
* LICENCE.APACHE. Please refer to those files for details. | ||
* | ||
* JavaParser is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
*/ | ||
package japa.bdd.samples; | ||
|
||
import com.github.javaparser.JavaParser; | ||
import japa.parser.ParseException; | ||
import com.github.javaparser.ast.CompilationUnit; | ||
import java.io.*; | ||
import java.util.*; | ||
|
||
@Deprecated | ||
public class JavaConceptsBase<T extends List<int[]>, X> extends Base implements Serializable { | ||
|
||
static Class clz1 = String.class; | ||
|
||
protected Class clz2 = (String.class); | ||
|
||
Class clz3 = int.class; | ||
|
||
Class clz4 = (int.class); | ||
|
||
int[] arr = new int[10]; | ||
|
||
byte bye = 0; | ||
|
||
byte[] byebye = null; | ||
|
||
short sh1, sh2 = 1; | ||
|
||
int intWithUnderscore = 1234_5678; | ||
|
||
long longWithUnderscore = 1234_5678L; | ||
|
||
float floatWithUnderscore = 1_234.5_678f; | ||
|
||
float floatWithUnderscoreAndExponent = 1_234e1_0f; | ||
|
||
double doubleWithUnderscore = 1_234.5_678; | ||
|
||
double doubleWithUnderscoreAndExponent = 1_234e1_0; | ||
|
||
int binaryLiteral = 0b101101; | ||
|
||
List<String>[][] arrLS = (List<String>[][]) new List<?>[10][]; | ||
|
||
int[][][][] arr2 = new int[10][2][1][0]; | ||
|
||
volatile float fff = 0x1.fffeP+127f; | ||
|
||
char cc = 'a'; | ||
|
||
int[][] arr3 = { { 1, 2 }, { 3, 4 } }; | ||
|
||
static int[][] arr4 = {}; | ||
|
||
static { | ||
arr4 = new int[][] { { 2 }, { 1 } }; | ||
} | ||
|
||
{ | ||
arr3 = new int[][] { { 2 }, { 1 } }; | ||
} | ||
|
||
public static JavaConceptsBase t; | ||
} |
70 changes: 70 additions & 0 deletions
70
...-testing/src/test/resources/com/github/javaparser/printer/JavaConceptsEnums_prettyprinted
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,70 @@ | ||
/* | ||
* Copyright (C) 2007-2010 Júlio Vilmar Gesser. | ||
* Copyright (C) 2011, 2013-2016 The JavaParser Team. | ||
* | ||
* This file is part of JavaParser. | ||
* | ||
* JavaParser can be used either under the terms of | ||
* a) the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* b) the terms of the Apache License | ||
* | ||
* You should have received a copy of both licenses in LICENCE.LGPL and | ||
* LICENCE.APACHE. Please refer to those files for details. | ||
* | ||
* JavaParser is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
*/ | ||
package japa.bdd.samples; | ||
|
||
@Deprecated | ||
public class JavaConceptsEnums { | ||
|
||
public enum Teste { | ||
|
||
asc, | ||
def | ||
} | ||
|
||
public enum Sexo { | ||
|
||
m, | ||
@Deprecated | ||
f; | ||
|
||
public enum Sexo_ implements Serializable, Cloneable { | ||
|
||
} | ||
} | ||
|
||
@Deprecated | ||
public enum Enum { | ||
|
||
m(1) { | ||
|
||
@Override | ||
void mm() { | ||
} | ||
} | ||
, | ||
f(2) { | ||
|
||
void mm() { | ||
} | ||
} | ||
; | ||
|
||
native void nnn(); | ||
|
||
transient int x; | ||
|
||
private Enum(int x) { | ||
this.x = x; | ||
} | ||
|
||
abstract void mm(); | ||
} | ||
} |
135 changes: 135 additions & 0 deletions
135
...g/src/test/resources/com/github/javaparser/printer/JavaConceptsInnerClasses_prettyprinted
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,135 @@ | ||
/* | ||
* Copyright (C) 2007-2010 Júlio Vilmar Gesser. | ||
* Copyright (C) 2011, 2013-2016 The JavaParser Team. | ||
* | ||
* This file is part of JavaParser. | ||
* | ||
* JavaParser can be used either under the terms of | ||
* a) the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* b) the terms of the Apache License | ||
* | ||
* You should have received a copy of both licenses in LICENCE.LGPL and | ||
* LICENCE.APACHE. Please refer to those files for details. | ||
* | ||
* JavaParser is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
*/ | ||
package japa.bdd.samples; | ||
|
||
import com.github.javaparser.JavaParser; | ||
import japa.parser.ParseException; | ||
import com.github.javaparser.ast.CompilationUnit; | ||
import org.junit.Ignore; | ||
import java.io.*; | ||
import java.util.*; | ||
|
||
@Ignore | ||
@Deprecated | ||
public class JavaConceptsInnerClasses<T extends List<int[]>, X> extends Base implements Serializable { | ||
|
||
public <T, E> JavaConceptsInnerClasses(int x) { | ||
this.arr[0] = x; | ||
T val1 = null; | ||
E val2 = null; | ||
super.<T, E>check2(val1, val2); | ||
boolean b = true, y = false; | ||
abstract class X { | ||
|
||
int i = 0; | ||
|
||
public <D> X() { | ||
} | ||
|
||
public void m() { | ||
} | ||
} | ||
@Deprecated | ||
final class Y extends X { | ||
|
||
public Y() { | ||
super(); | ||
JavaConceptsInnerClasses.this.cc = 'c'; | ||
super.i = 1; | ||
Y.super.m(); | ||
} | ||
|
||
public Y(int y) { | ||
super(); | ||
} | ||
|
||
public Y(long x) { | ||
this(); | ||
} | ||
} | ||
} | ||
|
||
public <T> JavaConceptsInnerClasses(String str) { | ||
} | ||
|
||
private class QWE extends JavaConceptsInnerClasses<List<int[]>, String> { | ||
|
||
@Deprecated | ||
final int z = 0; | ||
|
||
int i = (int) -1; | ||
|
||
public QWE(String... x) { | ||
<String>super(x[0]); | ||
} | ||
|
||
public QWE(int... x) { | ||
super(x[0]); | ||
i = x[0]; | ||
assert true; | ||
assert 1 == 1 : 2; | ||
{ | ||
int iii = 3; | ||
iii += 3; | ||
} | ||
label: { | ||
int iii = 1; | ||
} | ||
; | ||
; | ||
int min = -2147483648; | ||
long sl = 123123123123l; | ||
long minl = -9223372036854775808L; | ||
switch(i) { | ||
} | ||
ll: switch(i) { | ||
case 1: | ||
System.out.println(1); | ||
break ll; | ||
default: | ||
{ | ||
System.out.println("default"); | ||
break; | ||
} | ||
case 2: | ||
if (t instanceof Base) { | ||
System.out.println(1); | ||
} | ||
i++; | ||
++i; | ||
} | ||
} | ||
|
||
private synchronized int[] doSomething() { | ||
List<? extends Number> x = new ArrayList<Integer>(); | ||
return new int[] { 1 }; | ||
} | ||
} | ||
} | ||
|
||
class Base { | ||
|
||
public <A, B> void check2(A val1, B val2) { | ||
} | ||
} | ||
|
||
interface XXX extends Serializable, Cloneable { | ||
} |
Oops, something went wrong.