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
View
270 .settings/org.eclipse.jdt.core.prefs
@@ -1,5 +1,15 @@
-#Fri Apr 09 16:09:10 SGT 2010
+#Mon Apr 12 13:03:08 SGT 2010
eclipse.preferences.version=1
+org.eclipse.jdt.core.codeComplete.argumentPrefixes=
+org.eclipse.jdt.core.codeComplete.argumentSuffixes=
+org.eclipse.jdt.core.codeComplete.fieldPrefixes=
+org.eclipse.jdt.core.codeComplete.fieldSuffixes=
+org.eclipse.jdt.core.codeComplete.localPrefixes=
+org.eclipse.jdt.core.codeComplete.localSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
@@ -72,3 +82,261 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=116
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
View
66 .settings/org.eclipse.jdt.ui.prefs
@@ -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>
View
22 src/example/java/lambda/MicroBench.java
@@ -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];
View
15 src/example/java/lambda/enumerable/EnumerableExample.java
@@ -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 {
/**
View
4 src/main/java/lambda/annotation/NewLambda.java
@@ -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.
*
View
32 src/main/java/lambda/enumerable/Enumerable.java
@@ -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);
}
View
13 src/main/java/lambda/enumerable/EnumerableArrays.java
@@ -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++];
}
View
2 src/main/java/lambda/enumerable/Range.java
@@ -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;
View
2 src/main/java/lambda/enumerable/collection/ECollection.java
@@ -11,7 +11,7 @@ public ECollection() {
public ECollection(Collection<E> collection) {
super(collection);
}
-
+
public Collection<E> delegate() {
return (Collection<E>) iterable;
}
View
11 src/main/java/lambda/enumerable/collection/EIterable.java
@@ -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;
}
View
5 src/main/java/lambda/enumerable/collection/EList.java
@@ -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() {
View
2 src/main/java/lambda/enumerable/collection/EMap.java
@@ -17,7 +17,7 @@ public EMap() {
public EMap(Map<K, V> map) {
this.map = map;
}
-
+
public Map<K, V> delegate() {
return map;
}
View
2 src/main/java/lambda/enumerable/collection/ESet.java
@@ -11,7 +11,7 @@ public ESet() {
public ESet(Set<E> set) {
super(set);
}
-
+
public Set<E> delegate() {
return (Set<E>) iterable;
}
View
3 src/main/java/lambda/enumerable/collection/IEnumerable.java
@@ -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);
View
35 src/main/java/lambda/enumerable/primitives/EnumerableDoubles.java
@@ -1,14 +1,21 @@
package lambda.enumerable.primitives;
+import static java.lang.System.*;
+
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.NoSuchElementException;
import lambda.enumerable.Enumerable;
import lambda.enumerable.collection.EList;
import lambda.enumerable.collection.ESet;
-import lambda.primitives.*;
-import static java.lang.System.*;
+import lambda.primitives.Fn1DtoB;
+import lambda.primitives.Fn1DtoD;
+import lambda.primitives.Fn1DtoI;
+import lambda.primitives.Fn1DtoL;
+import lambda.primitives.Fn1DtoO;
+import lambda.primitives.Fn2DDtoD;
+import lambda.primitives.Fn2DDtoO;
/**
* Ruby/Smalltalk style internal iterators for Java 5 using bytecode
@@ -114,7 +121,8 @@
// is
// * not false. If no object matches, it returns ifNone.
// */
- // public static <E> E detect(double[] array, Fn1<E, Boolean> block, E ifNone)
+ // public static <E> E detect(double[] array, Fn1<E, Boolean> block, E
+ // ifNone)
// {
// return Enumerable.detect(asList(array), block);
// }
@@ -145,7 +153,7 @@
block.call(each);
return array;
}
-
+
/**
* @see #each(double[], Fn1DtoO)
*/
@@ -154,7 +162,7 @@
block.call(each);
return array;
}
-
+
/**
* @see #each(double[], Fn1DtoO)
*/
@@ -202,7 +210,8 @@
// /**
// * @see #detect(double[], Fn1, Object)
// */
- // public static <E> E find(double[] array, Fn1<E, Boolean> block, E ifNone) {
+ // public static <E> E find(double[] array, Fn1<E, Boolean> block, E ifNone)
+ // {
// return Enumerable.detect(asList(array), block);
// }
//
@@ -279,7 +288,7 @@ public static double inject(double[] array, double initial, Fn2DDtoD block) {
public static <R> R[] map(double[] array, Fn1DtoO<R> block, Class<R> type) {
return collect(array, block, type);
}
-
+
/**
* Returns the object in array with the maximum value. This form assumes all
* objects implement {@link Comparable}
@@ -382,12 +391,12 @@ public static double min(double[] array) {
return result;
}
-// /**
-// * Returns an array containing the items in array sorted by using the
-// * results of the supplied block.
-// */
-// public static double[] sort(double[] array, Fn2IItoI block) {
-// }
+ // /**
+ // * Returns an array containing the items in array sorted by using the
+ // * results of the supplied block.
+ // */
+ // public static double[] sort(double[] array, Fn2IItoI block) {
+ // }
//
// /**
// * Sorts array using a set of keys generated by mapping the values in
View
27 src/main/java/lambda/enumerable/primitives/EnumerableInts.java
@@ -1,14 +1,21 @@
package lambda.enumerable.primitives;
+import static java.lang.System.*;
+
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.NoSuchElementException;
import lambda.enumerable.Enumerable;
import lambda.enumerable.collection.EList;
import lambda.enumerable.collection.ESet;
-import lambda.primitives.*;
-import static java.lang.System.*;
+import lambda.primitives.Fn1ItoB;
+import lambda.primitives.Fn1ItoD;
+import lambda.primitives.Fn1ItoI;
+import lambda.primitives.Fn1ItoL;
+import lambda.primitives.Fn1ItoO;
+import lambda.primitives.Fn2IItoI;
+import lambda.primitives.Fn2IItoO;
/**
* Ruby/Smalltalk style internal iterators for Java 5 using bytecode
@@ -265,7 +272,7 @@ public static int inject(int[] array, int initial, Fn2IItoI block) {
public static double[] map(int[] array, Fn1ItoD block) {
return collect(array, block);
}
-
+
/**
* @see #collect(int[], Fn1ItoO)
*/
@@ -363,7 +370,7 @@ public static int min(int[] array) {
public static int[] range(int start, int end, boolean exclusive) {
return Enumerable.range(start, end, exclusive).toArray();
}
-
+
/**
* Returns an array containing all elements of array for which block is
* false.
@@ -399,12 +406,12 @@ public static int min(int[] array) {
return result;
}
-// /**
-// * Returns an array containing the items in array sorted by using the
-// * results of the supplied block.
-// */
-// public static int[] sort(int[] array, Fn2IItoI block) {
-// }
+ // /**
+ // * Returns an array containing the items in array sorted by using the
+ // * results of the supplied block.
+ // */
+ // public static int[] sort(int[] array, Fn2IItoI block) {
+ // }
//
// /**
// * Sorts array using a set of keys generated by mapping the values in
View
27 src/main/java/lambda/enumerable/primitives/EnumerableLongs.java
@@ -1,14 +1,21 @@
package lambda.enumerable.primitives;
+import static java.lang.System.*;
+
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.NoSuchElementException;
import lambda.enumerable.Enumerable;
import lambda.enumerable.collection.EList;
import lambda.enumerable.collection.ESet;
-import lambda.primitives.*;
-import static java.lang.System.*;
+import lambda.primitives.Fn1LtoB;
+import lambda.primitives.Fn1LtoD;
+import lambda.primitives.Fn1LtoI;
+import lambda.primitives.Fn1LtoL;
+import lambda.primitives.Fn1LtoO;
+import lambda.primitives.Fn2LLtoL;
+import lambda.primitives.Fn2LLtoO;
/**
* Ruby/Smalltalk style internal iterators for Java 5 using bytecode
@@ -127,7 +134,7 @@
block.call(each);
return array;
}
-
+
/**
* @see #each(long[], Fn1LtoO)
*/
@@ -265,7 +272,7 @@ public static long inject(long[] array, long initial, Fn2LLtoL block) {
public static double[] map(long[] array, Fn1LtoD block) {
return collect(array, block);
}
-
+
/**
* @see #map(long[], Fn1LtoO)
*/
@@ -382,12 +389,12 @@ public static long min(long[] array) {
return result;
}
-// /**
-// * Returns an array containing the items in array sorted by using the
-// * results of the supplied block.
-// */
-// public static long[] sort(long[] array, Fn2IItoI block) {
-// }
+ // /**
+ // * Returns an array containing the items in array sorted by using the
+ // * results of the supplied block.
+ // */
+ // public static long[] sort(long[] array, Fn2IItoI block) {
+ // }
//
// /**
// * Sorts array using a set of keys generated by mapping the values in
View
5 src/main/java/lambda/exception/UncheckedException.java
@@ -1,6 +1,9 @@
package lambda.exception;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
@SuppressWarnings("serial")
public class UncheckedException extends RuntimeException {
View
138 src/main/java/lambda/extra166y/LambdaOps.java
@@ -1,162 +1,162 @@
package lambda.extra166y;
-import static extra166y.Ops.*;
-
-import lambda.exception.LambdaWeavingNotEnabledException;
-import lambda.annotation.Unused;
import lambda.annotation.NewLambda;
+import lambda.annotation.Unused;
+import lambda.exception.LambdaWeavingNotEnabledException;
+import extra166y.Ops.*;
/**
- * This is class is similar {@link lambda.Lambda}, but instead of creating lambdas
- * inheriting from {@link lambda.Fn0} it creates lambdas implementing the interfaces defined in
- * {@link extra166y.Ops}, to be used together with {@link extra166y.ParallelArray}.
+ * This is class is similar {@link lambda.Lambda}, but instead of creating
+ * lambdas inheriting from {@link lambda.Fn0} it creates lambdas implementing
+ * the interfaces defined in {@link extra166y.Ops}, to be used together with
+ * {@link extra166y.ParallelArray}.
* <p>
* <i>This file was generated by lambda.extra166y.LambdaOpsGenerator.</i>
*/
public class LambdaOps {
@NewLambda
- public static <A, B> ObjectAndObjectToDouble<A, B> op(A a1, B a2, double block) {
+ public static <A, B> ObjectAndObjectToDouble<A, B> op(A a1, B a2, double block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A, B> ObjectAndObjectToLong<A, B> op(A a1, B a2, long block) {
+ public static <A, B> ObjectAndObjectToLong<A, B> op(A a1, B a2, long block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A, B> ObjectAndObjectToInt<A, B> op(A a1, B a2, int block) {
+ public static <A, B> ObjectAndObjectToInt<A, B> op(A a1, B a2, int block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A, B> ObjectAndObjectProcedure<A, B> procedure(A a1, B a2, Object block) {
+ public static <A, B> ObjectAndObjectProcedure<A, B> procedure(A a1, B a2, Object block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A, R> ObjectAndDoubleToObject<A, R> op(A a1, double a2, R block) {
+ public static <A, R> ObjectAndDoubleToObject<A, R> op(A a1, double a2, R block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> ObjectAndDoubleToDouble<A> op(A a1, double a2, double block) {
+ public static <A> ObjectAndDoubleToDouble<A> op(A a1, double a2, double block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> ObjectAndDoubleToLong<A> op(A a1, double a2, long block) {
+ public static <A> ObjectAndDoubleToLong<A> op(A a1, double a2, long block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> ObjectAndDoubleToInt<A> op(A a1, double a2, int block) {
+ public static <A> ObjectAndDoubleToInt<A> op(A a1, double a2, int block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> ObjectAndDoublePredicate<A> op(A a1, double a2, boolean block) {
+ public static <A> ObjectAndDoublePredicate<A> op(A a1, double a2, boolean block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> ObjectAndDoubleProcedure<A> procedure(A a1, double a2, Object block) {
+ public static <A> ObjectAndDoubleProcedure<A> procedure(A a1, double a2, Object block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A, R> ObjectAndLongToObject<A, R> op(A a1, long a2, R block) {
+ public static <A, R> ObjectAndLongToObject<A, R> op(A a1, long a2, R block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> ObjectAndLongToDouble<A> op(A a1, long a2, double block) {
+ public static <A> ObjectAndLongToDouble<A> op(A a1, long a2, double block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> ObjectAndLongToLong<A> op(A a1, long a2, long block) {
+ public static <A> ObjectAndLongToLong<A> op(A a1, long a2, long block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> ObjectAndLongToInt<A> op(A a1, long a2, int block) {
+ public static <A> ObjectAndLongToInt<A> op(A a1, long a2, int block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> ObjectAndLongPredicate<A> op(A a1, long a2, boolean block) {
+ public static <A> ObjectAndLongPredicate<A> op(A a1, long a2, boolean block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> ObjectAndLongProcedure<A> procedure(A a1, long a2, Object block) {
+ public static <A> ObjectAndLongProcedure<A> procedure(A a1, long a2, Object block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A, R> ObjectAndIntToObject<A, R> op(A a1, int a2, R block) {
+ public static <A, R> ObjectAndIntToObject<A, R> op(A a1, int a2, R block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> ObjectAndIntToDouble<A> op(A a1, int a2, double block) {
+ public static <A> ObjectAndIntToDouble<A> op(A a1, int a2, double block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> ObjectAndIntToLong<A> op(A a1, int a2, long block) {
+ public static <A> ObjectAndIntToLong<A> op(A a1, int a2, long block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> ObjectAndIntToInt<A> op(A a1, int a2, int block) {
+ public static <A> ObjectAndIntToInt<A> op(A a1, int a2, int block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> ObjectAndIntPredicate<A> op(A a1, int a2, boolean block) {
+ public static <A> ObjectAndIntPredicate<A> op(A a1, int a2, boolean block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> ObjectAndIntProcedure<A> procedure(A a1, int a2, Object block) {
+ public static <A> ObjectAndIntProcedure<A> procedure(A a1, int a2, Object block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A, R> DoubleAndObjectToObject<A, R> op(double a1, A a2, R block) {
+ public static <A, R> DoubleAndObjectToObject<A, R> op(double a1, A a2, R block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> DoubleAndObjectToDouble<A> op(double a1, A a2, double block) {
+ public static <A> DoubleAndObjectToDouble<A> op(double a1, A a2, double block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> DoubleAndObjectToLong<A> op(double a1, A a2, long block) {
+ public static <A> DoubleAndObjectToLong<A> op(double a1, A a2, long block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> DoubleAndObjectToInt<A> op(double a1, A a2, int block) {
+ public static <A> DoubleAndObjectToInt<A> op(double a1, A a2, int block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> DoubleAndObjectPredicate<A> op(double a1, A a2, boolean block) {
+ public static <A> DoubleAndObjectPredicate<A> op(double a1, A a2, boolean block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> DoubleAndObjectProcedure<A> procedure(double a1, A a2, Object block) {
+ public static <A> DoubleAndObjectProcedure<A> procedure(double a1, A a2, Object block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <R> DoubleAndDoubleToObject<R> op(double a1, double a2, R block) {
+ public static <R> DoubleAndDoubleToObject<R> op(double a1, double a2, R block) {
throw new LambdaWeavingNotEnabledException();
}
@@ -176,7 +176,7 @@ public static DoubleAndDoubleProcedure procedure(double a1, double a2, Object bl
}
@NewLambda
- public static <R> DoubleAndLongToObject<R> op(double a1, long a2, R block) {
+ public static <R> DoubleAndLongToObject<R> op(double a1, long a2, R block) {
throw new LambdaWeavingNotEnabledException();
}
@@ -206,7 +206,7 @@ public static DoubleAndLongProcedure procedure(double a1, long a2, Object block)
}
@NewLambda
- public static <R> DoubleAndIntToObject<R> op(double a1, int a2, R block) {
+ public static <R> DoubleAndIntToObject<R> op(double a1, int a2, R block) {
throw new LambdaWeavingNotEnabledException();
}
@@ -236,37 +236,37 @@ public static DoubleAndIntProcedure procedure(double a1, int a2, Object block) {
}
@NewLambda
- public static <A, R> LongAndObjectToObject<A, R> op(long a1, A a2, R block) {
+ public static <A, R> LongAndObjectToObject<A, R> op(long a1, A a2, R block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> LongAndObjectToDouble<A> op(long a1, A a2, double block) {
+ public static <A> LongAndObjectToDouble<A> op(long a1, A a2, double block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> LongAndObjectToLong<A> op(long a1, A a2, long block) {
+ public static <A> LongAndObjectToLong<A> op(long a1, A a2, long block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> LongAndObjectToInt<A> op(long a1, A a2, int block) {
+ public static <A> LongAndObjectToInt<A> op(long a1, A a2, int block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> LongAndObjectPredicate<A> op(long a1, A a2, boolean block) {
+ public static <A> LongAndObjectPredicate<A> op(long a1, A a2, boolean block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> LongAndObjectProcedure<A> procedure(long a1, A a2, Object block) {
+ public static <A> LongAndObjectProcedure<A> procedure(long a1, A a2, Object block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <R> LongAndDoubleToObject<R> op(long a1, double a2, R block) {
+ public static <R> LongAndDoubleToObject<R> op(long a1, double a2, R block) {
throw new LambdaWeavingNotEnabledException();
}
@@ -296,7 +296,7 @@ public static LongAndDoubleProcedure procedure(long a1, double a2, Object block)
}
@NewLambda
- public static <R> LongAndLongToObject<R> op(long a1, long a2, R block) {
+ public static <R> LongAndLongToObject<R> op(long a1, long a2, R block) {
throw new LambdaWeavingNotEnabledException();
}
@@ -316,7 +316,7 @@ public static LongAndLongProcedure procedure(long a1, long a2, Object block) {
}
@NewLambda
- public static <R> LongAndIntToObject<R> op(long a1, int a2, R block) {
+ public static <R> LongAndIntToObject<R> op(long a1, int a2, R block) {
throw new LambdaWeavingNotEnabledException();
}
@@ -346,37 +346,37 @@ public static LongAndIntProcedure procedure(long a1, int a2, Object block) {
}
@NewLambda
- public static <A, R> IntAndObjectToObject<A, R> op(int a1, A a2, R block) {
+ public static <A, R> IntAndObjectToObject<A, R> op(int a1, A a2, R block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> IntAndObjectToDouble<A> op(int a1, A a2, double block) {
+ public static <A> IntAndObjectToDouble<A> op(int a1, A a2, double block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> IntAndObjectToLong<A> op(int a1, A a2, long block) {
+ public static <A> IntAndObjectToLong<A> op(int a1, A a2, long block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> IntAndObjectToInt<A> op(int a1, A a2, int block) {
+ public static <A> IntAndObjectToInt<A> op(int a1, A a2, int block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> IntAndObjectPredicate<A> op(int a1, A a2, boolean block) {
+ public static <A> IntAndObjectPredicate<A> op(int a1, A a2, boolean block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> IntAndObjectProcedure<A> procedure(int a1, A a2, Object block) {
+ public static <A> IntAndObjectProcedure<A> procedure(int a1, A a2, Object block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <R> IntAndDoubleToObject<R> op(int a1, double a2, R block) {
+ public static <R> IntAndDoubleToObject<R> op(int a1, double a2, R block) {
throw new LambdaWeavingNotEnabledException();
}
@@ -406,7 +406,7 @@ public static IntAndDoubleProcedure procedure(int a1, double a2, Object block) {
}
@NewLambda
- public static <R> IntAndLongToObject<R> op(int a1, long a2, R block) {
+ public static <R> IntAndLongToObject<R> op(int a1, long a2, R block) {
throw new LambdaWeavingNotEnabledException();
}
@@ -436,7 +436,7 @@ public static IntAndLongProcedure procedure(int a1, long a2, Object block) {
}
@NewLambda
- public static <R> IntAndIntToObject<R> op(int a1, int a2, R block) {
+ public static <R> IntAndIntToObject<R> op(int a1, int a2, R block) {
throw new LambdaWeavingNotEnabledException();
}
@@ -456,22 +456,22 @@ public static IntAndIntProcedure procedure(int a1, int a2, Object block) {
}
@NewLambda
- public static <A> ObjectToDouble<A> op(A a1, double block) {
+ public static <A> ObjectToDouble<A> op(A a1, double block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> ObjectToLong<A> op(A a1, long block) {
+ public static <A> ObjectToLong<A> op(A a1, long block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> ObjectToInt<A> op(A a1, int block) {
+ public static <A> ObjectToInt<A> op(A a1, int block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <R> DoubleToObject<R> op(double a1, R block) {
+ public static <R> DoubleToObject<R> op(double a1, R block) {
throw new LambdaWeavingNotEnabledException();
}
@@ -486,7 +486,7 @@ public static DoubleToInt op(double a1, int block) {
}
@NewLambda
- public static <R> LongToObject<R> op(long a1, R block) {
+ public static <R> LongToObject<R> op(long a1, R block) {
throw new LambdaWeavingNotEnabledException();
}
@@ -501,7 +501,7 @@ public static LongToInt op(long a1, int block) {
}
@NewLambda
- public static <R> IntToObject<R> op(int a1, R block) {
+ public static <R> IntToObject<R> op(int a1, R block) {
throw new LambdaWeavingNotEnabledException();
}
@@ -641,37 +641,37 @@ public static IntOp op(int a1, int block) {
}
@NewLambda
- public static <A> Reducer<A> reducer(A a1, A a2, A block) {
+ public static <A> Reducer<A> reducer(A a1, A a2, A block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <R> Generator<R> op(Unused _, R block) {
+ public static <R> Generator<R> op(Unused _, R block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> Procedure<A> procedure(A a1, Object block) {
+ public static <A> Procedure<A> procedure(A a1, Object block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A, B> BinaryPredicate<A, B> op(A a1, B a2, boolean block) {
+ public static <A, B> BinaryPredicate<A, B> op(A a1, B a2, boolean block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A> Predicate<A> op(A a1, boolean block) {
+ public static <A> Predicate<A> op(A a1, boolean block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A, B, R> BinaryOp<A, B, R> op(A a1, B a2, R block) {
+ public static <A, B, R> BinaryOp<A, B, R> op(A a1, B a2, R block) {
throw new LambdaWeavingNotEnabledException();
}
@NewLambda
- public static <A, R> Op<A, R> op(A a1, R block) {
+ public static <A, R> Op<A, R> op(A a1, R block) {
throw new LambdaWeavingNotEnabledException();
}
}
View
8 src/main/java/lambda/weaving/AnnotationCache.java
@@ -1,16 +1,16 @@
package lambda.weaving;
+import static lambda.exception.UncheckedException.*;
+import static org.objectweb.asm.ClassReader.*;
+import static org.objectweb.asm.Type.*;
+
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.util.HashMap;
import java.util.Map;
import org.objectweb.asm.ClassReader;
-import static lambda.exception.UncheckedException.*;
-import static org.objectweb.asm.ClassReader.*;
-import static org.objectweb.asm.Type.*;
-
class AnnotationCache {
Map<String, Boolean> elementsToHasAnnotation = new HashMap<String, Boolean>();
Class<? extends Annotation> annotation;
View
4 src/main/java/lambda/weaving/AnnotationFinder.java
@@ -1,13 +1,13 @@
package lambda.weaving;
+import static org.objectweb.asm.Type.*;
+
import java.lang.annotation.Annotation;
import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.FieldVisitor;
import org.objectweb.asm.MethodVisitor;
-import static org.objectweb.asm.Type.*;
-
class AnnotationFinder extends EmptyVisitor {
String name;
String desc;
View
18 src/main/java/lambda/weaving/ClassInjector.java
@@ -1,12 +1,17 @@
package lambda.weaving;
-import java.io.*;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-
import static lambda.exception.UncheckedException.*;
import static lambda.weaving.Debug.*;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+
class ClassInjector {
static File classDir;
@@ -34,8 +39,9 @@
try {
String[] realAsmPackageNotToBeChangedByJarJar = { "org.objectweb." };
-
- Class<?> checkClassAdapter = Class.forName(realAsmPackageNotToBeChangedByJarJar[0] + "asm.util.CheckClassAdapter");
+
+ Class<?> checkClassAdapter = Class.forName(realAsmPackageNotToBeChangedByJarJar[0]
+ + "asm.util.CheckClassAdapter");
Class<?> classReader = Class.forName(realAsmPackageNotToBeChangedByJarJar[0] + "asm.ClassReader");
verify = checkClassAdapter.getMethod("verify", classReader, Boolean.TYPE, PrintWriter.class);
View
8 src/main/java/lambda/weaving/EmptyVisitor.java
@@ -1,6 +1,12 @@
package lambda.weaving;
-import org.objectweb.asm.*;
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.FieldVisitor;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
class EmptyVisitor implements ClassVisitor, FieldVisitor, MethodVisitor, Opcodes {
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
View
12 src/main/java/lambda/weaving/FirstPassClassVisitor.java
@@ -1,5 +1,8 @@
package lambda.weaving;
+import static lambda.exception.UncheckedException.*;
+import static org.objectweb.asm.Type.*;
+
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
@@ -10,9 +13,6 @@
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Type;
-import static lambda.exception.UncheckedException.*;
-import static org.objectweb.asm.Type.*;
-
class FirstPassClassVisitor extends EmptyVisitor {
Map<String, MethodInfo> methodsByNameAndDesc = new HashMap<String, MethodInfo>();
@@ -91,7 +91,7 @@ public void visitMethodInsn(int opcode, String owner, String name, String desc)
currentLambda.removeIllegalParameters();
Type returnType = getReturnType(desc);
-
+
if (returnType.equals(getType(Object.class))) {
resolvingTypeUsingCheckCast = true;
@@ -110,8 +110,8 @@ public void visitMethodInsn(int opcode, String owner, String name, String desc)
void setLambdaMethod() {
String descriptor = getMethodDescriptor(getType(Object.class), currentLambda.getParameterTypes());
- MethodInfo currentLambdaMethod = transformer.findMethodByParameterTypes(currentLambda.getType().getInternalName(),
- descriptor);
+ MethodInfo currentLambdaMethod = transformer.findMethodByParameterTypes(currentLambda.getType()
+ .getInternalName(), descriptor);
currentLambda.setLambdaMethod(currentLambdaMethod);
}
View
11 src/main/java/lambda/weaving/LambdaLoader.java
@@ -1,5 +1,11 @@
package lambda.weaving;
+import static java.lang.System.*;
+import static java.lang.Thread.*;
+import static lambda.exception.UncheckedException.*;
+import static lambda.weaving.Debug.*;
+import static lambda.weaving.Version.*;
+
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -13,11 +19,6 @@
import java.util.Set;
import lambda.exception.LambdaWeavingNotEnabledException;
-import static java.lang.System.*;
-import static java.lang.Thread.*;
-import static lambda.exception.UncheckedException.*;
-import static lambda.weaving.Debug.*;
-import static lambda.weaving.Version.*;
public class LambdaLoader extends ClassLoader implements ClassFileTransformer {
private static boolean isEnabled;
View
19 src/main/java/lambda/weaving/LambdaTransformer.java
@@ -1,5 +1,11 @@
package lambda.weaving;
+import static lambda.exception.UncheckedException.*;
+import static lambda.weaving.Debug.*;
+import static org.objectweb.asm.ClassReader.*;
+import static org.objectweb.asm.ClassWriter.*;
+import static org.objectweb.asm.Type.*;
+
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
@@ -9,13 +15,12 @@
import lambda.annotation.NewLambda;
import lambda.annotation.Unused;
-import org.objectweb.asm.*;
-
-import static lambda.exception.UncheckedException.*;
-import static lambda.weaving.Debug.*;
-import static org.objectweb.asm.ClassReader.*;
-import static org.objectweb.asm.ClassWriter.*;
-import static org.objectweb.asm.Type.*;
+import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.FieldVisitor;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
class LambdaTransformer implements Opcodes {
Map<String, byte[]> lambdasByClassName = new HashMap<String, byte[]>();
View
6 src/main/java/lambda/weaving/MethodFinder.java
@@ -1,11 +1,11 @@
package lambda.weaving;
+import static org.objectweb.asm.Type.*;
+
import java.util.Arrays;
import org.objectweb.asm.MethodVisitor;
-import static org.objectweb.asm.Type.*;
-
class MethodFinder extends EmptyVisitor {
String descToMatch;
MethodInfo method;
@@ -29,7 +29,7 @@ public MethodVisitor visitMethod(int access, String name, String desc, String si
boolean isAbstract(int access) {
return (access & ACC_ABSTRACT) != 0;
}
-
+
MethodInfo getMethod() {
return method;
}
View
20 src/main/java/lambda/weaving/MethodInfo.java
@@ -1,13 +1,21 @@
package lambda.weaving;
-import java.util.*;
+import static org.objectweb.asm.Type.*;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
import lambda.annotation.Unused;
import org.objectweb.asm.Type;
-import static org.objectweb.asm.Type.*;
-
class MethodInfo {
String name;
String desc;
@@ -226,7 +234,7 @@ Type getParameterType(String name) {
}
Type getExpressionType() {
- return newLambdaParameterTypes[newLambdaParameterTypes.length -1];
+ return newLambdaParameterTypes[newLambdaParameterTypes.length - 1];
}
void setLambdaMethod(MethodInfo method) {
@@ -257,7 +265,7 @@ void setNewLambdaParameterTypes(Type[] newLambdaParameterTypes) {
}
void removeIllegalParameters() {
- Map<String, VariableInfo> newParametersByName = new LinkedHashMap<String,VariableInfo>();
+ Map<String, VariableInfo> newParametersByName = new LinkedHashMap<String, VariableInfo>();
int i = 0;
for (Map.Entry<String, VariableInfo> entry : parametersByName.entrySet())
if (i++ < getArity() - 1)
@@ -277,7 +285,7 @@ Type getNewMethodParameterType(String name) {
}
return null;
}
-
+
public String toString() {
String locals = "";
if (!accessedLocals.isEmpty())
View
30 src/main/java/lambda/weaving/SecondPassClassVisitor.java
@@ -1,16 +1,26 @@
package lambda.weaving;
-import java.util.*;
-
-import lambda.weaving.MethodInfo.LambdaInfo;
-
-import org.objectweb.asm.*;
-
import static lambda.exception.UncheckedException.*;
import static lambda.weaving.Debug.*;
import static lambda.weaving.MethodInfo.*;
import static org.objectweb.asm.Type.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import lambda.weaving.MethodInfo.LambdaInfo;
+
+import org.objectweb.asm.ClassAdapter;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodAdapter;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Type;
+
class SecondPassClassVisitor extends ClassAdapter implements Opcodes {
String source;
String className;
@@ -207,7 +217,7 @@ public void visitMethodInsn(int opcode, String owner, String name, String desc)
void createAndCallStaticAccessMethodToReplacePrivateFieldAccess(int opcode, String owner, String name,
String desc) {
List<Type> argumentTypes = new ArrayList<Type>();
-
+
if (opcode == GETFIELD || opcode == PUTFIELD)
argumentTypes.add(getObjectType(owner));
@@ -255,8 +265,8 @@ MethodVisitor createAndCallAccessMethodAndLoadArguments(String owner, List<Type>
mv.visitMethodInsn(INVOKESTATIC, owner, accessMethodName, accessMethodDescriptor);
- MethodVisitor mv = cv.visitMethod(ACC_STATIC + ACC_SYNTHETIC,
- accessMethodName, accessMethodDescriptor, null, null);
+ MethodVisitor mv = cv.visitMethod(ACC_STATIC + ACC_SYNTHETIC, accessMethodName, accessMethodDescriptor,
+ null, null);
mv.visitCode();
int i = 0;
@@ -265,7 +275,7 @@ MethodVisitor createAndCallAccessMethodAndLoadArguments(String owner, List<Type>
return mv;
}
-
+
boolean isPrivateFieldOnOwnerWhichNeedsAcccessMethodFromLambda(int opcode, String owner, String name) {
return inLambda() && className.equals(owner) && transformer.isFieldPrivate(owner, name);
}
View
3 src/main/java/lambda/weaving/Version.java
@@ -1,11 +1,12 @@
package lambda.weaving;
+import static lambda.exception.UncheckedException.*;
+
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import lambda.enumerable.Enumerable;
-import static lambda.exception.UncheckedException.*;
public class Version {
public static Properties buildProperties = new Properties();
View
20 src/test/java/lambda/ClosureTest.java
@@ -1,17 +1,20 @@
package lambda;
-import java.io.*;
+import static java.lang.Math.*;
+import static lambda.Lambda.*;
+import static lambda.Parameters.*;
+import static org.junit.Assert.*;
+
+import java.io.ByteArrayOutputStream;
+import java.io.NotSerializableException;
+import java.io.PrintStream;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;
import org.junit.Test;
-import static java.lang.Math.*;
-import static lambda.Lambda.*;
-import static lambda.Parameters.*;
-import static org.junit.Assert.*;
-
@SuppressWarnings("serial")
public class ClosureTest extends TestBase implements Serializable {
@Test(expected = ArithmeticException.class)
@@ -199,7 +202,8 @@ public void closeOverForLoopVariable() throws Exception {
@Test
public void closeOverForLoopVariableInTestAndForUpdate() throws Exception {
int sum = 0;
- for (int i = 0; λ(n, n < 10).call(i); sum += λ(n, i += n).call(1));
+ for (int i = 0; λ(n, n < 10).call(i); sum += λ(n, i += n).call(1))
+ ;
assertEquals(55, sum);
}
@@ -301,7 +305,7 @@ public void callPrivateInstanceMethodOnThisWithExistingAccessMethod() throws Exc
public Object call() {
return privatePrimitiveHello("", 2);
}
- }.call(), (int) result);
+ }.call(), result);
}
@Test
View
26 src/test/java/lambda/LambdaTest.java
@@ -1,11 +1,21 @@
package lambda;
+import static java.lang.Thread.*;
+import static lambda.Lambda.*;
+import static lambda.Parameters.*;
+import static lambda.primitives.LambdaPrimitives.*;
+import static org.junit.Assert.*;
+
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
-import java.util.*;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Timer;
+import java.util.TimerTask;
import java.util.concurrent.Callable;
import lambda.annotation.LambdaParameter;
@@ -16,12 +26,6 @@
import org.junit.Test;
-import static java.lang.Thread.*;
-import static lambda.Lambda.*;
-import static lambda.Parameters.*;
-import static lambda.primitives.LambdaPrimitives.*;
-import static org.junit.Assert.*;
-
public class LambdaTest extends TestBase {
@Test
public void lambdaWithOnePrimitiveArgument() throws Exception {
@@ -117,12 +121,12 @@ public void applyWithNoArgumentSetsArgumentsToNull() throws Exception {
@Test
public void assignLambdaParameter() throws Exception {
- assertEquals(1, (int) λ(n, n = 1).call(5));
+ assertEquals(1, λ(n, n = 1).call(5));
}
@Test
public void incrementLambdaParameter() throws Exception {
- assertEquals(1, (int) λ(n, ++n).call(0));
+ assertEquals(1, λ(n, ++n).call(0));
}
@LambdaParameter
@@ -139,11 +143,11 @@ public void callLambdaWithArrayArgument() throws Exception {
@Test
public void callLambdaInLambda() throws Exception {
Fn1<Integer, Integer> timesTwo = λ(n, n * 2);
- assertEquals(6, (int) λ(n, m, timesTwo.call(n) + m).call(2, 2));
+ assertEquals(6, λ(n, m, timesTwo.call(n) + m).call(2, 2));
}
@LambdaParameter
- static Fn1<String,String> stringToString;
+ static Fn1<String, String> stringToString;
@Test
public void callLambdaWithLambdaArgument() throws Exception {
View
12 src/test/java/lambda/TestBase.java
@@ -1,14 +1,18 @@
package lambda;
-import java.io.*;
+import static java.util.Arrays.*;
+import static lambda.enumerable.Enumerable.*;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import lambda.enumerable.collection.EList;
-import static java.util.Arrays.*;
-
-import static lambda.enumerable.Enumerable.*;
public class TestBase {
public EList<Integer> oneToTen = toList(list(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
View
17 src/test/java/lambda/enumerable/EnumerableArraysTest.java
@@ -1,18 +1,16 @@
package lambda.enumerable;
+import static lambda.Lambda.*;
+import static lambda.Parameters.*;
+import static lambda.enumerable.EnumerableArrays.*;
+import static org.junit.Assert.*;
+
import java.util.List;
import lambda.TestBase;
import org.junit.Test;
-import static lambda.Lambda.*;
-import static lambda.Parameters.*;
-
-import static lambda.enumerable.EnumerableArrays.*;
-
-import static org.junit.Assert.*;
-
public class EnumerableArraysTest extends TestBase {
Integer[] oneToFive = new Integer[] { 1, 2, 3, 4, 5 };
@@ -43,13 +41,14 @@ public void collectElementsToDifferentTypeWithEmptyArray() throws Exception {
@Test
public void inclusiveRanges() throws Exception {
- assertArrayEquals(oneToFive, range(1, 5));
+ assertArrayEquals(oneToFive, range(1, 5));
}