diff options
author | Pascal Rapicault | 2010-01-13 17:29:41 +0000 |
---|---|---|
committer | Pascal Rapicault | 2010-01-13 17:29:41 +0000 |
commit | 18189f0d42f7375660762dc6c885cf31683ae562 (patch) | |
tree | 17775d847bed9a33f3c68b74db2df75a2139c0bc /bundles/org.eclipse.equinox.p2.core | |
parent | c363f2984a09b73c422e38f4556fd3b23eafe958 (diff) | |
download | rt.equinox.p2-18189f0d42f7375660762dc6c885cf31683ae562.tar.gz rt.equinox.p2-18189f0d42f7375660762dc6c885cf31683ae562.tar.xz rt.equinox.p2-18189f0d42f7375660762dc6c885cf31683ae562.zip |
Merging api branch back to HEADv20100113
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.core')
24 files changed, 564 insertions, 589 deletions
diff --git a/bundles/org.eclipse.equinox.p2.core/.classpath b/bundles/org.eclipse.equinox.p2.core/.classpath index 6f3b481ac..64c5e31b7 100644 --- a/bundles/org.eclipse.equinox.p2.core/.classpath +++ b/bundles/org.eclipse.equinox.p2.core/.classpath @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/CDC-1.1%Foundation-1.1"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="src" path="src"/> <classpathentry kind="output" path="bin"/> diff --git a/bundles/org.eclipse.equinox.p2.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.core/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 327fbe678..000000000 --- a/bundles/org.eclipse.equinox.p2.core/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,346 +0,0 @@ -#Mon Aug 24 11:19:53 EDT 2009 -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=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_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -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_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning -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_local_declarations=insert -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.classpath.exclusionPatterns=enabled -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.comment.line_length=80 -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.builder.cleanOutputFolder=clean -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.incompleteClasspath=error -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.comment.format_block_comments=false -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=insert -org.eclipse.jdt.core.formatter.comment.format_html=true -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_closing_paren_in_enum_constant=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_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -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_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning -org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=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_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=error -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=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_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=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_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.circularClasspath=error -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=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_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=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.alignment_for_enum_constants=0 -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=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_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.compiler.problem.discouragedReference=error -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.comment.format_line_comments=false -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.comment.indent_root_tags=false -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.compiler.problem.unusedImport=error -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.builder.invalidClasspath=abort -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=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_before_opening_paren_in_for=insert -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.incompatibleJDKLevel=ignore -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.lineSplit=800 -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled -org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000 -org.eclipse.jdt.core.compiler.source=1.3 -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.builder.duplicateResourceTask=warning -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=insert -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.compiler.doc.comment.support=enabled -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=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_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.compiler.compliance=1.4 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 diff --git a/bundles/org.eclipse.equinox.p2.core/.settings/org.eclipse.pde.api.tools.prefs b/bundles/org.eclipse.equinox.p2.core/.settings/org.eclipse.pde.api.tools.prefs index 7b4e4a2c4..c97ebe5f5 100644 --- a/bundles/org.eclipse.equinox.p2.core/.settings/org.eclipse.pde.api.tools.prefs +++ b/bundles/org.eclipse.equinox.p2.core/.settings/org.eclipse.pde.api.tools.prefs @@ -1,10 +1,12 @@ -#Wed Dec 03 12:05:24 EST 2008 +#Wed Jan 13 12:12:41 EST 2010 ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error CLASS_ELEMENT_TYPE_ADDED_METHOD=Error CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error @@ -56,8 +58,8 @@ INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -INVALID_JAVADOC_TAG=Warning -INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Error +INVALID_JAVADOC_TAG=Ignore +INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Ignore LEAK_EXTEND=Warning LEAK_FIELD_DECL=Warning LEAK_IMPLEMENT=Warning @@ -79,6 +81,7 @@ TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +UNUSED_PROBLEM_FILTERS=Warning eclipse.preferences.version=1 incompatible_api_component_version=Error incompatible_api_component_version_include_major_without_breaking_change=Disabled @@ -86,3 +89,5 @@ incompatible_api_component_version_include_minor_without_api_change=Disabled invalid_since_tag_version=Error malformed_since_tag=Error missing_since_tag=Error +report_api_breakage_when_major_version_incremented=Disabled +report_resolution_errors_api_component=Warning diff --git a/bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF index de1a72cde..2f2feff92 100644 --- a/bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF @@ -4,7 +4,7 @@ Bundle-SymbolicName: org.eclipse.equinox.p2.core;singleton:=true Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-Localization: plugin -Bundle-Version: 1.1.0.qualifier +Bundle-Version: 2.0.0.qualifier Import-Package: org.eclipse.osgi.framework.eventmgr;version="1.2.0", org.eclipse.osgi.framework.log;version="1.0.0", org.eclipse.osgi.service.debug;version="1.0.0", @@ -25,12 +25,14 @@ Export-Package: org.eclipse.equinox.internal.p2.core;x-friends:="org.eclipse.equ org.eclipse.equinox.p2.installer, org.eclipse.equinox.p2.metadata, org.eclipse.equinox.p2.metadata.generator, + org.eclipse.equinox.p2.operations, org.eclipse.equinox.frameworkadmin.test, org.eclipse.equinox.p2.metadata.repository, org.eclipse.equinox.p2.repositoryoptimizer, org.eclipse.equinox.p2.touchpoint.eclipse, org.eclipse.equinox.p2.touchpoint.natives, org.eclipse.equinox.p2.ui, + org.eclipse.equinox.p2.ui.admin, org.eclipse.equinox.p2.ui.sdk, org.eclipse.equinox.p2.ui.sdk.scheduler, org.eclipse.equinox.p2.updatechecker, @@ -42,7 +44,8 @@ Export-Package: org.eclipse.equinox.internal.p2.core;x-friends:="org.eclipse.equ org.eclipse.equinox.p2.extensionlocation, org.eclipse.equinox.p2.publisher, org.eclipse.equinox.p2.repository.tools, - org.eclipse.equinox.p2.repository", + org.eclipse.equinox.p2.repository, + org.eclipse.equinox.p2.ql", org.eclipse.equinox.internal.provisional.p2.core; x-friends:="org.eclipse.equinox.p2.artifact.optimizers, org.eclipse.equinox.p2.artifact.processors, @@ -56,6 +59,7 @@ Export-Package: org.eclipse.equinox.internal.p2.core;x-friends:="org.eclipse.equ org.eclipse.equinox.p2.installer, org.eclipse.equinox.p2.metadata.generator, org.eclipse.equinox.p2.metadata.repository, + org.eclipse.equinox.p2.operations, org.eclipse.equinox.p2.publisher, org.eclipse.equinox.p2.reconciler.dropins, org.eclipse.equinox.p2.touchpoint.eclipse, @@ -86,21 +90,16 @@ Export-Package: org.eclipse.equinox.internal.p2.core;x-friends:="org.eclipse.equ org.eclipse.equinox.p2.artifact.repository, org.eclipse.equinox.p2.touchpoint.eclipse, org.eclipse.equinox.p2.touchpoint.natives, + org.eclipse.equinox.p2.operations, org.eclipse.equinox.p2.publisher, org.eclipse.equinox.p2.repository", - org.eclipse.equinox.internal.provisional.p2.core.location; - x-friends:="org.eclipse.equinox.p2.artifact.repository, - org.eclipse.equinox.p2.touchpoint.natives, - org.eclipse.equinox.p2.metadata.repository, - org.eclipse.equinox.p2.director, - org.eclipse.equinox.p2.engine, - org.eclipse.equinox.p2.touchpoint.eclipse", org.eclipse.equinox.p2.core, org.eclipse.equinox.p2.core.spi Bundle-ActivationPolicy: lazy Bundle-ClassPath: . -Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1, - J2SE-1.4 +Bundle-RequiredExecutionEnvironment: J2SE-1.5, + J2SE-1.4, + CDC-1.1/Foundation-1.1 Bundle-Activator: org.eclipse.equinox.internal.p2.core.Activator Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.5.0,4.0.0)" Service-Component: OSGI-INF/eventBus.xml, OSGI-INF/agentProvider.xml diff --git a/bundles/org.eclipse.equinox.p2.core/build.properties b/bundles/org.eclipse.equinox.p2.core/build.properties index 4f52e07f1..98b717479 100644 --- a/bundles/org.eclipse.equinox.p2.core/build.properties +++ b/bundles/org.eclipse.equinox.p2.core/build.properties @@ -16,3 +16,5 @@ bin.includes = META-INF/,\ OSGI-INF/ src.includes = about.html source.. = src/ +javacTarget=jsr14 +javacSource=1.5 diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/Activator.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/Activator.java index 8b67449da..45f8a9d66 100644 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/Activator.java +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/Activator.java @@ -11,18 +11,19 @@ package org.eclipse.equinox.internal.p2.core; import java.io.File; -import java.net.MalformedURLException; -import java.net.URL; +import java.net.URI; +import java.net.URISyntaxException; import java.util.Dictionary; import java.util.Hashtable; import org.eclipse.core.runtime.Path; -import org.eclipse.equinox.internal.provisional.p2.core.location.AgentLocation; +import org.eclipse.core.runtime.URIUtil; +import org.eclipse.equinox.p2.core.IAgentLocation; import org.eclipse.osgi.framework.log.FrameworkLog; import org.osgi.framework.*; import org.osgi.util.tracker.ServiceTracker; public class Activator implements BundleActivator { - public static AgentLocation agentDataLocation = null; + public static IAgentLocation agentDataLocation = null; public static BundleContext context; private static final String DEFAULT_AGENT_LOCATION = "../p2"; //$NON-NLS-1$ @@ -51,12 +52,12 @@ public class Activator implements BundleActivator { * NOTE: This method is copied from LocationHelper in org.eclipse.osgi * due to access restrictions. */ - private static URL adjustTrailingSlash(URL url, boolean trailingSlash) throws MalformedURLException { - String file = url.getFile(); + private static URI adjustTrailingSlash(URI url, boolean trailingSlash) throws URISyntaxException { + String file = url.toString(); if (trailingSlash == (file.endsWith("/"))) //$NON-NLS-1$ return url; file = trailingSlash ? file + "/" : file.substring(0, file.length() - 1); //$NON-NLS-1$ - return new URL(url.getProtocol(), url.getHost(), file); + return new URI(file); } /** @@ -68,22 +69,22 @@ public class Activator implements BundleActivator { * @param trailingSlash flag to indicate a trailing slash on the spec * @return a URL */ - private static URL buildURL(String spec, boolean trailingSlash) { + private static URI buildURL(String spec, boolean trailingSlash) { if (spec == null) return null; boolean isFile = spec.startsWith("file:"); //$NON-NLS-1$ try { if (isFile) - return adjustTrailingSlash(new File(spec.substring(5)).toURL(), trailingSlash); - return new URL(spec); - } catch (MalformedURLException e) { + return adjustTrailingSlash(new File(spec.substring(5)).toURI(), trailingSlash); + return new URI(spec); + } catch (URISyntaxException e) { // if we failed and it is a file spec, there is nothing more we can do // otherwise, try to make the spec into a file URL. if (isFile) return null; try { - return adjustTrailingSlash(new File(spec).toURL(), trailingSlash); - } catch (MalformedURLException e1) { + return adjustTrailingSlash(new File(spec).toURI(), trailingSlash); + } catch (URISyntaxException e1) { return null; } } @@ -114,16 +115,16 @@ public class Activator implements BundleActivator { return value + source.substring(var.length()); } - private AgentLocation buildLocation(String property, URL defaultLocation, boolean readOnlyDefault, boolean addTrailingSlash) { + private IAgentLocation buildLocation(String property, URI defaultLocation, boolean readOnlyDefault, boolean addTrailingSlash) { String location = Activator.context.getProperty(property); // if the instance location is not set, predict where the workspace will be and // put the instance area inside the workspace meta area. if (location == null) - return new BasicLocation(defaultLocation); + return new AgentLocation(defaultLocation); if (location.equalsIgnoreCase(NONE)) return null; if (location.equalsIgnoreCase(NO_DEFAULT)) - return new BasicLocation(null); + return new AgentLocation(null); if (location.startsWith(VAR_USER_HOME)) { String base = substituteVar(location, VAR_USER_HOME, PROP_USER_HOME); location = new Path(base).toFile().getAbsolutePath(); @@ -134,10 +135,10 @@ public class Activator implements BundleActivator { //note the config dir system property is already a URL location = substituteVar(location, VAR_CONFIG_DIR, PROP_CONFIG_DIR); } - URL url = buildURL(location, addTrailingSlash); - BasicLocation result = null; + URI url = buildURL(location, addTrailingSlash); + AgentLocation result = null; if (url != null) { - result = new BasicLocation(url); + result = new AgentLocation(url); } return result; } @@ -156,12 +157,12 @@ public class Activator implements BundleActivator { public void start(BundleContext aContext) throws Exception { instance = this; Activator.context = aContext; - URL defaultLocation = new URL(aContext.getProperty(PROP_CONFIG_DIR) + DEFAULT_AGENT_LOCATION + '/'); + URI defaultLocation = URIUtil.fromString(aContext.getProperty(PROP_CONFIG_DIR) + DEFAULT_AGENT_LOCATION + '/'); agentDataLocation = buildLocation(PROP_AGENT_DATA_AREA, defaultLocation, false, true); - Dictionary locationProperties = new Hashtable(); + Dictionary<String, Object> locationProperties = new Hashtable<String, Object>(); if (agentDataLocation != null) { locationProperties.put("type", PROP_AGENT_DATA_AREA); //$NON-NLS-1$ - agentLocationRegistration = aContext.registerService(AgentLocation.SERVICE_NAME, agentDataLocation, locationProperties); + agentLocationRegistration = aContext.registerService(IAgentLocation.SERVICE_NAME, agentDataLocation, locationProperties); } } diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/AgentLocation.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/AgentLocation.java new file mode 100644 index 000000000..75849e02f --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/AgentLocation.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * Copyright (c) 2004, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.equinox.internal.p2.core; + +import java.net.URI; +import org.eclipse.core.runtime.URIUtil; +import org.eclipse.equinox.p2.core.IAgentLocation; + +/** + * Internal class. + */ +public class AgentLocation implements IAgentLocation { + + private URI location = null; + + public AgentLocation(URI location) { + this.location = location; + } + + public synchronized URI getRootLocation() { + return location; + } + + public URI getDataArea(String touchpointId) { + return URIUtil.append(getRootLocation(), touchpointId + '/'); + } +} diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/BasicLocation.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/BasicLocation.java deleted file mode 100644 index 327d6a0a1..000000000 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/BasicLocation.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2009 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.p2.core; - -import java.net.*; -import org.eclipse.core.runtime.URIUtil; -import org.eclipse.equinox.internal.provisional.p2.core.location.AgentLocation; - -/** - * Internal class. - */ -public class BasicLocation implements AgentLocation { - - private URL location = null; - - public BasicLocation(URL location) { - this.location = location; - } - - public synchronized URL getURL() { - return location; - } - - public URI getArtifactRepositoryURI() { - //the cache is a co-located repository - return getMetadataRepositoryURI(); - } - - public URI getMetadataRepositoryURI() { - try { - return URIUtil.toURI(new URL(getDataArea(Activator.ID), "cache/")); //$NON-NLS-1$ - } catch (MalformedURLException e) { - // TODO Auto-generated catch block - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - } - return null; - } - - public URL getDataArea(String touchpointId) { - try { - return new URL(getURL(), touchpointId + '/'); - } catch (MalformedURLException e) { - // TODO Auto-generated catch block - return null; - } - } -} diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/DefaultAgentProvider.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/DefaultAgentProvider.java index 2fd5b8f92..158e28177 100644 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/DefaultAgentProvider.java +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/DefaultAgentProvider.java @@ -11,9 +11,10 @@ package org.eclipse.equinox.internal.p2.core; import java.net.URI; -import org.eclipse.equinox.p2.core.IProvisioningAgent; -import org.eclipse.equinox.p2.core.IProvisioningAgentProvider; -import org.osgi.framework.BundleContext; +import java.util.Dictionary; +import java.util.Hashtable; +import org.eclipse.equinox.p2.core.*; +import org.osgi.framework.*; /** * Default implementation of {@link IProvisioningAgentProvider}. @@ -27,9 +28,19 @@ public class DefaultAgentProvider implements IProvisioningAgentProvider { public IProvisioningAgent createAgent(URI location) { ProvisioningAgent result = new ProvisioningAgent(); - result.setLocation(location); result.setBundleContext(context); + result.setLocation(location); + IAgentLocation agentLocation = (IAgentLocation) result.getService(IAgentLocation.SERVICE_NAME); + Dictionary<String, Object> properties = new Hashtable<String, Object>(5); + if (agentLocation != null) + properties.put("locationURI", String.valueOf(agentLocation.getRootLocation())); //$NON-NLS-1$ + //make the currently running system have a higher service ranking + if (location == null) { + properties.put(Constants.SERVICE_RANKING, new Integer(100)); + properties.put(IProvisioningAgent.SERVICE_CURRENT, Boolean.TRUE.toString()); + } + ServiceRegistration reg = context.registerService(IProvisioningAgent.SERVICE_NAME, result, properties); + result.setServiceRegistration(reg); return result; } - } diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/ProvisioningAgent.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/ProvisioningAgent.java index aef7146b5..c0fd26504 100644 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/ProvisioningAgent.java +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/ProvisioningAgent.java @@ -10,12 +10,9 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.core; -import java.net.MalformedURLException; import java.net.URI; import java.util.*; -import org.eclipse.core.runtime.*; -import org.eclipse.equinox.internal.p2.core.helpers.LogHelper; -import org.eclipse.equinox.internal.provisional.p2.core.location.AgentLocation; +import org.eclipse.equinox.p2.core.IAgentLocation; import org.eclipse.equinox.p2.core.IProvisioningAgent; import org.eclipse.equinox.p2.core.spi.IAgentServiceFactory; import org.osgi.framework.*; @@ -25,14 +22,23 @@ import org.osgi.framework.*; */ public class ProvisioningAgent implements IProvisioningAgent { - private final Map agentServices = Collections.synchronizedMap(new HashMap()); - + private final Map<String, Object> agentServices = Collections.synchronizedMap(new HashMap<String, Object>()); private BundleContext context; + private boolean stopped = false; + private ServiceRegistration reg; + + /** + * Instantiates a provisioning agent. + */ + public ProvisioningAgent() { + super(); + } /* (non-Javadoc) * @see org.eclipse.equinox.p2.core.IProvisioningAgent#getService(java.lang.String) */ public Object getService(String serviceName) { + checkRunning(); Object service = agentServices.get(serviceName); if (service != null) return service; @@ -59,7 +65,13 @@ public class ProvisioningAgent implements IProvisioningAgent { return service; } + private synchronized void checkRunning() { + if (stopped) + throw new RuntimeException("Attempt to access stopped agent: " + this); + } + public void registerService(String serviceName, Object service) { + checkRunning(); agentServices.put(serviceName, service); } @@ -68,18 +80,40 @@ public class ProvisioningAgent implements IProvisioningAgent { } public void setLocation(URI location) { - try { - AgentLocation agentLocation = new BasicLocation(URIUtil.toURL(location)); - agentServices.put(AgentLocation.SERVICE_NAME, agentLocation); - } catch (MalformedURLException e) { - LogHelper.log(new Status(IStatus.ERROR, Activator.ID, "Invalid agent location", e)); //$NON-NLS-1$ + //treat a null location as using the currently running platform + IAgentLocation agentLocation = null; + if (location == null) { + ServiceReference ref = context.getServiceReference(IAgentLocation.SERVICE_NAME); + if (ref != null) { + agentLocation = (IAgentLocation) context.getService(ref); + context.ungetService(ref); + } + } else { + agentLocation = new AgentLocation(location); } + agentServices.put(IAgentLocation.SERVICE_NAME, agentLocation); } public void unregisterService(String serviceName, Object service) { + synchronized (this) { + if (stopped) + return; + } synchronized (agentServices) { if (agentServices.get(serviceName) == service) agentServices.remove(serviceName); } } + + public synchronized void stop() { + stopped = true; + if (reg != null) { + reg.unregister(); + reg = null; + } + } + + public void setServiceRegistration(ServiceRegistration reg) { + this.reg = reg; + } } diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/StringPool.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/StringPool.java index 930378462..f7ff68cd6 100644 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/StringPool.java +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/StringPool.java @@ -23,7 +23,7 @@ import java.util.HashMap; */ public final class StringPool { private int savings; - private final HashMap map = new HashMap(); + private final HashMap<String, String> map = new HashMap<String, String>(); /** * Creates a new string pool. @@ -41,11 +41,11 @@ public final class StringPool { public String add(String string) { if (string == null) return string; - Object result = map.get(string); + String result = map.get(string); if (result != null) { if (result != string) savings += 44 + 2 * string.length(); - return (String) result; + return result; } //explicitly copy the string to trim excess baggage String trim = new String(string.toCharArray()); diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/CollectionUtils.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/CollectionUtils.java new file mode 100644 index 000000000..5bea8c961 --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/CollectionUtils.java @@ -0,0 +1,263 @@ +/******************************************************************************* + * Copyright (c) 2009, 2010 Cloudsmith Inc. and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cloudsmith Inc. - initial API and implementation + *******************************************************************************/ +package org.eclipse.equinox.internal.p2.core.helpers; + +import java.io.*; +import java.lang.reflect.Array; +import java.util.*; + +/** + * Helper class that provides some useful support when dealing with collections. + */ +public class CollectionUtils { + + /** + * A unmodifiable {@link List} implementation on top of an object array. + * @param <E> The element type. + */ + private static class UnmodifiableArrayList<E> extends AbstractList<E> implements RandomAccess, java.io.Serializable { + private static final long serialVersionUID = 7435304230643855579L; + final E[] array; + + UnmodifiableArrayList(E[] array) { + this.array = array; + } + + public boolean contains(Object o) { + return indexOf(o) != -1; + } + + public E get(int index) { + return array[index]; + } + + public int indexOf(Object o) { + int size = array.length; + if (o == null) { + for (int i = 0; i < size; i++) + if (array[i] == null) + return i; + } else { + for (int i = 0; i < size; i++) + if (o.equals(array[i])) + return i; + } + return -1; + } + + public Iterator<E> iterator() { + return listIterator(); + } + + /** + * Rapid iterator, motivated by the fact that we don't need to check + * for concurrent modifications. + */ + public ListIterator<E> listIterator() { + return new ListIterator<E>() { + private int index = 0; + + public boolean hasNext() { + return index < array.length; + } + + public E next() { + if (index >= array.length) + throw new NoSuchElementException(); + return array[index++]; + } + + public boolean hasPrevious() { + return index > 0; + } + + public E previous() { + if (--index < 0) { + ++index; + throw new NoSuchElementException(); + } + return array[index]; + } + + public int nextIndex() { + return index; + } + + public int previousIndex() { + return index - 1; + } + + public void remove() { + throw new UnsupportedOperationException(); + } + + public void set(E e) { + throw new UnsupportedOperationException(); + } + + public void add(E e) { + throw new UnsupportedOperationException(); + } + }; + } + + public int lastIndexOf(Object o) { + int idx = array.length; + if (o == null) { + while (--idx >= 0) + if (array[idx] == null) + return idx; + } else { + while (--idx >= 0) + if (o.equals(array[idx])) + return idx; + } + return -1; + } + + public E set(int index, E element) { + throw new UnsupportedOperationException(); + } + + public int size() { + return array.length; + } + + public Object[] toArray() { + return array.clone(); + } + + @SuppressWarnings("unchecked") + public <T> T[] toArray(T[] a) { + int size = array.length; + if (a.length < size) + a = (T[]) Array.newInstance(a.getClass().getComponentType(), size); + System.arraycopy(this.array, 0, a, 0, size); + while (size < a.length) + a[size++] = null; + return a; + } + } + + /** + * Creates a combined hash for an array of objects. + * @param objects The objects to hash + * @return The combined hashCode of the objects. + */ + public static int hashCode(Object objects[]) { + if (objects == null) + return 0; + + int result = 1; + int idx = objects.length; + while (--idx >= 0) { + Object object = objects[idx]; + result = 17 * result + (object == null ? 0 : object.hashCode()); + } + return result; + } + + /** + * The emptyList() method was introduced in Java 1.5 so we need this here to be able to + * down compile to 1.4. + * @param <T> The type of the elements + * @return An empty list + */ + @SuppressWarnings("unchecked") + public static <T> List<T> emptyList() { + return Collections.EMPTY_LIST; + } + + /** + * The emptySet() method was introduced in Java 1.5 so we need this here to be able to + * down compile to 1.4. + * @param <T> The type of the elements + * @return An empty set + */ + @SuppressWarnings("unchecked") + public static <T> Set<T> emptySet() { + return Collections.EMPTY_SET; + } + + /** + * The emptyMap() method was introduced in Java 1.5 so we need this here to be able to + * down compile to 1.4. + * @param <K> The type of the map keys + * @param <V> The type of the map values + * @return An empty set + */ + @SuppressWarnings("unchecked") + public static <K, V> Map<K, V> emptyMap() { + return Collections.EMPTY_MAP; + } + + /** + * Returns an unmodifiable list that is backed by the <code>array</code>. + * @param <T> The list element type + * @param array The array of elements + * @return The unmodifiable list + */ + public static <T> List<T> unmodifiableList(T[] array) { + return array == null || array.length == 0 ? CollectionUtils.<T> emptyList() : new UnmodifiableArrayList<T>(array); + } + + /** + * Reads a property list using the {@link Properties#load(InputStream)} method. The + * properties are stored in a map. + * @param stream The stream to read from + * @return The resulting map + * @throws IOException propagated from the load method. + */ + public static Map<String, String> loadProperties(InputStream stream) throws IOException { + Properties properties = new Properties(); + properties.load(stream); + return toMap(properties); + } + + /** + * Copies all elements from <code>properties</code> into a Map. The returned map might be unmodifiable + * @param properties + * @return The map containing all elements + */ + public static Map<String, String> toMap(Properties properties) { + if (properties == null || properties.isEmpty()) + return emptyMap(); + + Map<String, String> props = new HashMap<String, String>(properties.size()); + putAll(properties, props); + return props; + } + + /** + * Copies all elements from <code>properties</code> into the given <code>result</code>. + * @param properties + * @param result + */ + public static void putAll(Properties properties, Map<String, String> result) { + for (Enumeration<Object> keys = properties.keys(); keys.hasMoreElements();) { + String key = (String) keys.nextElement(); + result.put(key, properties.getProperty(key)); + } + } + + /** + * Stores the properties using {@link Properties#store(OutputStream, String)} on the given <code>stream</code>. + * @param properties The properties to store + * @param stream The stream to store to + * @param comment The comment to use + * @throws IOException + */ + public static void storeProperties(Map<String, String> properties, OutputStream stream, String comment) throws IOException { + Properties props = new Properties(); + props.putAll(properties); + props.store(stream, comment); + } +} diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/FileUtils.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/FileUtils.java index 96a9f9810..ded76dffc 100644 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/FileUtils.java +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/FileUtils.java @@ -21,10 +21,10 @@ public class FileUtils { private static File[] untarFile(File source, File outputDir) throws IOException, TarException { TarFile tarFile = new TarFile(source); - List untarredFiles = new ArrayList(); + List<File> untarredFiles = new ArrayList<File>(); try { - for (Enumeration e = tarFile.entries(); e.hasMoreElements();) { - TarEntry entry = (TarEntry) e.nextElement(); + for (Enumeration<TarEntry> e = tarFile.entries(); e.hasMoreElements();) { + TarEntry entry = e.nextElement(); InputStream input = tarFile.getInputStream(entry); try { File outFile = new File(outputDir, entry.getName()); @@ -52,7 +52,7 @@ public class FileUtils { } finally { tarFile.close(); } - return (File[]) untarredFiles.toArray(new File[untarredFiles.size()]); + return untarredFiles.toArray(new File[untarredFiles.size()]); } /** @@ -107,7 +107,7 @@ public class FileUtils { in.close(); throw new IOException(Messages.Util_Invalid_Zip_File_Format); } - ArrayList unzippedFiles = new ArrayList(); + ArrayList<File> unzippedFiles = new ArrayList<File>(); do { File outFile = new File(outputDir, ze.getName()); unzippedFiles.add(outFile); @@ -131,7 +131,7 @@ public class FileUtils { } while ((ze = in.getNextEntry()) != null); in.close(); - return (File[]) unzippedFiles.toArray(new File[unzippedFiles.size()]); + return unzippedFiles.toArray(new File[unzippedFiles.size()]); } // Delete empty directories under dir, including dir itself. @@ -243,8 +243,8 @@ public class FileUtils { public static void zip(File[] inclusions, File[] exclusions, File destinationArchive, IPathComputer pathComputer) throws IOException { FileOutputStream fileOutput = new FileOutputStream(destinationArchive); ZipOutputStream output = new ZipOutputStream(fileOutput); - HashSet exclusionSet = exclusions == null ? new HashSet() : new HashSet(Arrays.asList(exclusions)); - HashSet directoryEntries = new HashSet(); + HashSet<File> exclusionSet = exclusions == null ? new HashSet<File>() : new HashSet<File>(Arrays.asList(exclusions)); + HashSet<IPath> directoryEntries = new HashSet<IPath>(); try { for (int i = 0; i < inclusions.length; i++) { pathComputer.reset(); @@ -273,11 +273,11 @@ public class FileUtils { * @param pathComputer - computer used to create the path of the files in the result. * @throws IOException */ - public static void zip(ZipOutputStream output, File source, Set exclusions, IPathComputer pathComputer) throws IOException { - zip(output, source, exclusions, pathComputer, new HashSet()); + public static void zip(ZipOutputStream output, File source, Set<File> exclusions, IPathComputer pathComputer) throws IOException { + zip(output, source, exclusions, pathComputer, new HashSet<IPath>()); } - public static void zip(ZipOutputStream output, File source, Set exclusions, IPathComputer pathComputer, Set directoryEntries) throws IOException { + public static void zip(ZipOutputStream output, File source, Set<File> exclusions, IPathComputer pathComputer, Set<IPath> directoryEntries) throws IOException { if (exclusions.contains(source)) return; if (source.isDirectory()) //if the file path is a URL then isDir and isFile are both false @@ -286,7 +286,7 @@ public class FileUtils { zipFile(output, source, pathComputer, directoryEntries); } - private static void zipDirectoryEntry(ZipOutputStream output, IPath entry, long time, Set directoryEntries) throws IOException { + private static void zipDirectoryEntry(ZipOutputStream output, IPath entry, long time, Set<IPath> directoryEntries) throws IOException { entry = entry.addTrailingSeparator(); if (!directoryEntries.contains(entry)) { //make sure parent entries are in the zip @@ -314,7 +314,7 @@ public class FileUtils { * Zip the contents of the given directory into the zip file represented by * the given zip stream. Prepend the given prefix to the file paths. */ - private static void zipDir(ZipOutputStream output, File source, Set exclusions, IPathComputer pathComputer, Set directoryEntries) throws IOException { + private static void zipDir(ZipOutputStream output, File source, Set<File> exclusions, IPathComputer pathComputer, Set<IPath> directoryEntries) throws IOException { File[] files = source.listFiles(); if (files.length == 0) { zipDirectoryEntry(output, pathComputer.computePath(source), source.lastModified(), directoryEntries); @@ -326,16 +326,16 @@ public class FileUtils { // foo/bar.txt // foo/something/bar2.txt // foo/something/else/bar3.txt - Arrays.sort(files, new Comparator() { - public int compare(Object arg0, Object arg1) { - Path a = new Path(((File) arg0).getAbsolutePath()); - Path b = new Path(((File) arg1).getAbsolutePath()); + Arrays.sort(files, new Comparator<File>() { + public int compare(File arg0, File arg1) { + Path a = new Path(arg0.getAbsolutePath()); + Path b = new Path(arg1.getAbsolutePath()); if (a.segmentCount() == b.segmentCount()) { - if (((File) arg0).isDirectory() && ((File) arg1).isFile()) + if (arg0.isDirectory() && arg1.isFile()) return 1; - else if (((File) arg0).isDirectory() && ((File) arg1).isDirectory()) + else if (arg0.isDirectory() && arg1.isDirectory()) return 0; - else if (((File) arg0).isFile() && ((File) arg1).isDirectory()) + else if (arg0.isFile() && arg1.isDirectory()) return -1; else return 0; @@ -352,7 +352,7 @@ public class FileUtils { * Add the given file to the zip file represented by the specified stream. * Prepend the given prefix to the path of the file. */ - private static void zipFile(ZipOutputStream output, File source, IPathComputer pathComputer, Set directoryEntries) throws IOException { + private static void zipFile(ZipOutputStream output, File source, IPathComputer pathComputer, Set<IPath> directoryEntries) throws IOException { boolean isManifest = false; //manifest files are special InputStream input = new BufferedInputStream(new FileInputStream(source)); try { diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/LogHelper.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/LogHelper.java index cb3fd613a..749401c68 100644 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/LogHelper.java +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/LogHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -13,7 +13,7 @@ package org.eclipse.equinox.internal.p2.core.helpers; import java.util.ArrayList; import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.p2.core.Activator; -import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; +import org.eclipse.equinox.p2.core.ProvisionException; import org.eclipse.osgi.framework.log.FrameworkLog; import org.eclipse.osgi.framework.log.FrameworkLogEntry; @@ -39,7 +39,7 @@ public class LogHelper { */ private static FrameworkLogEntry getLog(IStatus status) { Throwable t = status.getException(); - ArrayList childlist = new ArrayList(); + ArrayList<FrameworkLogEntry> childlist = new ArrayList<FrameworkLogEntry>(); int stackCode = t instanceof CoreException ? 1 : 0; // ensure a substatus inside a CoreException is properly logged @@ -57,7 +57,7 @@ public class LogHelper { } } - FrameworkLogEntry[] children = (FrameworkLogEntry[]) (childlist.size() == 0 ? null : childlist.toArray(new FrameworkLogEntry[childlist.size()])); + FrameworkLogEntry[] children = (childlist.size() == 0 ? null : childlist.toArray(new FrameworkLogEntry[childlist.size()])); return new FrameworkLogEntry(status.getPlugin(), status.getSeverity(), status.getCode(), status.getMessage(), stackCode, t, children); } diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/OrderedProperties.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/OrderedProperties.java index 442132bf6..2520f2d0d 100644 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/OrderedProperties.java +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/OrderedProperties.java @@ -26,11 +26,11 @@ import java.util.*; * The class does not support default properties as they can be expressed by * creating java.util.Properties hierarchies. */ -public class OrderedProperties extends Dictionary implements Map { +public class OrderedProperties extends Dictionary<String, String> implements Map<String, String> { - LinkedHashMap propertyMap = null; + LinkedHashMap<String, String> propertyMap = null; - public static OrderedProperties unmodifiableProperties(Map properties) { + public static OrderedProperties unmodifiableProperties(Map<String, String> properties) { return new UnmodifiableProperties(properties); } @@ -40,12 +40,12 @@ public class OrderedProperties extends Dictionary implements Map { public OrderedProperties(int size) { super(); - propertyMap = new LinkedHashMap(size); + propertyMap = new LinkedHashMap<String, String>(size); } public OrderedProperties(OrderedProperties properties) { super(); - propertyMap = new LinkedHashMap(properties.size()); + propertyMap = new LinkedHashMap<String, String>(properties.size()); putAll(properties); } @@ -67,11 +67,11 @@ public class OrderedProperties extends Dictionary implements Map { } public String getProperty(String key) { - return (String) (propertyMap == null ? null : propertyMap.get(key)); + return (propertyMap == null ? null : propertyMap.get(key)); } public void putAll(OrderedProperties properties) { - putAll((Map) properties); + putAll(properties); } /** @@ -79,7 +79,7 @@ public class OrderedProperties extends Dictionary implements Map { */ private void init() { if (propertyMap == null) { - propertyMap = new LinkedHashMap(); + propertyMap = new LinkedHashMap<String, String>(); } } @@ -95,9 +95,9 @@ public class OrderedProperties extends Dictionary implements Map { propertyMap = null; } - public Object put(Object arg0, Object arg1) { + public String put(String key, String value) { init(); - return propertyMap.put(arg0, arg1); + return propertyMap.put(key, value); } public boolean containsKey(Object key) { @@ -108,29 +108,29 @@ public class OrderedProperties extends Dictionary implements Map { return propertyMap != null ? propertyMap.containsValue(value) : false; } - public Set entrySet() { - return propertyMap != null ? propertyMap.entrySet() : Collections.EMPTY_SET; + public Set<Map.Entry<String, String>> entrySet() { + return propertyMap != null ? propertyMap.entrySet() : CollectionUtils.<Map.Entry<String, String>> emptySet(); } - public Object get(Object key) { + public String get(Object key) { return propertyMap != null ? propertyMap.get(key) : null; } - public Set keySet() { - return propertyMap != null ? propertyMap.keySet() : Collections.EMPTY_SET; + public Set<String> keySet() { + return propertyMap != null ? propertyMap.keySet() : CollectionUtils.<String> emptySet(); } - public void putAll(Map arg0) { + public void putAll(Map<? extends String, ? extends String> arg0) { init(); propertyMap.putAll(arg0); } - public Object remove(Object key) { + public String remove(Object key) { return propertyMap != null ? propertyMap.remove(key) : null; } - public Collection values() { - return propertyMap != null ? propertyMap.values() : Collections.EMPTY_LIST; + public Collection<String> values() { + return propertyMap != null ? propertyMap.values() : CollectionUtils.<String> emptyList(); } public boolean equals(Object o) { @@ -147,8 +147,8 @@ public class OrderedProperties extends Dictionary implements Map { return rhs.propertyMap.equals(this.propertyMap); } if (this.propertyMap == null) { - if (o instanceof Map) - return ((Map) o).isEmpty(); + if (o instanceof Map<?, ?>) + return ((Map<?, ?>) o).isEmpty(); return false; } return this.propertyMap.equals(o); @@ -164,54 +164,36 @@ public class OrderedProperties extends Dictionary implements Map { return sb.toString(); } - private class ElementsEnum implements Enumeration { + private class StringsEnum implements Enumeration<String> { - Iterator iterator = null; + private final Iterator<String> iterator; - public ElementsEnum(OrderedProperties properties) { - iterator = properties.propertyMap.values().iterator(); + public StringsEnum(Collection<String> elems) { + this.iterator = elems.iterator(); } public boolean hasMoreElements() { return iterator.hasNext(); } - public Object nextElement() { + public String nextElement() { return iterator.next(); } } - public Enumeration elements() { - return new ElementsEnum(this); - } - - private class KeysEnum implements Enumeration { - - Iterator iterator = null; - - public KeysEnum(OrderedProperties properties) { - iterator = properties.propertyMap.keySet().iterator(); - } - - public boolean hasMoreElements() { - return iterator.hasNext(); - } - - public Object nextElement() { - return iterator.next(); - } + public Enumeration<String> elements() { + return new StringsEnum(propertyMap.values()); } - public Enumeration keys() { - return new KeysEnum(this); + public Enumeration<String> keys() { + return new StringsEnum(propertyMap.keySet()); } private static class UnmodifiableProperties extends OrderedProperties { - UnmodifiableProperties(Map properties) { + UnmodifiableProperties(Map<String, String> properties) { super(); - for (Iterator iter = properties.entrySet().iterator(); iter.hasNext();) { - Map.Entry entry = (Map.Entry) iter.next(); + for (Map.Entry<String, String> entry : properties.entrySet()) { super.put(entry.getKey(), entry.getValue()); } } @@ -220,15 +202,15 @@ public class OrderedProperties extends Dictionary implements Map { throw new UnsupportedOperationException(); } - public synchronized Object put(Object key, Object value) { + public synchronized String put(String key, String value) { throw new UnsupportedOperationException(); } - public synchronized Object remove(Object key) { + public synchronized String remove(Object key) { throw new UnsupportedOperationException(); } - public synchronized void putAll(Map t) { + public synchronized void putAll(Map<? extends String, ? extends String> t) { throw new UnsupportedOperationException(); } diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/StringHelper.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/StringHelper.java index c1995c27f..2d6a9e557 100644 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/StringHelper.java +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/StringHelper.java @@ -26,7 +26,7 @@ public class StringHelper { if (spec.length() > 0) resultArr = new String[] {spec}; } else { - List result = new ArrayList(); + List<String> result = new ArrayList<String>(); while (splitIdx >= 0) { String part = spec.substring(0, splitIdx).trim(); if (part.length() > 0) @@ -37,7 +37,7 @@ public class StringHelper { spec = spec.trim(); if (spec.length() > 0) result.add(spec); - resultArr = (String[]) result.toArray(new String[result.size()]); + resultArr = result.toArray(new String[result.size()]); } } return resultArr; diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/TarFile.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/TarFile.java index 5500bc765..4b4971236 100644 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/TarFile.java +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/TarFile.java @@ -70,13 +70,13 @@ public class TarFile { * * @return enumeration of all files in the archive */ - public Enumeration entries() { - return new Enumeration() { + public Enumeration<TarEntry> entries() { + return new Enumeration<TarEntry>() { public boolean hasMoreElements() { return (curEntry != null); } - public Object nextElement() { + public TarEntry nextElement() { TarEntry oldEntry = curEntry; try { curEntry = entryEnumerationStream.getNextEntry(); diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/IServiceUI.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/IServiceUI.java index 0b339d5a2..89fe5231e 100644 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/IServiceUI.java +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/IServiceUI.java @@ -24,6 +24,11 @@ import java.security.cert.Certificate; */ public interface IServiceUI { /** + * Service name constant for the UI service. + */ + public static final String SERVICE_NAME = IServiceUI.class.getName(); + + /** * Authentication information returned from an authentication prompt request. */ public static class AuthenticationInfo { diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/location/AgentLocation.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/location/AgentLocation.java deleted file mode 100644 index aacd84ac4..000000000 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/location/AgentLocation.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.provisional.p2.core.location; - -import java.net.URI; -import java.net.URL; - -public interface AgentLocation { - public static final String SERVICE_NAME = AgentLocation.class.getName(); - - public URI getArtifactRepositoryURI(); - - public URI getMetadataRepositoryURI(); - - /** - * Returns the location where the bundle with the given namespace - * may write its agent-related data. - * @param namespace The namespace of the bundle storing the data - * @return The data location - */ - public URL getDataArea(String namespace); - - /** - * Returns the actual {@link URL} of this location. If the location's value has been set, - * that value is returned. If the value is not set and the location allows defaults, - * the value is set to the default and returned. In all other cases <code>null</code> - * is returned. - * - * @return the URL for this location or <code>null</code> if none - */ - public URL getURL(); - -} diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/p2/core/IAgentLocation.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/p2/core/IAgentLocation.java new file mode 100644 index 000000000..13b18ab3a --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/p2/core/IAgentLocation.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (c) 2007, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.equinox.p2.core; + +import java.net.URI; + +/** + * An instance of this service represents the location of a provisioning agent's + * metadata. + * + * @noimplement This interface is not intended to be implemented by clients. + * @noextend This interface is not intended to be extended by clients. + * @since 2.0 + */ +public interface IAgentLocation { + /** + * Service name constant for the agent location service. + */ + public static final String SERVICE_NAME = IAgentLocation.class.getName(); + + /** + * Returns the location where the bundle with the given namespace + * may write its agent-related data. + * @param namespace The namespace of the bundle storing the data + * @return The data location + */ + public URI getDataArea(String namespace); + + /** + * Returns the root {@link URI} of the agent metadata. + * + * @return the location of the agent metadata + */ + public URI getRootLocation(); + +} diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/p2/core/IProvisioningAgent.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/p2/core/IProvisioningAgent.java index 6bcada44b..52e9470aa 100644 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/p2/core/IProvisioningAgent.java +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/p2/core/IProvisioningAgent.java @@ -25,10 +25,31 @@ import org.eclipse.equinox.p2.core.spi.IAgentServiceFactory; * </p> * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. - * @since 1.1 + * @since 2.0 */ public interface IProvisioningAgent { /** + * Service name constant for the agent service. Note that an agent obtained directly + * as a service typically represents the agent of the currently running system. To + * obtain an agent for a different system the {@link IProvisioningAgentProvider} + * service must be used. + */ + public static final String SERVICE_NAME = IProvisioningAgent.class.getName(); + + /** + * Service property identifying whether an agent is the default agent. + * + * <p> + * This property may be used by clients wishing to obtain or track the + * provisioning agent for the currently running system. When the value of + * this property is <code>"true"</code> then the corresponding service is + * the agent for the currently running system. If the property is undefined or + * has any other value, then the service is not the agent for the currently running system. + * </p> + */ + public static final String SERVICE_CURRENT = "agent.current"; //$NON-NLS-1$ + + /** * Returns the service with the given service name, or <code>null</code> * if no such service is available in this agent. */ @@ -43,6 +64,18 @@ public interface IProvisioningAgent { public void registerService(String serviceName, Object service); /** + * Stops the provisioning agent. This causes services provided by this + * agent to be cleaned up and discarded. No services provided by the agent + * should be referenced after the agent has been stopped, and subsequent + * attempts to obtain services after the agent has stopped will fail. + * <p> + * An agent should only be stopped by the client who first created the agent + * by invoking {@link IProvisioningAgentProvider#createAgent(java.net.URI)}. + * </p> + */ + public void stop(); + + /** * Unregisters a service that has previously been registered with this * agent via {@link #registerService(String, Object)}. This method has * no effect if no such service is registered with this agent. diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/p2/core/IProvisioningAgentProvider.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/p2/core/IProvisioningAgentProvider.java index b3067c00c..462b56d60 100644 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/p2/core/IProvisioningAgentProvider.java +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/p2/core/IProvisioningAgentProvider.java @@ -11,12 +11,11 @@ package org.eclipse.equinox.p2.core; import java.net.URI; -import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; /** * A service that is used to create or obtain instances of an * {@link IProvisioningAgent}. - * @since 1.1 + * @since 2.0 */ public interface IProvisioningAgentProvider { @@ -31,7 +30,10 @@ public interface IProvisioningAgentProvider { * currently running system is returned, if available. If a <code>null</code> * location is provided and the currently running system has not been provisioned * by any known agent, <code>null</code> is returned. - * + * <p> + * Callers of this method are responsible for stopping the agent + * when they are finished using it by invoking {@link IProvisioningAgent#stop()}. + * </p> * @param location The location where the agent metadata is stored * @return A provisioning agent, or <code>null</code> if a <code>null</code> * parameter is provided an there is no currently running agent. @@ -39,6 +41,7 @@ public interface IProvisioningAgentProvider { * <ul> * <li>The location is not writeable.</li> * </ul> + * @see IProvisioningAgent#stop() */ public IProvisioningAgent createAgent(URI location) throws ProvisionException; } diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/ProvisionException.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/p2/core/ProvisionException.java index dd1feee10..af5b6786a 100644 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/ProvisionException.java +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/p2/core/ProvisionException.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 IBM Corporation and others. + * Copyright (c) 2007, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -8,7 +8,7 @@ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ -package org.eclipse.equinox.internal.provisional.p2.core; +package org.eclipse.equinox.p2.core; import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.p2.core.Activator; @@ -18,6 +18,7 @@ import org.eclipse.equinox.internal.p2.core.Activator; * The status provides a further description of the problem. * * @noextend This class is not intended to be subclassed by clients. + * @since 2.0 */ public class ProvisionException extends CoreException { private static final long serialVersionUID = 1L; diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/p2/core/spi/IAgentServiceFactory.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/p2/core/spi/IAgentServiceFactory.java index 8fd467b67..0c1b7de12 100644 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/p2/core/spi/IAgentServiceFactory.java +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/p2/core/spi/IAgentServiceFactory.java @@ -16,7 +16,7 @@ import org.eclipse.equinox.p2.core.IProvisioningAgent; * A factory for creating a service that forms part of a provisioning agent instance. * Factories themselves are registered in the OSGi service registry so that they * can be obtained by a provisioning agent. - * @since 1.1 + * @since 2.0 */ public interface IAgentServiceFactory { /** |