Permalink
Browse files

Running clean up code on entire project, killing trailing whitespace …

…etc. Made all settings project specific, so they're saved into vcs
  • Loading branch information...
1 parent f31981f commit 441c347ced349e1eef64034d9b3cd9470f6e4a66 @hraberg committed Apr 12, 2010
Showing with 769 additions and 340 deletions.
  1. +269 −1 .settings/org.eclipse.jdt.core.prefs
  2. +66 −0 .settings/org.eclipse.jdt.ui.prefs
  3. +11 −11 src/example/java/lambda/MicroBench.java
  4. +7 −8 src/example/java/lambda/enumerable/EnumerableExample.java
  5. +2 −2 src/main/java/lambda/annotation/NewLambda.java
  6. +25 −7 src/main/java/lambda/enumerable/Enumerable.java
  7. +8 −5 src/main/java/lambda/enumerable/EnumerableArrays.java
  8. +1 −1 src/main/java/lambda/enumerable/Range.java
  9. +1 −1 src/main/java/lambda/enumerable/collection/ECollection.java
  10. +7 −4 src/main/java/lambda/enumerable/collection/EIterable.java
  11. +4 −1 src/main/java/lambda/enumerable/collection/EList.java
  12. +1 −1 src/main/java/lambda/enumerable/collection/EMap.java
  13. +1 −1 src/main/java/lambda/enumerable/collection/ESet.java
  14. +1 −2 src/main/java/lambda/enumerable/collection/IEnumerable.java
  15. +22 −13 src/main/java/lambda/enumerable/primitives/EnumerableDoubles.java
  16. +17 −10 src/main/java/lambda/enumerable/primitives/EnumerableInts.java
  17. +17 −10 src/main/java/lambda/enumerable/primitives/EnumerableLongs.java
  18. +4 −1 src/main/java/lambda/exception/UncheckedException.java
  19. +69 −69 src/main/java/lambda/extra166y/LambdaOps.java
  20. +4 −4 src/main/java/lambda/weaving/AnnotationCache.java
  21. +2 −2 src/main/java/lambda/weaving/AnnotationFinder.java
  22. +12 −6 src/main/java/lambda/weaving/ClassInjector.java
  23. +7 −1 src/main/java/lambda/weaving/EmptyVisitor.java
  24. +6 −6 src/main/java/lambda/weaving/FirstPassClassVisitor.java
  25. +6 −5 src/main/java/lambda/weaving/LambdaLoader.java
  26. +12 −7 src/main/java/lambda/weaving/LambdaTransformer.java
  27. +3 −3 src/main/java/lambda/weaving/MethodFinder.java
  28. +14 −6 src/main/java/lambda/weaving/MethodInfo.java
  29. +20 −10 src/main/java/lambda/weaving/SecondPassClassVisitor.java
  30. +2 −1 src/main/java/lambda/weaving/Version.java
  31. +12 −8 src/test/java/lambda/ClosureTest.java
  32. +15 −11 src/test/java/lambda/LambdaTest.java
  33. +8 −4 src/test/java/lambda/TestBase.java
  34. +8 −9 src/test/java/lambda/enumerable/EnumerableArraysTest.java
  35. +8 −24 src/test/java/lambda/enumerable/EnumerableRegressionTest.java
  36. +17 −19 src/test/java/lambda/enumerable/EnumerableTest.java
  37. +11 −9 src/test/java/lambda/enumerable/collection/EnumerableCollectionsTest.java
  38. +19 −17 src/test/java/lambda/enumerable/primitives/EnumerableDoublesTest.java
  39. +10 −7 src/test/java/lambda/enumerable/primitives/EnumerableIntsTest.java
  40. +21 −19 src/test/java/lambda/enumerable/primitives/EnumerableLongsTest.java
  41. +3 −3 src/test/java/lambda/exception/UncheckedExceptionTest.java
  42. +6 −3 src/test/java/lambda/extra166y/LambdaOpsGenerator.java
  43. +5 −4 src/test/java/lambda/extra166y/ParallelArrayToLowerCaseTest.java
  44. +5 −4 src/test/java/lambda/extra166y/ParallelLongArraySieveTest.java

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,66 @@
+#Mon Apr 12 13:03:09 SGT 2010
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=false
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=true
+cleanup.format_source_code=true
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=true
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=false
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=_Eclipse [mine]
+cleanup_settings_version=2
+eclipse.preferences.version=1
+formatter_profile=_Eclipse [mine]
+formatter_settings_version=11
+org.eclipse.jdt.ui.exception.name=e
+org.eclipse.jdt.ui.gettersetter.use.is=true
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=java;javax;org;com;
+org.eclipse.jdt.ui.javadoc=false
+org.eclipse.jdt.ui.keywordthis=false
+org.eclipse.jdt.ui.ondemandthreshold=20
+org.eclipse.jdt.ui.overrideannotation=false
+org.eclipse.jdt.ui.staticondemandthreshold=1
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="false" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment"/><template autoinsert\="false" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment"/><template autoinsert\="false" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment"/><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">&\#13;\r\n</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment"/><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment"/><template autoinsert\="false" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment"/><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment"/><template autoinsert\="false" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment"/><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">throw uncheck(${exception_var});</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody"/><template autoinsert\="false" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody"/><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
@@ -1,5 +1,10 @@
package lambda;
+import static java.lang.System.*;
+import static lambda.Lambda.*;
+import static lambda.Parameters.*;
+import static lambda.enumerable.Enumerable.*;
+
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
@@ -9,11 +14,6 @@
import lambda.primitives.LambdaPrimitives;
import lambda.weaving.LambdaLoader;
import lambda.weaving.Version;
-import static java.lang.System.*;
-import static lambda.Lambda.*;
-import static lambda.Parameters.*;
-
-import static lambda.enumerable.Enumerable.*;
public class MicroBench {
public static void main(String[] args) {
@@ -38,18 +38,18 @@ void run(int n, int times) {
out.println();
- bench("object collect for loop", times, λ(_, methodCollect()));
+ bench("object collect for loop", times, λ(_, methodCollect()));
bench("object collect lambda", times, λ(_, lambdaCollect()));
- bench("primitive collect for loop", times, λ(_, methodCollectP()));
+ bench("primitive collect for loop", times, λ(_, methodCollectP()));
bench("primitive collect lambda", times, λ(_, lambdaCollectP()));
out.println();
- bench("object inject for loop", times, λ(_, methodInject()));
+ bench("object inject for loop", times, λ(_, methodInject()));
bench("object inject lambda", times, λ(_, lambdaInject()));
- bench("primitive inject for loop", times, λ(_, methodInjectP()));
+ bench("primitive inject for loop", times, λ(_, methodInjectP()));
bench("primitive inject lambda", times, λ(_, lambdaInjectP()));
}
@@ -82,7 +82,7 @@ Integer methodInject() {
result *= i;
return result;
}
-
+
Integer lambdaInject() {
return inject(integers, λ(n, m, n * m));
}
@@ -110,7 +110,7 @@ long bench(String name, int times, Fn0<?> block) {
Fn1ItoI fibp;
int length = 100000;
-
+
List<Integer> integers = new ArrayList<Integer>(length);
int[] ints = new int[length];
@@ -1,5 +1,12 @@
package lambda.enumerable;
+import static java.lang.Math.*;
+import static java.util.Arrays.*;
+import static lambda.Lambda.*;
+import static lambda.Parameters.*;
+import static lambda.enumerable.Enumerable.*;
+import static lambda.primitives.LambdaPrimitives.*;
+
import java.io.PrintStream;
import java.util.HashMap;
import java.util.List;
@@ -11,14 +18,6 @@
import lambda.primitives.Fn1ItoI;
import lambda.weaving.LambdaLoader;
import lambda.weaving.Version;
-import static java.lang.Math.*;
-import static java.util.Arrays.*;
-import static lambda.Lambda.*;
-import static lambda.Parameters.*;
-
-import static lambda.enumerable.Enumerable.*;
-
-import static lambda.primitives.LambdaPrimitives.*;
public class EnumerableExample {
/**
@@ -13,8 +13,8 @@
* <p>
* The last argument to the method is the actual block expression. The other
* arguments have to be {@link LambdaParameter} marking the blocks signature.
- * The first parameter can be {@link Unused} to create blocks that
- * take no parameters.
+ * The first parameter can be {@link Unused} to create blocks that take no
+ * parameters.
* <p>
* The return type of the block is the type of the block expression parameter.
*
@@ -1,16 +1,33 @@
package lambda.enumerable;
-import java.io.*;
-import java.util.*;
+import static java.lang.Boolean.*;
+import static lambda.exception.UncheckedException.*;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
import java.util.Map.Entry;
import java.util.regex.Pattern;
import lambda.Fn0;
import lambda.Fn1;
import lambda.Fn2;
-import lambda.enumerable.collection.*;
-import static java.lang.Boolean.*;
-import static lambda.exception.UncheckedException.*;
+import lambda.enumerable.collection.EIterable;
+import lambda.enumerable.collection.EList;
+import lambda.enumerable.collection.EMap;
+import lambda.enumerable.collection.ESet;
/**
* Ruby/Smalltalk style internal iterators for Java 5 using bytecode
@@ -557,11 +574,12 @@ public int compare(E o1, E o2) {
}
public int compare(E o1, E o2) {
- return - comparator.compare(o1, o2);
+ return -comparator.compare(o1, o2);
}
}
- private static final class NaturalOrderComparator<E extends Object & Comparable<? super E>> implements Comparator<E> {
+ private static final class NaturalOrderComparator<E extends Object & Comparable<? super E>> implements
+ Comparator<E> {
public int compare(E o1, E o2) {
return o1.compareTo(o2);
}
@@ -1,7 +1,10 @@
package lambda.enumerable;
import java.lang.reflect.Array;
-import java.util.*;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+import java.util.NoSuchElementException;
import java.util.regex.Pattern;
import lambda.Fn1;
@@ -270,7 +273,7 @@
public static Integer[] range(int start, int end, boolean exclusive) {
return Enumerable.range(start, end, exclusive).toList().toArray(new Integer[0]);
}
-
+
/**
* Returns an array containing all elements of array for which block is
* false.
@@ -363,11 +366,11 @@
private static <T> T[] newEmptyArray(T[] array) {
return (T[]) Array.newInstance(array.getClass().getComponentType(), 0);
}
-
+
private static <T> Iterable<T> asIterable(T[] array) {
return new ArrayIterable<T>(array);
}
-
+
static class ArrayIterable<T> implements Iterable<T> {
T[] array;
@@ -385,7 +388,7 @@ public boolean hasNext() {
public T next() {
if (i == array.length)
- throw new NoSuchElementException();
+ throw new NoSuchElementException();
return array[i++];
}
@@ -28,7 +28,7 @@ public Range(int start, int end, boolean exclusive) {
result.add(integer);
return result;
}
-
+
public int[] toArray() {
int[] array = new int[(exclusive ? end : end + 1) - start];
int i = 0;
@@ -11,7 +11,7 @@ public ECollection() {
public ECollection(Collection<E> collection) {
super(collection);
}
-
+
public Collection<E> delegate() {
return (Collection<E>) iterable;
}
@@ -1,13 +1,16 @@
package lambda.enumerable.collection;
-import java.util.*;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
import java.util.regex.Pattern;
import lambda.Fn1;
import lambda.Fn2;
import lambda.enumerable.Enumerable;
-public class EIterable<E> implements Iterable<E>, IEnumerable<E> {
+public class EIterable<E> implements Iterable<E>, IEnumerable<E> {
@SuppressWarnings("unchecked")
public static <T, R extends EIterable<T>> R from(Iterable<T> iterable) {
if (iterable instanceof EIterable<?>)
@@ -20,7 +23,7 @@
return (R) new ECollection<T>((Collection<T>) iterable);
return (R) new EIterable<T>(iterable);
}
-
+
protected final Iterable<E> iterable;
public EIterable(Iterable<E> iterable) {
@@ -39,7 +42,7 @@ public boolean equals(Object obj) {
if (obj instanceof EIterable<?>)
return this.iterable.equals(((EIterable<?>) obj).iterable);
if (obj instanceof Iterable<?>)
- return this.iterable.equals((Iterable<?>) obj);
+ return this.iterable.equals(obj);
return false;
}
@@ -1,6 +1,9 @@
package lambda.enumerable.collection;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.ListIterator;
public class EList<E> extends ECollection<E> implements List<E> {
public EList() {
@@ -17,7 +17,7 @@ public EMap() {
public EMap(Map<K, V> map) {
this.map = map;
}
-
+
public Map<K, V> delegate() {
return map;
}
@@ -11,7 +11,7 @@ public ESet() {
public ESet(Set<E> set) {
super(set);
}
-
+
public Set<E> delegate() {
return (Set<E>) iterable;
}
@@ -219,8 +219,7 @@
*
* <p>
* Due to varargs this version doesn't support taking a block like in Ruby.
- * Feed the result into {@link #collect(Fn1)} to achieve the same
- * effect.
+ * Feed the result into {@link #collect(Fn1)} to achieve the same effect.
* </p>
*/
EList<EList<?>> zip(Iterable<?>... args);
Oops, something went wrong.

0 comments on commit 441c347

Please sign in to comment.