Permalink
Browse files

Some minor cleanup after IntelliJ import

  • Loading branch information...
1 parent 5f8a094 commit 6c9fd50a395df6646127ebfe2cccf36e851106ec @hraberg committed Oct 29, 2011
View
@@ -1,3 +1,4 @@
target/
.cache
-src/java-spikes
+src/java-spikes
+.idea/
View
@@ -0,0 +1,209 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+ <component name="EclipseModuleManager">
+ <libelement value="jar://$MODULE_DIR$/lib/junit-4.7.jar!/" />
+ <libelement value="jar://$MODULE_DIR$/lib/extra166y-1.7.0.jar!/" />
+ <libelement value="jar://$MODULE_DIR$/lib/jsr166y-1.7.0.jar!/" />
+ <libelement value="jar://$MODULE_DIR$/lib/asm-debug-all-3.3.1.jar!/" />
+ <libelement value="jar://$MODULE_DIR$/lib/clojure-1.3.0.jar!/" />
+ <libelement value="jar://$MODULE_DIR$/lib/jruby-complete-1.6.5.jar!/" />
+ <libelement value="jar://$MODULE_DIR$/lib/guava-10.0.1.jar!/" />
+ <libelement value="jar://$MODULE_DIR$/lib/clojure-jsr223-1.0.jar!/" />
+ <libelement value="jar://$MODULE_DIR$/lib/groovy-all-1.8.3.jar!/" />
+ <libelement value="jar://$MODULE_DIR$/lib/javaparser-1.0.8.jar!/" />
+ <libelement value="jar://$MODULE_DIR$/lib/ecj-3.7.1.jar!/" />
+ <libelement value="jar://$MODULE_DIR$/lib/scala-compiler-2.9.1.jar!/" />
+ <libelement value="jar://$MODULE_DIR$/lib/scala-library-2.9.1.jar!/" />
+ <libelement value="jar://$MODULE_DIR$/lib/functionaljava-3.0.jar!/" />
+ <conelement value="org.scala-ide.sdt.launching.SCALA_CONTAINER" />
+ <src_description expected_position="0">
+ <src_folder value="file://$MODULE_DIR$/src/main/java" expected_position="0" />
+ <src_folder value="file://$MODULE_DIR$/src/test/java" expected_position="1" />
+ <src_folder value="file://$MODULE_DIR$/src/example/java" expected_position="2" />
+ <src_folder value="file://$MODULE_DIR$/src/test/jruby" expected_position="3" />
+ <src_folder value="file://$MODULE_DIR$/src/test/rubyspec" expected_position="4" />
+ <src_folder value="file://$MODULE_DIR$/src/main/scala" expected_position="5" />
+ <src_folder value="file://$MODULE_DIR$/src/test/scala" expected_position="6" />
+ </src_description>
+ </component>
+ <component name="FacetManager">
+ <facet type="scala" name="Scala">
+ <configuration>
+ <option name="compilerLibraryLevel" value="Global" />
+ <option name="compilerLibraryName" value="scala-compiler-2.9.1" />
+ </configuration>
+ </facet>
+ <facet type="JRUBY" name="JRuby">
+ <configuration>
+ <JRUBY_FACET_CONFIG_ID NAME="JRUBY_SDK_NAME" VALUE="RVM: jruby-1.6.4" />
+ <LOAD_PATH number="0" />
+ <I18N_FOLDERS number="0" />
+ </configuration>
+ </facet>
+ </component>
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/example/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/jruby" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/rubyspec" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/scala" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/scala" isTestSource="false" />
+ </content>
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="module-library">
+ <library name="junit-4.7.jar">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/junit-4.7.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/lib/src/junit-4.7-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="extra166y-1.7.0.jar">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/extra166y-1.7.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/lib/src/extra166y-1.7.0-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="jsr166y-1.7.0.jar">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/jsr166y-1.7.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/lib/src/jsr166y-1.7.0-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="asm-debug-all-3.3.1.jar">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/asm-debug-all-3.3.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/lib/src/asm-all-3.3.1-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="clojure-1.3.0.jar">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/clojure-1.3.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/lib/src/clojure-1.3.0-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="jruby-complete-1.6.5.jar">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/jruby-complete-1.6.5.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/lib/src/jruby-complete-1.6.5-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="guava-10.0.1.jar">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/guava-10.0.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="file://lib/src/guava-10.0.1-sources.zip" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="clojure-jsr223-1.0.jar">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/clojure-jsr223-1.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="groovy-all-1.8.3.jar">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/groovy-all-1.8.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="file://lib/src/groovy-1.8.3-sources.jar" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="javaparser-1.0.8.jar">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/javaparser-1.0.8.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="file://lib/src/javaparser-1.0.8-src.zip" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="ecj-3.7.1.jar">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/ecj-3.7.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="file://lib/src/ecjsrc-3.7.1-sources.jar" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="scala-compiler-2.9.1.jar">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/scala-compiler-2.9.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="scala-library-2.9.1.jar">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/scala-library-2.9.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="functionaljava-3.0.jar">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/functionaljava-3.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/lib/src/functionaljava-3.0-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="library" scope="PROVIDED" name="RVM: jruby-1.6.4 facet library" level="application" />
+ </component>
+</module>
+
@@ -1,23 +1,22 @@
package org.enumerable.lambda;
-import static java.lang.System.*;
-import static org.enumerable.lambda.Lambda.*;
-import static org.enumerable.lambda.Parameters.*;
-import static org.enumerable.lambda.enumerable.Enumerable.*;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Random;
-
-import org.enumerable.lambda.Fn0;
-import org.enumerable.lambda.Fn1;
-import org.enumerable.lambda.Lambda;
import org.enumerable.lambda.enumerable.primitives.EnumerableInts;
import org.enumerable.lambda.primitives.Fn1ItoI;
import org.enumerable.lambda.primitives.LambdaPrimitives;
import org.enumerable.lambda.weaving.LambdaLoader;
import org.enumerable.lambda.weaving.Version;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
+import static java.lang.System.currentTimeMillis;
+import static java.lang.System.out;
+import static org.enumerable.lambda.Lambda.λ;
+import static org.enumerable.lambda.Parameters.m;
+import static org.enumerable.lambda.Parameters.n;
+import static org.enumerable.lambda.enumerable.Enumerable.*;
+
public class MicroBench {
public static void main(String[] args) {
@@ -1,28 +1,26 @@
package org.enumerable.lambda.enumerable;
-import java.util.Map;
-
import org.enumerable.lambda.annotation.LambdaParameter;
import org.enumerable.lambda.enumerable.collection.EList;
import org.enumerable.lambda.weaving.LambdaLoader;
import org.enumerable.lambda.weaving.Version;
-import static org.enumerable.lambda.Lambda.*;
-import static org.enumerable.lambda.Parameters.*;
-import static org.enumerable.lambda.enumerable.collection.ECollections.*;
+import java.util.Map;
+import static org.enumerable.lambda.Lambda.λ;
+import static org.enumerable.lambda.Parameters.s;
+import static org.enumerable.lambda.Parameters.t;
+import static org.enumerable.lambda.enumerable.collection.ECollections.list;
+import static org.enumerable.lambda.enumerable.collection.ECollections.pair;
public class AdvancedExample {
-
public static void main(String[] args) {
LambdaLoader.bootstrapMainIfNotEnabledAndExitUponItsReturn(args);
System.out.println("[example] " + Version.getVersionString());
new AdvancedExample().run();
}
-
-
@LambdaParameter
static Map.Entry<String, EList<String>> e;
@@ -50,6 +48,4 @@ private void run() {
f => 1
*/
}
-
-
}
@@ -1,17 +1,5 @@
package org.enumerable.lambda.enumerable;
-import static java.lang.Math.*;
-import static java.util.Arrays.*;
-import static org.enumerable.lambda.Lambda.*;
-import static org.enumerable.lambda.Parameters.*;
-import static org.enumerable.lambda.enumerable.Enumerable.*;
-import static org.enumerable.lambda.primitives.LambdaPrimitives.*;
-
-import java.io.PrintStream;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
import org.enumerable.lambda.Fn1;
import org.enumerable.lambda.Lambda;
import org.enumerable.lambda.enumerable.collection.EList;
@@ -20,6 +8,19 @@
import org.enumerable.lambda.weaving.LambdaLoader;
import org.enumerable.lambda.weaving.Version;
+import java.io.PrintStream;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static java.lang.Math.*;
+import static java.util.Arrays.asList;
+import static org.enumerable.lambda.Lambda.λ;
+import static org.enumerable.lambda.Parameters.*;
+import static org.enumerable.lambda.enumerable.Enumerable.*;
+import static org.enumerable.lambda.primitives.LambdaPrimitives.fn;
+import static org.enumerable.lambda.primitives.LambdaPrimitives.λ;
+
public class EnumerableExample {
/**
@@ -1,21 +1,15 @@
package org.enumerable.lambda;
-import static java.lang.Boolean.*;
-import static org.enumerable.lambda.exception.UncheckedException.*;
+import org.enumerable.lambda.annotation.LambdaLocal;
import java.io.Serializable;
-import java.lang.reflect.Array;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.util.ArrayList;
-import java.util.List;
+import java.lang.reflect.*;
import java.util.SortedSet;
import java.util.TreeSet;
import java.util.regex.Pattern;
-import org.enumerable.lambda.annotation.LambdaLocal;
+import static java.lang.Boolean.FALSE;
+import static org.enumerable.lambda.exception.UncheckedException.uncheck;
/**
@@ -45,7 +39,7 @@ public static boolean isFalseOrNull(Object result) {
public static int getAndCheckArityForMethod(Class<?> aClass, String methodName) {
int basicArity = 0;
for (Method method : aClass.getDeclaredMethods())
- if (method.getName() == methodName)
+ if (method.getName().equals(methodName))
basicArity = method.getParameterTypes().length;
SortedSet<Integer> defaultValues = new TreeSet<Integer>();
@@ -185,14 +179,6 @@ Field findField(String name) {
}
return null;
}
-
- public List<LambdaLocal> locals() {
- List<LambdaLocal> result = new ArrayList<LambdaLocal>();
- for (Field field : Fn0.this.getClass().getDeclaredFields())
- if (field.isAnnotationPresent(LambdaLocal.class))
- result.add(field.getAnnotation(LambdaLocal.class));
- return result;
- }
}
/**
@@ -51,7 +51,7 @@ public R call() {
* Function composition, returns a {@link Fn0} that calls this function with
* the result of f.
*/
- public <X> Fn0<R> compose(final Fn0<? extends A1> f) {
+ public Fn0<R> compose(final Fn0<? extends A1> f) {
return new Fn0<R>() {
public R call() {
return Fn1.this.call(f.call());
@@ -16,6 +16,7 @@
* λ(${impst:importStatic('lambda.Lambda.*')}${cursor})
* </pre>
*/
+@SuppressWarnings("unused")
public class Lambda {
/**
* Creates a new lambda implementing single abstract method interface or
Oops, something went wrong.

0 comments on commit 6c9fd50

Please sign in to comment.