Fix new instance on parenthesis
This commit is contained in:
parent
5e3208c262
commit
0111df23f5
3 changed files with 8 additions and 11 deletions
|
@ -30,12 +30,7 @@ public class JavaParser{
|
|||
}
|
||||
|
||||
public static void main(String[] args) throws Exception{
|
||||
String variable = "Collection collection = new ArrayList<String>() {\r\n"
|
||||
+ " { add(\"1\");\r\n"
|
||||
+ " add(\"2\");\r\n"
|
||||
+ " add(\"3\");\r\n"
|
||||
+ " }\r\n"
|
||||
+ " };";
|
||||
String variable = "Future future = {new Runnable()};";
|
||||
|
||||
String clazz = "package test; public class Test{ "+variable+" }";
|
||||
BufferedWriter writer = new BufferedWriter(new FileWriter(new File("/home/tmp.txt")));
|
||||
|
|
|
@ -93,7 +93,9 @@ public class Variable {
|
|||
private String generiqueTypes(String content, CleanerPool cleaner){
|
||||
System.out.println("generic "+content);
|
||||
String unzip = cleaner.unzip(content, (value, pattern) -> {
|
||||
return (pattern.equals("^GENERIC_FUNCTION")) ? null : value.replaceAll("\\s+", "");
|
||||
if(pattern.equals("^GENERIC_FUNCTION")) return null;
|
||||
if(pattern.equals("^GENERIC_PARENTHESIS")) return value.replace("\\s+", " ");
|
||||
return value.replaceAll("\\s+", "");
|
||||
});
|
||||
System.out.println("unzip "+unzip);
|
||||
unzip = UNZIP_STICK.matcher(unzip).replaceAll("${e}");
|
||||
|
|
Loading…
Add table
Reference in a new issue