aboutsummaryrefslogtreecommitdiff
path: root/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/Example.java
diff options
context:
space:
mode:
Diffstat (limited to 'javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/Example.java')
-rw-r--r--javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/Example.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/Example.java b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/Example.java
new file mode 100644
index 000000000..70cf2cd91
--- /dev/null
+++ b/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/Example.java
@@ -0,0 +1,31 @@
+package com.github.javaparser.ast;
+
+import com.github.javaparser.JavaParser;
+import com.github.javaparser.ParseException;
+import com.github.javaparser.ast.CompilationUnit;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+
+/**
+ * Created by federico on 07/01/16.
+ */
+public class Example {
+
+ public static void main(String[] args) throws UnsupportedEncodingException, ParseException {
+ String code = "interface A {\n" +
+ " default Comparator<T> thenComparing(Comparator<? super T> other) {\n" +
+ " Objects.requireNonNull(other);\n" +
+ " return (Comparator<T> & Serializable) (c1, c2) -> { // this is the defaulting line\n" +
+ " int res = compare(c1, c2);\n" +
+ " return (res != 0) ? res : other.compare(c1, c2);\n" +
+ " };\n" +
+ " }\n" +
+ "}";
+ InputStream stream = new ByteArrayInputStream(code.getBytes("UTF-8"));
+ CompilationUnit cu = JavaParser.parse(stream);
+
+ }
+
+}