diff options
Diffstat (limited to 'bundles')
41 files changed, 3305 insertions, 1562 deletions
diff --git a/bundles/org.eclipse.equinox.weaving.aspectj/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.equinox.weaving.aspectj/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..074ef504d --- /dev/null +++ b/bundles/org.eclipse.equinox.weaving.aspectj/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +#Mon Aug 04 14:34:18 CEST 2008 +eclipse.preferences.version=1 +encoding/<project>=UTF-8 diff --git a/bundles/org.eclipse.equinox.weaving.aspectj/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.weaving.aspectj/.settings/org.eclipse.jdt.core.prefs index 35c2a5b04..7af86d307 100644 --- a/bundles/org.eclipse.equinox.weaving.aspectj/.settings/org.eclipse.jdt.core.prefs +++ b/bundles/org.eclipse.equinox.weaving.aspectj/.settings/org.eclipse.jdt.core.prefs @@ -1,12 +1,339 @@ -#Wed Feb 27 23:06:56 CET 2008 -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.compliance=1.3 +#Mon Aug 04 14:34:18 CEST 2008 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.1 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.3 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.1 +org.eclipse.jdt.core.compiler.doc.comment.support=enabled +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=ignore +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore org.eclipse.jdt.core.compiler.problem.enumIdentifier=ignore -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning +org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +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.3 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=ignore +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=1 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=1 +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=1 +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=false +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=do not 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=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.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=true +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=80 +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 diff --git a/bundles/org.eclipse.equinox.weaving.aspectj/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.equinox.weaving.aspectj/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..5423ee617 --- /dev/null +++ b/bundles/org.eclipse.equinox.weaving.aspectj/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,114 @@ +#Mon Aug 04 14:34:18 CEST 2008 +cleanup.add_default_serial_version_id=false +cleanup.add_generated_serial_version_id=true +cleanup.add_missing_annotations=true +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=true +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=false +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=true +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=true +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=true +cleanup.sort_members_all=true +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=_defaultCleanUpProfile +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_defaultFormatterProfile +formatter_settings_version=11 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;com;de;net;org; +org.eclipse.jdt.ui.javadoc=false +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><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">/*******************************************************************************\n * Copyright (c) 2008 ${user} and others.\n * All rights reserved. This program and the accompanying materials \n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http\://www.eclipse.org/legal/epl-v10.html.\n * \n * Contributors\:\n * ${user} - initial implementation\n ******************************************************************************/\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">/**\n * @author ${user}\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><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">/**\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n\n${package_declaration}\n\n${typecomment}\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">\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">\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">\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">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><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">// ${todo} Auto-generated constructor stub\n${body_statement}</template><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> +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.make_local_variable_final=true +sp_cleanup.make_parameters_final=true +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=true +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=true +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=true +sp_cleanup.sort_members_all=true +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/bundles/org.eclipse.equinox.weaving.aspectj/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.equinox.weaving.aspectj/.settings/org.eclipse.pde.prefs new file mode 100644 index 000000000..21798cc6b --- /dev/null +++ b/bundles/org.eclipse.equinox.weaving.aspectj/.settings/org.eclipse.pde.prefs @@ -0,0 +1,22 @@ +#Mon Aug 04 14:34:18 CEST 2008 +compilers.f.unresolved-features=1 +compilers.f.unresolved-plugins=1 +compilers.incompatible-environment=1 +compilers.p.build=1 +compilers.p.deprecated=1 +compilers.p.discouraged-class=1 +compilers.p.internal=1 +compilers.p.missing-packages=2 +compilers.p.no-required-att=0 +compilers.p.not-externalized-att=1 +compilers.p.unknown-attribute=1 +compilers.p.unknown-class=1 +compilers.p.unknown-element=1 +compilers.p.unknown-identifier=1 +compilers.p.unknown-resource=1 +compilers.p.unresolved-ex-points=0 +compilers.p.unresolved-import=0 +compilers.s.create-docs=false +compilers.s.doc-folder=doc +compilers.s.open-tags=1 +eclipse.preferences.version=1 diff --git a/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/WeavingService.java b/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/WeavingService.java index fcb5ef7ed..1c5369571 100644 --- a/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/WeavingService.java +++ b/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/WeavingService.java @@ -24,70 +24,92 @@ import org.eclipse.osgi.service.resolver.State; import org.osgi.framework.Bundle; public class WeavingService implements IWeavingService { - - private ClassLoader loader; - private BundleDescription bundle; - private OSGiWeavingAdaptor adaptor1; - private OSGiWeavingContext weavingContext; - - public WeavingService(){ - if (WeavingServicePlugin.DEBUG) System.out.println("- WeavingService.<init>"); - } - - public WeavingService (ClassLoader loader, Bundle bundle, State state, BundleDescription bundleDescription, SupplementerRegistry supplementerRegistry) { - this.loader=(ClassLoader)loader; - this.bundle = bundleDescription; - this.weavingContext = new OSGiWeavingContext((ClassLoader)loader, bundle, state, bundleDescription, supplementerRegistry); - } - - /** - * Return an instance of this service, initalised with the specified classloader - */ - public IWeavingService getInstance(ClassLoader loader, Bundle bundle, State resolverState, BundleDescription bundleDesciption, SupplementerRegistry supplementerRegistry){ - return new WeavingService(loader, bundle, resolverState, bundleDesciption, supplementerRegistry); - } - - /** - * See Aj.preProcess - */ - public byte[] preProcess(String name, byte[] classbytes, ClassLoader loader) throws IOException { - if (WeavingServicePlugin.DEBUG) System.out.println("> WeavingService.preProcess() bundle=" + bundle.getSymbolicName() + ", name=" + name + ", bytes=" + classbytes.length); - byte[] newBytes; - ensureAdaptorInit(); - - // Bug 215177: Adapt to updated (AJ 1.5.4) signature. - newBytes = adaptor1.weaveClass(name,classbytes, false); - if (WeavingServicePlugin.DEBUG) System.out.println("< WeavingService.preProcess() bytes=" + newBytes.length); - return newBytes; - } - - /** - * Initialise Aj - */ - private void ensureAdaptorInit(){ - if (adaptor1 == null){ - adaptor1 = new OSGiWeavingAdaptor(loader,weavingContext); - adaptor1.initialize(); - } - } - - public String getKey () { - if (WeavingServicePlugin.DEBUG) System.out.println("> WeavingService.getKey() bundle=" + bundle.getSymbolicName()); - String key; - ensureAdaptorInit(); - key = adaptor1.getNamespace(); - if (WeavingServicePlugin.DEBUG)System.out.println("< WeavingService.getKey() key='" + key + "'"); - return key; - } - - public boolean generatedClassesExistFor(ClassLoader loader, String className) { - ensureAdaptorInit(); - return adaptor1.generatedClassesExistFor(className); - } - - public void flushGeneratedClasses(ClassLoader loader) { - ensureAdaptorInit(); - adaptor1.flushGeneratedClasses(); - } - + + private OSGiWeavingAdaptor adaptor1; + + private BundleDescription bundle; + + private ClassLoader loader; + + private OSGiWeavingContext weavingContext; + + public WeavingService() { + if (WeavingServicePlugin.DEBUG) + System.out.println("- WeavingService.<init>"); + } + + public WeavingService(final ClassLoader loader, final Bundle bundle, + final State state, final BundleDescription bundleDescription, + final SupplementerRegistry supplementerRegistry) { + this.loader = loader; + this.bundle = bundleDescription; + this.weavingContext = new OSGiWeavingContext(loader, bundle, state, + bundleDescription, supplementerRegistry); + } + + public void flushGeneratedClasses(final ClassLoader loader) { + ensureAdaptorInit(); + adaptor1.flushGeneratedClasses(); + } + + public boolean generatedClassesExistFor(final ClassLoader loader, + final String className) { + ensureAdaptorInit(); + return adaptor1.generatedClassesExistFor(className); + } + + /** + * Return an instance of this service, initalised with the specified + * classloader + */ + public IWeavingService getInstance(final ClassLoader loader, + final Bundle bundle, final State resolverState, + final BundleDescription bundleDesciption, + final SupplementerRegistry supplementerRegistry) { + return new WeavingService(loader, bundle, resolverState, + bundleDesciption, supplementerRegistry); + } + + public String getKey() { + if (WeavingServicePlugin.DEBUG) + System.out.println("> WeavingService.getKey() bundle=" + + bundle.getSymbolicName()); + String key; + ensureAdaptorInit(); + key = adaptor1.getNamespace(); + if (WeavingServicePlugin.DEBUG) + System.out.println("< WeavingService.getKey() key='" + key + "'"); + return key; + } + + /** + * See Aj.preProcess + */ + public byte[] preProcess(final String name, final byte[] classbytes, + final ClassLoader loader) throws IOException { + if (WeavingServicePlugin.DEBUG) + System.out.println("> WeavingService.preProcess() bundle=" + + bundle.getSymbolicName() + ", name=" + name + ", bytes=" + + classbytes.length); + byte[] newBytes; + ensureAdaptorInit(); + + // Bug 215177: Adapt to updated (AJ 1.5.4) signature. + newBytes = adaptor1.weaveClass(name, classbytes, false); + if (WeavingServicePlugin.DEBUG) + System.out.println("< WeavingService.preProcess() bytes=" + + newBytes.length); + return newBytes; + } + + /** + * Initialise Aj + */ + private void ensureAdaptorInit() { + if (adaptor1 == null) { + adaptor1 = new OSGiWeavingAdaptor(loader, weavingContext); + adaptor1.initialize(); + } + } + } diff --git a/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/WeavingServiceFactory.java b/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/WeavingServiceFactory.java index 6371c7e46..0b9bf0841 100644 --- a/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/WeavingServiceFactory.java +++ b/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/WeavingServiceFactory.java @@ -1,3 +1,4 @@ + package org.eclipse.equinox.weaving.aspectj; import org.osgi.framework.Bundle; @@ -6,12 +7,14 @@ import org.osgi.framework.ServiceRegistration; public class WeavingServiceFactory implements ServiceFactory { - public Object getService(Bundle bundle, ServiceRegistration registration) { - return (new WeavingService()); - } + public Object getService(final Bundle bundle, + final ServiceRegistration registration) { + return (new WeavingService()); + } - public void ungetService(Bundle bundle, ServiceRegistration registration, Object service) { - //nothing here - } + public void ungetService(final Bundle bundle, + final ServiceRegistration registration, final Object service) { + //nothing here + } } diff --git a/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/WeavingServicePlugin.java b/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/WeavingServicePlugin.java index e05d0655a..1ebd20ca1 100644 --- a/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/WeavingServicePlugin.java +++ b/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/WeavingServicePlugin.java @@ -25,64 +25,68 @@ import org.osgi.framework.ServiceReference; */ public class WeavingServicePlugin implements BundleActivator { - public static boolean verbose = Boolean.getBoolean("org.aspectj.osgi.verbose"); + public static boolean DEBUG; - //The shared instance. - private static WeavingServicePlugin plugin; - - /** - * The constructor. - */ - public WeavingServicePlugin() { - plugin = this; -// IWeavingContext iwc = new WeavingContext(null,null);//force bundle to be resolved - } + public static boolean verbose = Boolean + .getBoolean("org.aspectj.osgi.verbose"); - /** - * This method is called upon plug-in activation - */ - public void start(BundleContext context) throws Exception { - loadOptions(context); - if (verbose) System.err.println("[org.aspectj.osgi.service.weaving] info Starting AspectJ weaving service ..."); - String serviceName = IWeavingService.class.getName(); -// ServiceFactory factory = new WeavingServiceFactory(); - IWeavingService weavingService = new WeavingService(); - Properties props = new Properties(); -// context.registerService(serviceName, factory, props); - context.registerService(serviceName, weavingService, props); -// System.out.println("WeavingServicePlugin.start() - registered WeavingService"); - } + //The shared instance. + private static WeavingServicePlugin plugin; - /** - * This method is called when the plug-in is stopped - */ - public void stop(BundleContext context) throws Exception { - plugin = null; - } + /** + * The constructor. + */ + public WeavingServicePlugin() { + plugin = this; + // IWeavingContext iwc = new WeavingContext(null,null);//force bundle to be resolved + } - /** - * Returns the shared instance. - */ - public static WeavingServicePlugin getDefault() { - return plugin; - } + /** + * Returns the shared instance. + */ + public static WeavingServicePlugin getDefault() { + return plugin; + } - private void loadOptions (BundleContext context) { - // all this is only to get the application args - DebugOptions service = null; - ServiceReference reference = context.getServiceReference(DebugOptions.class.getName()); - if (reference != null) - service = (DebugOptions) context.getService(reference); - if (service == null) - return; - try { - DEBUG = service.getBooleanOption("org.aspectj.osgi.service.weaving/debug", false); - } finally { - // we have what we want - release the service - context.ungetService(reference); - } - } - - public static boolean DEBUG; + /** + * This method is called upon plug-in activation + */ + public void start(final BundleContext context) throws Exception { + loadOptions(context); + if (verbose) + System.err + .println("[org.aspectj.osgi.service.weaving] info Starting AspectJ weaving service ..."); + final String serviceName = IWeavingService.class.getName(); + // ServiceFactory factory = new WeavingServiceFactory(); + final IWeavingService weavingService = new WeavingService(); + final Properties props = new Properties(); + // context.registerService(serviceName, factory, props); + context.registerService(serviceName, weavingService, props); + // System.out.println("WeavingServicePlugin.start() - registered WeavingService"); + } + + /** + * This method is called when the plug-in is stopped + */ + public void stop(final BundleContext context) throws Exception { + plugin = null; + } + + private void loadOptions(final BundleContext context) { + // all this is only to get the application args + DebugOptions service = null; + final ServiceReference reference = context + .getServiceReference(DebugOptions.class.getName()); + if (reference != null) + service = (DebugOptions) context.getService(reference); + if (service == null) return; + try { + DEBUG = service.getBooleanOption( + "org.aspectj.osgi.service.weaving/debug", false); + } finally { + // we have what we want - release the service + context.ungetService(reference); + } + } } diff --git a/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/loadtime/OSGiWeavingAdaptor.java b/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/loadtime/OSGiWeavingAdaptor.java index 9534299f0..09d2a488d 100644 --- a/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/loadtime/OSGiWeavingAdaptor.java +++ b/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/loadtime/OSGiWeavingAdaptor.java @@ -36,43 +36,35 @@ public class OSGiWeavingAdaptor extends ClassLoaderWeavingAdaptor { private static final String DEFAULT_AOP_CONTEXT_LOCATION = "META-INF/aop.xml"; + private final ClassLoader classLoader; + private boolean initialized; private boolean initializing; - private ClassLoader classLoader; - - private OSGiWeavingContext weavingContext; + private final StringBuffer namespaceAddon; - private StringBuffer namespaceAddon; + private final OSGiWeavingContext weavingContext; - public OSGiWeavingAdaptor(ClassLoader loader, OSGiWeavingContext context) { + public OSGiWeavingAdaptor(final ClassLoader loader, + final OSGiWeavingContext context) { super(); this.classLoader = loader; this.weavingContext = context; this.namespaceAddon = new StringBuffer(); } - // Bug 215177: Adapt to updated (AJ 1.5.4) super class signature: /** - * @see org.aspectj.weaver.tools.WeavingAdaptor#weaveClass(java.lang.String, - * byte[], boolean) + * @see org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor#getNamespace() */ - public byte[] weaveClass(String name, byte[] bytes, boolean mustWeave) - throws IOException { - - /* Avoid recursion during adaptor initialization */ - if (!initializing) { - if (!initialized) { - initializing = true; - initialize(classLoader, weavingContext); - initialized = true; - initializing = false; - } - // Bug 215177: Adapt to updated (AJ 1.5.4) super class signature: - bytes = super.weaveClass(name, bytes, mustWeave); + public String getNamespace() { + final String namespace = super.getNamespace(); + if (namespace != null && namespace.length() > 0 + && namespaceAddon.length() > 0) { + return namespace + " - " + namespaceAddon.toString(); //$NON-NLS-1$ + } else { + return namespace; } - return bytes; } public void initialize() { @@ -105,8 +97,8 @@ public class OSGiWeavingAdaptor extends ClassLoaderWeavingAdaptor { * @param loader */ public List parseDefinitionsForBundle() { - List definitions = new ArrayList(); - Set seenBefore = new HashSet(); + final List definitions = new ArrayList(); + final Set seenBefore = new HashSet(); try { parseDefinitionsFromVisibility(definitions, seenBefore); @@ -115,7 +107,7 @@ public class OSGiWeavingAdaptor extends ClassLoaderWeavingAdaptor { info("no configuration found. Disabling weaver for bundler " + weavingContext.getClassLoaderName()); } - } catch (Exception e) { + } catch (final Exception e) { definitions.clear(); warn("parse definitions failed", e); } @@ -123,37 +115,32 @@ public class OSGiWeavingAdaptor extends ClassLoaderWeavingAdaptor { return definitions; } - private void parseDefinitionsFromVisibility(List definitions, Set seenBefore) { - String resourcePath = System.getProperty( - "org.aspectj.weaver.loadtime.configuration", ""); - StringTokenizer st = new StringTokenizer(resourcePath, ";"); - - while (st.hasMoreTokens()) { - try { - Enumeration xmls = weavingContext.getResources(st.nextToken()); - - while (xmls.hasMoreElements()) { - URL xml = (URL) xmls.nextElement(); - if (!seenBefore.contains(xml)) { - info("using configuration " - + weavingContext.getFile(xml)); - definitions.add(DocumentParser.parse(xml)); - seenBefore.add(xml); + // Bug 215177: Adapt to updated (AJ 1.5.4) super class signature: + /** + * @see org.aspectj.weaver.tools.WeavingAdaptor#weaveClass(java.lang.String, + * byte[], boolean) + */ + public byte[] weaveClass(final String name, byte[] bytes, + final boolean mustWeave) throws IOException { - addToNamespaceAddon(xml); - } else { - warn("ignoring duplicate definition: " + xml); - } - } - } catch (Exception e) { - warn("parse definitions failed", e); + /* Avoid recursion during adaptor initialization */ + if (!initializing) { + if (!initialized) { + initializing = true; + initialize(classLoader, weavingContext); + initialized = true; + initializing = false; } + // Bug 215177: Adapt to updated (AJ 1.5.4) super class signature: + bytes = super.weaveClass(name, bytes, mustWeave); } + return bytes; } - private void addToNamespaceAddon(URL xml) { - String bundleName = weavingContext.getBundleIdFromURL(xml); - String bundleVersion = weavingContext.getBundleVersionFromURL(xml); + private void addToNamespaceAddon(final URL xml) { + final String bundleName = weavingContext.getBundleIdFromURL(xml); + final String bundleVersion = weavingContext + .getBundleVersionFromURL(xml); namespaceAddon.append(bundleName); namespaceAddon.append(":"); @@ -161,29 +148,22 @@ public class OSGiWeavingAdaptor extends ClassLoaderWeavingAdaptor { namespaceAddon.append(";"); } - private void parseDefinitionsFromRequiredBundles(List definitions, - Set seenBefore) { - Bundle[] bundles = weavingContext.getBundles(); - - Arrays.sort(bundles, new Comparator() { - - public int compare(Object arg0, Object arg1) { - long bundleId1 = ((Bundle) arg0).getBundleId(); - long bundleId2 = ((Bundle) arg1).getBundleId(); - return (int) (bundleId1 - bundleId2); - } - }); - - for (int i = 0; i < bundles.length; i++) { - parseDefinitionFromRequiredBundle(bundles[i], definitions, - seenBefore); + private String getDefinitionLocation(final Bundle bundle) { + String aopContextHeader = (String) bundle.getHeaders().get( + AOP_CONTEXT_LOCATION_HEADER); + if (aopContextHeader != null) { + aopContextHeader = aopContextHeader.trim(); + return aopContextHeader; } + + return DEFAULT_AOP_CONTEXT_LOCATION; } - private void parseDefinitionFromRequiredBundle(Bundle bundle, - List definitions, Set seenBefore) { + private void parseDefinitionFromRequiredBundle(final Bundle bundle, + final List definitions, final Set seenBefore) { try { - URL aopXmlDef = bundle.getEntry(getDefinitionLocation(bundle)); + final URL aopXmlDef = bundle + .getEntry(getDefinitionLocation(bundle)); if (aopXmlDef != null) { if (!seenBefore.contains(aopXmlDef)) { definitions.add(DocumentParser.parse(aopXmlDef)); @@ -194,32 +174,57 @@ public class OSGiWeavingAdaptor extends ClassLoaderWeavingAdaptor { warn("ignoring duplicate definition: " + aopXmlDef); } } - } catch (Exception e) { + } catch (final Exception e) { warn("parse definitions failed", e); } } - private String getDefinitionLocation(Bundle bundle) { - String aopContextHeader = (String) bundle.getHeaders().get( - AOP_CONTEXT_LOCATION_HEADER); - if (aopContextHeader != null) { - aopContextHeader = aopContextHeader.trim(); - return aopContextHeader; - } + private void parseDefinitionsFromRequiredBundles(final List definitions, + final Set seenBefore) { + final Bundle[] bundles = weavingContext.getBundles(); - return DEFAULT_AOP_CONTEXT_LOCATION; + Arrays.sort(bundles, new Comparator() { + + public int compare(final Object arg0, final Object arg1) { + final long bundleId1 = ((Bundle) arg0).getBundleId(); + final long bundleId2 = ((Bundle) arg1).getBundleId(); + return (int) (bundleId1 - bundleId2); + } + }); + + for (int i = 0; i < bundles.length; i++) { + parseDefinitionFromRequiredBundle(bundles[i], definitions, + seenBefore); + } } - /** - * @see org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor#getNamespace() - */ - public String getNamespace() { - String namespace = super.getNamespace(); - if (namespace != null && namespace.length() > 0 - && namespaceAddon.length() > 0) { - return namespace + " - " + namespaceAddon.toString(); //$NON-NLS-1$ - } else { - return namespace; + private void parseDefinitionsFromVisibility(final List definitions, + final Set seenBefore) { + final String resourcePath = System.getProperty( + "org.aspectj.weaver.loadtime.configuration", ""); + final StringTokenizer st = new StringTokenizer(resourcePath, ";"); + + while (st.hasMoreTokens()) { + try { + final Enumeration xmls = weavingContext.getResources(st + .nextToken()); + + while (xmls.hasMoreElements()) { + final URL xml = (URL) xmls.nextElement(); + if (!seenBefore.contains(xml)) { + info("using configuration " + + weavingContext.getFile(xml)); + definitions.add(DocumentParser.parse(xml)); + seenBefore.add(xml); + + addToNamespaceAddon(xml); + } else { + warn("ignoring duplicate definition: " + xml); + } + } + } catch (final Exception e) { + warn("parse definitions failed", e); + } } } diff --git a/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/loadtime/OSGiWeavingContext.java b/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/loadtime/OSGiWeavingContext.java index 718a8d62c..5b1a3439e 100644 --- a/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/loadtime/OSGiWeavingContext.java +++ b/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/loadtime/OSGiWeavingContext.java @@ -32,17 +32,17 @@ import org.osgi.framework.Bundle; public class OSGiWeavingContext extends DefaultWeavingContext { - private final State resolverState; - private final Bundle bundle; private final BundleDescription bundleDescription; + private final State resolverState; + private final SupplementerRegistry supplementerRegistry; - public OSGiWeavingContext(ClassLoader loader, Bundle bundle, State state, - BundleDescription bundleDescription, - SupplementerRegistry supplementerRegistry) { + public OSGiWeavingContext(final ClassLoader loader, final Bundle bundle, + final State state, final BundleDescription bundleDescription, + final SupplementerRegistry supplementerRegistry) { super(loader); this.bundle = bundle; this.bundleDescription = bundleDescription; @@ -53,26 +53,68 @@ public class OSGiWeavingContext extends DefaultWeavingContext { + loader + ", bundle=" + bundle.getSymbolicName()); } - public String getBundleIdFromURL(URL url) { + public String getBundleIdFromURL(final URL url) { return resolverState.getBundle(Integer.parseInt(url.getHost())) .getSymbolicName(); } - public String getBundleVersionFromURL(URL url) { - return resolverState.getBundle(Integer.parseInt(url.getHost())) - .getVersion().toString(); + public Bundle[] getBundles() { + final Set bundles = new HashSet(); + + // the bundle this context belongs to should be used + bundles.add(this.bundle); + + // add required bundles + if (this.bundle.getBundleContext() != null) { + final BundleDescription[] resolvedRequires = this.bundleDescription + .getResolvedRequires(); + for (int i = 0; i < resolvedRequires.length; i++) { + final Bundle requiredBundle = this.bundle.getBundleContext() + .getBundle(resolvedRequires[i].getBundleId()); + if (requiredBundle != null) { + bundles.add(requiredBundle); + } + } + } + + // add fragment bundles + if (this.bundle.getBundleContext() != null) { + final BundleDescription[] fragments = this.bundleDescription + .getFragments(); + for (int i = 0; i < fragments.length; i++) { + final Bundle fragmentBundle = this.bundle.getBundleContext() + .getBundle(fragments[i].getBundleId()); + if (fragmentBundle != null) { + bundles.add(fragmentBundle); + } + } + } + + // add supplementers + final Bundle[] supplementers = this.supplementerRegistry + .getSupplementers(this.bundle); + bundles.addAll(Arrays.asList(supplementers)); + + return (Bundle[]) bundles.toArray(new Bundle[bundles.size()]); } - public String toString() { - return getClass().getName() + "[" + bundleDescription.getSymbolicName() - + "]"; + public String getBundleVersionFromURL(final URL url) { + return resolverState.getBundle(Integer.parseInt(url.getHost())) + .getVersion().toString(); } public String getClassLoaderName() { return bundleDescription.getSymbolicName(); } - public String getFile(URL url) { + public List getDefinitions(final ClassLoader loader, + final WeavingAdaptor adaptor) { + final List definitions = ((OSGiWeavingAdaptor) adaptor) + .parseDefinitionsForBundle(); + return definitions; + } + + public String getFile(final URL url) { return getBundleIdFromURL(url) + url.getFile(); } @@ -80,18 +122,19 @@ public class OSGiWeavingContext extends DefaultWeavingContext { return bundleDescription.getSymbolicName(); } - public Enumeration getResources(String name) throws IOException { + public Enumeration getResources(final String name) throws IOException { Enumeration result = super.getResources(name); if (name.endsWith("aop.xml")) { - Vector modified = new Vector(); - BundleSpecification[] requires = bundleDescription + final Vector modified = new Vector(); + final BundleSpecification[] requires = bundleDescription .getRequiredBundles(); - BundleDescription[] fragments = bundleDescription.getFragments(); + final BundleDescription[] fragments = bundleDescription + .getFragments(); while (result.hasMoreElements()) { - URL xml = (URL) result.nextElement(); - String resourceBundleName = getBundleIdFromURL(xml); + final URL xml = (URL) result.nextElement(); + final String resourceBundleName = getBundleIdFromURL(xml); if (bundleDescription.getSymbolicName().equals( resourceBundleName)) { @@ -100,7 +143,7 @@ public class OSGiWeavingContext extends DefaultWeavingContext { } for (int i = 0; i < requires.length; i++) { - BundleSpecification r = requires[i]; + final BundleSpecification r = requires[i]; if (r.getName().equals(resourceBundleName)) { modified.add(xml); continue; @@ -108,10 +151,10 @@ public class OSGiWeavingContext extends DefaultWeavingContext { } for (int i = 0; i < fragments.length; i++) { - BundleSpecification[] fragmentRequires = fragments[i] + final BundleSpecification[] fragmentRequires = fragments[i] .getRequiredBundles(); for (int j = 0; j < fragmentRequires.length; j++) { - BundleSpecification r = fragmentRequires[j]; + final BundleSpecification r = fragmentRequires[j]; if (r.getName().equals(resourceBundleName)) { modified.add(xml); continue; @@ -125,50 +168,9 @@ public class OSGiWeavingContext extends DefaultWeavingContext { return result; } - public List getDefinitions(ClassLoader loader, WeavingAdaptor adaptor) { - List definitions = ((OSGiWeavingAdaptor) adaptor) - .parseDefinitionsForBundle(); - return definitions; - } - - public Bundle[] getBundles() { - Set bundles = new HashSet(); - - // the bundle this context belongs to should be used - bundles.add(this.bundle); - - // add required bundles - if (this.bundle.getBundleContext() != null) { - BundleDescription[] resolvedRequires = this.bundleDescription - .getResolvedRequires(); - for (int i = 0; i < resolvedRequires.length; i++) { - Bundle requiredBundle = this.bundle.getBundleContext() - .getBundle(resolvedRequires[i].getBundleId()); - if (requiredBundle != null) { - bundles.add(requiredBundle); - } - } - } - - // add fragment bundles - if (this.bundle.getBundleContext() != null) { - BundleDescription[] fragments = this.bundleDescription - .getFragments(); - for (int i = 0; i < fragments.length; i++) { - Bundle fragmentBundle = this.bundle.getBundleContext() - .getBundle(fragments[i].getBundleId()); - if (fragmentBundle != null) { - bundles.add(fragmentBundle); - } - } - } - - // add supplementers - Bundle[] supplementers = this.supplementerRegistry - .getSupplementers(this.bundle); - bundles.addAll(Arrays.asList(supplementers)); - - return (Bundle[]) bundles.toArray(new Bundle[bundles.size()]); + public String toString() { + return getClass().getName() + "[" + bundleDescription.getSymbolicName() + + "]"; } } diff --git a/bundles/org.eclipse.equinox.weaving.caching.j9/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.equinox.weaving.caching.j9/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..131a78f72 --- /dev/null +++ b/bundles/org.eclipse.equinox.weaving.caching.j9/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +#Mon Aug 04 14:33:55 CEST 2008 +eclipse.preferences.version=1 +encoding/<project>=UTF-8 diff --git a/bundles/org.eclipse.equinox.weaving.caching.j9/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.weaving.caching.j9/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..14ce0666b --- /dev/null +++ b/bundles/org.eclipse.equinox.weaving.caching.j9/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,329 @@ +#Mon Aug 04 14:33:55 CEST 2008 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.doc.comment.support=enabled +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning +org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +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.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=1 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=1 +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=1 +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=false +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=do not 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=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.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=true +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=80 +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 diff --git a/bundles/org.eclipse.equinox.weaving.caching.j9/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.equinox.weaving.caching.j9/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..4f5015a43 --- /dev/null +++ b/bundles/org.eclipse.equinox.weaving.caching.j9/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,114 @@ +#Mon Aug 04 14:33:55 CEST 2008 +cleanup.add_default_serial_version_id=false +cleanup.add_generated_serial_version_id=true +cleanup.add_missing_annotations=true +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=true +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=false +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=true +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=true +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=true +cleanup.sort_members_all=true +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=_defaultCleanUpProfile +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_defaultFormatterProfile +formatter_settings_version=11 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;com;de;net;org; +org.eclipse.jdt.ui.javadoc=false +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><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">/*******************************************************************************\n * Copyright (c) 2008 ${user} and others.\n * All rights reserved. This program and the accompanying materials \n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http\://www.eclipse.org/legal/epl-v10.html.\n * \n * Contributors\:\n * ${user} - initial implementation\n ******************************************************************************/\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">/**\n * @author ${user}\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><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">/**\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n\n${package_declaration}\n\n${typecomment}\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">\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">\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">\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">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><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">// ${todo} Auto-generated constructor stub\n${body_statement}</template><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> +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.make_local_variable_final=true +sp_cleanup.make_parameters_final=true +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=true +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=true +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=true +sp_cleanup.sort_members_all=true +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/bundles/org.eclipse.equinox.weaving.caching.j9/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.equinox.weaving.caching.j9/.settings/org.eclipse.pde.prefs new file mode 100644 index 000000000..d0cd50210 --- /dev/null +++ b/bundles/org.eclipse.equinox.weaving.caching.j9/.settings/org.eclipse.pde.prefs @@ -0,0 +1,22 @@ +#Mon Aug 04 14:33:55 CEST 2008 +compilers.f.unresolved-features=1 +compilers.f.unresolved-plugins=1 +compilers.incompatible-environment=1 +compilers.p.build=1 +compilers.p.deprecated=1 +compilers.p.discouraged-class=1 +compilers.p.internal=1 +compilers.p.missing-packages=2 +compilers.p.no-required-att=0 +compilers.p.not-externalized-att=1 +compilers.p.unknown-attribute=1 +compilers.p.unknown-class=1 +compilers.p.unknown-element=1 +compilers.p.unknown-identifier=1 +compilers.p.unknown-resource=1 +compilers.p.unresolved-ex-points=0 +compilers.p.unresolved-import=0 +compilers.s.create-docs=false +compilers.s.doc-folder=doc +compilers.s.open-tags=1 +eclipse.preferences.version=1 diff --git a/bundles/org.eclipse.equinox.weaving.caching.j9/src/org/eclipse/equinox/weaving/internal/caching/j9/CachingService.java b/bundles/org.eclipse.equinox.weaving.caching.j9/src/org/eclipse/equinox/weaving/internal/caching/j9/CachingService.java index 7381ff074..61b971ddd 100644 --- a/bundles/org.eclipse.equinox.weaving.caching.j9/src/org/eclipse/equinox/weaving/internal/caching/j9/CachingService.java +++ b/bundles/org.eclipse.equinox.weaving.caching.j9/src/org/eclipse/equinox/weaving/internal/caching/j9/CachingService.java @@ -16,89 +16,111 @@ import java.net.URL; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; -import org.eclipse.equinox.service.weaving.CacheEntry; -import org.eclipse.equinox.service.weaving.ICachingService; -import org.osgi.framework.Bundle; - import com.ibm.oti.shared.HelperAlreadyDefinedException; import com.ibm.oti.shared.Shared; import com.ibm.oti.shared.SharedClassURLHelper; +import org.eclipse.equinox.service.weaving.CacheEntry; +import org.eclipse.equinox.service.weaving.ICachingService; +import org.osgi.framework.Bundle; + public class CachingService implements ICachingService { - - private Bundle bundle; - private ClassLoader classLoader; - private String partition; - SharedClassURLHelper urlhelper; - - public CachingService () { - if (CachingServicePlugin.DEBUG) System.out.println("- CachingService.<init>()"); - } - - public CachingService (ClassLoader loader, Bundle bundle, String key) { - if (CachingServicePlugin.DEBUG) System.out.println("> CachingService.<init>() bundle=" + bundle.getSymbolicName() + ", loader=" + loader + ", key='" + key + "'"); - this.bundle = bundle; - this.classLoader = loader; - this.partition = hashNamespace(key); - try{ - urlhelper = Shared.getSharedClassHelperFactory().getURLHelper(classLoader); - } catch (HelperAlreadyDefinedException e) { - e.printStackTrace(); - } - if (CachingServicePlugin.DEBUG) System.out.println("< CachingService.<init>() partition='" + partition + "', urlhelper=" + urlhelper); - } - - public ICachingService getInstance(ClassLoader classLoader, Bundle bundle, String key) { - return new CachingService(classLoader,bundle, key); - } - - public CacheEntry findStoredClass(String namespace, URL sourceFileURL, String name) { - byte[] bytes = urlhelper.findSharedClass(partition, sourceFileURL, name); - if (CachingServicePlugin.DEBUG && bytes != null) System.out.println("- CachingService.findStoredClass() bundle=" + bundle.getSymbolicName() + ", name=" + name + ", url=" + sourceFileURL + ", bytes=" + bytes); - - if (bytes != null) { - return new CacheEntry(true, bytes); - } - else { - return new CacheEntry(false, null); - } - } - - public boolean storeClass(String namespace, URL sourceFileURL, Class clazz, byte[] classbytes) { - boolean success = urlhelper.storeSharedClass(partition, sourceFileURL, clazz); - if (CachingServicePlugin.DEBUG && success) System.out.println("- CachingService.storeClass() bundle=" + bundle.getSymbolicName() + ", clazz=" + clazz + ", url=" + sourceFileURL); - return success; - } - - /** - * Hash the shared class namespace using MD5 - * @param keyToHash - * @return the MD5 version of the input string - */ - public String hashNamespace(String namespace){ - MessageDigest md = null; - try { - md = MessageDigest.getInstance("MD5"); - } catch (NoSuchAlgorithmException e) { - e.printStackTrace(); - } - byte[] bytes = md.digest(namespace.getBytes()); - StringBuffer result = new StringBuffer(); - for(int i=0; i<bytes.length; i++){ - byte b = bytes[i]; - int num; - if(b<0) { - num = b+256; - }else{ - num=b; - } - String s = Integer.toHexString(num); - while (s.length()<2){ - s = "0"+s; - } - result.append(s); - } - return new String(result); - } + + SharedClassURLHelper urlhelper; + + private Bundle bundle; + + private ClassLoader classLoader; + + private String partition; + + public CachingService() { + if (CachingServicePlugin.DEBUG) + System.out.println("- CachingService.<init>()"); + } + + public CachingService(final ClassLoader loader, final Bundle bundle, + final String key) { + if (CachingServicePlugin.DEBUG) + System.out.println("> CachingService.<init>() bundle=" + + bundle.getSymbolicName() + ", loader=" + loader + + ", key='" + key + "'"); + this.bundle = bundle; + this.classLoader = loader; + this.partition = hashNamespace(key); + try { + urlhelper = Shared.getSharedClassHelperFactory().getURLHelper( + classLoader); + } catch (final HelperAlreadyDefinedException e) { + e.printStackTrace(); + } + if (CachingServicePlugin.DEBUG) + System.out.println("< CachingService.<init>() partition='" + + partition + "', urlhelper=" + urlhelper); + } + + public CacheEntry findStoredClass(final String namespace, + final URL sourceFileURL, final String name) { + final byte[] bytes = urlhelper.findSharedClass(partition, + sourceFileURL, name); + if (CachingServicePlugin.DEBUG && bytes != null) + System.out.println("- CachingService.findStoredClass() bundle=" + + bundle.getSymbolicName() + ", name=" + name + ", url=" + + sourceFileURL + ", bytes=" + bytes); + + if (bytes != null) { + return new CacheEntry(true, bytes); + } else { + return new CacheEntry(false, null); + } + } + + public ICachingService getInstance(final ClassLoader classLoader, + final Bundle bundle, final String key) { + return new CachingService(classLoader, bundle, key); + } + + /** + * Hash the shared class namespace using MD5 + * + * @param keyToHash + * @return the MD5 version of the input string + */ + public String hashNamespace(final String namespace) { + MessageDigest md = null; + try { + md = MessageDigest.getInstance("MD5"); + } catch (final NoSuchAlgorithmException e) { + e.printStackTrace(); + } + final byte[] bytes = md.digest(namespace.getBytes()); + final StringBuffer result = new StringBuffer(); + for (int i = 0; i < bytes.length; i++) { + final byte b = bytes[i]; + int num; + if (b < 0) { + num = b + 256; + } else { + num = b; + } + String s = Integer.toHexString(num); + while (s.length() < 2) { + s = "0" + s; + } + result.append(s); + } + return new String(result); + } + + public boolean storeClass(final String namespace, final URL sourceFileURL, + final Class clazz, final byte[] classbytes) { + final boolean success = urlhelper.storeSharedClass(partition, + sourceFileURL, clazz); + if (CachingServicePlugin.DEBUG && success) + System.out.println("- CachingService.storeClass() bundle=" + + bundle.getSymbolicName() + ", clazz=" + clazz + ", url=" + + sourceFileURL); + return success; + } } diff --git a/bundles/org.eclipse.equinox.weaving.caching.j9/src/org/eclipse/equinox/weaving/internal/caching/j9/CachingServiceFactory.java b/bundles/org.eclipse.equinox.weaving.caching.j9/src/org/eclipse/equinox/weaving/internal/caching/j9/CachingServiceFactory.java index c3c86db7d..bd03c8912 100644 --- a/bundles/org.eclipse.equinox.weaving.caching.j9/src/org/eclipse/equinox/weaving/internal/caching/j9/CachingServiceFactory.java +++ b/bundles/org.eclipse.equinox.weaving.caching.j9/src/org/eclipse/equinox/weaving/internal/caching/j9/CachingServiceFactory.java @@ -18,13 +18,14 @@ import org.osgi.framework.ServiceRegistration; public class CachingServiceFactory implements ServiceFactory { - public Object getService(Bundle bundle, ServiceRegistration registration) { - return new CachingService(); - } + public Object getService(final Bundle bundle, + final ServiceRegistration registration) { + return new CachingService(); + } - public void ungetService(Bundle bundle, ServiceRegistration registration, - Object service) { + public void ungetService(final Bundle bundle, + final ServiceRegistration registration, final Object service) { - } + } } diff --git a/bundles/org.eclipse.equinox.weaving.caching.j9/src/org/eclipse/equinox/weaving/internal/caching/j9/CachingServicePlugin.java b/bundles/org.eclipse.equinox.weaving.caching.j9/src/org/eclipse/equinox/weaving/internal/caching/j9/CachingServicePlugin.java index 4009aeb82..0fa3572c4 100644 --- a/bundles/org.eclipse.equinox.weaving.caching.j9/src/org/eclipse/equinox/weaving/internal/caching/j9/CachingServicePlugin.java +++ b/bundles/org.eclipse.equinox.weaving.caching.j9/src/org/eclipse/equinox/weaving/internal/caching/j9/CachingServicePlugin.java @@ -13,98 +13,114 @@ package org.eclipse.equinox.weaving.internal.caching.j9; +import com.ibm.oti.shared.Shared; + import org.eclipse.equinox.service.weaving.ICachingService; import org.eclipse.osgi.service.debug.DebugOptions; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; -import com.ibm.oti.shared.Shared; - /** * The main plugin class to be used in the desktop. */ public class CachingServicePlugin implements BundleActivator { - public static boolean verbose = Boolean.getBoolean("org.aspectj.osgi.verbose"); - - /** - * The constructor. - */ - public CachingServicePlugin() { - } - - /** - * This method is called upon plug-in activation - */ - public void start(BundleContext context) throws Exception { - if (CachingServicePlugin.DEBUG) System.out.println("> CachingServicePlugin.start() context=" + context); - - loadOptions(context); - - //are we on J9? - if(shouldRegister()){ - if (verbose) System.err.println("[org.aspectj.osgi.service.caching.j9] info starting J9 caching service ..."); - String name = ICachingService.class.getName(); -// CachingServiceFactory factory = new CachingServiceFactory(); - CachingService singleCachingService = new CachingService(); - context.registerService(name,singleCachingService,null); -// System.out.println("CachingServicePlugin.start() - registered cachingService"); - } - else { - if (verbose) System.err.println("[org.aspectj.osgi.service.caching.j9] warning cannot start J9 caching service"); - } - - if (CachingServicePlugin.DEBUG) System.out.println("< CachingServicePlugin.start()"); - } - - /** - * This method is called when the plug-in is stopped - */ - public void stop(BundleContext context) throws Exception { - } - - private boolean shouldRegister(){ - if (CachingServicePlugin.DEBUG) System.out.println("> CachingServicePlugin.shouldRegister()"); - - boolean enabled; - try{ - Class.forName("com.ibm.oti.vm.VM"); //if this fails we are not on J9 - boolean sharing = Shared.isSharingEnabled(); //if not using shared classes we want a different adaptor - if (CachingServicePlugin.DEBUG) System.out.println("- CachingServicePlugin.shouldRegister() sharing=" + sharing); - - if(sharing) { - enabled = true; - }else{ - enabled = false; - } - } - catch(ClassNotFoundException ex){ - if (CachingServicePlugin.DEBUG) System.out.println("E CachingServicePlugin.shouldRegister() ex=" + ex); - //not on J9 - enabled = false; - } - - if (CachingServicePlugin.DEBUG) System.out.println("< CachingServicePlugin.shouldRegister() " + enabled); - return enabled; - } - - private void loadOptions (BundleContext context) { - // all this is only to get the application args - DebugOptions service = null; - ServiceReference reference = context.getServiceReference(DebugOptions.class.getName()); - if (reference != null) - service = (DebugOptions) context.getService(reference); - if (service == null) - return; - try { - DEBUG = service.getBooleanOption("org.aspectj.osgi.service.caching.j9/debug", false); - } finally { - // we have what we want - release the service - context.ungetService(reference); - } - } - - public static boolean DEBUG; + public static boolean DEBUG; + + public static boolean verbose = Boolean + .getBoolean("org.aspectj.osgi.verbose"); + + /** + * The constructor. + */ + public CachingServicePlugin() { + } + + /** + * This method is called upon plug-in activation + */ + public void start(final BundleContext context) throws Exception { + if (CachingServicePlugin.DEBUG) + System.out.println("> CachingServicePlugin.start() context=" + + context); + + loadOptions(context); + + //are we on J9? + if (shouldRegister()) { + if (verbose) + System.err + .println("[org.aspectj.osgi.service.caching.j9] info starting J9 caching service ..."); + final String name = ICachingService.class.getName(); + // CachingServiceFactory factory = new CachingServiceFactory(); + final CachingService singleCachingService = new CachingService(); + context.registerService(name, singleCachingService, null); + // System.out.println("CachingServicePlugin.start() - registered cachingService"); + } else { + if (verbose) + System.err + .println("[org.aspectj.osgi.service.caching.j9] warning cannot start J9 caching service"); + } + + if (CachingServicePlugin.DEBUG) + System.out.println("< CachingServicePlugin.start()"); + } + + /** + * This method is called when the plug-in is stopped + */ + public void stop(final BundleContext context) throws Exception { + } + + private void loadOptions(final BundleContext context) { + // all this is only to get the application args + DebugOptions service = null; + final ServiceReference reference = context + .getServiceReference(DebugOptions.class.getName()); + if (reference != null) + service = (DebugOptions) context.getService(reference); + if (service == null) return; + try { + DEBUG = service.getBooleanOption( + "org.aspectj.osgi.service.caching.j9/debug", false); + } finally { + // we have what we want - release the service + context.ungetService(reference); + } + } + + private boolean shouldRegister() { + if (CachingServicePlugin.DEBUG) + System.out.println("> CachingServicePlugin.shouldRegister()"); + + boolean enabled; + try { + Class.forName("com.ibm.oti.vm.VM"); //if this fails we are not on J9 + final boolean sharing = Shared.isSharingEnabled(); //if not using shared classes we want a different adaptor + if (CachingServicePlugin.DEBUG) + System.out + .println("- CachingServicePlugin.shouldRegister() sharing=" + + sharing); + + if (sharing) { + enabled = true; + } else { + enabled = false; + } + } catch (final ClassNotFoundException ex) { + if (CachingServicePlugin.DEBUG) + System.out + .println("E CachingServicePlugin.shouldRegister() ex=" + + ex); + //not on J9 + enabled = false; + } + + if (CachingServicePlugin.DEBUG) + System.out.println("< CachingServicePlugin.shouldRegister() " + + enabled); + return enabled; + } } diff --git a/bundles/org.eclipse.equinox.weaving.caching/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.weaving.caching/.settings/org.eclipse.jdt.core.prefs index 1baed40a7..68690b64e 100644 --- a/bundles/org.eclipse.equinox.weaving.caching/.settings/org.eclipse.jdt.core.prefs +++ b/bundles/org.eclipse.equinox.weaving.caching/.settings/org.eclipse.jdt.core.prefs @@ -1,4 +1,4 @@ -#Mon Jul 14 17:30:27 CEST 2008 +#Mon Aug 04 14:32:44 CEST 2008 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 @@ -135,7 +135,7 @@ 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.insert_new_line_for_parameter=do not 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 diff --git a/bundles/org.eclipse.equinox.weaving.caching/src/org/eclipse/equinox/weaving/internal/caching/BundleCachingService.java b/bundles/org.eclipse.equinox.weaving.caching/src/org/eclipse/equinox/weaving/internal/caching/BundleCachingService.java index ea80dba66..92b752875 100644 --- a/bundles/org.eclipse.equinox.weaving.caching/src/org/eclipse/equinox/weaving/internal/caching/BundleCachingService.java +++ b/bundles/org.eclipse.equinox.weaving.caching/src/org/eclipse/equinox/weaving/internal/caching/BundleCachingService.java @@ -70,14 +70,11 @@ public class BundleCachingService extends BaseCachingService { private File cachePartition; /** - * @param bundleContext - * Must not be null! - * @param bundle - * Must not be null! - * @param key - * Must not be null! - * @throws IllegalArgumentException - * if given bundleContext or bundle is null. + * @param bundleContext Must not be null! + * @param bundle Must not be null! + * @param key Must not be null! + * @throws IllegalArgumentException if given bundleContext or bundle is + * null. */ public BundleCachingService(final BundleContext bundleContext, final Bundle bundle, final String key) { diff --git a/bundles/org.eclipse.equinox.weaving.caching/src/org/eclipse/equinox/weaving/internal/caching/Log.java b/bundles/org.eclipse.equinox.weaving.caching/src/org/eclipse/equinox/weaving/internal/caching/Log.java index 7a9e2f60d..a25b1c3f7 100644 --- a/bundles/org.eclipse.equinox.weaving.caching/src/org/eclipse/equinox/weaving/internal/caching/Log.java +++ b/bundles/org.eclipse.equinox.weaving.caching/src/org/eclipse/equinox/weaving/internal/caching/Log.java @@ -27,8 +27,7 @@ public class Log { /** * Logging debug information. * - * @param message - * The tracing message, optional. + * @param message The tracing message, optional. */ public static void debug(final String message) { if (debugEnabled) { @@ -41,10 +40,8 @@ public class Log { /** * Logging an error. * - * @param message - * The error message, optional. - * @param t - * The Throwable for this error, optional. + * @param message The error message, optional. + * @param t The Throwable for this error, optional. */ public static void error(final String message, final Throwable t) { if (message != null) { diff --git a/bundles/org.eclipse.equinox.weaving.caching/src/org/eclipse/equinox/weaving/internal/caching/SingletonCachingService.java b/bundles/org.eclipse.equinox.weaving.caching/src/org/eclipse/equinox/weaving/internal/caching/SingletonCachingService.java index e5ac0a456..e42ae0875 100644 --- a/bundles/org.eclipse.equinox.weaving.caching/src/org/eclipse/equinox/weaving/internal/caching/SingletonCachingService.java +++ b/bundles/org.eclipse.equinox.weaving.caching/src/org/eclipse/equinox/weaving/internal/caching/SingletonCachingService.java @@ -35,10 +35,8 @@ public class SingletonCachingService extends BaseCachingService { private final BundleContext bundleContext; /** - * @param bundleContext - * Must not be null! - * @throws IllegalArgumentException - * if given bundleContext is null. + * @param bundleContext Must not be null! + * @throws IllegalArgumentException if given bundleContext is null. */ public SingletonCachingService(final BundleContext bundleContext) { if (bundleContext == null) { @@ -63,8 +61,7 @@ public class SingletonCachingService extends BaseCachingService { * Generates the unique id for the cache of the given bundle (usually the * symbolic name and the bundle version) * - * @param bundle - * The bundle for which a unique cache id should be calculated + * @param bundle The bundle for which a unique cache id should be calculated * @return The unique id of the cache for the given bundle */ public String getCacheId(final Bundle bundle) { diff --git a/bundles/org.eclipse.equinox.weaving.hook/.options b/bundles/org.eclipse.equinox.weaving.hook/.options index 1b6f040ff..b588b6c4e 100644 --- a/bundles/org.eclipse.equinox.weaving.hook/.options +++ b/bundles/org.eclipse.equinox.weaving.hook/.options @@ -1,6 +1,6 @@ org.aspectj.osgi/debug=false org.aspectj.osgi/debug/bundle=false -org.aspectj.osgi/debug/weave=false +org.aspectj.osgi/debug/weave=true org.aspectj.osgi/debug/cache=false org.aspectj.osgi/debug/supplements=false -org.aspectj.osgi/debug/bundleName= +org.aspectj.osgi/debug/bundleName=false diff --git a/bundles/org.eclipse.equinox.weaving.hook/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.equinox.weaving.hook/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..f8cd6fbcf --- /dev/null +++ b/bundles/org.eclipse.equinox.weaving.hook/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +#Mon Aug 04 14:33:29 CEST 2008 +eclipse.preferences.version=1 +encoding/<project>=UTF-8 diff --git a/bundles/org.eclipse.equinox.weaving.hook/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.weaving.hook/.settings/org.eclipse.jdt.core.prefs index 3121c2dbc..bfed381f8 100644 --- a/bundles/org.eclipse.equinox.weaving.hook/.settings/org.eclipse.jdt.core.prefs +++ b/bundles/org.eclipse.equinox.weaving.hook/.settings/org.eclipse.jdt.core.prefs @@ -1,4 +1,4 @@ -#Fri Oct 13 09:40:18 BST 2006 +#Mon Aug 04 14:33:29 CEST 2008 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.1 @@ -7,6 +7,333 @@ org.eclipse.jdt.core.compiler.compliance=1.3 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.doc.comment.support=enabled +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=ignore +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore org.eclipse.jdt.core.compiler.problem.enumIdentifier=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning +org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +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.3 +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=1 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=1 +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=1 +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=false +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=do not 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=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.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=true +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=80 +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 diff --git a/bundles/org.eclipse.equinox.weaving.hook/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.equinox.weaving.hook/.settings/org.eclipse.jdt.ui.prefs index 320731eb0..1c44c2b31 100644 --- a/bundles/org.eclipse.equinox.weaving.hook/.settings/org.eclipse.jdt.ui.prefs +++ b/bundles/org.eclipse.equinox.weaving.hook/.settings/org.eclipse.jdt.ui.prefs @@ -1,3 +1,115 @@ -#Fri Oct 13 09:40:18 BST 2006 +#Mon Aug 04 14:33:29 CEST 2008 +cleanup.add_default_serial_version_id=false +cleanup.add_generated_serial_version_id=true +cleanup.add_missing_annotations=true +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=true +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=false +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=true +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=true +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=true +cleanup.sort_members_all=true +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=_defaultCleanUpProfile +cleanup_settings_version=2 eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_defaultFormatterProfile +formatter_settings_version=11 internal.default.compliance=default +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;com;de;net;org; +org.eclipse.jdt.ui.javadoc=false +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><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">/*******************************************************************************\n * Copyright (c) 2008 ${user} and others.\n * All rights reserved. This program and the accompanying materials \n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http\://www.eclipse.org/legal/epl-v10.html.\n * \n * Contributors\:\n * ${user} - initial implementation\n ******************************************************************************/\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">/**\n * @author ${user}\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><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">/**\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n\n${package_declaration}\n\n${typecomment}\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">\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">\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">\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">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><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">// ${todo} Auto-generated constructor stub\n${body_statement}</template><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> +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.make_local_variable_final=true +sp_cleanup.make_parameters_final=true +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=true +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=true +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=true +sp_cleanup.sort_members_all=true +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/bundles/org.eclipse.equinox.weaving.hook/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.equinox.weaving.hook/.settings/org.eclipse.pde.prefs new file mode 100644 index 000000000..7a5611d8b --- /dev/null +++ b/bundles/org.eclipse.equinox.weaving.hook/.settings/org.eclipse.pde.prefs @@ -0,0 +1,22 @@ +#Mon Aug 04 14:33:29 CEST 2008 +compilers.f.unresolved-features=1 +compilers.f.unresolved-plugins=1 +compilers.incompatible-environment=1 +compilers.p.build=1 +compilers.p.deprecated=1 +compilers.p.discouraged-class=1 +compilers.p.internal=1 +compilers.p.missing-packages=2 +compilers.p.no-required-att=0 +compilers.p.not-externalized-att=1 +compilers.p.unknown-attribute=1 +compilers.p.unknown-class=1 +compilers.p.unknown-element=1 +compilers.p.unknown-identifier=1 +compilers.p.unknown-resource=1 +compilers.p.unresolved-ex-points=0 +compilers.p.unresolved-import=0 +compilers.s.create-docs=false +compilers.s.doc-folder=doc +compilers.s.open-tags=1 +eclipse.preferences.version=1 diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/service/weaving/CacheEntry.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/service/weaving/CacheEntry.java index ed736a3ad..004a8ea11 100644 --- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/service/weaving/CacheEntry.java +++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/service/weaving/CacheEntry.java @@ -13,11 +13,11 @@ package org.eclipse.equinox.service.weaving; public class CacheEntry { - private byte[] cachedBytes; + private final byte[] cachedBytes; - private boolean dontWeave; + private final boolean dontWeave; - public CacheEntry(boolean dontWeave, byte[] cachedBytes) { + public CacheEntry(final boolean dontWeave, final byte[] cachedBytes) { this.dontWeave = dontWeave; this.cachedBytes = cachedBytes; } diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/service/weaving/ICachingService.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/service/weaving/ICachingService.java index da89f0b70..305c11c0f 100644 --- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/service/weaving/ICachingService.java +++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/service/weaving/ICachingService.java @@ -17,11 +17,14 @@ import java.net.URL; import org.osgi.framework.Bundle; public interface ICachingService { - - public ICachingService getInstance(ClassLoader classLoader, Bundle bundle, String key); - - public CacheEntry findStoredClass(String namespace, URL sourceFileURL, String name); - - public boolean storeClass(String namespace, URL sourceFileURL, Class clazz, byte[] classbytes); - + + public CacheEntry findStoredClass(String namespace, URL sourceFileURL, + String name); + + public ICachingService getInstance(ClassLoader classLoader, Bundle bundle, + String key); + + public boolean storeClass(String namespace, URL sourceFileURL, Class clazz, + byte[] classbytes); + } diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/service/weaving/IWeavingService.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/service/weaving/IWeavingService.java index 72f568168..86ad6dbc7 100644 --- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/service/weaving/IWeavingService.java +++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/service/weaving/IWeavingService.java @@ -20,17 +20,17 @@ import org.osgi.framework.Bundle; public interface IWeavingService { - public IWeavingService getInstance(ClassLoader loader, Bundle bundle, - State resolverState, BundleDescription bundleDesciption, - SupplementerRegistry supplementerRegistry); + public void flushGeneratedClasses(ClassLoader loader); - public byte[] preProcess(String name, byte[] classbytes, ClassLoader loader) - throws IOException; + public boolean generatedClassesExistFor(ClassLoader loader, String className); - public String getKey(); + public IWeavingService getInstance(ClassLoader loader, Bundle bundle, + State resolverState, BundleDescription bundleDesciption, + SupplementerRegistry supplementerRegistry); - public boolean generatedClassesExistFor(ClassLoader loader, String className); + public String getKey(); - public void flushGeneratedClasses(ClassLoader loader); + public byte[] preProcess(String name, byte[] classbytes, ClassLoader loader) + throws IOException; } diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/service/weaving/SupplementerRegistry.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/service/weaving/SupplementerRegistry.java index c47ab8e64..425f669c7 100644 --- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/service/weaving/SupplementerRegistry.java +++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/service/weaving/SupplementerRegistry.java @@ -8,11 +8,13 @@ * Contributors: * Matthew Webster initial implementation * Martin Lippert supplementing mechanism reworked + * Heiko Seeberger Enhancements for service dynamics *******************************************************************************/ package org.eclipse.equinox.service.weaving; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.Dictionary; import java.util.HashMap; @@ -33,236 +35,300 @@ import org.osgi.framework.Constants; import org.osgi.service.packageadmin.PackageAdmin; public class SupplementerRegistry { - - /** - * Manifest header (named "Supplement-Importer") identifying the names - * (and optionally, version numbers) of the packages that the bundle supplements. - * All importers of one of these packages will have the exported packages of this - * bundle added to their imports in addition. - * - * <p> - * The attribute value may be retrieved from the <code>Dictionary</code> - * object returned by the <code>Bundle.getHeaders</code> method. - */ - public static final String SUPPLEMENT_IMPORTER = "Eclipse-SupplementImporter"; //$NON-NLS-1$ - - /** - * Manifest header (named "Supplement-Exporter") identifying the names - * (and optionally, version numbers) of the packages that the bundle supplements. - * All exporters of one of these packages will have the exported packages of this bundle - * added to their imports list. - * - * <p> - * The attribute value may be retrieved from the <code>Dictionary</code> - * object returned by the <code>Bundle.getHeaders</code> method. - */ - public static final String SUPPLEMENT_EXPORTER = "Eclipse-SupplementExporter"; //$NON-NLS-1$ - - //knibb - /** - * Manifest header (named "Supplement-Bundle") identifying the names - * (and optionally, version numbers) of any bundles supplemented by this bundle. - * All supplemented bundles will have all the exported packages of this bundle - * added to their imports list - * - * <p> - * The attribute value may be retrieved from the <code>Dictionary</code> - * object returned by the <code>Bundle.getHeaders</code> method. - */ - public static final String SUPPLEMENT_BUNDLE = "Eclipse-SupplementBundle"; //$NON-NLS-1$ - - private final Map supplementers; // keys of type String (symbolic name of supplementer bundle), values of type Supplementer - private final Set dontWeaveTheseBundles; // elements of type String (symbolic name of bundle) - private BundleContext context; - private PackageAdmin packageAdmin; - - public SupplementerRegistry() { - this.supplementers = new HashMap(); - this.dontWeaveTheseBundles = new HashSet(); - - this.dontWeaveTheseBundles.add("org.eclipse.osgi"); - this.dontWeaveTheseBundles.add("org.eclipse.update.configurator"); - this.dontWeaveTheseBundles.add("org.eclipse.core.runtime"); - this.dontWeaveTheseBundles.add("org.eclipse.equinox.common"); - this.dontWeaveTheseBundles.add("org.eclipse.equinox.weaving.hook"); - this.dontWeaveTheseBundles.add("org.eclipse.equinox.weaving.aspectj"); - this.dontWeaveTheseBundles.add("org.eclipse.equinox.weaving.caching"); - this.dontWeaveTheseBundles.add("org.eclipse.equinox.weaving.caching.j9"); - this.dontWeaveTheseBundles.add("org.aspectj.runtime"); - this.dontWeaveTheseBundles.add("org.aspectj.weaver"); - this.dontWeaveTheseBundles.add("org.eclipse.equinox.simpleconfigurator"); - } - - public void setBundleContext(BundleContext context) { - this.context = context; - } - - public void setPackageAdmin(PackageAdmin packageAdmin) { - this.packageAdmin = packageAdmin; - } - - public void addSupplementer(Bundle bundle) { - Dictionary manifest = bundle.getHeaders(); - try { - // First analyze which supplementers already exists for this bundle - ManifestElement[] imports = ManifestElement.parseHeader(Constants.IMPORT_PACKAGE, (String) manifest.get(Constants.IMPORT_PACKAGE)); - ManifestElement[] exports = ManifestElement.parseHeader(Constants.EXPORT_PACKAGE, (String) manifest.get(Constants.EXPORT_PACKAGE)); - List supplementers = getSupplementers(bundle.getSymbolicName(), imports, exports); - if (supplementers.size() > 0) { - this.addSupplementedBundle(bundle, supplementers); - } - - // Second analyze if this bundle itself is a supplementer - ManifestElement[] supplementBundle = ManifestElement.parseHeader(SUPPLEMENT_BUNDLE, (String) manifest.get(SUPPLEMENT_BUNDLE)); - ManifestElement[] supplementImporter = ManifestElement.parseHeader(SUPPLEMENT_IMPORTER, (String) manifest.get(SUPPLEMENT_IMPORTER)); - ManifestElement[] supplementExporter = ManifestElement.parseHeader(SUPPLEMENT_EXPORTER, (String) manifest.get(SUPPLEMENT_EXPORTER)); - - if (supplementBundle != null || supplementImporter != null || supplementExporter != null) { - Supplementer newSupplementer = new Supplementer(bundle, supplementBundle, supplementImporter, supplementExporter); - - this.supplementers.put(bundle.getSymbolicName(), newSupplementer); - resupplementInstalledBundles(newSupplementer); - } - } - catch (BundleException e) { - } - } - - public void removeSupplementer(Bundle bundle) { - // if this bundle is itself supplemented by others, remove the bundle from those lists - removeSupplementedBundle(bundle); - - // if this bundle supplements other bundles, remove this supplementer and update the other bundles - if (supplementers.containsKey(bundle.getSymbolicName())) { - Supplementer supplementer = (Supplementer) supplementers.get(bundle.getSymbolicName()); - supplementers.remove(bundle.getSymbolicName()); - if (AbstractAspectJHook.verbose) System.err.println("[org.aspectj.osgi] info removing supplementer " + bundle.getSymbolicName()); - - Bundle[] supplementedBundles = supplementer.getSupplementedBundles(); - for (int i = 0; i < supplementedBundles.length; i++) { - Bundle supplementedBundle = supplementedBundles[i]; - if (supplementedBundle != null) { - updateInstalledBundle(supplementedBundle); - } - } - } - } - - public List getSupplementers (String symbolicName, ManifestElement[] imports, ManifestElement[] exports) { - List result = Collections.EMPTY_LIST; - - if (supplementers.size() > 0 && !this.dontWeaveTheseBundles.contains(symbolicName)) { - result = new LinkedList(); - for (Iterator i = supplementers.values().iterator(); i.hasNext();) { - Supplementer supplementer = (Supplementer) i.next(); - if (isSupplementerMatching(symbolicName, imports, exports, supplementer)) { - result.add(supplementer.getSymbolicName()); - } - } - } - - return result; - } - - public Bundle[] getSupplementers(Bundle bundle) { - List result = Collections.EMPTY_LIST; - - if (supplementers.size() > 0) { - result = new ArrayList(); - for (Iterator i = supplementers.values().iterator(); i.hasNext();) { - Supplementer supplementer = (Supplementer) i.next(); - if (supplementer.isSupplemented(bundle)) { - result.add(supplementer.getSupplementerBundle()); - } - } - } - - return (Bundle[]) result.toArray(new Bundle[result.size()]); - } - - public void addSupplementedBundle(Bundle supplementedBundle, List supplementers) { - for (Iterator iterator = supplementers.iterator(); iterator.hasNext();) { - String supplementersName = (String) iterator.next(); - if (this.supplementers.containsKey(supplementersName)) { - Supplementer supplementer = (Supplementer) this.supplementers.get(supplementersName); - supplementer.addSupplementedBundle(supplementedBundle); - } - } - } - - public void removeSupplementedBundle(Bundle bundle) { - for (Iterator iterator = this.supplementers.values().iterator(); iterator.hasNext();) { - Supplementer supplementer = (Supplementer) iterator.next(); - supplementer.removeSupplementedBundle(bundle); - } - } - - private boolean isSupplementerMatching(String symbolicName, - ManifestElement[] imports, ManifestElement[] exports, Supplementer supplementer) { - String supplementerName = supplementer.getSymbolicName(); - if (!supplementerName.equals(symbolicName)) { - if (supplementer.matchSupplementer(symbolicName) - || (imports != null && supplementer.matchesSupplementImporter(imports)) - || (exports != null && supplementer.matchesSupplementExporter(exports))) { - return true; - } - } - return false; - } - - private void resupplementInstalledBundles(Supplementer supplementer) { - Bundle[] installedBundles = context.getBundles(); - - for (int i = 0; i < installedBundles.length; i++) { - try { - Bundle bundle = installedBundles[i]; - - if (bundle.getSymbolicName().equals(supplementer.getSymbolicName())) { - continue; - } - - if (dontWeaveTheseBundles.contains(bundle.getSymbolicName())) { - continue; - } - - Dictionary manifest = bundle.getHeaders(); - ManifestElement[] imports = ManifestElement.parseHeader(Constants.IMPORT_PACKAGE, (String) manifest.get(Constants.IMPORT_PACKAGE)); - ManifestElement[] exports = ManifestElement.parseHeader(Constants.EXPORT_PACKAGE, (String) manifest.get(Constants.EXPORT_PACKAGE)); - - if (isSupplementerMatching(bundle.getSymbolicName(), imports, exports, supplementer)) { - boolean alreadyRequired = false; - ManifestElement[] requires = ManifestElement.parseHeader(Constants.REQUIRE_BUNDLE, (String) manifest.get(Constants.REQUIRE_BUNDLE)); - if (requires != null) { - for (int j = 0; j < requires.length; j++) { - if (requires[j].getValue().equals(supplementer.getSymbolicName())) { - alreadyRequired = true; - } - } - } - - if (!alreadyRequired) { - updateInstalledBundle(bundle); - } - } - - } catch (BundleException e) { - e.printStackTrace(); - } - } - } - - private void updateInstalledBundle(Bundle bundle) { - if (AbstractAspectJHook.verbose) System.err.println("[org.aspectj.osgi] info triggering update for re-supplementing " + bundle.getSymbolicName()); - - try { - int initialstate = (bundle.getState() | (Bundle.ACTIVE | Bundle.STARTING)); - if (initialstate != 0 && packageAdmin != null && packageAdmin.getBundleType(bundle) != PackageAdmin.BUNDLE_TYPE_FRAGMENT) - bundle.stop(Bundle.STOP_TRANSIENT); - bundle.update(); - } - catch (BundleException e) { - e.printStackTrace(); - } - } + + //knibb + /** + * Manifest header (named "Supplement-Bundle") identifying the + * names (and optionally, version numbers) of any bundles supplemented by + * this bundle. All supplemented bundles will have all the exported packages + * of this bundle added to their imports list + * + * <p> + * The attribute value may be retrieved from the <code>Dictionary</code> + * object returned by the <code>Bundle.getHeaders</code> method. + */ + public static final String SUPPLEMENT_BUNDLE = "Eclipse-SupplementBundle"; //$NON-NLS-1$ + + /** + * Manifest header (named "Supplement-Exporter") identifying the + * names (and optionally, version numbers) of the packages that the bundle + * supplements. All exporters of one of these packages will have the + * exported packages of this bundle added to their imports list. + * + * <p> + * The attribute value may be retrieved from the <code>Dictionary</code> + * object returned by the <code>Bundle.getHeaders</code> method. + */ + public static final String SUPPLEMENT_EXPORTER = "Eclipse-SupplementExporter"; //$NON-NLS-1$ + + /** + * Manifest header (named "Supplement-Importer") identifying the + * names (and optionally, version numbers) of the packages that the bundle + * supplements. All importers of one of these packages will have the + * exported packages of this bundle added to their imports in addition. + * + * <p> + * The attribute value may be retrieved from the <code>Dictionary</code> + * object returned by the <code>Bundle.getHeaders</code> method. + */ + public static final String SUPPLEMENT_IMPORTER = "Eclipse-SupplementImporter"; //$NON-NLS-1$ + + private BundleContext context; + + private final Set dontWeaveTheseBundles; // elements of type String (symbolic name of bundle) + + private PackageAdmin packageAdmin; + + private final Map supplementers; // keys of type String (symbolic name of supplementer bundle), values of type Supplementer + + public SupplementerRegistry() { + this.supplementers = new HashMap(); + this.dontWeaveTheseBundles = new HashSet(); + + this.dontWeaveTheseBundles.add("org.eclipse.osgi"); + this.dontWeaveTheseBundles.add("org.eclipse.update.configurator"); + this.dontWeaveTheseBundles.add("org.eclipse.core.runtime"); + this.dontWeaveTheseBundles.add("org.eclipse.equinox.common"); + this.dontWeaveTheseBundles.add("org.eclipse.equinox.weaving.hook"); + this.dontWeaveTheseBundles.add("org.eclipse.equinox.weaving.aspectj"); + this.dontWeaveTheseBundles.add("org.eclipse.equinox.weaving.caching"); + this.dontWeaveTheseBundles + .add("org.eclipse.equinox.weaving.caching.j9"); + this.dontWeaveTheseBundles.add("org.aspectj.runtime"); + this.dontWeaveTheseBundles.add("org.aspectj.weaver"); + this.dontWeaveTheseBundles + .add("org.eclipse.equinox.simpleconfigurator"); + } + + public void addSupplementedBundle(final Bundle supplementedBundle, + final List supplementers) { + for (final Iterator iterator = supplementers.iterator(); iterator + .hasNext();) { + final String supplementersName = (String) iterator.next(); + if (this.supplementers.containsKey(supplementersName)) { + final Supplementer supplementer = (Supplementer) this.supplementers + .get(supplementersName); + supplementer.addSupplementedBundle(supplementedBundle); + } + } + } + + public void addSupplementer(final Bundle bundle) { + final Dictionary manifest = bundle.getHeaders(); + try { + // First analyze which supplementers already exists for this bundle + final ManifestElement[] imports = ManifestElement.parseHeader( + Constants.IMPORT_PACKAGE, (String) manifest + .get(Constants.IMPORT_PACKAGE)); + final ManifestElement[] exports = ManifestElement.parseHeader( + Constants.EXPORT_PACKAGE, (String) manifest + .get(Constants.EXPORT_PACKAGE)); + final List supplementers = getSupplementers(bundle + .getSymbolicName(), imports, exports); + if (supplementers.size() > 0) { + this.addSupplementedBundle(bundle, supplementers); + } + + // Second analyze if this bundle itself is a supplementer + final ManifestElement[] supplementBundle = ManifestElement + .parseHeader(SUPPLEMENT_BUNDLE, (String) manifest + .get(SUPPLEMENT_BUNDLE)); + final ManifestElement[] supplementImporter = ManifestElement + .parseHeader(SUPPLEMENT_IMPORTER, (String) manifest + .get(SUPPLEMENT_IMPORTER)); + final ManifestElement[] supplementExporter = ManifestElement + .parseHeader(SUPPLEMENT_EXPORTER, (String) manifest + .get(SUPPLEMENT_EXPORTER)); + + if (supplementBundle != null || supplementImporter != null + || supplementExporter != null) { + final Supplementer newSupplementer = new Supplementer(bundle, + supplementBundle, supplementImporter, + supplementExporter); + + this.supplementers.put(bundle.getSymbolicName(), + newSupplementer); + resupplementInstalledBundles(newSupplementer); + } + } catch (final BundleException e) { + } + } + + public Set getSupplementedBundles() { + final Set supplementedBundles = new HashSet(); + final Iterator supplementersIterator = supplementers.values() + .iterator(); + while (supplementersIterator.hasNext()) { + final Supplementer supplementer = (Supplementer) supplementersIterator + .next(); + supplementedBundles.addAll(Arrays.asList(supplementer + .getSupplementedBundles())); + } + return supplementedBundles; + } + + public Bundle[] getSupplementers(final Bundle bundle) { + List result = Collections.EMPTY_LIST; + + if (supplementers.size() > 0) { + result = new ArrayList(); + for (final Iterator i = supplementers.values().iterator(); i + .hasNext();) { + final Supplementer supplementer = (Supplementer) i.next(); + if (supplementer.isSupplemented(bundle)) { + result.add(supplementer.getSupplementerBundle()); + } + } + } + + return (Bundle[]) result.toArray(new Bundle[result.size()]); + } + + public List getSupplementers(final String symbolicName, + final ManifestElement[] imports, final ManifestElement[] exports) { + List result = Collections.EMPTY_LIST; + + if (supplementers.size() > 0 + && !this.dontWeaveTheseBundles.contains(symbolicName)) { + result = new LinkedList(); + for (final Iterator i = supplementers.values().iterator(); i + .hasNext();) { + final Supplementer supplementer = (Supplementer) i.next(); + if (isSupplementerMatching(symbolicName, imports, exports, + supplementer)) { + result.add(supplementer.getSymbolicName()); + } + } + } + + return result; + } + + public void removeSupplementedBundle(final Bundle bundle) { + for (final Iterator iterator = this.supplementers.values().iterator(); iterator + .hasNext();) { + final Supplementer supplementer = (Supplementer) iterator.next(); + supplementer.removeSupplementedBundle(bundle); + } + } + + public void removeSupplementer(final Bundle bundle) { + // if this bundle is itself supplemented by others, remove the bundle from those lists + removeSupplementedBundle(bundle); + + // if this bundle supplements other bundles, remove this supplementer and update the other bundles + if (supplementers.containsKey(bundle.getSymbolicName())) { + final Supplementer supplementer = (Supplementer) supplementers + .get(bundle.getSymbolicName()); + supplementers.remove(bundle.getSymbolicName()); + if (AbstractAspectJHook.verbose) + System.err + .println("[org.aspectj.osgi] info removing supplementer " + + bundle.getSymbolicName()); + + final Bundle[] supplementedBundles = supplementer + .getSupplementedBundles(); + for (int i = 0; i < supplementedBundles.length; i++) { + final Bundle supplementedBundle = supplementedBundles[i]; + if (supplementedBundle != null) { + updateInstalledBundle(supplementedBundle); + } + } + } + } + + public void setBundleContext(final BundleContext context) { + this.context = context; + } + + public void setPackageAdmin(final PackageAdmin packageAdmin) { + this.packageAdmin = packageAdmin; + } + + public void updateInstalledBundle(final Bundle bundle) { + if (AbstractAspectJHook.verbose) + System.err + .println("[org.aspectj.osgi] info triggering update for re-supplementing " + + bundle.getSymbolicName()); + + try { + final int initialstate = (bundle.getState() | (Bundle.ACTIVE | Bundle.STARTING)); + // TODO Why stop? Shouldn't start again? + if (initialstate != 0 + && packageAdmin != null + && packageAdmin.getBundleType(bundle) != PackageAdmin.BUNDLE_TYPE_FRAGMENT) + bundle.stop(Bundle.STOP_TRANSIENT); + bundle.update(); + } catch (final BundleException e) { + e.printStackTrace(); + } + } + + private boolean isSupplementerMatching(final String symbolicName, + final ManifestElement[] imports, final ManifestElement[] exports, + final Supplementer supplementer) { + final String supplementerName = supplementer.getSymbolicName(); + if (!supplementerName.equals(symbolicName)) { + if (supplementer.matchSupplementer(symbolicName) + || (imports != null && supplementer + .matchesSupplementImporter(imports)) + || (exports != null && supplementer + .matchesSupplementExporter(exports))) { + return true; + } + } + return false; + } + + private void resupplementInstalledBundles(final Supplementer supplementer) { + final Bundle[] installedBundles = context.getBundles(); + + for (int i = 0; i < installedBundles.length; i++) { + try { + final Bundle bundle = installedBundles[i]; + + if (bundle.getSymbolicName().equals( + supplementer.getSymbolicName())) { + continue; + } + + if (dontWeaveTheseBundles.contains(bundle.getSymbolicName())) { + continue; + } + + final Dictionary manifest = bundle.getHeaders(); + final ManifestElement[] imports = ManifestElement.parseHeader( + Constants.IMPORT_PACKAGE, (String) manifest + .get(Constants.IMPORT_PACKAGE)); + final ManifestElement[] exports = ManifestElement.parseHeader( + Constants.EXPORT_PACKAGE, (String) manifest + .get(Constants.EXPORT_PACKAGE)); + + if (isSupplementerMatching(bundle.getSymbolicName(), imports, + exports, supplementer)) { + boolean alreadyRequired = false; + final ManifestElement[] requires = ManifestElement + .parseHeader(Constants.REQUIRE_BUNDLE, + (String) manifest + .get(Constants.REQUIRE_BUNDLE)); + if (requires != null) { + for (int j = 0; j < requires.length; j++) { + if (requires[j].getValue().equals( + supplementer.getSymbolicName())) { + alreadyRequired = true; + } + } + } + + if (!alreadyRequired) { + updateInstalledBundle(bundle); + } + } + + } catch (final BundleException e) { + e.printStackTrace(); + } + } + } } diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/AspectJAdaptor.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/AspectJAdaptor.java index d862a4944..f16035ba1 100644 --- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/AspectJAdaptor.java +++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/AspectJAdaptor.java @@ -10,6 +10,7 @@ * Matthew Webster Eclipse 3.2 changes * Martin Lippert minor changes and bugfixes *******************************************************************************/ + package org.eclipse.equinox.weaving.adaptors; import java.io.IOException; @@ -30,161 +31,215 @@ import org.osgi.framework.Bundle; public class AspectJAdaptor implements IAspectJAdaptor { - private boolean initialized = false; - private BaseData data; - private AspectJAdaptorFactory factory; - private BaseClassLoader baseLoader; - private Bundle bundle; - private String symbolicName; - private IWeavingService weavingService; - private ICachingService cachingService; - - private static ThreadLocalSet identifyRecursionSet = new ThreadLocalSet(); - - private static class ThreadLocalSet extends ThreadLocal { - - public void put(Object obj) { - Set set = (Set) get(); - if (set.contains(obj)) { - throw new RuntimeException(obj.toString()); - } - set.add(obj); - } - - public void remove(Object obj) { - Set set = (Set) get(); - if (!set.contains(obj)) { - throw new RuntimeException(obj.toString()); - } - set.remove(obj); - } - - public boolean contains(Object obj) { - Set set = (Set) get(); - return set.contains(obj); - } - - protected Object initialValue() { - return new HashSet(); - } - } - - public AspectJAdaptor (BaseData baseData, AspectJAdaptorFactory serviceFactory, BaseClassLoader baseClassLoader, IWeavingService weavingService, ICachingService cachingService) { - this.data = baseData; - this.factory = serviceFactory; - this.symbolicName = baseData.getLocation(); - if (Debug.DEBUG_GENERAL) Debug.println("- AspectJAdaptor.AspectJAdaptor() bundle=" + symbolicName); - } - - private void initialize () { - synchronized(this) { - if (initialized) return; - - this.bundle = data.getBundle(); - this.symbolicName = data.getSymbolicName(); - if (!identifyRecursionSet.contains(this)) { - identifyRecursionSet.put(this); - - if (Debug.DEBUG_GENERAL) Debug.println("> AspectJAdaptor.initialize() bundle=" + symbolicName + ", baseLoader=" + baseLoader); - - if (symbolicName.startsWith("org.aspectj")) { - if (Debug.DEBUG_GENERAL) Debug.println("- AspectJAdaptor.initialize() symbolicName=" + symbolicName + ", baseLoader=" + baseLoader); - } - else if (baseLoader != null) { - weavingService = factory.getWeavingService(baseLoader); - cachingService = factory.getCachingService(baseLoader,bundle,weavingService); - } - else if (bundle instanceof BundleFragment) { - BundleFragment fragment = (BundleFragment)bundle; - BundleHost host = (BundleHost)factory.getHost(fragment); - if (Debug.DEBUG_GENERAL) Debug.println("- AspectJAdaptor.initialize() symbolicName=" + symbolicName + ", host=" + host); - - BaseData hostData = (BaseData)host.getBundleData(); - // System.err.println("? AspectJAdaptor.initialize() bundleData=" + hostData); - BundleFile bundleFile = hostData.getBundleFile(); - if (bundleFile instanceof AspectJBundleFile) { - AspectJBundleFile hostFile = (AspectJBundleFile)bundleFile; - // System.err.println("? AspectJAdaptor.initialize() bundleFile=" + hostFile); - AspectJAdaptor hostAdaptor = (AspectJAdaptor)hostFile.getAdaptor(); - // System.err.println("? AspectJAdaptor.initialize() bundleFile=" + hostAdaptor); - weavingService = hostAdaptor.weavingService; - cachingService = factory.getCachingService(hostAdaptor.baseLoader,bundle,weavingService); - } - } - else { - if (Debug.DEBUG_GENERAL) Debug.println("W AspectJAdaptor.initialize() symbolicName=" + symbolicName + ", baseLoader=" + baseLoader); - } - initialized = true; - identifyRecursionSet.remove(this); - } - - if (Debug.DEBUG_GENERAL) Debug.println("< AspectJAdaptor.initialize() weavingService=" + (weavingService != null) + ", cachingService=" + (cachingService != null)); - } - } - - public void setBaseClassLoader (BaseClassLoader baseClassLoader) { - this.baseLoader = baseClassLoader; - - if (Debug.DEBUG_GENERAL) Debug.println("- AspectJAdaptor.setBaseClassLoader() bundle=" + symbolicName + ", baseLoader=" + baseLoader); - } - - public CacheEntry findClass (String name, URL sourceFileURL) { - if (Debug.DEBUG_CACHE) Debug.println("> AspectJAdaptor.findClass() bundle=" + symbolicName + ", url=" + sourceFileURL + ", name=" + name); - CacheEntry cacheEntry = null; - - initialize(); - if (cachingService != null) { - cacheEntry = cachingService.findStoredClass("",sourceFileURL,name); - } - - if (Debug.DEBUG_CACHE) Debug.println("< AspectJAdaptor.findClass() cacheEntry=" + cacheEntry); - return cacheEntry; - } - - public byte[] weaveClass (String name, byte[] bytes) { - if (Debug.DEBUG_WEAVE) Debug.println("> AspectJAdaptor.weaveClass() bundle=" + symbolicName + ", name=" + name + ", bytes=" + bytes.length); - byte[] newBytes = null; - - initialize(); - if (/*shouldWeave(bytes) && */ weavingService != null){ - try { - newBytes = weavingService.preProcess(name,bytes,(ClassLoader)baseLoader); - } - catch (IOException ex) { - throw new ClassFormatError(ex.toString()); - } - } - - if (Debug.DEBUG_WEAVE) Debug.println("< AspectJAdaptor.weaveClass() newBytes=" + newBytes); - return newBytes; - } - - public boolean storeClass (String name, URL sourceFileURL, Class clazz, byte[] classbytes) { - if (Debug.DEBUG_CACHE) Debug.println("> AspectJAdaptor.storeClass() bundle=" + symbolicName + ", url=" + sourceFileURL + ", name=" + name + ", clazz=" + clazz); - boolean stored = false; - - initialize(); - if (cachingService != null) { - //have we generated a closure? - //If so we cannot store in shared cache (as closure will be lost for future runs) - if (weavingService != null && weavingService.generatedClassesExistFor((ClassLoader)baseLoader,name)) { - weavingService.flushGeneratedClasses((ClassLoader)baseLoader); - if (Debug.DEBUG_CACHE) Debug.println("- AspectJAdaptor.storeClass() generatedClassesExistFor=true"); -// return clazz; - } - else{ - stored = cachingService.storeClass("",sourceFileURL,clazz,classbytes); - if(!stored){ - if (Debug.DEBUG_CACHE) Debug.println("E AspectJHook.storeClass() bundle=" + symbolicName + ", name=" + name); - } - } - } - if (Debug.DEBUG_CACHE) Debug.println("< AspectJAdaptor.storeClass() stored=" + stored); - return stored; - } - - public String toString () { - return "AspectJAdaptor[" + symbolicName + "]"; - } - -}
\ No newline at end of file + private static class ThreadLocalSet extends ThreadLocal { + + public boolean contains(final Object obj) { + final Set set = (Set) get(); + return set.contains(obj); + } + + public void put(final Object obj) { + final Set set = (Set) get(); + if (set.contains(obj)) { + throw new RuntimeException(obj.toString()); + } + set.add(obj); + } + + public void remove(final Object obj) { + final Set set = (Set) get(); + if (!set.contains(obj)) { + throw new RuntimeException(obj.toString()); + } + set.remove(obj); + } + + protected Object initialValue() { + return new HashSet(); + } + } + + private static ThreadLocalSet identifyRecursionSet = new ThreadLocalSet(); + + private BaseClassLoader baseLoader; + + private Bundle bundle; + + private ICachingService cachingService; + + private final BaseData data; + + private final AspectJAdaptorFactory factory; + + private boolean initialized = false; + + private String symbolicName; + + private IWeavingService weavingService; + + public AspectJAdaptor(final BaseData baseData, + final AspectJAdaptorFactory serviceFactory, + final BaseClassLoader baseClassLoader, + final IWeavingService weavingService, + final ICachingService cachingService) { + this.data = baseData; + this.factory = serviceFactory; + this.symbolicName = baseData.getLocation(); + if (Debug.DEBUG_GENERAL) + Debug.println("- AspectJAdaptor.AspectJAdaptor() bundle=" + + symbolicName); + } + + public CacheEntry findClass(final String name, final URL sourceFileURL) { + if (Debug.DEBUG_CACHE) + Debug.println("> AspectJAdaptor.findClass() bundle=" + symbolicName + + ", url=" + sourceFileURL + ", name=" + name); + CacheEntry cacheEntry = null; + + initialize(); + if (cachingService != null) { + cacheEntry = cachingService + .findStoredClass("", sourceFileURL, name); + } + + if (Debug.DEBUG_CACHE) + Debug.println("< AspectJAdaptor.findClass() cacheEntry=" + + cacheEntry); + return cacheEntry; + } + + public void setBaseClassLoader(final BaseClassLoader baseClassLoader) { + this.baseLoader = baseClassLoader; + + if (Debug.DEBUG_GENERAL) + Debug.println("- AspectJAdaptor.setBaseClassLoader() bundle=" + + symbolicName + ", baseLoader=" + baseLoader); + } + + public boolean storeClass(final String name, final URL sourceFileURL, + final Class clazz, final byte[] classbytes) { + if (Debug.DEBUG_CACHE) + Debug.println("> AspectJAdaptor.storeClass() bundle=" + + symbolicName + ", url=" + sourceFileURL + ", name=" + + name + ", clazz=" + clazz); + boolean stored = false; + + initialize(); + if (cachingService != null) { + //have we generated a closure? + //If so we cannot store in shared cache (as closure will be lost for future runs) + if (weavingService != null + && weavingService.generatedClassesExistFor( + (ClassLoader) baseLoader, name)) { + weavingService.flushGeneratedClasses((ClassLoader) baseLoader); + if (Debug.DEBUG_CACHE) + Debug + .println("- AspectJAdaptor.storeClass() generatedClassesExistFor=true"); + // return clazz; + } else { + stored = cachingService.storeClass("", sourceFileURL, clazz, + classbytes); + if (!stored) { + if (Debug.DEBUG_CACHE) + Debug.println("E AspectJHook.storeClass() bundle=" + + symbolicName + ", name=" + name); + } + } + } + if (Debug.DEBUG_CACHE) + Debug.println("< AspectJAdaptor.storeClass() stored=" + stored); + return stored; + } + + public String toString() { + return "AspectJAdaptor[" + symbolicName + "]"; + } + + public byte[] weaveClass(final String name, final byte[] bytes) { + if (Debug.DEBUG_WEAVE) + Debug.println("> AspectJAdaptor.weaveClass() bundle=" + + symbolicName + ", name=" + name + ", bytes=" + + bytes.length); + byte[] newBytes = null; + + initialize(); + if (/* shouldWeave(bytes) && */weavingService != null) { + try { + newBytes = weavingService.preProcess(name, bytes, + (ClassLoader) baseLoader); + } catch (final IOException ex) { + throw new ClassFormatError(ex.toString()); + } + } + + if (Debug.DEBUG_WEAVE) + Debug.println("< AspectJAdaptor.weaveClass() newBytes=" + newBytes); + return newBytes; + } + + private void initialize() { + synchronized (this) { + if (initialized) return; + + this.bundle = data.getBundle(); + this.symbolicName = data.getSymbolicName(); + if (!identifyRecursionSet.contains(this)) { + identifyRecursionSet.put(this); + + if (Debug.DEBUG_GENERAL) + Debug.println("> AspectJAdaptor.initialize() bundle=" + + symbolicName + ", baseLoader=" + baseLoader); + + if (symbolicName.startsWith("org.aspectj")) { + if (Debug.DEBUG_GENERAL) + Debug + .println("- AspectJAdaptor.initialize() symbolicName=" + + symbolicName + + ", baseLoader=" + + baseLoader); + } else if (baseLoader != null) { + weavingService = factory.getWeavingService(baseLoader); + cachingService = factory.getCachingService(baseLoader, + bundle, weavingService); + } else if (bundle instanceof BundleFragment) { + final BundleFragment fragment = (BundleFragment) bundle; + final BundleHost host = (BundleHost) factory + .getHost(fragment); + if (Debug.DEBUG_GENERAL) + Debug + .println("- AspectJAdaptor.initialize() symbolicName=" + + symbolicName + ", host=" + host); + + final BaseData hostData = (BaseData) host.getBundleData(); + // System.err.println("? AspectJAdaptor.initialize() bundleData=" + hostData); + final BundleFile bundleFile = hostData.getBundleFile(); + if (bundleFile instanceof AspectJBundleFile) { + final AspectJBundleFile hostFile = (AspectJBundleFile) bundleFile; + // System.err.println("? AspectJAdaptor.initialize() bundleFile=" + hostFile); + final AspectJAdaptor hostAdaptor = (AspectJAdaptor) hostFile + .getAdaptor(); + // System.err.println("? AspectJAdaptor.initialize() bundleFile=" + hostAdaptor); + weavingService = hostAdaptor.weavingService; + cachingService = factory.getCachingService( + hostAdaptor.baseLoader, bundle, weavingService); + } + } else { + if (Debug.DEBUG_GENERAL) + Debug + .println("W AspectJAdaptor.initialize() symbolicName=" + + symbolicName + + ", baseLoader=" + + baseLoader); + } + initialized = true; + identifyRecursionSet.remove(this); + } + + if (Debug.DEBUG_GENERAL) + Debug.println("< AspectJAdaptor.initialize() weavingService=" + + (weavingService != null) + ", cachingService=" + + (cachingService != null)); + } + } + +} diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/AspectJAdaptorFactory.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/AspectJAdaptorFactory.java index a9535a916..4ec4bcaf5 100644 --- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/AspectJAdaptorFactory.java +++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/AspectJAdaptorFactory.java @@ -7,10 +7,14 @@ * * Contributors: * David Knibb initial implementation - * Matthew Webster Eclipse 3.2 changes + * Matthew Webster Eclipse 3.2 changes + * Heiko Seeberger Enhancements for service dynamics *******************************************************************************/ + package org.eclipse.equinox.weaving.adaptors; +import java.util.Iterator; + import org.eclipse.equinox.service.weaving.ICachingService; import org.eclipse.equinox.service.weaving.IWeavingService; import org.eclipse.equinox.service.weaving.SupplementerRegistry; @@ -20,134 +24,179 @@ import org.eclipse.osgi.service.resolver.BundleDescription; import org.eclipse.osgi.service.resolver.State; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceEvent; -import org.osgi.framework.ServiceListener; import org.osgi.framework.ServiceReference; import org.osgi.service.packageadmin.PackageAdmin; +import org.osgi.util.tracker.ServiceTracker; +import org.osgi.util.tracker.ServiceTrackerCustomizer; public class AspectJAdaptorFactory { - private BundleContext bundleContext; - private IWeavingService singletonWeavingService; - private ICachingService singletonCachingService; - private PackageAdmin packageAdminService; - private SupplementerRegistry supplementerRegistry; - - public AspectJAdaptorFactory () { - } - - public void initialize (BundleContext context, SupplementerRegistry supplementerRegistry) { - if (Debug.DEBUG_GENERAL) Debug.println("> AspectJAdaptorFactory.initialize() context=" + context); - this.bundleContext = context; - this.supplementerRegistry = supplementerRegistry; - - String weavingFilter = "(objectclass="+IWeavingService.class.getName()+")"; - String cachingFilter = "(objectclass="+ICachingService.class.getName()+")"; - /* - * Add listeners to listen for the - * registration of the weaving and caching services - */ - ServiceListener weavingListener = new ServiceListener() { - - public void serviceChanged(ServiceEvent event) { - if(event.getType() == ServiceEvent.REGISTERED) { -// System.err.println("ServiceListener.serviceChanged() event=" + event); - initializeWeavingService(); - } - } - - }; - - ServiceListener cachingListener = new ServiceListener(){ - - public void serviceChanged(ServiceEvent event) { - if(event.getType() == ServiceEvent.REGISTERED) { -// System.err.println("ServiceListener.serviceChanged() event=" + event); - initializeCachingService(); - } - } - - }; - - try { - bundleContext.addServiceListener(weavingListener,weavingFilter); - bundleContext.addServiceListener(cachingListener,cachingFilter); - } - catch (Exception ex) { - ex.printStackTrace(); - } - - initializePackageAdminService(context); - - if (Debug.DEBUG_GENERAL) Debug.println("< AspectJAdaptorFactory.initialize() weavingListener=" + weavingListener + ", cachingListener=" + cachingListener); - } - - protected void initializeWeavingService () { - if (Debug.DEBUG_GENERAL) Debug.println("> AspectJAdaptorFactory.initializeWeavingService()"); - ServiceReference ref = bundleContext.getServiceReference(IWeavingService.class.getName()); - if (ref!=null){ - singletonWeavingService = (IWeavingService)bundleContext.getService(ref); - } - if (Debug.DEBUG_GENERAL) Debug.println("< AspectJAdaptorFactory.initializeWeavingService() weavingService=" + singletonWeavingService); - } - - protected IWeavingService getWeavingService (BaseClassLoader loader) { - if (Debug.DEBUG_WEAVE) Debug.println("> AspectJAdaptorFactory.getWeavingService() baseClassLoader=" + loader); - IWeavingService weavingService = null; - - if (singletonWeavingService != null) { - BaseData baseData = loader.getClasspathManager().getBaseData(); - State state = baseData.getAdaptor().getState(); - Bundle bundle = baseData.getBundle(); - BundleDescription bundleDescription = state.getBundle(bundle.getBundleId()); - weavingService = singletonWeavingService.getInstance((ClassLoader)loader, bundle, state, bundleDescription, supplementerRegistry); - } - if (Debug.DEBUG_WEAVE) Debug.println("< AspectJAdaptorFactory.getWeavingService() service=" + weavingService); - return weavingService; - } - - protected void initializeCachingService () { - if (Debug.DEBUG_CACHE) Debug.println("> AspectJAdaptorFactory.initializeCachingService()"); - ServiceReference ref = bundleContext.getServiceReference(ICachingService.class.getName()); - if (ref != null){ - singletonCachingService = (ICachingService)bundleContext.getService(ref); - } - if (Debug.DEBUG_CACHE) Debug.println("< AspectJAdaptorFactory.initializeCachingService() singletonCachingService=" + singletonCachingService); - } - - protected ICachingService getCachingService (BaseClassLoader loader, Bundle bundle, IWeavingService weavingService) { - if (Debug.DEBUG_CACHE) Debug.println("> AspectJAdaptorFactory.getCachingService() bundle=" + bundle + ", weavingService=" + weavingService); - ICachingService service = null; - String key = ""; - - if (weavingService != null) { - key = weavingService.getKey(); - } - if (singletonCachingService != null) { - service = singletonCachingService.getInstance((ClassLoader)loader,bundle,key); - } - if (Debug.DEBUG_CACHE) Debug.println("< AspectJAdaptorFactory.getCachingService() service=" + service + ", key='" + key + "'"); - return service; - } - - private void initializePackageAdminService (BundleContext context) { - if (Debug.DEBUG_GENERAL) Debug.println("> AspectJAdaptorFactory.initializePackageAdminService() context=" + context); - - ServiceReference ref = context.getServiceReference(PackageAdmin.class.getName()); - if (ref != null) { - packageAdminService = (PackageAdmin)context.getService(ref); - } - - if (Debug.DEBUG_GENERAL) Debug.println("< AspectJAdaptorFactory.initializePackageAdminService() " + packageAdminService); - } - - public Bundle getHost (Bundle fragment) { - if (Debug.DEBUG_GENERAL) Debug.println("> AspectJAdaptorFactory.getHost() fragment=" + fragment); - - Bundle host = null; - if (packageAdminService != null) host = packageAdminService.getHosts(fragment)[0]; - - if (Debug.DEBUG_GENERAL) Debug.println("< AspectJAdaptorFactory.getHost() " + host); - return host; - } + private BundleContext bundleContext; + + private ServiceTracker cachingServiceTracker; + + private PackageAdmin packageAdminService; + + private SupplementerRegistry supplementerRegistry; + + private ServiceTracker weavingServiceTracker; + + public AspectJAdaptorFactory() { + } + + public void dispose() { + weavingServiceTracker.close(); + if (Debug.DEBUG_WEAVE) + Debug.println("> Closed service tracker for weaving service."); + + cachingServiceTracker.close(); + if (Debug.DEBUG_CACHE) + Debug.println("> Closed service tracker for caching service."); + } + + public Bundle getHost(final Bundle fragment) { + if (Debug.DEBUG_GENERAL) + Debug.println("> AspectJAdaptorFactory.getHost() fragment=" + + fragment); + + Bundle host = null; + if (packageAdminService != null) + host = packageAdminService.getHosts(fragment)[0]; + + if (Debug.DEBUG_GENERAL) + Debug.println("< AspectJAdaptorFactory.getHost() " + host); + return host; + } + + public void initialize(final BundleContext context, + final SupplementerRegistry supplementerRegistry) { + if (Debug.DEBUG_GENERAL) + Debug.println("> AspectJAdaptorFactory.initialize() context=" + + context); + this.bundleContext = context; + this.supplementerRegistry = supplementerRegistry; + + // Service tracker for weaving service + weavingServiceTracker = new ServiceTracker(context, + IWeavingService.class.getName(), + new ServiceTrackerCustomizer() { + + public Object addingService(final ServiceReference reference) { + updateSupplementedBundles(context, supplementerRegistry); + return context.getService(reference); + } + + public void modifiedService( + final ServiceReference reference, + final Object service) { + // Nothing to be done! + } + + public void removedService( + final ServiceReference reference, + final Object service) { + updateSupplementedBundles(context, supplementerRegistry); + context.ungetService(reference); + } + + private void updateSupplementedBundles( + final BundleContext context, + final SupplementerRegistry supplementerRegistry) { + final Iterator supplementedBundlesIterator = supplementerRegistry + .getSupplementedBundles().iterator(); + while (supplementedBundlesIterator.hasNext()) { + final Bundle supplementedBundle = (Bundle) supplementedBundlesIterator + .next(); + supplementerRegistry + .updateInstalledBundle(supplementedBundle); + if (Debug.DEBUG_WEAVE) + Debug.println("> Updated supplemented bundle " + + supplementedBundle.getSymbolicName()); + System.err.println("> Updated supplemented bundle " + + supplementedBundle.getSymbolicName()); + } + } + }); + weavingServiceTracker.open(); + if (Debug.DEBUG_WEAVE) + Debug.println("> Opened service tracker for weaving service."); + + // Service tracker for caching service + cachingServiceTracker = new ServiceTracker(context, + ICachingService.class.getName(), null); + cachingServiceTracker.open(); + if (Debug.DEBUG_CACHE) + Debug.println("> Opened service tracker for caching service."); + + initializePackageAdminService(context); + } + + protected ICachingService getCachingService(final BaseClassLoader loader, + final Bundle bundle, final IWeavingService weavingService) { + if (Debug.DEBUG_CACHE) + Debug.println("> AspectJAdaptorFactory.getCachingService() bundle=" + + bundle + ", weavingService=" + weavingService); + ICachingService service = null; + String key = ""; + + if (weavingService != null) { + key = weavingService.getKey(); + } + final ICachingService singletonCachingService = (ICachingService) cachingServiceTracker + .getService(); + if (singletonCachingService != null) { + service = singletonCachingService.getInstance((ClassLoader) loader, + bundle, key); + } + if (Debug.DEBUG_CACHE) + Debug + .println("< AspectJAdaptorFactory.getCachingService() service=" + + service + ", key='" + key + "'"); + return service; + } + + protected IWeavingService getWeavingService(final BaseClassLoader loader) { + if (Debug.DEBUG_WEAVE) + Debug + .println("> AspectJAdaptorFactory.getWeavingService() baseClassLoader=" + + loader); + + IWeavingService weavingService = null; + final IWeavingService singletonWeavingService = (IWeavingService) weavingServiceTracker + .getService(); + if (singletonWeavingService != null) { + final BaseData baseData = loader.getClasspathManager() + .getBaseData(); + final State state = baseData.getAdaptor().getState(); + final Bundle bundle = baseData.getBundle(); + final BundleDescription bundleDescription = state.getBundle(bundle + .getBundleId()); + weavingService = singletonWeavingService.getInstance( + (ClassLoader) loader, bundle, state, bundleDescription, + supplementerRegistry); + } + if (Debug.DEBUG_WEAVE) + Debug + .println("< AspectJAdaptorFactory.getWeavingService() service=" + + weavingService); + return weavingService; + } + + private void initializePackageAdminService(final BundleContext context) { + if (Debug.DEBUG_GENERAL) + Debug + .println("> AspectJAdaptorFactory.initializePackageAdminService() context=" + + context); + + final ServiceReference ref = context + .getServiceReference(PackageAdmin.class.getName()); + if (ref != null) { + packageAdminService = (PackageAdmin) context.getService(ref); + } + + if (Debug.DEBUG_GENERAL) + Debug + .println("< AspectJAdaptorFactory.initializePackageAdminService() " + + packageAdminService); + } } diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/Debug.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/Debug.java index d045a5c9f..2a35339c5 100644 --- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/Debug.java +++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/Debug.java @@ -15,39 +15,56 @@ import org.eclipse.osgi.framework.debug.FrameworkDebugOptions; public class Debug { - public static boolean DEBUG_GENERAL; - public static boolean DEBUG_BUNDLE; - public static boolean DEBUG_WEAVE; - public static boolean DEBUG_CACHE; - public static boolean DEBUG_SUPPLEMENTS; - - private static String bundleName; - - public static boolean bundleNameMatches (String name) { - return name.equals(bundleName); - } - - public static final String ASPECTJ_OSGI = "org.aspectj.osgi"; - public static final String OPTION_DEBUG_GENERAL = ASPECTJ_OSGI + "/debug"; - public static final String OPTION_DEBUG_BUNDLE = ASPECTJ_OSGI + "/debug/bundle"; - public static final String OPTION_DEBUG_WEAVE = ASPECTJ_OSGI + "/debug/weave"; - public static final String OPTION_DEBUG_CACHE = ASPECTJ_OSGI + "/debug/cache"; - public static final String OPTION_DEBUG_BUNDLENAME = ASPECTJ_OSGI + "/debug/bundleName"; - public static final String OPTION_DEBUG_SUPPLEMENTS = ASPECTJ_OSGI + "/debug/supplements"; - - static { - FrameworkDebugOptions fdo = FrameworkDebugOptions.getDefault(); - if (fdo != null) { - DEBUG_GENERAL = fdo.getBooleanOption(OPTION_DEBUG_GENERAL,false); - DEBUG_BUNDLE = fdo.getBooleanOption(OPTION_DEBUG_BUNDLE,false); - DEBUG_WEAVE = fdo.getBooleanOption(OPTION_DEBUG_WEAVE,false); - DEBUG_CACHE = fdo.getBooleanOption(OPTION_DEBUG_CACHE,false); - bundleName = fdo.getOption(OPTION_DEBUG_BUNDLENAME,""); - DEBUG_SUPPLEMENTS = fdo.getBooleanOption(OPTION_DEBUG_SUPPLEMENTS,false); - } - } - - public static void println (String s) { - /*if (s.indexOf("org.eclipse.osgi.tests") != -1)*/ System.err.println(s); - } + public static final String ASPECTJ_OSGI = "org.aspectj.osgi"; + + public static boolean DEBUG_BUNDLE; + + public static String DEBUG_BUNDLENAME; + + public static boolean DEBUG_CACHE; + + public static boolean DEBUG_GENERAL; + + public static boolean DEBUG_SUPPLEMENTS; + + public static boolean DEBUG_WEAVE; + + public static final String OPTION_DEBUG_BUNDLE = ASPECTJ_OSGI + + "/debug/bundle"; + + public static final String OPTION_DEBUG_BUNDLENAME = ASPECTJ_OSGI + + "/debug/bundleName"; + + public static final String OPTION_DEBUG_CACHE = ASPECTJ_OSGI + + "/debug/cache"; + + public static final String OPTION_DEBUG_GENERAL = ASPECTJ_OSGI + "/debug"; + + public static final String OPTION_DEBUG_SUPPLEMENTS = ASPECTJ_OSGI + + "/debug/supplements"; + + public static final String OPTION_DEBUG_WEAVE = ASPECTJ_OSGI + + "/debug/weave"; + + static { + final FrameworkDebugOptions fdo = FrameworkDebugOptions.getDefault(); + if (fdo != null) { + DEBUG_GENERAL = fdo.getBooleanOption(OPTION_DEBUG_GENERAL, false); + DEBUG_BUNDLE = fdo.getBooleanOption(OPTION_DEBUG_BUNDLE, false); + DEBUG_WEAVE = fdo.getBooleanOption(OPTION_DEBUG_WEAVE, false); + DEBUG_CACHE = fdo.getBooleanOption(OPTION_DEBUG_CACHE, false); + DEBUG_BUNDLENAME = fdo.getOption(OPTION_DEBUG_BUNDLENAME, ""); + DEBUG_SUPPLEMENTS = fdo.getBooleanOption(OPTION_DEBUG_SUPPLEMENTS, + false); + } + } + + public static boolean bundleNameMatches(final String name) { + return name.equals(DEBUG_BUNDLENAME); + } + + public static void println(final String s) { + /* if (s.indexOf("org.eclipse.osgi.tests") != -1) */System.err + .println(s); + } } diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/IAspectJAdaptor.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/IAspectJAdaptor.java index 47c167941..b5cf7ebe9 100644 --- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/IAspectJAdaptor.java +++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/IAspectJAdaptor.java @@ -9,6 +9,7 @@ * David Knibb initial implementation * Matthew Webster Eclipse 3.2 changes *******************************************************************************/ + package org.eclipse.equinox.weaving.adaptors; import java.net.URL; @@ -18,12 +19,13 @@ import org.eclipse.osgi.baseadaptor.loader.BaseClassLoader; public interface IAspectJAdaptor { - public void setBaseClassLoader (BaseClassLoader baseClassLoader); - - public CacheEntry findClass (String name, URL sourceFileURL); - - public byte[] weaveClass (String name, byte[] bytes); - - public boolean storeClass (String name, URL sourceFileURL, Class clazz, byte[] classbytes); + public CacheEntry findClass(String name, URL sourceFileURL); + + public void setBaseClassLoader(BaseClassLoader baseClassLoader); + + public boolean storeClass(String name, URL sourceFileURL, Class clazz, + byte[] classbytes); + + public byte[] weaveClass(String name, byte[] bytes); } diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AbstractAJBundleFile.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AbstractAJBundleFile.java index b2d0fe4c2..45748ba20 100644 --- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AbstractAJBundleFile.java +++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AbstractAJBundleFile.java @@ -23,60 +23,63 @@ import org.eclipse.osgi.baseadaptor.bundlefile.BundleFile; public abstract class AbstractAJBundleFile extends BundleFile { - protected IAspectJAdaptor adaptor; - protected BundleFile delegate; - - public AbstractAJBundleFile (IAspectJAdaptor aspectjAdaptor, BundleFile bundleFile) { - super(bundleFile.getBaseFile()); - this.adaptor = aspectjAdaptor; - this.delegate = bundleFile; - } - - public File getBaseFile() { - File baseFile = delegate.getBaseFile(); - return baseFile; - } - - /** - * @deprecated - */ - public URL getResourceURL(String path, long hostBundleID, int index) { - return delegate.getResourceURL(path, hostBundleID, index); - } - - /** - * @deprecated - */ - public URL getResourceURL(String path, long hostBundleID) { - return delegate.getResourceURL(path, hostBundleID); - } - - public void close() throws IOException { - delegate.close(); - } - - public boolean containsDir(String dir) { - return delegate.containsDir(dir); - } - - public BundleEntry getEntry(String path) { - return delegate.getEntry(path); - } - - public Enumeration getEntryPaths(String path) { - return delegate.getEntryPaths(path); - } - - public File getFile(String path, boolean nativeCode) { - return delegate.getFile(path, nativeCode); - } - - public void open() throws IOException { - delegate.open(); - } - - public IAspectJAdaptor getAdaptor() { - return adaptor; - } + protected IAspectJAdaptor adaptor; + + protected BundleFile delegate; + + public AbstractAJBundleFile(final IAspectJAdaptor aspectjAdaptor, + final BundleFile bundleFile) { + super(bundleFile.getBaseFile()); + this.adaptor = aspectjAdaptor; + this.delegate = bundleFile; + } + + public void close() throws IOException { + delegate.close(); + } + + public boolean containsDir(final String dir) { + return delegate.containsDir(dir); + } + + public IAspectJAdaptor getAdaptor() { + return adaptor; + } + + public File getBaseFile() { + final File baseFile = delegate.getBaseFile(); + return baseFile; + } + + public BundleEntry getEntry(final String path) { + return delegate.getEntry(path); + } + + public Enumeration getEntryPaths(final String path) { + return delegate.getEntryPaths(path); + } + + public File getFile(final String path, final boolean nativeCode) { + return delegate.getFile(path, nativeCode); + } + + /** + * @deprecated + */ + public URL getResourceURL(final String path, final long hostBundleID) { + return delegate.getResourceURL(path, hostBundleID); + } + + /** + * @deprecated + */ + public URL getResourceURL(final String path, final long hostBundleID, + final int index) { + return delegate.getResourceURL(path, hostBundleID, index); + } + + public void open() throws IOException { + delegate.open(); + } } diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AspectJBundleEntry.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AspectJBundleEntry.java index 167e9a0ad..3f8230547 100644 --- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AspectJBundleEntry.java +++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AspectJBundleEntry.java @@ -22,75 +22,93 @@ import org.eclipse.osgi.baseadaptor.bundlefile.BundleEntry; public class AspectJBundleEntry extends BundleEntry { - private IAspectJAdaptor adaptor; - private String name; - private byte[] bytes; - private URL bundleFileURL; - private BundleEntry delegate; - private boolean dontWeave; - - public AspectJBundleEntry (IAspectJAdaptor aspectjAdaptor, BundleEntry delegate, URL url, boolean dontWeave) { - this.adaptor = aspectjAdaptor; - this.bundleFileURL = url; - this.delegate = delegate; - this.dontWeave = dontWeave; - } - - public AspectJBundleEntry (IAspectJAdaptor aspectjAdaptor, BundleEntry delegate, String name, byte[] bytes, URL url) { - this(aspectjAdaptor, delegate, url, true); - this.name = name; - this.bytes = bytes; - } - - public URL getBundleFileURL () { - return bundleFileURL; - } - - public IAspectJAdaptor getAdaptor() { - return adaptor; - } - - public URL getFileURL() { - if (bytes == null) return delegate.getFileURL(); - else return null; - } - - public InputStream getInputStream() throws IOException { - // this always returns the original stream of the delegate to - // allow getResourceAsStream to be used even in the context of - // caching with J9 class sharing - // - // class loading uses getBytes instead (where the caching is considered) - return delegate.getInputStream(); - } - - public byte[] getBytes() throws IOException { - if (bytes == null) return delegate.getBytes(); - return bytes; - } - - public URL getLocalURL() { - if (bytes == null) return delegate.getLocalURL(); - else return null; - } - - public String getName() { - if (bytes == null) return delegate.getName(); - else return name; - } - - public long getSize() { - if (delegate != null) return delegate.getSize(); - else return bytes.length; - } - - public long getTime() { - if (delegate != null) return delegate.getTime(); - else return 0; - } - - public boolean dontWeave() { - return dontWeave; - } + private final IAspectJAdaptor adaptor; + + private final URL bundleFileURL; + + private byte[] bytes; + + private final BundleEntry delegate; + + private final boolean dontWeave; + + private String name; + + public AspectJBundleEntry(final IAspectJAdaptor aspectjAdaptor, + final BundleEntry delegate, final String name, final byte[] bytes, + final URL url) { + this(aspectjAdaptor, delegate, url, true); + this.name = name; + this.bytes = bytes; + } + + public AspectJBundleEntry(final IAspectJAdaptor aspectjAdaptor, + final BundleEntry delegate, final URL url, final boolean dontWeave) { + this.adaptor = aspectjAdaptor; + this.bundleFileURL = url; + this.delegate = delegate; + this.dontWeave = dontWeave; + } + + public boolean dontWeave() { + return dontWeave; + } + + public IAspectJAdaptor getAdaptor() { + return adaptor; + } + + public URL getBundleFileURL() { + return bundleFileURL; + } + + public byte[] getBytes() throws IOException { + if (bytes == null) return delegate.getBytes(); + return bytes; + } + + public URL getFileURL() { + if (bytes == null) + return delegate.getFileURL(); + else + return null; + } + + public InputStream getInputStream() throws IOException { + // this always returns the original stream of the delegate to + // allow getResourceAsStream to be used even in the context of + // caching with J9 class sharing + // + // class loading uses getBytes instead (where the caching is considered) + return delegate.getInputStream(); + } + + public URL getLocalURL() { + if (bytes == null) + return delegate.getLocalURL(); + else + return null; + } + + public String getName() { + if (bytes == null) + return delegate.getName(); + else + return name; + } + + public long getSize() { + if (delegate != null) + return delegate.getSize(); + else + return bytes.length; + } + + public long getTime() { + if (delegate != null) + return delegate.getTime(); + else + return 0; + } } diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AspectJBundleFile.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AspectJBundleFile.java index e6eae5bc5..8a4c8b2f8 100644 --- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AspectJBundleFile.java +++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AspectJBundleFile.java @@ -23,44 +23,50 @@ import org.eclipse.osgi.baseadaptor.bundlefile.BundleFile; public class AspectJBundleFile extends AbstractAJBundleFile { - private URL url; - - public AspectJBundleFile (IAspectJAdaptor aa, BundleFile bundleFile) throws IOException { - super(aa,bundleFile); - this.url = delegate.getBaseFile().toURL(); - } - - public URL getURL () { - return url; - } + private final URL url; - public BundleEntry getEntry(String path) { - if (Debug.DEBUG_BUNDLE) Debug.println("> AspectJBundleFile.getEntry() path=" + path + ", url=" + url); - BundleEntry entry = delegate.getEntry(path); + public AspectJBundleFile(final IAspectJAdaptor aa, + final BundleFile bundleFile) throws IOException { + super(aa, bundleFile); + this.url = delegate.getBaseFile().toURL(); + } - if (path.endsWith(".class")) { - int offset = path.lastIndexOf('.'); - String name = path.substring(0,offset).replace('/','.'); -// byte[] bytes = adaptor.findClass(name,url); - CacheEntry cacheEntry = adaptor.findClass(name,url); - if (cacheEntry == null) { - if (entry != null) { - entry = new AspectJBundleEntry(adaptor, entry, url, false); - if (Debug.DEBUG_BUNDLE) Debug.println("- AspectJBundleFile.getEntry() path=" + path + ", entry=" + entry); - } - } - else { - if (cacheEntry.getCachedBytes() != null) { - entry = new AspectJBundleEntry(adaptor, entry, path, cacheEntry.getCachedBytes(), url); - } - else if (entry != null) { - entry = new AspectJBundleEntry(adaptor, entry, url, cacheEntry.dontWeave()); - } - } - } + public BundleEntry getEntry(final String path) { + if (Debug.DEBUG_BUNDLE) + Debug.println("> AspectJBundleFile.getEntry() path=" + path + + ", url=" + url); + BundleEntry entry = delegate.getEntry(path); - if (Debug.DEBUG_BUNDLE) Debug.println("< AspectJBundleFile.getEntry() entry=" + entry); - return entry; - } + if (path.endsWith(".class")) { + final int offset = path.lastIndexOf('.'); + final String name = path.substring(0, offset).replace('/', '.'); + // byte[] bytes = adaptor.findClass(name,url); + final CacheEntry cacheEntry = adaptor.findClass(name, url); + if (cacheEntry == null) { + if (entry != null) { + entry = new AspectJBundleEntry(adaptor, entry, url, false); + if (Debug.DEBUG_BUNDLE) + Debug.println("- AspectJBundleFile.getEntry() path=" + + path + ", entry=" + entry); + } + } else { + if (cacheEntry.getCachedBytes() != null) { + entry = new AspectJBundleEntry(adaptor, entry, path, + cacheEntry.getCachedBytes(), url); + } else if (entry != null) { + entry = new AspectJBundleEntry(adaptor, entry, url, + cacheEntry.dontWeave()); + } + } + } + + if (Debug.DEBUG_BUNDLE) + Debug.println("< AspectJBundleFile.getEntry() entry=" + entry); + return entry; + } + + public URL getURL() { + return url; + } } diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AspectJHook.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AspectJHook.java index de3f02a6a..0ba68fbd4 100644 --- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AspectJHook.java +++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AspectJHook.java @@ -33,57 +33,28 @@ import org.osgi.service.packageadmin.PackageAdmin; public class AspectJHook extends AbstractAspectJHook { - private BundleContext bundleContext; + private final AspectJAdaptorFactory adaptorFactory; - private AspectJAdaptorFactory adaptorFactory; + private BundleContext bundleContext; public AspectJHook() { if (Debug.DEBUG_GENERAL) Debug.println("- AspectJHook.<init>()"); adaptorFactory = new AspectJAdaptorFactory(); } - private void initialize(BundleContext context) { - if (Debug.DEBUG_GENERAL) - Debug.println("> AspectJHook.initialize() context=" + context); - - this.bundleContext = context; - adaptorFactory.initialize(context, getSupplementerRegistry()); - - ServiceReference serviceReference = context - .getServiceReference(PackageAdmin.class.getName()); - PackageAdmin packageAdmin = (PackageAdmin) context - .getService(serviceReference); - - getSupplementerRegistry().setBundleContext(context); - getSupplementerRegistry().setPackageAdmin(packageAdmin); - context.addBundleListener(new SupplementBundleListener( - getSupplementerRegistry())); - - if (Debug.DEBUG_GENERAL) - Debug.println("< AspectJHook.initialize() adaptorFactory=" - + adaptorFactory); - } - - public void frameworkStart(BundleContext context) throws BundleException { + public void frameworkStart(final BundleContext context) + throws BundleException { // Debug.println("? AspectJHook.frameworkStart() context=" + context + ", fdo=" + FrameworkDebugOptions.getDefault()); initialize(context); } - public void recordClassDefine(String name, Class clazz, byte[] classbytes, - ClasspathEntry classpathEntry, BundleEntry entry, - ClasspathManager manager) { - if (entry instanceof AspectJBundleEntry) { - AspectJBundleEntry ajBundleEntry = (AspectJBundleEntry) entry; - if (!ajBundleEntry.dontWeave()) { - IAspectJAdaptor adaptor = ajBundleEntry.getAdaptor(); - URL sourceFileURL = ajBundleEntry.getBundleFileURL(); - adaptor.storeClass(name, sourceFileURL, clazz, classbytes); - } - } + public void frameworkStop(final BundleContext context) + throws BundleException { + adaptorFactory.dispose(); } - public void initializedClassLoader(BaseClassLoader baseClassLoader, - BaseData data) { + public void initializedClassLoader(final BaseClassLoader baseClassLoader, + final BaseData data) { if (Debug.DEBUG_GENERAL) Debug .println("> AspectJHook.initializedClassLoader() bundle=" @@ -91,9 +62,9 @@ public class AspectJHook extends AbstractAspectJHook { + baseClassLoader + ", data=" + data + ", bundleFile=" + data.getBundleFile()); IAspectJAdaptor adaptor = null; - BundleFile bundleFile = data.getBundleFile(); + final BundleFile bundleFile = data.getBundleFile(); if (bundleFile instanceof BaseAjBundleFile) { - BaseAjBundleFile baseBundleFile = (BaseAjBundleFile) bundleFile; + final BaseAjBundleFile baseBundleFile = (BaseAjBundleFile) bundleFile; adaptor = baseBundleFile.getAdaptor(); adaptor.setBaseClassLoader(baseClassLoader); } @@ -103,22 +74,36 @@ public class AspectJHook extends AbstractAspectJHook { + adaptor); } - public byte[] processClass(String name, byte[] classbytes, - ClasspathEntry classpathEntry, BundleEntry entry, - ClasspathManager manager) { + public byte[] processClass(final String name, final byte[] classbytes, + final ClasspathEntry classpathEntry, final BundleEntry entry, + final ClasspathManager manager) { byte[] newClassytes = null; if (entry instanceof AspectJBundleEntry) { - AspectJBundleEntry ajBundleEntry = (AspectJBundleEntry) entry; + final AspectJBundleEntry ajBundleEntry = (AspectJBundleEntry) entry; if (!ajBundleEntry.dontWeave()) { - IAspectJAdaptor adaptor = ajBundleEntry.getAdaptor(); + final IAspectJAdaptor adaptor = ajBundleEntry.getAdaptor(); newClassytes = adaptor.weaveClass(name, classbytes); } } return newClassytes; } - public BundleFile wrapBundleFile(BundleFile bundleFile, Object content, - BaseData data, boolean base) throws IOException { + public void recordClassDefine(final String name, final Class clazz, + final byte[] classbytes, final ClasspathEntry classpathEntry, + final BundleEntry entry, final ClasspathManager manager) { + if (entry instanceof AspectJBundleEntry) { + final AspectJBundleEntry ajBundleEntry = (AspectJBundleEntry) entry; + if (!ajBundleEntry.dontWeave()) { + final IAspectJAdaptor adaptor = ajBundleEntry.getAdaptor(); + final URL sourceFileURL = ajBundleEntry.getBundleFileURL(); + adaptor.storeClass(name, sourceFileURL, clazz, classbytes); + } + } + } + + public BundleFile wrapBundleFile(final BundleFile bundleFile, + final Object content, final BaseData data, final boolean base) + throws IOException { BundleFile wrapped = null; if (Debug.DEBUG_BUNDLE) Debug @@ -136,7 +121,7 @@ public class AspectJHook extends AbstractAspectJHook { + bundleFile.getBaseFile()); if (base) { - IAspectJAdaptor adaptor = createAspectJAdaptor(data); + final IAspectJAdaptor adaptor = createAspectJAdaptor(data); if (adaptor != null) { wrapped = new BaseAjBundleFile(adaptor, bundleFile); } @@ -161,7 +146,7 @@ public class AspectJHook extends AbstractAspectJHook { return wrapped; } - private IAspectJAdaptor createAspectJAdaptor(BaseData baseData) { + private IAspectJAdaptor createAspectJAdaptor(final BaseData baseData) { if (Debug.DEBUG_GENERAL) Debug.println("> AspectJHook.createAspectJAdaptor() location=" + baseData.getLocation()); @@ -182,16 +167,38 @@ public class AspectJHook extends AbstractAspectJHook { return adaptor; } - private IAspectJAdaptor getAspectJAdaptor(BaseData data) { + private IAspectJAdaptor getAspectJAdaptor(final BaseData data) { IAspectJAdaptor adaptor = null; - BundleFile bundleFile = data.getBundleFile(); + final BundleFile bundleFile = data.getBundleFile(); if (bundleFile instanceof BaseAjBundleFile) { - BaseAjBundleFile baseBundleFile = (BaseAjBundleFile) bundleFile; + final BaseAjBundleFile baseBundleFile = (BaseAjBundleFile) bundleFile; adaptor = baseBundleFile.getAdaptor(); } return adaptor; } + private void initialize(final BundleContext context) { + if (Debug.DEBUG_GENERAL) + Debug.println("> AspectJHook.initialize() context=" + context); + + this.bundleContext = context; + adaptorFactory.initialize(context, getSupplementerRegistry()); + + final ServiceReference serviceReference = context + .getServiceReference(PackageAdmin.class.getName()); + final PackageAdmin packageAdmin = (PackageAdmin) context + .getService(serviceReference); + + getSupplementerRegistry().setBundleContext(context); + getSupplementerRegistry().setPackageAdmin(packageAdmin); + context.addBundleListener(new SupplementBundleListener( + getSupplementerRegistry())); + + if (Debug.DEBUG_GENERAL) + Debug.println("< AspectJHook.initialize() adaptorFactory=" + + adaptorFactory); + } + } diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AspectJStorageHook.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AspectJStorageHook.java index c2114df55..76a51cdb5 100644 --- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AspectJStorageHook.java +++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AspectJStorageHook.java @@ -32,179 +32,222 @@ import org.osgi.framework.BundleException; import org.osgi.framework.Constants; public class AspectJStorageHook implements StorageHook { - - public static final String KEY = AspectJStorageHook.class.getName(); - public static final int HASHCODE = KEY.hashCode(); - - private BaseData bundleData; - private final SupplementerRegistry supplementerRegistry; - - - public AspectJStorageHook(SupplementerRegistry supplementerRegistry) { - if (Debug.DEBUG_SUPPLEMENTS) Debug.println("- AspectJStorageHook.AspectJStorageHook()"); - this.supplementerRegistry = supplementerRegistry; - } - - public AspectJStorageHook(BaseData bd, SupplementerRegistry supplementerRegistry) { - if (Debug.DEBUG_SUPPLEMENTS) Debug.println("- AspectJStorageHook.AspectJStorageHook() baseDate=" + bd); - this.bundleData = bd; - this.supplementerRegistry = supplementerRegistry; - } - - private String getSymbolicName () { - return (bundleData == null)? "root" : bundleData.getSymbolicName(); - } - - public void copy(StorageHook storageHook) { - // TODO Auto-generated method stub - } - - public StorageHook create(BaseData bundledata) throws BundleException { -// System.err.println("? AbstractAspectJHook.create()"); - // TODO Auto-generated method stub -// StorageHook result; - final StorageHook hook = new AspectJStorageHook(bundledata, supplementerRegistry); -//// if (bundledata.getSymbolicName().equals("demo.hello")) { -// InvocationHandler ih = new InvocationHandler() { -// public Object invoke(Object proxy, java.lang.reflect.Method method, Object[] args) throws Throwable { -// System.err.println("? " + method.getName()); -// return method.invoke(hook,args); -// } -// }; -// result = (StorageHook)Proxy.newProxyInstance(getClass().getClassLoader(),new Class[] { StorageHook.class }, ih); -//// } -//// else { -//// result = hook; -//// } -// return result; - return hook; - } - - public boolean forgetStartLevelChange(int startlevel) { - // TODO Auto-generated method stub - return false; - } - - public boolean forgetStatusChange(int status) { - // TODO Auto-generated method stub - return false; - } - - public Dictionary getManifest(boolean firstLoad) throws BundleException { -// System.err.println("? AspectJStorageHook.getManifest() " + this + " firstLoad=" + firstLoad); - // TODO Auto-generated method stub - return null; - } - - public int getStorageVersion() { - // TODO Auto-generated method stub - return 0; - } - - public void initialize(Dictionary manifest) throws BundleException { -// System.err.println("? AspectJStorageHook.initialize() " + this + " manifest=" + manifest); - if (Debug.DEBUG_SUPPLEMENTS) Debug.println("> AspectJStorageHook.initialize() " + getSymbolicName()); - try { - ManifestElement[] imports = ManifestElement.parseHeader(Constants.IMPORT_PACKAGE, (String) manifest.get(Constants.IMPORT_PACKAGE)); - ManifestElement[] exports = ManifestElement.parseHeader(Constants.EXPORT_PACKAGE, (String) manifest.get(Constants.EXPORT_PACKAGE)); - List supplementers = supplementerRegistry.getSupplementers(bundleData.getSymbolicName(), imports, exports); - if (!supplementers.isEmpty()) { - if (Debug.DEBUG_SUPPLEMENTS) Debug.println("- AspectJStorageHook.initialize() " + getSymbolicName() + " supplementers=" + supplementers); - if (addRequiredBundles(supplementers)) { - if (AbstractAspectJHook.verbose) System.err.println("[org.aspectj.osgi] info supplementing " + getSymbolicName() + " with " + supplementers); - } - else { - if (AbstractAspectJHook.verbose) System.err.println("[org.aspectj.osgi] info not supplementing " + getSymbolicName()); - } - } - } - catch (Exception ex) { - ex.printStackTrace(); - } - if (Debug.DEBUG_SUPPLEMENTS) Debug.println("< AspectJStorageHook.initialize() "); - } - - private boolean addRequiredBundles (List bundles) throws BundleException { - Dictionary manifest = bundleData.getManifest(); - manifest = ((CachedManifest)manifest).getManifest(); - - if (manifest != null) { - String value = (String)manifest.get(Constants.REQUIRE_BUNDLE); - for (Iterator i = bundles.iterator(); i.hasNext();) { - String name = (String)i.next(); - if (value == null) value = name; - else value += "," + name; - } - - if (Debug.DEBUG_SUPPLEMENTS) Debug.println("- AspectJStorageHook.addRequiredBundles() " + bundleData.getSymbolicName() + " ,manifest=" + manifest.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(manifest)) + ", value=" + value); - setHeader((Headers)manifest,Constants.REQUIRE_BUNDLE,value,true); - } - - return true; - } - - private Object setHeader(Headers manifest, Object key, Object value, boolean replace) throws BundleException { - try { - /* In Eclipse 3.3 we must use reflection to allow the manifest to be modified */ - if (readOnly != null) { - readOnly.set(manifest,new Boolean(false)); - } - - return manifest.set(Constants.REQUIRE_BUNDLE,value,true); - } - catch (IllegalAccessException ex) { - throw new BundleException(key + "=" + value,ex); - } - } - - private static Field readOnly; - - static { - try { - readOnly = Headers.class.getDeclaredField("readOnly"); - readOnly.setAccessible(true); - } - catch (Exception ex) { - if (Debug.DEBUG_SUPPLEMENTS) ex.printStackTrace(); - } - } - - public StorageHook load(BaseData bundledata, DataInputStream is) throws IOException { - if (Debug.DEBUG_SUPPLEMENTS) Debug.println("- AspectJStorageHook.load() " + getSymbolicName() + " bundleData=" + bundledata); - return new AspectJStorageHook(bundledata, supplementerRegistry); - } - - public boolean matchDNChain(String pattern) { - // TODO Auto-generated method stub -// System.err.println("? AspectJStorageHook.matchDNChain() " + getSymbolicName() + " pattern=" + pattern); - return false; - } - - public void save(DataOutputStream os) throws IOException { - // TODO Auto-generated method stub - if (Debug.DEBUG_SUPPLEMENTS) Debug.println("- AspectJStorageHook.save() " + getSymbolicName()); - } - - public void validate() throws IllegalArgumentException { - // TODO Auto-generated method stub -// System.err.println("? AspectJStorageHook.validate()"); - } - - public boolean compare(KeyedElement other) { - // TODO Auto-generated method stub - return other.getKey() == KEY; - } - - public Object getKey() { - return KEY; - } - - public int getKeyHashCode() { - return HASHCODE; - } - - public String toString () { - return "AspectJStorageHook[" + getSymbolicName() + "]"; - } + + public static final int HASHCODE; + + public static final String KEY; + + private static Field readOnly; + + static { + KEY = AspectJStorageHook.class.getName(); + HASHCODE = KEY.hashCode(); + try { + readOnly = Headers.class.getDeclaredField("readOnly"); + readOnly.setAccessible(true); + } catch (final Exception ex) { + if (Debug.DEBUG_SUPPLEMENTS) ex.printStackTrace(); + } + } + + private BaseData bundleData; + + private final SupplementerRegistry supplementerRegistry; + + public AspectJStorageHook(final BaseData bd, + final SupplementerRegistry supplementerRegistry) { + if (Debug.DEBUG_SUPPLEMENTS) + Debug.println("- AspectJStorageHook.AspectJStorageHook() baseDate=" + + bd); + this.bundleData = bd; + this.supplementerRegistry = supplementerRegistry; + } + + public AspectJStorageHook(final SupplementerRegistry supplementerRegistry) { + if (Debug.DEBUG_SUPPLEMENTS) + Debug.println("- AspectJStorageHook.AspectJStorageHook()"); + this.supplementerRegistry = supplementerRegistry; + } + + public boolean compare(final KeyedElement other) { + // TODO Auto-generated method stub + return other.getKey() == KEY; + } + + public void copy(final StorageHook storageHook) { + // TODO Auto-generated method stub + } + + public StorageHook create(final BaseData bundledata) throws BundleException { + // System.err.println("? AbstractAspectJHook.create()"); + // TODO Auto-generated method stub + // StorageHook result; + final StorageHook hook = new AspectJStorageHook(bundledata, + supplementerRegistry); + //// if (bundledata.getSymbolicName().equals("demo.hello")) { + // InvocationHandler ih = new InvocationHandler() { + // public Object invoke(Object proxy, java.lang.reflect.Method method, Object[] args) throws Throwable { + // System.err.println("? " + method.getName()); + // return method.invoke(hook,args); + // } + // }; + // result = (StorageHook)Proxy.newProxyInstance(getClass().getClassLoader(),new Class[] { StorageHook.class }, ih); + //// } + //// else { + //// result = hook; + //// } + // return result; + return hook; + } + + public boolean forgetStartLevelChange(final int startlevel) { + // TODO Auto-generated method stub + return false; + } + + public boolean forgetStatusChange(final int status) { + // TODO Auto-generated method stub + return false; + } + + public Object getKey() { + return KEY; + } + + public int getKeyHashCode() { + return HASHCODE; + } + + public Dictionary getManifest(final boolean firstLoad) + throws BundleException { + // System.err.println("? AspectJStorageHook.getManifest() " + this + " firstLoad=" + firstLoad); + // TODO Auto-generated method stub + return null; + } + + public int getStorageVersion() { + // TODO Auto-generated method stub + return 0; + } + + public void initialize(final Dictionary manifest) throws BundleException { + // System.err.println("? AspectJStorageHook.initialize() " + this + " manifest=" + manifest); + if (Debug.DEBUG_SUPPLEMENTS) + Debug.println("> AspectJStorageHook.initialize() " + + getSymbolicName()); + try { + final ManifestElement[] imports = ManifestElement.parseHeader( + Constants.IMPORT_PACKAGE, (String) manifest + .get(Constants.IMPORT_PACKAGE)); + final ManifestElement[] exports = ManifestElement.parseHeader( + Constants.EXPORT_PACKAGE, (String) manifest + .get(Constants.EXPORT_PACKAGE)); + final List supplementers = supplementerRegistry.getSupplementers( + bundleData.getSymbolicName(), imports, exports); + if (!supplementers.isEmpty()) { + if (Debug.DEBUG_SUPPLEMENTS) + Debug.println("- AspectJStorageHook.initialize() " + + getSymbolicName() + " supplementers=" + + supplementers); + if (addRequiredBundles(supplementers)) { + if (AbstractAspectJHook.verbose) + System.err + .println("[org.aspectj.osgi] info supplementing " + + getSymbolicName() + + " with " + + supplementers); + } else { + if (AbstractAspectJHook.verbose) + System.err + .println("[org.aspectj.osgi] info not supplementing " + + getSymbolicName()); + } + } + } catch (final Exception ex) { + ex.printStackTrace(); + } + if (Debug.DEBUG_SUPPLEMENTS) + Debug.println("< AspectJStorageHook.initialize() "); + } + + public StorageHook load(final BaseData bundledata, final DataInputStream is) + throws IOException { + if (Debug.DEBUG_SUPPLEMENTS) + Debug.println("- AspectJStorageHook.load() " + getSymbolicName() + + " bundleData=" + bundledata); + return new AspectJStorageHook(bundledata, supplementerRegistry); + } + + public boolean matchDNChain(final String pattern) { + // TODO Auto-generated method stub + // System.err.println("? AspectJStorageHook.matchDNChain() " + getSymbolicName() + " pattern=" + pattern); + return false; + } + + public void save(final DataOutputStream os) throws IOException { + // TODO Auto-generated method stub + if (Debug.DEBUG_SUPPLEMENTS) + Debug.println("- AspectJStorageHook.save() " + getSymbolicName()); + } + + public String toString() { + return "AspectJStorageHook[" + getSymbolicName() + "]"; + } + + public void validate() throws IllegalArgumentException { + // TODO Auto-generated method stub + // System.err.println("? AspectJStorageHook.validate()"); + } + + private boolean addRequiredBundles(final List bundles) + throws BundleException { + Dictionary manifest = bundleData.getManifest(); + manifest = ((CachedManifest) manifest).getManifest(); + + if (manifest != null) { + String value = (String) manifest.get(Constants.REQUIRE_BUNDLE); + for (final Iterator i = bundles.iterator(); i.hasNext();) { + final String name = (String) i.next(); + if (value == null) + value = name; + else + value += "," + name; + } + + if (Debug.DEBUG_SUPPLEMENTS) + Debug.println("- AspectJStorageHook.addRequiredBundles() " + + bundleData.getSymbolicName() + + " ,manifest=" + + manifest.getClass().getName() + + "@" + + Integer + .toHexString(System.identityHashCode(manifest)) + + ", value=" + value); + setHeader((Headers) manifest, Constants.REQUIRE_BUNDLE, value, true); + } + + return true; + } + + private String getSymbolicName() { + return (bundleData == null) ? "root" : bundleData.getSymbolicName(); + } + + private Object setHeader(final Headers manifest, final Object key, + final Object value, final boolean replace) throws BundleException { + try { + /* + * In Eclipse 3.3 we must use reflection to allow the manifest to be + * modified + */ + if (readOnly != null) { + readOnly.set(manifest, new Boolean(false)); + } + + return manifest.set(Constants.REQUIRE_BUNDLE, value, true); + } catch (final IllegalAccessException ex) { + throw new BundleException(key + "=" + value, ex); + } + } } diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/BaseAjBundleFile.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/BaseAjBundleFile.java index df674d8aa..db48a48f1 100644 --- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/BaseAjBundleFile.java +++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/BaseAjBundleFile.java @@ -19,7 +19,8 @@ import org.eclipse.osgi.baseadaptor.bundlefile.BundleFile; public class BaseAjBundleFile extends AspectJBundleFile { - public BaseAjBundleFile (IAspectJAdaptor aspectjAdaptor, BundleFile bundleFile) throws IOException { - super(aspectjAdaptor,bundleFile); - } + public BaseAjBundleFile(final IAspectJAdaptor aspectjAdaptor, + final BundleFile bundleFile) throws IOException { + super(aspectjAdaptor, bundleFile); + } } diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/SupplementBundleListener.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/SupplementBundleListener.java index a5ed6a481..006625352 100644 --- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/SupplementBundleListener.java +++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/SupplementBundleListener.java @@ -18,24 +18,23 @@ import org.osgi.framework.SynchronousBundleListener; public class SupplementBundleListener implements SynchronousBundleListener { - private final SupplementerRegistry supplementerRegistry; + private final SupplementerRegistry supplementerRegistry; - public SupplementBundleListener(SupplementerRegistry supplementerRegistry) { - this.supplementerRegistry = supplementerRegistry; - } + public SupplementBundleListener( + final SupplementerRegistry supplementerRegistry) { + this.supplementerRegistry = supplementerRegistry; + } - public void bundleChanged(BundleEvent event) { - Bundle bundle = event.getBundle(); - if (event.getType() == BundleEvent.INSTALLED) { - supplementerRegistry.addSupplementer(bundle); - } - else if (event.getType() == BundleEvent.UNINSTALLED) { - supplementerRegistry.removeSupplementer(bundle); - } - else if (event.getType() == BundleEvent.UPDATED) { - supplementerRegistry.removeSupplementer(bundle); - supplementerRegistry.addSupplementer(bundle); - } - } + public void bundleChanged(final BundleEvent event) { + final Bundle bundle = event.getBundle(); + if (event.getType() == BundleEvent.INSTALLED) { + supplementerRegistry.addSupplementer(bundle); + } else if (event.getType() == BundleEvent.UNINSTALLED) { + supplementerRegistry.removeSupplementer(bundle); + } else if (event.getType() == BundleEvent.UPDATED) { + supplementerRegistry.removeSupplementer(bundle); + supplementerRegistry.addSupplementer(bundle); + } + } } diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/Supplementer.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/Supplementer.java index 005d88b1a..792909e70 100644 --- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/Supplementer.java +++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/Supplementer.java @@ -20,103 +20,113 @@ import org.osgi.framework.Bundle; public class Supplementer { - private ManifestElement[] supplementBundle; - private ManifestElement[] supplementImporter; - private ManifestElement[] supplementExporter; - private Bundle supplementer; - private List supplementedBundles; // elements of type Bundle - - public Supplementer(Bundle bundle, - ManifestElement[] supplementBundle, - ManifestElement[] supplementImporter, - ManifestElement[] supplementExporter) { - this.supplementer = bundle; - this.supplementBundle = supplementBundle; - this.supplementImporter = supplementImporter; - this.supplementExporter = supplementExporter; - this.supplementedBundles = new ArrayList(); - } - - public Bundle getSupplementerBundle() { - return supplementer; - } - - public String getSymbolicName() { - return supplementer.getSymbolicName(); - } - - public void addSupplementedBundle(Bundle supplementedBundle) { - this.supplementedBundles.add(supplementedBundle); - } - - public void removeSupplementedBundle(Bundle supplementedBundle) { - this.supplementedBundles.remove(supplementedBundle); - } - - public Bundle[] getSupplementedBundles() { - return (Bundle[]) supplementedBundles.toArray(new Bundle[supplementedBundles.size()]); - } - - public boolean isSupplemented(Bundle bundle) { - return supplementedBundles.contains(bundle); - } - - public boolean matchSupplementer(String symbolicName) { - boolean matches = false; - - if (supplementBundle != null) for (int i = 0; !matches && i < supplementBundle.length; i++) { - ManifestElement bundle = supplementBundle[i]; - if (equals_wild(bundle.getValue(),symbolicName)) matches = true; - } - - return matches; - } - - public boolean matchesSupplementImporter(ManifestElement[] imports) { - boolean matches = false; - - if (supplementImporter != null) for (int i = 0; !matches && i < supplementImporter.length; i++) { - ManifestElement supplementImport = supplementImporter[i]; - for (int j = 0; !matches && j < imports.length; j++) { - ManifestElement importPackage = imports[j]; - if (supplementImport.getValue().equals(importPackage.getValue())) matches = true; - } - } - - return matches; - } - - public boolean matchesSupplementExporter(ManifestElement[] exports) { - boolean matches = false; - - if (supplementExporter != null) for (int i = 0; !matches && i < supplementExporter.length; i++) { - ManifestElement supplementExport = supplementExporter[i]; - for (int j = 0; !matches && j < exports.length; j++) { - ManifestElement exportPackage = exports[j]; - if (supplementExport.getValue().equals(exportPackage.getValue())) matches = true; - } - } - - return matches; - } - - //knibb - //test if two Strings are equal - //with wild card support - only supports strings ending in * - private boolean equals_wild(String input, String match){ - if(input.equals(match)){ - //its a match so just return true - return true; - } - if(input.endsWith("*")==false){ - //no wildcards are being used here - return false; - } - String wild_in = input.substring(0, input.length()-1); - if(match.startsWith(wild_in)) - return true; - - return false; - } + private final ManifestElement[] supplementBundle; + + private final List supplementedBundles; // elements of type Bundle + + private final Bundle supplementer; + + private final ManifestElement[] supplementExporter; + + private final ManifestElement[] supplementImporter; + + public Supplementer(final Bundle bundle, + final ManifestElement[] supplementBundle, + final ManifestElement[] supplementImporter, + final ManifestElement[] supplementExporter) { + this.supplementer = bundle; + this.supplementBundle = supplementBundle; + this.supplementImporter = supplementImporter; + this.supplementExporter = supplementExporter; + this.supplementedBundles = new ArrayList(); + } + + public void addSupplementedBundle(final Bundle supplementedBundle) { + this.supplementedBundles.add(supplementedBundle); + } + + public Bundle[] getSupplementedBundles() { + return (Bundle[]) supplementedBundles + .toArray(new Bundle[supplementedBundles.size()]); + } + + public Bundle getSupplementerBundle() { + return supplementer; + } + + public String getSymbolicName() { + return supplementer.getSymbolicName(); + } + + public boolean isSupplemented(final Bundle bundle) { + return supplementedBundles.contains(bundle); + } + + public boolean matchesSupplementExporter(final ManifestElement[] exports) { + boolean matches = false; + + if (supplementExporter != null) + for (int i = 0; !matches && i < supplementExporter.length; i++) { + final ManifestElement supplementExport = supplementExporter[i]; + for (int j = 0; !matches && j < exports.length; j++) { + final ManifestElement exportPackage = exports[j]; + if (supplementExport.getValue().equals( + exportPackage.getValue())) matches = true; + } + } + + return matches; + } + + public boolean matchesSupplementImporter(final ManifestElement[] imports) { + boolean matches = false; + + if (supplementImporter != null) + for (int i = 0; !matches && i < supplementImporter.length; i++) { + final ManifestElement supplementImport = supplementImporter[i]; + for (int j = 0; !matches && j < imports.length; j++) { + final ManifestElement importPackage = imports[j]; + if (supplementImport.getValue().equals( + importPackage.getValue())) matches = true; + } + } + + return matches; + } + + public boolean matchSupplementer(final String symbolicName) { + boolean matches = false; + + if (supplementBundle != null) + for (int i = 0; !matches && i < supplementBundle.length; i++) { + final ManifestElement bundle = supplementBundle[i]; + if (equals_wild(bundle.getValue(), symbolicName)) + matches = true; + } + + return matches; + } + + public void removeSupplementedBundle(final Bundle supplementedBundle) { + this.supplementedBundles.remove(supplementedBundle); + } + + //knibb + //test if two Strings are equal + //with wild card support - only supports strings ending in * + private boolean equals_wild(final String input, final String match) { + if (input.equals(match)) { + //its a match so just return true + return true; + } + if (input.endsWith("*") == false) { + //no wildcards are being used here + return false; + } + final String wild_in = input.substring(0, input.length() - 1); + if (match.startsWith(wild_in)) return true; + + return false; + } } |