diff options
Diffstat (limited to 'debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java')
29 files changed, 410 insertions, 0 deletions
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/Issue_1122.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/Issue_1122.java new file mode 100644 index 00000000..5712f9ee --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/Issue_1122.java @@ -0,0 +1,2 @@ +private void save() throws IOException { +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/Issue_1124.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/Issue_1124.java new file mode 100644 index 00000000..dcea4172 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/Issue_1124.java @@ -0,0 +1,4 @@ +new URL(url) +. +openConnection(); +new URL(url).openConnection(); diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/Issue_1845.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/Issue_1845.java new file mode 100644 index 00000000..cc7656ba --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/Issue_1845.java @@ -0,0 +1,7 @@ +public class Version implements Comparable<Version> { + + @Override + public int compareTo(@NonNull Version that) { + return 0; + } +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/Issue_670.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/Issue_670.java new file mode 100644 index 00000000..52d64f1e --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/Issue_670.java @@ -0,0 +1,3 @@ +Class definition: +public class A_Really_Really_Long_Class_Name extends Another_Really_Long_Class_Name { +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/Java8DoubleColon.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/Java8DoubleColon.java new file mode 100644 index 00000000..ec594909 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/Java8DoubleColon.java @@ -0,0 +1,10 @@ +import java.util.Objects; +import java.util.function.Predicate; + +public class Java8DoubleColon { +public static void main(String[] args) { + Predicate<Object> p = Objects::nonNull; + System.out.println(false == p.test(null)); + System.out.println(true == p.test(p)); +} +}
\ No newline at end of file diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/annotation1.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/annotation1.java new file mode 100644 index 00000000..d7417542 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/annotation1.java @@ -0,0 +1,24 @@ +package com.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Documented @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE,ElementType.METHOD, + ElementType.CONSTRUCTOR,ElementType.ANNOTATION_TYPE, + ElementType.PACKAGE,ElementType.FIELD,ElementType.LOCAL_VARIABLE}) +@Inherited + +public @interface Unfinished { + public enum Priority { LOW, MEDIUM, HIGH } + String value(); + String[] changedBy() default ""; + String[] lastChangedBy() default ""; + Priority priority() default Priority.MEDIUM; + String createdBy() default "James Gosling"; + String lastChanged() default "08/07/2011"; +} + diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/annotation2.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/annotation2.java new file mode 100644 index 00000000..596c2562 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/annotation2.java @@ -0,0 +1 @@ +public class Foo {private Runnable bar=new Runnable(){@Override @SuppressWarnings("baz") public void run(){ quux();}};} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/annotation3.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/annotation3.java new file mode 100644 index 00000000..3d84c04c --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/annotation3.java @@ -0,0 +1,10 @@ +public class LocalTests extends IosTest { + /** + * Check that app started up correctly. Then check that app continually runs for 5 seconds. + * Then wait up to 20 seconds for the splash screen disappear. + * @throws InterruptedException + */ + @Test(groups = {"testdroid", "local"}) + public void checkAppForCrash() throws InterruptedException { + } +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/assert.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/assert.java new file mode 100644 index 00000000..8076663b --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/assert.java @@ -0,0 +1,9 @@ +public class JavaClass { + + public static void main(String[] args) { + /* assert EXPRESSION1 ; */ + assert ( a != null ) && ( b != null ); + /* assert EXPRESSION1 : EXPRESSION2 ; */ + assert ( a != null ) && ( b != null ) : "Message"; + } +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/cast.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/cast.java new file mode 100644 index 00000000..8f2d983b --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/cast.java @@ -0,0 +1,24 @@ +public class JavaClass { + private boolean isButtonHit(ImageView imageView, int x, int y) { + if (imageView != null) { + RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams)imageView.getLayoutParams(); + Rect buttonRect = new Rect((int) (layoutParams.leftMargin - buttonExtraMargin), + (int) (layoutParams.topMargin - buttonExtraMargin), + (int) (layoutParams.leftMargin + imageView.getWidth() + buttonExtraMargin), + (int) (layoutParams.topMargin + imageView.getHeight() + buttonExtraMargin)); + + if (buttonRect.contains(x, y)) { + return true; + } + } + + Map< ? , ? > map = (Map< ? , ? >)object; + + return false; + } + + @SuppressWarnings("unchecked") + public static List<Object> fromJSON(JSONArray obj) { + return (List<Object>)fromJSON((Object) obj); + } +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/double_brace.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/double_brace.java new file mode 100644 index 00000000..8ba15c47 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/double_brace.java @@ -0,0 +1,22 @@ +member.func(new List() {{ + add("Text"); + add("Text", + "Hello"); +}}); + + +private static final Set<String> VALID_CODES = new HashSet<String>() +{{ + add("XZ13s"); + add("AB21/X"); + add("YYLEX"); + add("AR2D"); + }}; + +add(new JPanel(){{ + setLayout(...); + setBorder(...); + add(new JLabel(...)); + add(new JSpinner(...)); + }}); + diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/doxy-javadoc-alignment.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/doxy-javadoc-alignment.java new file mode 100644 index 00000000..838d765c --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/doxy-javadoc-alignment.java @@ -0,0 +1,79 @@ +/** + * @author Firstname Lastname <address @ example.com> + * @version 1.6 (current version number of program) + * @since 1.2 (the version of the package to which this class was first added) + */ + +/** + * Short one line description. (1) + * + * Longer description. If there were any, it would be (2) + * here. + * + * And even more explanations to follow in consecutive + * paragraphs separated by HTML paragraph breaks... + * or so we think, haha. After this paragraph, add a + * reference to an @param to verify that it is ignored + * since it does not occur at the beginning of the line. + * Let's also throw in an @return to verify that it passes + * the test as well. + * + * @param variable Description text text text. (3) + * @return Description text text text. + */ + +/** + * Validates a chess move. + * + * Use {@link #doMove(int fromFile, int fromRank, int toFile, int toRank)} to move a piece. + * + * @param fromFile file from which a piece is being moved + * @param fromRank rank from which a piece is being moved + * @param toFile file to which a piece is being moved + * @param toRank rank to which a piece is being moved + * @return true if the move is valid, otherwise false + * @since 1.0 + */ + +/** +* Draws as much of the specified image as is currently available +* with its northwest corner at the specified coordinate (x, y). +* This method will return immediately in all cases, even if the +* entire image has not yet been scaled, dithered and converted +* for the current output device. +* +* If the current output representation is not yet complete then +* the method will return false and the indicated +* {@link ImageObserver} object will be notified as the +* conversion process progresses. +* +* @param img the image to be drawn +* @param x,y the x- and y-coordinates of the northwest corner +* of the destination rectangle in pixels +* @param observer the image observer to be notified as more +* of the image is converted. May be +* null +* @return true if the image is completely +* loaded and was painted successfully; +* false otherwise. +* @see Image +* @see ImageObserver +* @since 1.0 +*/ + +/** +* @see #create(int, int, int, int) +* @see #finalize() +* @see Component#getGraphics() +* @see Component#paint(Graphics) +* @see Component#update(Graphics) +* @since 1.0 +*/ + +/** +* Disposes of this graphics context once it is no longer +* referenced. +* +* @see #dispose() +* @since 1.0 +*/ diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/foreach.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/foreach.java new file mode 100644 index 00000000..e475dc29 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/foreach.java @@ -0,0 +1,11 @@ + + +public class Foo { + + public static void main(String[] args) { + for (ProcessDefinition processDefinition : allOfTheDefinitions.getData()) { +doit(processDefinition); + } + } +} + diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/generics.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/generics.java new file mode 100644 index 00000000..729013ce --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/generics.java @@ -0,0 +1,30 @@ +// Note: Some tests running on this _input_ file rely upon that the tripple +// closing '>' are not separated by spaces or anything else! +public class TestClass { +private static void initMap(void) { + HashMap < String, HashMap < String, List < Track >>> resolutionTracks = new HashMap < String, HashMap < String, List < Track >>> (); +} + +private static void addTrackToMap(String resolution, Track track, HashMap < String, HashMap < String, List < Track >>> resolutionTracks) { + HashMap<String, List<Track> > tracks = null; + + if (resolutionTracks.containsKey(resolution)) { + tracks = resolutionTracks.get(resolution); + } else { + tracks = new HashMap<String, List<Track> >(); + tracks.put("soun", new LinkedList<Track>()); + tracks.put("vide", new LinkedList<Track>()); + resolutionTracks.put(resolution, tracks); + } + + if (track.getHandler() != null) { + if (track.getHandler().equals("soun")) { + List<Track> audioTracks = tracks.get("soun"); + audioTracks.add(track); + } else if (track.getHandler().equals("vide")) { + List<Track> videoTracks = tracks.get("vide"); + videoTracks.add(track); + } + } +} +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/generics_return_type.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/generics_return_type.java new file mode 100644 index 00000000..818ac721 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/generics_return_type.java @@ -0,0 +1,8 @@ +public class TestClass { + public static < T > void executeRequest(final HttpUriRequest request, final ITestClassAPIResponseListener<T> responseListener) { + } + + public <T extends YourType> T mymethod(T type) { + return type; + } +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/generics_wildcard.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/generics_wildcard.java new file mode 100644 index 00000000..358e333b --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/generics_wildcard.java @@ -0,0 +1,25 @@ +public class TestClass { + private Map< ? , ? > map1 = null; + private Map< ? , ? > map2 = null; + private Map< ? , ? > map3 = null; + + public static HttpUriRequest getHttpUriRequest(TestClassAPIRequestMethod method, String apiPath) { + switch (method) { + case BOTTOM_LEFT: + break; + case GET: + req = new HttpGet(url); + break; + case POST: + req = new HttpPost(url); + break; + case PUT: + req = new HttpPut(url); + break; + case DELETE: + req = new HttpDelete(url); + break; + } + return req; + } +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/i1121.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/i1121.java new file mode 100644 index 00000000..18567ec3 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/i1121.java @@ -0,0 +1,7 @@ +public class Test { +public static void main() { + btn.addActionListener(e->{ + System.exit(0); + }); +} +}
\ No newline at end of file diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/issue_672.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/issue_672.java new file mode 100644 index 00000000..2f632625 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/issue_672.java @@ -0,0 +1,2 @@ +public abstract class KeyValueItemWriter<K, V> implements ItemWriter<V>, InitializingBean {} +//3456789=123456789=12 diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/leading-tabs-for-java-lambda.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/leading-tabs-for-java-lambda.java new file mode 100644 index 00000000..19b6df0f --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/leading-tabs-for-java-lambda.java @@ -0,0 +1,29 @@ +class MyClass { + void foo(List<Integer> arr) { + arr.forEach(n -> { + // Okay: This line will be indented with only tabs. + if (cond1) { // Okay + // BAD1: This line will be indented with tabs up to lambda brace level, then spaces for the rest. + if (cond2) // BAD2 + // Okay + bar(); // Okay + if (cond3) // BAD3 + { // BAD4 + // BAD5 + bar(); // BAD6 + } // Okay + } // Okay + if (cond4) { // Okay + /* + BAD7: C-style comments will also be affected on all lines. + */ + } // Okay + if (cond5) // Okay + { // Okay + bar(); // BAD8 + } // Okay + if (cond6) // Okay + bar; // Okay + }); + } +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/long_cl_cmt.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/long_cl_cmt.java new file mode 100644 index 00000000..45e5252b --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/long_cl_cmt.java @@ -0,0 +1,5 @@ +public class Cls +{ +public void f(); +} +// no class end semicolon
\ No newline at end of file diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/nl_before_ignore_after_case.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/nl_before_ignore_after_case.java new file mode 100644 index 00000000..a84e8847 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/nl_before_ignore_after_case.java @@ -0,0 +1,18 @@ +void func(void) +{ + switch (cond) + { + case CASE_F: + synchronized(thingy) + { + do_a(); + do_b(); + } + break; + } + synchronized(thingy) + { + do_a(); + do_b(); + } +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/sf567.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/sf567.java new file mode 100644 index 00000000..68a63221 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/sf567.java @@ -0,0 +1,14 @@ +package com.temp.test; + +public class Database +{ + private Database(String fileName) + { + readConfig(fileName, "asdfasdf", 1); + readConfig(ame, "aasdf", 1); + + Database.readConfig(fileName, "asdfasdf", 1); + Database.readConfig(ame, "aasdf", 1); + } + +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/sp_after_angle.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/sp_after_angle.java new file mode 100644 index 00000000..1e11c4c9 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/sp_after_angle.java @@ -0,0 +1,4 @@ +public class TestClassPrefetchData implements ITestClassAPIInputStreamResponseListener{ + private class TestClassPrefetchDataWrite extends AsyncTask<Void, Void, Void>{ + } +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/sp_after_for_colon.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/sp_after_for_colon.java new file mode 100644 index 00000000..fecd1833 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/sp_after_for_colon.java @@ -0,0 +1 @@ +for (Type var : expr) diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/sp_before_byref.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/sp_before_byref.java new file mode 100644 index 00000000..7927ee89 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/sp_before_byref.java @@ -0,0 +1,5 @@ +public static void method() { + if (argA != null && argB != null) { + } + return (argA != null && argB != null); +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/sp_this_paren.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/sp_this_paren.java new file mode 100644 index 00000000..628b327f --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/sp_this_paren.java @@ -0,0 +1,9 @@ +public class JavaClass { + public JavaClass() { + this(1); + } + + public JavaClass(int i) { + super(i); + } +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/synchronized.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/synchronized.java new file mode 100644 index 00000000..369394b8 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/synchronized.java @@ -0,0 +1,6 @@ +public class A{ + private synchronized static void g(){int x=1;} + synchronized A f(){return null;} + public void foo(){ + g(); synchronized(this){g();}g();synchronized(this){synchronized(this){synchronized(this){g();}}g();}synchronized(this){g();}} +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/try.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/try.java new file mode 100644 index 00000000..aea6a7f3 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/try.java @@ -0,0 +1,6 @@ +public static void main(String[] args) { + try (File file = new File("filename.txt")) + { + doit(processDefinition); + } + } diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/variable_aligns.java b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/variable_aligns.java new file mode 100644 index 00000000..76c6131c --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/input/java/variable_aligns.java @@ -0,0 +1,35 @@ +class Aligns { +final int SZF = 4; +final int SZ2F = 4; +final int aBarF; +final int someIntsF[]; +final int someIntsSzdF[4]; +final int[] someMoreIntsF; +final int lotsOfIntsF[][][][][][]; +final int[][][][] lotsMoreIntsF; +final Tem<Plate> edVarF; +final int aBarSetF=null; +final int someIntsSetF[]=null; +final int someIntsSzdSetF[4]=null; +final int[] someMoreIntsSetF=null; +final int lotsOfIntsSetF[][][][][][]=null; +final int[][][][] lotsMoreIntsSetF=null; +final Tem<Plate> edVarF=null; +int SZ = 4; +int SZ2 = 4; +int aBar; +int someInts[]; +int someIntsSzd[4]; +int spacer; +int[] someMoreInts; +int lotsOfInts[][][][][][]; +int[][][][] lotsMoreInts; +Tem<Plate> edVar; +int aBarSet=null; +int someIntsSet[]=null; +int someIntsSzdSet[4]=null; +int[] someMoreIntsSet=null; +int lotsOfIntsSet[][][][][][]=null; +int[][][][] lotsMoreIntsSet=null; +Tem<Plate> edVar=null; +} |