diff options
author | Alexander Kurtakov | 2017-12-13 16:52:32 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2017-12-13 17:00:34 +0000 |
commit | ab3de3d3708d1df05a230037fdd3c0ac5488d696 (patch) | |
tree | 6b1b423049c5c542de5fcaf973d8d44e03704212 | |
parent | 5f3de8c6783a218911b7fbc70b63bc6c64abb8fb (diff) | |
download | eclipse.pde.build-ab3de3d3708d1df05a230037fdd3c0ac5488d696.tar.gz eclipse.pde.build-ab3de3d3708d1df05a230037fdd3c0ac5488d696.tar.xz eclipse.pde.build-ab3de3d3708d1df05a230037fdd3c0ac5488d696.zip |
Bug 528731 - Move pde.build tests to Java 8
Modernize as much as possible now.
Changed to standard eclipse formatter as the one defined was unmanaged
and reformatted license headers which should not happen.
Change-Id: I8e2283f091bdcf6c79fbca809caf4a7eecd283cd
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
20 files changed, 852 insertions, 799 deletions
diff --git a/org.eclipse.pde.build.tests/.classpath b/org.eclipse.pde.build.tests/.classpath index 2fbb7a23..eca7bdba 100644 --- a/org.eclipse.pde.build.tests/.classpath +++ b/org.eclipse.pde.build.tests/.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/J2SE-1.4"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="src" path="src"/> <classpathentry kind="output" path="bin"/> diff --git a/org.eclipse.pde.build.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.pde.build.tests/.settings/org.eclipse.jdt.core.prefs index c66a4892..16dffd0d 100644 --- a/org.eclipse.pde.build.tests/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.pde.build.tests/.settings/org.eclipse.jdt.core.prefs @@ -1,339 +1,424 @@ -#Tue Oct 26 11:16:56 EDT 2010 -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=ignore -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=warning -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 +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullable.secondary= +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.8 +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.problem.APILeak=warning +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +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=ignore org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore -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.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore -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=ignore -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.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +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.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullReference=ignore +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=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=ignore -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -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.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=true -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.terminalDeprecation=warning +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled +org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +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.unusedExceptionParameter=ignore +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.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -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.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -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.codeComplete.fieldSuffixes= -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 +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_annotation=0 +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_expressions_in_for_loop_header=0 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 +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_resources_in_try=80 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.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.alignment_for_type_arguments=0 +org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.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_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.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_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.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -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.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore -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=error -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=ignore -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_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_lambda_body=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore -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=warning -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.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.count_line_length_from_starting_position=true +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +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.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +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.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.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_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +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_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=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_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=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_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=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_after_opening_paren_in_switch=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.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.codeComplete.fieldPrefixes= -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_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=do not 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.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= -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.compiler.problem.includeNullInfoFromAsserts=disabled -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +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_lambda_arrow=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_try=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_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.codeComplete.localPrefixes= -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_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=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.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.codeComplete.localSuffixes= -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=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_try=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_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=ignore -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=disabled -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_default=do not insert org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.compiler.debug.sourceFile=generate +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_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_lambda_arrow=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.comment.indent_root_tags=true -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_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.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=disabled -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.compiler.problem.deadCode=warning +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_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=warning -org.eclipse.jdt.core.codeComplete.argumentPrefixes= -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.codeComplete.argumentSuffixes= -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_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.compiler.problem.unqualifiedFieldAccess=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=ignore -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +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.compiler.debug.lineNumber=generate -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=enabled -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_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_try=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_semicolon_in_try_resources=do not 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.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled -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=disabled -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=error -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.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.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore -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.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.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 +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=120 +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.parentheses_positions_in_annotation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/org.eclipse.pde.build.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.pde.build.tests/.settings/org.eclipse.jdt.ui.prefs index eaaaf822..1e8d7a7b 100644 --- a/org.eclipse.pde.build.tests/.settings/org.eclipse.jdt.ui.prefs +++ b/org.eclipse.pde.build.tests/.settings/org.eclipse.jdt.ui.prefs @@ -1,67 +1,71 @@ -#Thu Oct 22 11:32:25 EDT 2009 -sp_cleanup.add_missing_override_annotations=true -org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/> -sp_cleanup.convert_to_enhanced_for_loop=false -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true -sp_cleanup.remove_unnecessary_nls_tags=false +eclipse.preferences.version=1 editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -sp_cleanup.make_variable_declarations_final=true -sp_cleanup.add_generated_serial_version_id=false -sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +formatter_profile=org.eclipse.jdt.ui.default.eclipse_profile +formatter_settings_version=13 +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=; +org.eclipse.jdt.ui.javadoc=false +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=3 org.eclipse.jdt.ui.overrideannotation=true -sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +org.eclipse.jdt.ui.staticondemandthreshold=3 +org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><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_missing_override_annotations_interface_methods=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.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -sp_cleanup.remove_unused_private_methods=true -sp_cleanup.sort_members=false -org.eclipse.jdt.ui.keywordthis=false -sp_cleanup.remove_trailing_whitespaces=false -sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.convert_functional_interfaces=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.insert_inferred_type_arguments=false +sp_cleanup.make_local_variable_final=false sp_cleanup.make_parameters_final=false -sp_cleanup.remove_unused_private_members=false -org.eclipse.jdt.ui.staticondemandthreshold=3 sp_cleanup.make_private_fields_final=true -sp_cleanup.remove_unused_imports=false -sp_cleanup.make_local_variable_final=false -sp_cleanup.always_use_parentheses_in_expressions=false -sp_cleanup.remove_unnecessary_casts=true -sp_cleanup.use_this_for_non_static_method_access=false +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=false +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_redundant_type_arguments=false +sp_cleanup.remove_trailing_whitespaces=false sp_cleanup.remove_trailing_whitespaces_all=true -sp_cleanup.add_missing_deprecated_annotations=true -org.eclipse.jdt.ui.exception.name=e -sp_cleanup.add_missing_annotations=true -sp_cleanup.never_use_parentheses_in_expressions=true -formatter_profile=_core -sp_cleanup.format_source_code_changes_only=false -sp_cleanup.organize_imports=true -org.eclipse.jdt.ui.gettersetter.use.is=true -sp_cleanup.always_use_blocks=true -org.eclipse.jdt.ui.importorder=; -sp_cleanup.use_blocks=false -sp_cleanup.use_this_for_non_static_field_access=false -sp_cleanup.never_use_blocks=false -sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=false +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=false sp_cleanup.sort_members_all=false -sp_cleanup.add_missing_nls_tags=false -sp_cleanup.always_use_this_for_non_static_field_access=false -eclipse.preferences.version=1 -org.eclipse.jdt.ui.ondemandthreshold=3 -sp_cleanup.add_missing_methods=false -sp_cleanup.make_type_abstract_if_missing_method=false -sp_cleanup.format_source_code=true -sp_cleanup.add_missing_override_annotations_interface_methods=true +sp_cleanup.use_anonymous_class_creation=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_lambda=false sp_cleanup.use_parentheses_in_expressions=false -sp_cleanup.on_save_use_additional_actions=false -sp_cleanup.add_default_serial_version_id=true -sp_cleanup.remove_unused_local_variables=false -sp_cleanup.qualify_static_field_accesses_with_declaring_class=false -sp_cleanup.correct_indentation=false -sp_cleanup.remove_unused_private_fields=true -formatter_settings_version=11 -sp_cleanup.qualify_static_member_accesses_with_declaring_class=false -org.eclipse.jdt.ui.javadoc=false -org.eclipse.jdt.ui.ignorelowercasenames=true -sp_cleanup.add_serial_version_id=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/org.eclipse.pde.build.tests/META-INF/MANIFEST.MF b/org.eclipse.pde.build.tests/META-INF/MANIFEST.MF index 31703ad1..7dd88e57 100644 --- a/org.eclipse.pde.build.tests/META-INF/MANIFEST.MF +++ b/org.eclipse.pde.build.tests/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Tests Plug-in Bundle-SymbolicName: org.eclipse.pde.build.tests;singleton:=true -Bundle-Version: 1.1.900.qualifier +Bundle-Version: 1.2.0.qualifier Bundle-Activator: org.eclipse.pde.build.tests.Activator Export-Package: org.eclipse.pde.build.internal.tests;x-internal:=true, org.eclipse.pde.build.internal.tests.ant;x-internal:=true, @@ -17,7 +17,7 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.debug.core, org.eclipse.equinox.p2.publisher;bundle-version="1.1.0", org.eclipse.equinox.p2.publisher.eclipse;bundle-version="1.0.0" -Bundle-RequiredExecutionEnvironment: J2SE-1.4 +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: org.eclipse.equinox.frameworkadmin;version="2.0.0", org.eclipse.equinox.internal.p2.artifact.repository, org.eclipse.equinox.internal.p2.core.helpers, diff --git a/org.eclipse.pde.build.tests/pom.xml b/org.eclipse.pde.build.tests/pom.xml index 116bda42..cb3e84ec 100644 --- a/org.eclipse.pde.build.tests/pom.xml +++ b/org.eclipse.pde.build.tests/pom.xml @@ -18,7 +18,7 @@ </parent> <groupId>org.eclipse.pde</groupId> <artifactId>org.eclipse.pde.build.tests</artifactId> - <version>1.1.900-SNAPSHOT</version> + <version>1.2.0-SNAPSHOT</version> <packaging>eclipse-test-plugin</packaging> <properties> <skipTests>true</skipTests> diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/AssembleTests.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/AssembleTests.java index 53e68ee7..95c91e62 100644 --- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/AssembleTests.java +++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/AssembleTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2013 IBM Corporation and others. All rights reserved. + * Copyright (c) 2007, 2017 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 @@ -182,7 +182,7 @@ public class AssembleTests extends PDETestCase { runBuild(buildFolder); - Set entries = new HashSet(); + Set<String> entries = new HashSet<>(); entries.add("eclipse/plugins/A_1.0.0.jar"); entries.add("eclipse/plugins/B_1.0.0/META-INF/MANIFEST.MF"); assertZipContents(buildFolder, "I.TestBuild/F-TestBuild.zip", entries); diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/FetchTests.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/FetchTests.java index 8542500c..b6009dd8 100644 --- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/FetchTests.java +++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/FetchTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 IBM Corporation and others. All rights reserved. + * Copyright (c) 2007, 2017 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 @@ -244,7 +244,7 @@ public class FetchTests extends PDETestCase { URL mapFile = FileLocator.find(Platform.getBundle("org.eclipse.pde.build.tests"), new Path("/resources/p2.get/directory.txt.template"), null); URL repoLocation = FileLocator.find(Platform.getBundle("org.eclipse.pde.build.tests"), new Path("/resources/repos/1"), null); repoLocation = FileLocator.resolve(repoLocation); - Map replacements = new HashMap(); + Map<String, String> replacements = new HashMap<>(); replacements.put("repoLocation", repoLocation.toExternalForm()); Utils.transferAndReplace(mapFile, buildFolder.getFile("directory.txt"), replacements); diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ProductTests.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ProductTests.java index 3d2cbc19..ed40ffdf 100644 --- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ProductTests.java +++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ProductTests.java @@ -59,7 +59,7 @@ public class ProductTests extends PDETestCase { runBuild(buildFolder); - Set entries = new HashSet(); + Set<String> entries = new HashSet<>(); entries.add("eclipse/.eclipseproduct"); entries.add("eclipse/configuration/config.ini"); entries.add("eclipse/rcp.app/Contents/Info.plist"); @@ -91,7 +91,7 @@ public class ProductTests extends PDETestCase { runProductBuild(buildFolder); - Set entries = new HashSet(); + Set<String> entries = new HashSet<>(); entries.add("eclipse/pablo.exe"); entries.add("eclipse/configuration/config.ini"); @@ -152,10 +152,10 @@ public class ProductTests extends PDETestCase { IFile assembleScript = buildFolder.getFile("assemble.F.win32.win32.x86.xml"); - Map alternateTasks = new HashMap(); + Map<String, String> alternateTasks = new HashMap<>(); alternateTasks.put("eclipse.brand", "org.eclipse.pde.build.internal.tests.ant.TestBrandTask"); Project antProject = assertValidAntScript(assembleScript, alternateTasks); - Target main = (Target) antProject.getTargets().get("main"); + Target main = antProject.getTargets().get("main"); assertNotNull(main); TestBrandTask brand = (TestBrandTask) AntUtils.getFirstChildByName(main, "eclipse.brand"); assertNotNull(brand); @@ -163,7 +163,7 @@ public class ProductTests extends PDETestCase { assertTrue(brand.icons.indexOf("mail.ico") > 0); //bug 178928 - Target gather = (Target) antProject.getTargets().get("gather.bin.parts"); + Target gather = antProject.getTargets().get("gather.bin.parts"); Task[] subTasks = gather.getTasks(); assertEquals(subTasks.length, 2); } @@ -229,11 +229,7 @@ public class ProductTests extends PDETestCase { File delta = Utils.findDeltaPack(); assertNotNull(delta); - FilenameFilter filter = new FilenameFilter() { - public boolean accept(File dir, String name) { - return name.startsWith("org.eclipse.equinox.executable"); - } - }; + FilenameFilter filter = (dir, name) -> name.startsWith("org.eclipse.equinox.executable"); File[] files = new File(delta, "features").listFiles(filter); File win32Exe = new File(files[0], "bin/win32/win32/x86/launcher.exe"); @@ -253,12 +249,12 @@ public class ProductTests extends PDETestCase { //IconExe prints to stderr, redirect that to a file PrintStream oldErr = System.err; - PrintStream newErr = new PrintStream(new FileOutputStream(buildFolder.getLocation().toOSString() + "/out.out")); - System.setErr(newErr); - IconExe.main(new String[] {win32File.getLocation().toOSString(), icoFile.getLocation().toOSString()}); - IconExe.main(new String[] {win64File.getLocation().toOSString(), icoFile.getLocation().toOSString()}); - System.setErr(oldErr); - newErr.close(); + try (PrintStream newErr = new PrintStream(new FileOutputStream(buildFolder.getLocation().toOSString() + "/out.out"))) { + System.setErr(newErr); + IconExe.main(new String[] {win32File.getLocation().toOSString(), icoFile.getLocation().toOSString()}); + IconExe.main(new String[] {win64File.getLocation().toOSString(), icoFile.getLocation().toOSString()}); + System.setErr(oldErr); + } assertEquals(0, new File(buildFolder.getLocation().toOSString(), "out.out").length()); } @@ -269,7 +265,7 @@ public class ProductTests extends PDETestCase { Utils.generateFeature(buildFolder, "f", null, new String[] {"a", "b", "c", "d"}); Utils.generateProduct(product, null, "1.0.0", null, new String[] {"f"}, true); - AssembleScriptGenerator.setConfigInfo("win32,win32,x86 & linux,gtk,x86"); + AbstractScriptGenerator.setConfigInfo("win32,win32,x86 & linux,gtk,x86"); Config win32 = new Config("win32,win32,x86"); Config linux = new Config("linux, gtk, x86"); AssemblyInformation assembly = new AssemblyInformation(); @@ -337,11 +333,7 @@ public class ProductTests extends PDETestCase { FileUtils.unzipFile(buildFolder.getFile("I.TestBuild/eclipse-win32.win32.x86.zip").getLocation().toFile(), tmp.getLocation().toFile()); File file = buildFolder.getFolder("tmp/eclipse/plugins").getLocation().toFile(); - String[] a = file.list(new FilenameFilter() { - public boolean accept(File dir, String name) { - return name.startsWith("A_1.0.0.v"); - } - }); + String[] a = file.list((dir, name) -> name.startsWith("A_1.0.0.v")); assertTrue(a.length == 1); String bundleString = a[0].substring(0, a[0].length() - 4); //trim .jar @@ -446,10 +438,10 @@ public class ProductTests extends PDETestCase { ProductFile productFile = new ProductFile(product.getLocation().toOSString(), null); assertEquals(productFile.getVersion(), "1.2.3.va"); - Iterator i = productFile.getProductEntries().iterator(); - assertEquals(((FeatureEntry) i.next()).getVersion(), "1.2.3"); - assertEquals(((FeatureEntry) i.next()).getVersion(), "2.3.4"); - assertEquals(((FeatureEntry) i.next()).getVersion(), "1.2.1"); + Iterator<FeatureEntry> i = productFile.getProductEntries().iterator(); + assertEquals(i.next().getVersion(), "1.2.3"); + assertEquals(i.next().getVersion(), "2.3.4"); + assertEquals(i.next().getVersion(), "1.2.1"); } public void testBug262324() throws Exception { @@ -573,7 +565,7 @@ public class ProductTests extends PDETestCase { runProductBuild(buildFolder); - Set entries = new HashSet(); + Set<String> entries = new HashSet<>(); entries.add("eclipse/plugins/A_1.0.0.jar"); entries.add("eclipse/rcp.exe"); assertZipContents(buildFolder, "I.TestBuild/eclipse-win32.win32.x86.zip", entries); diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java index 24cb3646..8e648842 100644 --- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java +++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2014 IBM Corporation and others. All rights reserved. + * Copyright (c) 2007, 2017 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 @@ -56,7 +56,8 @@ public class ScriptGenerationTests extends PDETestCase { IProject buildProject = newTest(); class MyBuildScriptGenerator extends BuildScriptGenerator { - public HashMap getArchivesFormat() { + @Override + public HashMap<Config, String> getArchivesFormat() { return super.getArchivesFormat(); } }; @@ -70,9 +71,9 @@ public class ScriptGenerationTests extends PDETestCase { generator.setArchivesFormat("win32, win32, x86 - antZip"); generator.generate(); - HashMap map = generator.getArchivesFormat(); + HashMap<Config, String> map = generator.getArchivesFormat(); assertEquals(map.size(), 1); - Config config = (Config) map.keySet().iterator().next(); + Config config = map.keySet().iterator().next(); assertEquals(map.get(config), "antZip"); clearStatics(); @@ -87,7 +88,7 @@ public class ScriptGenerationTests extends PDETestCase { map = generator.getArchivesFormat(); assertEquals(map.size(), 1); - config = (Config) map.keySet().iterator().next(); + config = map.keySet().iterator().next(); assertEquals(map.get(config), "folder"); } @@ -141,6 +142,7 @@ public class ScriptGenerationTests extends PDETestCase { String baseLocation = Platform.getInstallLocation().getURL().getPath(); File features = new File(baseLocation, "features"); FileFilter filter = new FileFilter() { + @Override public boolean accept(File pathname) { return pathname.getName().startsWith("org.eclipse.rcp_"); } @@ -152,7 +154,7 @@ public class ScriptGenerationTests extends PDETestCase { // copy platform.xml and set the baseLocation and rcp version IFile sourceXML = buildFolder.getFile("platform.xml"); - Map replacements = new HashMap(); + Map<String, String> replacements = new HashMap<>(); replacements.put("BASE_LOCATION", baseLocation); replacements.put("RCP_VERSION", version); Utils.transferAndReplace(sourceXML.getLocationURI().toURL(), configFolder.getFile("platform.xml"), replacements); @@ -300,7 +302,7 @@ public class ScriptGenerationTests extends PDETestCase { IFile buildScript = buildFolder.getFile("build.xml"); Project antProject = assertValidAntScript(buildScript); - Target dot = (Target) antProject.getTargets().get("@dot"); + Target dot = antProject.getTargets().get("@dot"); assertNotNull(dot); Object child = AntUtils.getFirstChildByName(dot, "path"); assertNotNull(child); @@ -326,7 +328,7 @@ public class ScriptGenerationTests extends PDETestCase { IFile buildScript = buildFolder.getFile("build.xml"); Project antProject = assertValidAntScript(buildScript); - Target dot = (Target) antProject.getTargets().get("@dot"); + Target dot = antProject.getTargets().get("@dot"); assertNotNull(dot); Object child = AntUtils.getFirstChildByName(dot, "path"); assertNotNull(child); @@ -376,7 +378,7 @@ public class ScriptGenerationTests extends PDETestCase { //from the state by the filtering, check that is isn't in the classpath IFile buildScript = bundleFolder.getFile("build.xml"); Project antProject = assertValidAntScript(buildScript); - Target dot = (Target) antProject.getTargets().get("@dot"); + Target dot = antProject.getTargets().get("@dot"); Object child = AntUtils.getFirstChildByName(dot, "path"); assertTrue(child instanceof Path); String path = child.toString(); @@ -771,7 +773,7 @@ public class ScriptGenerationTests extends PDETestCase { IFile buildScript = buildFolder.getFile("compile.feature.xml"); Project antProject = assertValidAntScript(buildScript); - Target main = (Target) antProject.getTargets().get("main"); + Target main = antProject.getTargets().get("main"); assertNotNull(main); Object[] children = AntUtils.getChildrenByName(main, "parallel"); assertTrue(children.length == 4); @@ -920,7 +922,7 @@ public class ScriptGenerationTests extends PDETestCase { Utils.storeBuildProperties(buildFolder, properties); runBuild(buildFolder); - Set entries = new HashSet(); + Set<String> entries = new HashSet<>(); entries.add("plugins/P1_1.0.0/@dot.log"); entries.add("plugins/P2_1.0.0/@dot.log"); assertZipContents(f1, "F1_1.0.0.log.zip", entries); @@ -1014,14 +1016,14 @@ public class ScriptGenerationTests extends PDETestCase { Utils.writeBuffer(custom.getFile("profiles/my.profile"), buffer); Utils.writeBuffer(custom.getFile("profile.list"), new StringBuffer("java.profiles=profiles/my.profile\n")); - ZipOutputStream jar = new ZipOutputStream(new FileOutputStream(new File(custom.getLocation().toOSString() + ".jar"))); - jar.putNextEntry(new ZipEntry(JarFile.MANIFEST_NAME)); - Utils.transferStreams(custom.getFile(JarFile.MANIFEST_NAME).getContents(), true, jar, false); - jar.putNextEntry(new ZipEntry("profile.list")); - Utils.transferStreams(custom.getFile("profile.list").getContents(), true, jar, false); - jar.putNextEntry(new ZipEntry("profiles/my.profile")); - Utils.transferStreams(custom.getFile("profiles/my.profile").getContents(), true, jar, false); - jar.close(); + try (ZipOutputStream jar = new ZipOutputStream(new FileOutputStream(new File(custom.getLocation().toOSString() + ".jar")))) { + jar.putNextEntry(new ZipEntry(JarFile.MANIFEST_NAME)); + Utils.transferStreams(custom.getFile(JarFile.MANIFEST_NAME).getContents(), true, jar, false); + jar.putNextEntry(new ZipEntry("profile.list")); + Utils.transferStreams(custom.getFile("profile.list").getContents(), true, jar, false); + jar.putNextEntry(new ZipEntry("profiles/my.profile")); + Utils.transferStreams(custom.getFile("profiles/my.profile").getContents(), true, jar, false); + } custom.delete(true, null); @@ -1085,7 +1087,7 @@ public class ScriptGenerationTests extends PDETestCase { Utils.storeBuildProperties(buildFolder, properties); runBuild(buildFolder); - Set zipEntries = new HashSet(); + Set<String> zipEntries = new HashSet<>(); zipEntries.add("eclipse/1"); zipEntries.add("eclipse/sub/2"); zipEntries.add("eclipse/3"); @@ -1134,13 +1136,9 @@ public class ScriptGenerationTests extends PDETestCase { runAntScript(buildXMLPath, new String[] {"build.update.jar"}, buildFolder.getLocation().toOSString(), null); assertResourceFile(bundle, "bundle_1.0.0.jar"); - JarFile jar = null; - try { - jar = new JarFile(bundle.getFile("bundle_1.0.0.jar").getLocation().toFile()); + try (JarFile jar = new JarFile(bundle.getFile("bundle_1.0.0.jar").getLocation().toFile());) { Manifest manifest = jar.getManifest(); assertEquals(manifest.getMainAttributes().getValue("Bundle-SymbolicName"), "bundle"); - } finally { - jar.close(); } } @@ -1226,7 +1224,7 @@ public class ScriptGenerationTests extends PDETestCase { Utils.storeBuildProperties(buildFolder, properties); runBuild(buildFolder); - Set zipEntries = new HashSet(); + Set<String> zipEntries = new HashSet<>(); zipEntries.add("plugins/p1_1.0.0.jar"); zipEntries.add("plugins/p2_1.0.0.jar"); assertZipContents(buildFolder, "I.TestBuild/f-TestBuild.zip", zipEntries); @@ -1260,15 +1258,11 @@ public class ScriptGenerationTests extends PDETestCase { zipEntries.add("plugins/p2_1.0.0.jar.pack.gz"); assertZipContents(buildFolder, "I.TestBuild/f-TestBuild.zip", zipEntries); - java.util.zip.ZipFile zip = null; File tempJar = new File(zipFile.getParentFile(), "temp.jar"); - try { - zip = new java.util.zip.ZipFile(zipFile); + try (java.util.zip.ZipFile zip = new java.util.zip.ZipFile(zipFile)) { ZipEntry entry = zip.getEntry("plugins/p1_1.0.0.jar"); OutputStream output = new BufferedOutputStream(new FileOutputStream(tempJar)); Utils.transferStreams(zip.getInputStream(entry), true, output, true); - } finally { - zip.close(); } assertJarVerifies(tempJar, true); } @@ -1699,6 +1693,7 @@ public class ScriptGenerationTests extends PDETestCase { antProperties.put(IBuildPropertiesConstants.PROPERTY_PACKAGER_AS_NORMALIZER, "true"); BuildScriptGenerator generator = new BuildScriptGenerator() { + @Override public void setImmutableAntProperties(Properties properties) { AbstractScriptGenerator.setStaticAntProperties(properties); } @@ -1742,37 +1737,37 @@ public class ScriptGenerationTests extends PDETestCase { Project antProject = assertValidAntScript(buildScript); // check the excludes directive for copying files over - Target dot = (Target) antProject.getTargets().get("@dot"); + Target dot = antProject.getTargets().get("@dot"); Copy copyChild = (Copy) AntUtils.getFirstChildByName(dot, "copy"); - Enumeration rc = ((RuntimeConfigurable) copyChild.getRuntimeConfigurableWrapper().getChildren().nextElement()).getChildren(); - RuntimeConfigurable configurable = (RuntimeConfigurable) rc.nextElement(); + Enumeration<RuntimeConfigurable> rc = copyChild.getRuntimeConfigurableWrapper().getChildren().nextElement().getChildren(); + RuntimeConfigurable configurable = rc.nextElement(); assertEquals(configurable.getElementTag(), "exclude"); assertEquals(configurable.getAttributeMap().get("name"), "**/*.java"); - assertEquals(((RuntimeConfigurable) rc.nextElement()).getAttributeMap().get("name"), "**/*.aj"); - assertEquals(((RuntimeConfigurable) rc.nextElement()).getAttributeMap().get("name"), "**/*.groovy"); - assertEquals(((RuntimeConfigurable) rc.nextElement()).getAttributeMap().get("name"), "**/package.htm*"); + assertEquals(rc.nextElement().getAttributeMap().get("name"), "**/*.aj"); + assertEquals(rc.nextElement().getAttributeMap().get("name"), "**/*.groovy"); + assertEquals(rc.nextElement().getAttributeMap().get("name"), "**/package.htm*"); assertFalse("Should have only found 4 filter elements", rc.hasMoreElements()); // check the includes directive for copying source files - Target copySource = (Target) antProject.getTargets().get("copy.src.zip"); + Target copySource = antProject.getTargets().get("copy.src.zip"); copyChild = (Copy) AntUtils.getFirstChildByName(copySource, "copy"); - rc = ((RuntimeConfigurable) copyChild.getRuntimeConfigurableWrapper().getChildren().nextElement()).getChildren(); - configurable = (RuntimeConfigurable) rc.nextElement(); + rc = copyChild.getRuntimeConfigurableWrapper().getChildren().nextElement().getChildren(); + configurable = rc.nextElement(); assertEquals(configurable.getElementTag(), "include"); assertEquals(configurable.getAttributeMap().get("name"), "**/*.java"); - assertEquals(((RuntimeConfigurable) rc.nextElement()).getAttributeMap().get("name"), "**/*.aj"); - assertEquals(((RuntimeConfigurable) rc.nextElement()).getAttributeMap().get("name"), "**/*.groovy"); + assertEquals(rc.nextElement().getAttributeMap().get("name"), "**/*.aj"); + assertEquals(rc.nextElement().getAttributeMap().get("name"), "**/*.groovy"); assertFalse("Should have only found 3 filter elements", rc.hasMoreElements()); // check the includes directive for zipping source files - Target zipSource = (Target) antProject.getTargets().get("zip.src.zip"); + Target zipSource = antProject.getTargets().get("zip.src.zip"); Zip zipChild = (Zip) AntUtils.getFirstChildByName(zipSource, "zip"); - rc = ((RuntimeConfigurable) zipChild.getRuntimeConfigurableWrapper().getChildren().nextElement()).getChildren(); - configurable = (RuntimeConfigurable) rc.nextElement(); + rc = zipChild.getRuntimeConfigurableWrapper().getChildren().nextElement().getChildren(); + configurable = rc.nextElement(); assertEquals(configurable.getElementTag(), "include"); assertEquals(configurable.getAttributeMap().get("name"), "**/*.java"); - assertEquals(((RuntimeConfigurable) rc.nextElement()).getAttributeMap().get("name"), "**/*.aj"); - assertEquals(((RuntimeConfigurable) rc.nextElement()).getAttributeMap().get("name"), "**/*.groovy"); + assertEquals(rc.nextElement().getAttributeMap().get("name"), "**/*.aj"); + assertEquals(rc.nextElement().getAttributeMap().get("name"), "**/*.groovy"); assertFalse("Should have only found 3 filter elements", rc.hasMoreElements()); } @@ -1798,25 +1793,25 @@ public class ScriptGenerationTests extends PDETestCase { Project antProject = assertValidAntScript(buildScript); // check the excludes directive for copying files over - Target dot = (Target) antProject.getTargets().get("@dot"); + Target dot = antProject.getTargets().get("@dot"); Copy copyChild = (Copy) AntUtils.getFirstChildByName(dot, "copy"); - Enumeration rc = ((RuntimeConfigurable) copyChild.getRuntimeConfigurableWrapper().getChildren().nextElement()).getChildren(); - assertEquals(((RuntimeConfigurable) rc.nextElement()).getAttributeMap().get("name"), "**/*.java"); - assertEquals(((RuntimeConfigurable) rc.nextElement()).getAttributeMap().get("name"), "**/package.htm*"); + Enumeration<RuntimeConfigurable> rc = copyChild.getRuntimeConfigurableWrapper().getChildren().nextElement().getChildren(); + assertEquals(rc.nextElement().getAttributeMap().get("name"), "**/*.java"); + assertEquals(rc.nextElement().getAttributeMap().get("name"), "**/package.htm*"); assertFalse("Should have only found 2 filter elements", rc.hasMoreElements()); // check the includes directive for copying source files - Target copySource = (Target) antProject.getTargets().get("copy.src.zip"); + Target copySource = antProject.getTargets().get("copy.src.zip"); copyChild = (Copy) AntUtils.getFirstChildByName(copySource, "copy"); - rc = ((RuntimeConfigurable) copyChild.getRuntimeConfigurableWrapper().getChildren().nextElement()).getChildren(); - assertEquals(((RuntimeConfigurable) rc.nextElement()).getAttributeMap().get("name"), "**/*.java"); + rc = copyChild.getRuntimeConfigurableWrapper().getChildren().nextElement().getChildren(); + assertEquals(rc.nextElement().getAttributeMap().get("name"), "**/*.java"); assertFalse("Should have only found 1 filter elements", rc.hasMoreElements()); // check the includes directive for zipping source files - Target zipSource = (Target) antProject.getTargets().get("zip.src.zip"); + Target zipSource = antProject.getTargets().get("zip.src.zip"); Zip zipChild = (Zip) AntUtils.getFirstChildByName(zipSource, "zip"); - rc = ((RuntimeConfigurable) zipChild.getRuntimeConfigurableWrapper().getChildren().nextElement()).getChildren(); - assertEquals(((RuntimeConfigurable) rc.nextElement()).getAttributeMap().get("name"), "**/*.java"); + rc = zipChild.getRuntimeConfigurableWrapper().getChildren().nextElement().getChildren(); + assertEquals(rc.nextElement().getAttributeMap().get("name"), "**/*.java"); assertFalse("Should have only found 1 filter elements", rc.hasMoreElements()); } @@ -1839,7 +1834,7 @@ public class ScriptGenerationTests extends PDETestCase { IFile buildxml = plugin.getFile("build.xml"); Project antProject = assertValidAntScript(buildxml); - Target dot = (Target) antProject.getTargets().get("@dot"); + Target dot = antProject.getTargets().get("@dot"); Javac javac = (Javac) AntUtils.getFirstChildByName(dot, "javac"); Object compiler = javac.getRuntimeConfigurableWrapper().getAttributeMap().get("compiler"); assertEquals("Incorrect compiler adapter", "org.foo.someCompilerAdapter", compiler); @@ -1864,13 +1859,13 @@ public class ScriptGenerationTests extends PDETestCase { IFile buildxml = plugin.getFile("build.xml"); Project antProject = assertValidAntScript(buildxml); - Target dot = (Target) antProject.getTargets().get("@dot"); + Target dot = antProject.getTargets().get("@dot"); Javac javac = (Javac) AntUtils.getFirstChildByName(dot, "javac"); // check that the build file contains the expected lines - Enumeration en = javac.getRuntimeConfigurableWrapper().getChildren(); + Enumeration<RuntimeConfigurable> en = javac.getRuntimeConfigurableWrapper().getChildren(); while (en.hasMoreElements()) { - RuntimeConfigurable rc = (RuntimeConfigurable) en.nextElement(); + RuntimeConfigurable rc = en.nextElement(); if ("compilerarg".equals(rc.getElementTag())) { if (rc.getAttributeMap().containsKey("line") && "-log '${build.result.folder}/@dot${logExtension}'".equals(rc.getAttributeMap().get("line")) && "org.foo.someCompilerAdapter".equals(rc.getAttributeMap().get("compiler"))) { return; @@ -1900,13 +1895,13 @@ public class ScriptGenerationTests extends PDETestCase { IFile buildxml = plugin.getFile("build.xml"); Project antProject = assertValidAntScript(buildxml); - Target dot = (Target) antProject.getTargets().get("@dot"); + Target dot = antProject.getTargets().get("@dot"); Javac javac = (Javac) AntUtils.getFirstChildByName(dot, "javac"); // check that the build file contains the expected lines - Enumeration en = javac.getRuntimeConfigurableWrapper().getChildren(); + Enumeration<RuntimeConfigurable> en = javac.getRuntimeConfigurableWrapper().getChildren(); while (en.hasMoreElements()) { - RuntimeConfigurable rc = (RuntimeConfigurable) en.nextElement(); + RuntimeConfigurable rc = en.nextElement(); if ("compilerarg".equals(rc.getElementTag())) { if (rc.getAttributeMap().containsKey("line") && "-log '${build.result.folder}/@dot${logExtension}'".equals(rc.getAttributeMap().get("line")) && "org.foo.someCompilerAdapter".equals(rc.getAttributeMap().get("compiler"))) { return; @@ -1936,13 +1931,13 @@ public class ScriptGenerationTests extends PDETestCase { IFile buildxml = plugin.getFile("build.xml"); Project antProject = assertValidAntScript(buildxml); - Target dot = (Target) antProject.getTargets().get("@dot"); + Target dot = antProject.getTargets().get("@dot"); Javac javac = (Javac) AntUtils.getFirstChildByName(dot, "javac"); // check that the build file contains the expected lines - Enumeration en = javac.getRuntimeConfigurableWrapper().getChildren(); + Enumeration<RuntimeConfigurable> en = javac.getRuntimeConfigurableWrapper().getChildren(); while (en.hasMoreElements()) { - RuntimeConfigurable rc = (RuntimeConfigurable) en.nextElement(); + RuntimeConfigurable rc = en.nextElement(); if ("compilerarg".equals(rc.getElementTag())) { if (rc.getAttributeMap().containsKey("line") && "-log '${build.result.folder}/@dot${logExtension}'".equals(rc.getAttributeMap().get("line")) && "org.foo.someCompilerAdapter".equals(rc.getAttributeMap().get("compiler"))) { fail("Should not have found compiler log entry:\n-log '${build.result.folder}/@dot${logExtension}'"); @@ -1971,13 +1966,13 @@ public class ScriptGenerationTests extends PDETestCase { IFile buildxml = plugin.getFile("build.xml"); Project antProject = assertValidAntScript(buildxml); - Target dot = (Target) antProject.getTargets().get("@dot"); + Target dot = antProject.getTargets().get("@dot"); Javac javac = (Javac) AntUtils.getFirstChildByName(dot, "javac"); // check that the build file contains the expected lines - Enumeration en = javac.getRuntimeConfigurableWrapper().getChildren(); + Enumeration<RuntimeConfigurable> en = javac.getRuntimeConfigurableWrapper().getChildren(); while (en.hasMoreElements()) { - RuntimeConfigurable rc = (RuntimeConfigurable) en.nextElement(); + RuntimeConfigurable rc = en.nextElement(); if ("compilerarg".equals(rc.getElementTag())) { if (rc.getAttributeMap().containsKey("value") && "@${basedir}/javaCompiler...args".equals(rc.getAttributeMap().get("value")) && "org.foo.someCompilerAdapter".equals(rc.getAttributeMap().get("compiler"))) { return; @@ -2008,13 +2003,13 @@ public class ScriptGenerationTests extends PDETestCase { IFile buildxml = plugin.getFile("build.xml"); Project antProject = assertValidAntScript(buildxml); - Target dot = (Target) antProject.getTargets().get("@dot"); + Target dot = antProject.getTargets().get("@dot"); Javac javac = (Javac) AntUtils.getFirstChildByName(dot, "javac"); // check that the build file contains the expected lines - Enumeration en = javac.getRuntimeConfigurableWrapper().getChildren(); + Enumeration<RuntimeConfigurable> en = javac.getRuntimeConfigurableWrapper().getChildren(); while (en.hasMoreElements()) { - RuntimeConfigurable rc = (RuntimeConfigurable) en.nextElement(); + RuntimeConfigurable rc = en.nextElement(); if ("compilerarg".equals(rc.getElementTag())) { if (rc.getAttributeMap().containsKey("value") && "@${basedir}/javaCompiler...args".equals(rc.getAttributeMap().get("value")) && "org.foo.someCompilerAdapter".equals(rc.getAttributeMap().get("compiler"))) { return; @@ -2045,13 +2040,13 @@ public class ScriptGenerationTests extends PDETestCase { IFile buildxml = plugin.getFile("build.xml"); Project antProject = assertValidAntScript(buildxml); - Target dot = (Target) antProject.getTargets().get("@dot"); + Target dot = antProject.getTargets().get("@dot"); Javac javac = (Javac) AntUtils.getFirstChildByName(dot, "javac"); // check that the build file contains the expected lines - Enumeration en = javac.getRuntimeConfigurableWrapper().getChildren(); + Enumeration<RuntimeConfigurable> en = javac.getRuntimeConfigurableWrapper().getChildren(); while (en.hasMoreElements()) { - RuntimeConfigurable rc = (RuntimeConfigurable) en.nextElement(); + RuntimeConfigurable rc = en.nextElement(); if ("compilerarg".equals(rc.getElementTag())) { if (rc.getAttributeMap().containsKey("value") && "@${basedir}/javaCompiler...args".equals(rc.getAttributeMap().get("value")) && "org.foo.someCompilerAdapter".equals(rc.getAttributeMap().get("compiler"))) { fail("Should not have found compiler log entry:\n@${basedir}/javaCompiler...args"); @@ -2078,13 +2073,13 @@ public class ScriptGenerationTests extends PDETestCase { assertResourceFile(plugin, "build.xml"); IFile buildxml = plugin.getFile("build.xml"); Project antProject = assertValidAntScript(buildxml); - Target dot = (Target) antProject.getTargets().get("@dot"); + Target dot = antProject.getTargets().get("@dot"); Javac javac = (Javac) AntUtils.getFirstChildByName(dot, "javac"); // check that the build file contains the expected lines - Enumeration en = javac.getRuntimeConfigurableWrapper().getChildren(); + Enumeration<RuntimeConfigurable> en = javac.getRuntimeConfigurableWrapper().getChildren(); while (en.hasMoreElements()) { - RuntimeConfigurable rc = (RuntimeConfigurable) en.nextElement(); + RuntimeConfigurable rc = en.nextElement(); if ("compilerarg".equals(rc.getElementTag())) { if (rc.getAttributeMap().containsKey("line") && "-foo -bar baz".equals(rc.getAttributeMap().get("line"))) { return; @@ -2113,13 +2108,13 @@ public class ScriptGenerationTests extends PDETestCase { assertResourceFile(plugin, "build.xml"); IFile buildxml = plugin.getFile("build.xml"); Project antProject = assertValidAntScript(buildxml); - Target dot = (Target) antProject.getTargets().get("@dot"); + Target dot = antProject.getTargets().get("@dot"); Javac javac = (Javac) AntUtils.getFirstChildByName(dot, "javac"); // check that the build file contains the expected lines - Enumeration en = javac.getRuntimeConfigurableWrapper().getChildren(); + Enumeration<RuntimeConfigurable> en = javac.getRuntimeConfigurableWrapper().getChildren(); while (en.hasMoreElements()) { - RuntimeConfigurable rc = (RuntimeConfigurable) en.nextElement(); + RuntimeConfigurable rc = en.nextElement(); if ("compilerarg".equals(rc.getElementTag())) { if (rc.getAttributeMap().containsKey("line") && "-foo -bar baz".equals(rc.getAttributeMap().get("line")) && "org.foo.someCompilerAdapter".equals(rc.getAttributeMap().get("compiler"))) { return; diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/SourceTests.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/SourceTests.java index f19d6196..662f14e5 100644 --- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/SourceTests.java +++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/SourceTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2013 IBM Corporation and others. All rights reserved. + * Copyright (c) 2007, 2017 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 @@ -68,7 +68,7 @@ public class SourceTests extends PDETestCase { runBuild(buildFolder); - Set entries = new HashSet(); + Set<String> entries = new HashSet<>(); entries.add("eclipse/features/a.feature.sdk_1.0.0/feature.xml"); entries.add("eclipse/features/a.feature.source_1.0.0/feature.xml"); entries.add("eclipse/plugins/a.feature.source_1.0.0/src/a.plugin_1.0.0/src.zip"); @@ -81,6 +81,7 @@ public class SourceTests extends PDETestCase { } // test that generated source fragments have a proper platform filter + @SuppressWarnings("unchecked") public void testBug184517() throws Exception { IFolder buildFolder = newTest("184517"); IFolder features = Utils.createFolder(buildFolder, "features"); @@ -116,19 +117,20 @@ public class SourceTests extends PDETestCase { // check the manifest for a correct platform filter assertResourceFile(sourceFragment, "META-INF/MANIFEST.MF"); - InputStream stream = new BufferedInputStream(sourceFragment.getFile("META-INF/MANIFEST.MF").getLocationURI().toURL().openStream()); - Manifest manifest = new Manifest(stream); - stream.close(); + try (InputStream stream = new BufferedInputStream(sourceFragment.getFile("META-INF/MANIFEST.MF").getLocationURI().toURL().openStream())) { + Manifest manifest = new Manifest(stream); + String filter = manifest.getMainAttributes().getValue("Eclipse-PlatformFilter"); + assertTrue(filter.length() > 0); + properties = new Properties(); + properties.put("osgi.os", os); + properties.put("osgi.ws", ws); + properties.put("osgi.arch", arch); + // In 1.6 VMs properties is not casted correctly to dictionary causing a compilation error (Bug 390267) + @SuppressWarnings("rawtypes") + Dictionary dictionary = properties; + assertTrue(FrameworkUtil.createFilter(filter).match(dictionary)); + } - String filter = manifest.getMainAttributes().getValue("Eclipse-PlatformFilter"); - assertTrue(filter.length() > 0); - properties = new Properties(); - properties.put("osgi.os", os); - properties.put("osgi.ws", ws); - properties.put("osgi.arch", arch); - // In 1.6 VMs properties is not casted correctly to dictionary causing a compilation error (Bug 390267) - Dictionary dictionary = properties; - assertTrue(FrameworkUtil.createFilter(filter).match(dictionary)); } // test that '<' and '>' are properly escaped in generated source feature @@ -159,9 +161,9 @@ public class SourceTests extends PDETestCase { //add some source to a.bundle File src = new File(bundleFolder.getLocation().toFile(), "src/a.java"); src.getParentFile().mkdir(); - FileOutputStream stream = new FileOutputStream(src); - stream.write("//L33T CODEZ\n".getBytes()); - stream.close(); + try (FileOutputStream stream = new FileOutputStream(src)) { + stream.write("//L33T CODEZ\n".getBytes()); + } Utils.generateFeature(buildFolder, "rcp", null, new String[] {"a.bundle"}); @@ -174,7 +176,7 @@ public class SourceTests extends PDETestCase { Utils.storeBuildProperties(buildFolder, BuildConfiguration.getBuilderProperties(buildFolder)); runBuild(buildFolder); - Set entries = new HashSet(); + Set<String> entries = new HashSet<>(); entries.add("eclipse/plugins/rcp.source_1.0.0/src/a.bundle_1.0.0/src.zip"); assertZipContents(buildFolder, "I.TestBuild/eclipse.zip", entries); } @@ -187,9 +189,9 @@ public class SourceTests extends PDETestCase { Utils.generateBundle(bundleFolder, "a.bundle"); File src = new File(bundleFolder.getLocation().toFile(), "src/a.java"); src.getParentFile().mkdir(); - FileOutputStream stream = new FileOutputStream(src); - stream.write("//L33T CODEZ\n".getBytes()); - stream.close(); + try (FileOutputStream stream = new FileOutputStream(src)) { + stream.write("//L33T CODEZ\n".getBytes()); + } Utils.generateFeature(buildFolder, "single", null, new String[] {"single.source", "a.bundle"}); Properties properties = new Properties(); @@ -200,7 +202,7 @@ public class SourceTests extends PDETestCase { Utils.storeBuildProperties(buildFolder, BuildConfiguration.getBuilderProperties(buildFolder)); runBuild(buildFolder); - Set entries = new HashSet(); + Set<String> entries = new HashSet<>(); entries.add("eclipse/plugins/single.source_1.0.0/src/a.bundle_1.0.0/src.zip"); assertZipContents(buildFolder, "I.TestBuild/eclipse.zip", entries); } @@ -216,16 +218,16 @@ public class SourceTests extends PDETestCase { Utils.generateBundle(bundleA, "bundleA"); File src = new File(bundleA.getLocation().toFile(), "src/a.java"); src.getParentFile().mkdir(); - FileOutputStream outputStream = new FileOutputStream(src); - outputStream.write("//L33T CODEZ\n".getBytes()); - outputStream.close(); + try (FileOutputStream outputStream = new FileOutputStream(src)) { + outputStream.write("//L33T CODEZ\n".getBytes()); + } Utils.generateBundle(bundleDoc, "bundleDoc"); src = new File(bundleDoc.getLocation().toFile(), "src/a.java"); src.getParentFile().mkdir(); - outputStream = new FileOutputStream(src); - outputStream.write("//L33T CODEZ\n".getBytes()); - outputStream.close(); + try (FileOutputStream outputStream = new FileOutputStream(src)) { + outputStream.write("//L33T CODEZ\n".getBytes()); + } //generate an SDK feature //test bug 208617 by naming the source feature something other than just originating feature + .source @@ -243,7 +245,7 @@ public class SourceTests extends PDETestCase { //bundleDoc only gets in the build by being added to the generated source feature, //check that it is there in the result and is in jar form. - Set entries = new HashSet(); + Set<String> entries = new HashSet<>(); entries.add("eclipse/plugins/bundleDoc_1.0.0.jar"); entries.add("eclipse/plugins/source_1.0.0/src/bundleA_1.0.0/src.zip"); assertZipContents(buildFolder, "I.TestBuild/eclipse.zip", entries); @@ -287,20 +289,20 @@ public class SourceTests extends PDETestCase { Utils.generatePluginBuildProperties(bundleA, buildProperties); File src = new File(bundleA.getLocation().toFile(), "src/a.java"); src.getParentFile().mkdir(); - FileOutputStream outputStream = new FileOutputStream(src); - outputStream.write("//L33T CODEZ\n".getBytes()); - outputStream.close(); + try (FileOutputStream outputStream = new FileOutputStream(src)) { + outputStream.write("//L33T CODEZ\n".getBytes()); + } File about = new File(bundleA.getLocation().toFile(), "about.html"); - outputStream = new FileOutputStream(about); - outputStream.write("about\n".getBytes()); - outputStream.close(); + try (FileOutputStream outputStream = new FileOutputStream(about)) { + outputStream.write("about\n".getBytes()); + } Utils.generateBundle(bundleB, "bundleB"); src = new File(bundleB.getLocation().toFile(), "src/b.java"); src.getParentFile().mkdir(); - outputStream = new FileOutputStream(src); - outputStream.write("//L33T CODEZ\n".getBytes()); - outputStream.close(); + try (FileOutputStream outputStream = new FileOutputStream(src)) { + outputStream.write("//L33T CODEZ\n".getBytes()); + } //generate an SDK feature Utils.generateFeature(buildFolder, "sdk", new String[] {"rcp", "rcp.source"}, null); @@ -317,18 +319,18 @@ public class SourceTests extends PDETestCase { Utils.storeBuildProperties(buildFolder, buildProperties); runBuild(buildFolder); - Set entries = new HashSet(); + Set<String> entries = new HashSet<>(); entries.add("eclipse/plugins/bundleA.source_1.0.0.jar"); entries.add("eclipse/plugins/bundleB.source_1.0.0.jar"); assertZipContents(buildFolder, "I.TestBuild/eclipse.zip", entries); - ZipFile zip = new ZipFile(buildFolder.getFile("I.TestBuild/eclipse.zip").getLocation().toFile()); - ZipEntry entry = zip.getEntry("eclipse/plugins/bundleA.source_1.0.0.jar"); - InputStream in = new BufferedInputStream(zip.getInputStream(entry)); - IFile jar = buildFolder.getFile("bundleA.source_1.0.0.jar"); - OutputStream out = new BufferedOutputStream(new FileOutputStream(jar.getLocation().toFile())); - org.eclipse.pde.internal.build.Utils.transferStreams(in, out); - zip.close(); + try (ZipFile zip = new ZipFile(buildFolder.getFile("I.TestBuild/eclipse.zip").getLocation().toFile())) { + ZipEntry entry = zip.getEntry("eclipse/plugins/bundleA.source_1.0.0.jar"); + InputStream in = new BufferedInputStream(zip.getInputStream(entry)); + IFile jar = buildFolder.getFile("bundleA.source_1.0.0.jar"); + OutputStream out = new BufferedOutputStream(new FileOutputStream(jar.getLocation().toFile())); + org.eclipse.pde.internal.build.Utils.transferStreams(in, out); + } entries.clear(); entries.add("about.html"); @@ -384,7 +386,7 @@ public class SourceTests extends PDETestCase { Utils.storeBuildProperties(buildFolder, properties); runBuild(buildFolder); - Set entries = new HashSet(); + Set<String> entries = new HashSet<>(); entries.clear(); entries.add("A.java"); entries.add("about.html"); @@ -405,9 +407,9 @@ public class SourceTests extends PDETestCase { Utils.generateBundle(bundleA, "bundleA"); File src = new File(bundleA.getLocation().toFile(), "src/A.java"); src.getParentFile().mkdir(); - FileOutputStream outputStream = new FileOutputStream(src); - outputStream.write("class A {\n}\n".getBytes()); - outputStream.close(); + try (FileOutputStream outputStream = new FileOutputStream(src)) { + outputStream.write("class A {\n}\n".getBytes()); + } //generate an SDK feature Utils.generateFeature(buildFolder, "sdk", null, new String[] {"bundleA", "bundleA.source"}); @@ -429,13 +431,13 @@ public class SourceTests extends PDETestCase { assertResourceFile(binaryASource, "A.java"); IFile manifestFile = plugins.getFile("bundleA.source_1.0.0/META-INF/MANIFEST.MF"); - InputStream contents = manifestFile.getContents(); - Manifest manifest = new Manifest(contents); - contents.close(); - Attributes attr = manifest.getMainAttributes(); - assertEquals(attr.getValue("Bundle-Version"), "1.0.0"); - assertEquals(attr.getValue("Bundle-SymbolicName"), "bundleA.source"); - assertTrue(attr.getValue("Eclipse-SourceBundle").startsWith("bundleA;version=\"1.0.0\"")); + try (InputStream contents = manifestFile.getContents()) { + Manifest manifest = new Manifest(contents); + Attributes attr = manifest.getMainAttributes(); + assertEquals(attr.getValue("Bundle-Version"), "1.0.0"); + assertEquals(attr.getValue("Bundle-SymbolicName"), "bundleA.source"); + assertTrue(attr.getValue("Eclipse-SourceBundle").startsWith("bundleA;version=\"1.0.0\"")); + } } public void test243475_243227() throws Exception { @@ -450,14 +452,14 @@ public class SourceTests extends PDETestCase { //add some source to a.bundle File src = new File(bundleFolder.getLocation().toFile(), "src/a.java"); src.getParentFile().mkdir(); - FileOutputStream stream = new FileOutputStream(src); - stream.write("//L33T CODEZ\n".getBytes()); - stream.close(); + try (FileOutputStream stream = new FileOutputStream(src)) { + stream.write("//L33T CODEZ\n".getBytes()); + } //add the about.html File about = new File(bundleFolder.getLocation().toFile(), "about.html"); - stream = new FileOutputStream(about); - stream.write("about\n".getBytes()); - stream.close(); + try (FileOutputStream stream = new FileOutputStream(about)) { + stream.write("about\n".getBytes()); + } Utils.generateFeature(buildFolder, "rcp", null, new String[] {"a.bundle"}, "1.0.0.qualifier"); @@ -656,7 +658,7 @@ public class SourceTests extends PDETestCase { IFile buildScript = buildFolder.getFile("plugins/bundleA.source_1.0.0/build.xml"); Project antProject = assertValidAntScript(buildScript); - Target publishBinParts = (Target) antProject.getTargets().get("publish.bin.parts"); + Target publishBinParts = antProject.getTargets().get("publish.bin.parts"); assertNotNull(publishBinParts); Object child = AntUtils.getFirstChildByName(publishBinParts, "ant"); assertNotNull(child); diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java index 214d2160..dda51c84 100644 --- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java +++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java @@ -8,7 +8,6 @@ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ - package org.eclipse.pde.build.internal.tests; import java.io.*; @@ -25,8 +24,7 @@ import org.eclipse.core.runtime.*; import org.eclipse.equinox.frameworkadmin.BundleInfo; import org.eclipse.equinox.simpleconfigurator.manipulator.SimpleConfiguratorManipulator; import org.eclipse.pde.build.tests.Activator; -import org.eclipse.pde.internal.build.BundleHelper; -import org.eclipse.pde.internal.build.FeatureGenerator; +import org.eclipse.pde.internal.build.*; import org.eclipse.pde.internal.build.site.BuildTimeSiteFactory; public class Utils { @@ -34,31 +32,36 @@ public class Utils { private static final String VERSION = "version"; /** - * Transfer the contents of resource into the destination IFile. During the transfer, replace all - * instances of "@replaceTag@" with "replaceString" + * Transfer the contents of resource into the destination IFile. During the + * transfer, replace all instances of "@replaceTag@" with "replaceString" * - * @param resource - input URL - * @param destination - IFile destination - * @param replacements - map of tokens and values to replaces, file should contain "@replaceTag@" - * @throws IOException - * @throws CoreException + * @param resource + * - input URL + * @param destination + * - IFile destination + * @param replacements + * - map of tokens and values to replaces, file should contain + * "@replaceTag@" + * @throws IOException + * @throws CoreException */ - static public void transferAndReplace(URL resource, IFile destination, Map replacements) throws IOException, CoreException { + static public void transferAndReplace(URL resource, IFile destination, Map<String, String> replacements) + throws IOException, CoreException { Reader reader = new InputStreamReader(new BufferedInputStream(resource.openStream())); final ReplaceTokens replaces = new ReplaceTokens(reader); - for (Iterator iterator = replacements.keySet().iterator(); iterator.hasNext();) { - String replaceTag = (String) iterator.next(); - String replaceString = (String) replacements.get(replaceTag); + for (Iterator<String> iterator = replacements.keySet().iterator(); iterator.hasNext();) { + String replaceTag = iterator.next(); + String replaceString = replacements.get(replaceTag); ReplaceTokens.Token token = new ReplaceTokens.Token(); token.setKey(replaceTag); token.setValue(replaceString); replaces.addConfiguredToken(token); } - ReaderInputStream inputStream = new ReaderInputStream(replaces); - destination.create(inputStream, true, null); - inputStream.close(); + try (ReaderInputStream inputStream = new ReaderInputStream(replaces)) { + destination.create(inputStream, true, null); + } } static public String[] getVersionsNoQualifier(String[] bundles) { @@ -73,18 +76,20 @@ public class Utils { static public void generateAllElements(IFolder buildFolder, String element) throws CoreException, IOException { if (element != null) { // get the productBuild/allElements.xml and replace @ELEMENT@ with element - URL allElements = FileLocator.find(Platform.getBundle(Activator.PLUGIN_ID), new Path("/resources/allElements.xml"), null); - Map replacements = new HashMap(1); + URL allElements = FileLocator.find(Platform.getBundle(Activator.PLUGIN_ID), + new Path("/resources/allElements.xml"), null); + Map<String, String> replacements = new HashMap<>(1); replacements.put("ELEMENT", element); transferAndReplace(allElements, buildFolder.getFile("allElements.xml"), replacements); buildFolder.refreshLocal(IResource.DEPTH_INFINITE, null); } } - static public void generatePluginBuildProperties(IFolder folder, Properties properties) throws FileNotFoundException, IOException { + static public void generatePluginBuildProperties(IFolder folder, Properties properties) + throws FileNotFoundException, IOException { Properties buildProperties = properties != null ? properties : new Properties(); - //default contents: + // default contents: if (!buildProperties.containsKey("source..")) buildProperties.put("source..", "src/"); if (!buildProperties.containsKey("output..")) @@ -95,7 +100,8 @@ public class Utils { storeBuildProperties(folder, buildProperties); } - static public void generateBundleManifest(IFolder folder, String bundleId, String bundleVersion, Attributes additionalAttributes) throws CoreException, IOException { + static public void generateBundleManifest(IFolder folder, String bundleId, String bundleVersion, + Attributes additionalAttributes) throws CoreException, IOException { Manifest manifest = new Manifest(); Attributes mainAttributes = manifest.getMainAttributes(); mainAttributes.put(Attributes.Name.MANIFEST_VERSION, "1.0"); @@ -110,9 +116,10 @@ public class Utils { IFolder metaInf = (IFolder) manifestFile.getParent(); if (!metaInf.exists()) metaInf.create(true, true, null); - OutputStream outputStream = new BufferedOutputStream(new FileOutputStream(manifestFile.getLocation().toFile())); - manifest.write(outputStream); - outputStream.close(); + try (OutputStream outputStream = new BufferedOutputStream( + new FileOutputStream(manifestFile.getLocation().toFile()))) { + manifest.write(outputStream); + } } static public void generateBundle(IFolder folder, String bundleId) throws CoreException, IOException { @@ -122,41 +129,48 @@ public class Utils { folder.refreshLocal(IResource.DEPTH_INFINITE, null); } - static public void generateBundle(IFolder folder, String bundleId, String version) throws CoreException, IOException { + static public void generateBundle(IFolder folder, String bundleId, String version) + throws CoreException, IOException { generateBundleManifest(folder, bundleId, version, null); generatePluginBuildProperties(folder, null); writeBuffer(folder.getFile("src/foo.java"), new StringBuffer("public class foo { int i; }")); folder.refreshLocal(IResource.DEPTH_INFINITE, null); } - static public void storeBuildProperties(IFolder buildFolder, Properties buildProperties) throws FileNotFoundException, IOException { + static public void storeBuildProperties(IFolder buildFolder, Properties buildProperties) + throws FileNotFoundException, IOException { storeProperties(buildFolder.getFile("build.properties"), buildProperties); } - static public void storeProperties(IFile propertiesFile, Properties buildProperties) throws FileNotFoundException, IOException { + static public void storeProperties(IFile propertiesFile, Properties buildProperties) + throws FileNotFoundException, IOException { File buildPropertiesFile = propertiesFile.getLocation().toFile(); - OutputStream outputStream = new BufferedOutputStream(new FileOutputStream(buildPropertiesFile)); - buildProperties.store(outputStream, ""); - outputStream.close(); + try (OutputStream outputStream = new BufferedOutputStream(new FileOutputStream(buildPropertiesFile))) { + buildProperties.store(outputStream, ""); + } } - static public void generateFeature(IFolder workingDirectory, String id, String[] featureList, String[] pluginList) throws CoreException, IOException { + static public void generateFeature(IFolder workingDirectory, String id, String[] featureList, String[] pluginList) + throws CoreException, IOException { generateFeature(workingDirectory, id, featureList, pluginList, null, false, false, null); } - static public void generateFeature(IFolder workingDirectory, String id, String[] featureList, String[] pluginList, String version) throws CoreException, IOException { + static public void generateFeature(IFolder workingDirectory, String id, String[] featureList, String[] pluginList, + String version) throws CoreException, IOException { generateFeature(workingDirectory, id, featureList, pluginList, null, false, false, version); } - static public void generateFeature(IFolder workingDirectory, String id, String[] featureList, String[] pluginList, String product, boolean includeLaunchers, boolean verify, String version) throws CoreException, IOException { + static public void generateFeature(IFolder workingDirectory, String id, String[] featureList, String[] pluginList, + String product, boolean includeLaunchers, boolean verify, String version) + throws CoreException, IOException { FeatureGenerator generator = new FeatureGenerator(); if (verify) { - FeatureGenerator.setConfigInfo("*,*,*"); + AbstractScriptGenerator.setConfigInfo("*,*,*"); String baseLocation = Platform.getInstallLocation().getURL().getPath(); BuildTimeSiteFactory.setInstalledBaseSite(baseLocation); File delta = findDeltaPack(); if (delta != null && !delta.equals(new File(baseLocation))) - generator.setPluginPath(new String[] {delta.getAbsolutePath()}); + generator.setPluginPath(new String[] { delta.getAbsolutePath() }); } generator.setIncludeLaunchers(includeLaunchers); generator.setVerify(verify); @@ -169,23 +183,30 @@ public class Utils { generator.generate(); } - static public void generateProduct(IFile productFile, String id, String version, String[] entryList, boolean features) throws CoreException, IOException { + static public void generateProduct(IFile productFile, String id, String version, String[] entryList, + boolean features) throws CoreException, IOException { generateProduct(productFile, id, version, null, entryList, features, null); } - static public void generateProduct(IFile productFile, String id, String version, String application, String[] entryList, boolean features) throws CoreException, IOException { + static public void generateProduct(IFile productFile, String id, String version, String application, + String[] entryList, boolean features) throws CoreException, IOException { generateProduct(productFile, id, version, application, entryList, features, null); } - static public void generateProduct(IFile productFile, String id, String version, String application, String[] entryList, boolean features, StringBuffer extra) throws CoreException, IOException { + static public void generateProduct(IFile productFile, String id, String version, String application, + String[] entryList, boolean features, StringBuffer extra) throws CoreException, IOException { generateProduct(productFile, null, id, version, application, null, entryList, features, extra); } - static public void generateProduct(IFile productFile, String id, String version, String application, String launcher, String[] entryList, boolean features, StringBuffer extra) throws CoreException, IOException { + static public void generateProduct(IFile productFile, String id, String version, String application, + String launcher, String[] entryList, boolean features, StringBuffer extra) + throws CoreException, IOException { generateProduct(productFile, null, id, version, application, launcher, entryList, features, extra); } - static public void generateProduct(IFile productFile, String uid, String id, String version, String application, String launcher, String[] entryList, boolean features, StringBuffer extra) throws CoreException, IOException { + static public void generateProduct(IFile productFile, String uid, String id, String version, String application, + String launcher, String[] entryList, boolean features, StringBuffer extra) + throws CoreException, IOException { StringBuffer buffer = new StringBuffer(); buffer.append("<product "); if (uid != null) { @@ -218,7 +239,8 @@ public class Utils { if (features) { buffer.append(" <features>\n"); for (int i = 0; i < entryList.length; i++) { - Map items = org.eclipse.pde.internal.build.Utils.parseExtraBundlesString(entryList[i], false); + Map<String, Object> items = org.eclipse.pde.internal.build.Utils.parseExtraBundlesString(entryList[i], + false); buffer.append(" <feature id=\""); buffer.append(items.get(ID)); buffer.append("\""); @@ -233,7 +255,8 @@ public class Utils { } else { buffer.append(" <plugins>\n"); for (int i = 0; i < entryList.length; i++) { - Map items = org.eclipse.pde.internal.build.Utils.parseExtraBundlesString(entryList[i], false); + Map<String, Object> items = org.eclipse.pde.internal.build.Utils.parseExtraBundlesString(entryList[i], + false); buffer.append(" <plugin id=\""); buffer.append(items.get(ID)); buffer.append("\""); @@ -257,7 +280,7 @@ public class Utils { } /** - * Creates a IFolder resources. Will create any folders necessary under parent + * Creates a IFolder resources. Will create any folders necessary under parent */ static public IFolder createFolder(IFolder parent, String path) throws CoreException { parent.refreshLocal(IResource.DEPTH_INFINITE, null); @@ -266,14 +289,14 @@ public class Utils { return folder; IFolder container = (IFolder) folder.getParent(); if (!container.exists()) { - LinkedList stack = new LinkedList(); + LinkedList<IFolder> stack = new LinkedList<>(); while (!container.equals(parent) && !container.exists()) { stack.add(0, container); container = (IFolder) container.getParent(); } - for (Iterator iterator = stack.iterator(); iterator.hasNext();) { - container = (IFolder) iterator.next(); + for (Iterator<IFolder> iterator = stack.iterator(); iterator.hasNext();) { + container = iterator.next(); container.create(true, true, null); } } @@ -283,11 +306,7 @@ public class Utils { private static File findExecutable(File baseLocation) { File plugins = new File(baseLocation, "features"); - FilenameFilter filter = new FilenameFilter() { - public boolean accept(File dir, String name) { - return name.startsWith("org.eclipse.equinox.executable"); - } - }; + FilenameFilter filter = (dir, name) -> name.startsWith("org.eclipse.equinox.executable"); String[] files = plugins.list(filter); if (files != null && files.length > 0) @@ -307,11 +326,14 @@ public class Utils { if (deltaLocation != null) return deltaLocation; - SimpleConfiguratorManipulator manipulator = (SimpleConfiguratorManipulator) BundleHelper.getDefault().acquireService(SimpleConfiguratorManipulator.class.getName()); + SimpleConfiguratorManipulator manipulator = (SimpleConfiguratorManipulator) BundleHelper.getDefault() + .acquireService(SimpleConfiguratorManipulator.class.getName()); if (manipulator != null) { - BundleInfo[] bundles = manipulator.loadConfiguration(BundleHelper.getDefault().getBundle().getBundleContext(), null); - //find a fragment for a platform we aren't - String id = "org.eclipse.equinox.launcher.win32.win32.x86" + (Platform.getOSArch().equals("x86") ? "_64" : ""); + BundleInfo[] bundles = manipulator + .loadConfiguration(BundleHelper.getDefault().getBundle().getBundleContext(), null); + // find a fragment for a platform we aren't + String id = "org.eclipse.equinox.launcher.win32.win32.x86" + + (Platform.getOSArch().equals("x86") ? "_64" : ""); for (int i = 0; i < bundles.length; i++) { if (bundles[i].getSymbolicName().equals(id)) { URI location = bundles[i].getLocation(); @@ -324,8 +346,10 @@ public class Utils { } if (Platform.OS_MACOSX.equals(Platform.getOS())) { - // After https://bugs.eclipse.org/431116 and related changes, the install location on the Mac - // moved down two directories (from <folder-containing-Eclipse.app> to Eclipse.app/Contents/Eclipse). + // After https://bugs.eclipse.org/431116 and related changes, the install + // location on the Mac + // moved down two directories (from <folder-containing-Eclipse.app> to + // Eclipse.app/Contents/Eclipse). baseLocation = baseLocation.getParentFile().getParentFile(); } deltaLocation = findExecutable(new File(baseLocation.getParent(), "deltapack/eclipse")); @@ -333,15 +357,10 @@ public class Utils { } public static void writeBuffer(IFile outputFile, StringBuffer buffer) throws IOException, CoreException { - FileOutputStream stream = null; - try { - File output = outputFile.getLocation().toFile(); - output.getParentFile().mkdirs(); - stream = new FileOutputStream(output); + File output = outputFile.getLocation().toFile(); + output.getParentFile().mkdirs(); + try (FileOutputStream stream = new FileOutputStream(output)) { stream.write(buffer.toString().getBytes()); - } finally { - if (stream != null) - stream.close(); } outputFile.getParent().refreshLocal(IResource.DEPTH_INFINITE, null); } @@ -350,7 +369,8 @@ public class Utils { transferStreams(source, true, destination, true); } - public static void transferStreams(InputStream source, boolean closeIn, OutputStream destination, boolean closeOut) throws IOException { + public static void transferStreams(InputStream source, boolean closeIn, OutputStream destination, boolean closeOut) + throws IOException { source = new BufferedInputStream(source); destination = new BufferedOutputStream(destination); try { @@ -378,15 +398,14 @@ public class Utils { } } - public static boolean extractFromZip(IFolder buildFolder, String zipFile, String zipEntry, IFile outputFile) throws CoreException { + public static boolean extractFromZip(IFolder buildFolder, String zipFile, String zipEntry, IFile outputFile) + throws CoreException { File folder = new File(buildFolder.getLocation().toOSString()); File archiveFile = new File(folder, zipFile); if (!archiveFile.exists()) return false; - ZipFile zip = null; - try { - zip = new ZipFile(archiveFile); + try (ZipFile zip = new ZipFile(archiveFile);) { ZipEntry entry = zip.getEntry(zipEntry); if (entry == null) return false; @@ -395,13 +414,6 @@ public class Utils { transferStreams(stream, out); } catch (Exception e) { return false; - } finally { - try { - if (zip != null) - zip.close(); - } catch (IOException e) { - return false; - } } outputFile.refreshLocal(IResource.DEPTH_ONE, null); return true; @@ -412,21 +424,12 @@ public class Utils { if (!propertiesFile.exists()) return null; - InputStream stream = null; - try { - Properties props = new Properties(); - stream = propertiesFile.getContents(true); + Properties props = new Properties(); + try (InputStream stream = propertiesFile.getContents(true)) { props.load(stream); return props; } catch (IOException e) { return null; - } finally { - if (stream != null) - try { - stream.close(); - } catch (IOException e) { - return null; - } } } @@ -443,31 +446,13 @@ public class Utils { copy(children[i], new File(target, children[i].getName())); return; } - InputStream input = null; - OutputStream output = null; - try { - input = new BufferedInputStream(new FileInputStream(source)); - output = new BufferedOutputStream(new FileOutputStream(target)); + try (InputStream input = new BufferedInputStream(new FileInputStream(source)); + OutputStream output = new BufferedOutputStream(new FileOutputStream(target))) { byte[] buffer = new byte[8192]; int bytesRead = 0; while ((bytesRead = input.read(buffer)) != -1) output.write(buffer, 0, bytesRead); - } finally { - if (input != null) { - try { - input.close(); - } catch (IOException e) { - //ignore - } - } - if (output != null) { - try { - output.close(); - } catch (IOException e) { - //ignore - } - } } } diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ant/AntUtils.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ant/AntUtils.java index 4e6c5540..b831d4db 100644 --- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ant/AntUtils.java +++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ant/AntUtils.java @@ -24,9 +24,10 @@ import org.eclipse.pde.build.tests.Activator; public class AntUtils { - /* This is somewhat destructive to the target, as resolving UnknownTasks - * results in Types being filtered from the getTasks list and no longer - * being accessible. + /* + * This is somewhat destructive to the target, as resolving UnknownTasks results + * in Types being filtered from the getTasks list and no longer being + * accessible. */ static public Object getFirstChildByName(Target target, String name) { Task[] tasks = target.getTasks(); @@ -43,7 +44,9 @@ public class AntUtils { return null; } + @SuppressWarnings("unchecked") static public Object[] getChildrenByName(Target target, String name) { + @SuppressWarnings("rawtypes") List list = new ArrayList(); Task[] tasks = target.getTasks(); for (int i = 0; i < tasks.length; i++) { @@ -64,22 +67,23 @@ public class AntUtils { Field nestedField = parallel.getClass().getDeclaredField("nestedTasks"); nestedField.setAccessible(true); - Vector nested = (Vector) nestedField.get(parallel); - return (Task[]) nested.toArray(new Task[nested.size()]); + @SuppressWarnings("unchecked") + Vector<Task> nested = (Vector<Task>) nestedField.get(parallel); + return nested.toArray(new Task[nested.size()]); } - static public void setupProject(Project project, Map alternateTasks) { + static public void setupProject(Project project, Map<String, String> alternateTasks) { setupClasspath(); - List tasks = AntCorePlugin.getPlugin().getPreferences().getTasks(); - for (Iterator iterator = tasks.iterator(); iterator.hasNext();) { - org.eclipse.ant.core.Task coreTask = (org.eclipse.ant.core.Task) iterator.next(); + List<org.eclipse.ant.core.Task> tasks = AntCorePlugin.getPlugin().getPreferences().getTasks(); + for (Iterator<org.eclipse.ant.core.Task> iterator = tasks.iterator(); iterator.hasNext();) { + org.eclipse.ant.core.Task coreTask = iterator.next(); AntTypeDefinition def = new AntTypeDefinition(); String name = ProjectHelper.genComponentName(coreTask.getURI(), coreTask.getTaskName()); def.setName(name); if (alternateTasks != null && alternateTasks.containsKey(name)) - def.setClassName((String) alternateTasks.get(name)); + def.setClassName(alternateTasks.get(name)); else def.setClassName(coreTask.getClassName()); def.setClassLoader(Activator.getDefault().getClass().getClassLoader()); @@ -88,9 +92,9 @@ public class AntUtils { ComponentHelper.getComponentHelper(project).addDataTypeDefinition(def); } - List types = AntCorePlugin.getPlugin().getPreferences().getTypes(); - for (Iterator iterator = types.iterator(); iterator.hasNext();) { - Type type = (Type) iterator.next(); + List<Type> types = AntCorePlugin.getPlugin().getPreferences().getTypes(); + for (Iterator<Type> iterator = types.iterator(); iterator.hasNext();) { + Type type = iterator.next(); AntTypeDefinition def = new AntTypeDefinition(); String name = ProjectHelper.genComponentName(type.getURI(), type.getTypeName()); def.setName(name); @@ -114,7 +118,8 @@ public class AntUtils { buff.append("; "); //$NON-NLS-1$ } - org.apache.tools.ant.types.Path systemClasspath = new org.apache.tools.ant.types.Path(null, buff.substring(0, buff.length() - 2)); + org.apache.tools.ant.types.Path systemClasspath = new org.apache.tools.ant.types.Path(null, + buff.substring(0, buff.length() - 2)); org.apache.tools.ant.types.Path.systemClasspath = systemClasspath; } } diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ant/TestBrandTask.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ant/TestBrandTask.java index ba3d6440..165562b0 100644 --- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ant/TestBrandTask.java +++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ant/TestBrandTask.java @@ -8,7 +8,6 @@ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ - package org.eclipse.pde.build.internal.tests.ant; import org.apache.tools.ant.BuildException; @@ -40,7 +39,8 @@ public class TestBrandTask extends Task { os = value; } + @Override public void execute() throws BuildException { - //nothing + // nothing } } diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/LicenseTests.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/LicenseTests.java index 1ffcd214..22419374 100644 --- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/LicenseTests.java +++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/LicenseTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 IBM Corporation and others. All rights reserved. + * Copyright (c) 2008, 2017 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 @@ -57,12 +57,12 @@ public class LicenseTests extends P2TestCase { IArtifactKey rootFileKey = (IArtifactKey) rootFileIU.getArtifacts().toArray()[0]; File actualRootFile = ((IFileArtifactRepository) artifacts).getArtifactFile(rootFileKey); - Set entries = new HashSet(); + Set<String> entries = new HashSet<>(); entries.add("root.html"); assertZipContents(actualRootFile, entries); // Check that all expected files are in zip - entries = new HashSet(); + entries = new HashSet<>(); entries.add("feature.properties"); entries.add("feature.xml"); entries.add("feature_fr.properties"); @@ -84,7 +84,7 @@ public class LicenseTests extends P2TestCase { assertEquals("Result feature.properties has incorrect number of properties", originalProperties.size() + 2, actualProperties.size()); - Enumeration keys = originalProperties.keys(); + Enumeration<Object> keys = originalProperties.keys(); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); assertEquals(originalProperties.getProperty(key, "originalMissing"), actualProperties.getProperty(key)); @@ -182,7 +182,7 @@ public class LicenseTests extends P2TestCase { runBuild(buildFolder); // Check that all expected files are in zip - Set entries = new HashSet(); + Set<String> entries = new HashSet<>(); entries.add("eclipse/features/F1_1.0.0/feature.properties"); entries.add("eclipse/features/F1_1.0.0/feature.xml"); entries.add("eclipse/features/F1_1.0.0/feature_fr.properties"); @@ -205,7 +205,7 @@ public class LicenseTests extends P2TestCase { assertEquals("Result feature.properties has incorrect number of properties", originalProperties.size() + 2, actualProperties.size()); - Enumeration keys = originalProperties.keys(); + Enumeration<Object> keys = originalProperties.keys(); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); assertEquals(originalProperties.getProperty(key, "originalMissing"), actualProperties.getProperty(key)); @@ -237,7 +237,7 @@ public class LicenseTests extends P2TestCase { runBuild(buildFolder); - Set entries = new HashSet(); + Set<String> entries = new HashSet<>(); entries.add("license.html"); assertZipContents(buildFolder, "buildRepo/features/F1_1.0.0.jar", entries); @@ -260,7 +260,7 @@ public class LicenseTests extends P2TestCase { properties.put("license", buildFolder.getFolder("features/L1").getLocation().toString()); runAntScript(testXML.getLocation().toOSString(), new String[] {"publish"}, buildFolder.getLocation().toOSString(), properties); - entries = new HashSet(); + entries = new HashSet<>(); entries.add("license.html"); assertZipContents(repo2, "features/F1_1.0.0.jar", entries); } @@ -300,12 +300,12 @@ public class LicenseTests extends P2TestCase { runBuild(buildFolder); - Set entries = new HashSet(); + Set<String> entries = new HashSet<>(); entries.add("sub/license.html"); entries.add("a.txt"); assertZipContents(buildFolder, "buildRepo/features/F1_1.0.0.jar", entries); - entries = new HashSet(); + entries = new HashSet<>(); entries.add("rootFile.html"); assertZipContents(buildFolder, "buildRepo/binary/F1_root_1.0.0", entries); } @@ -353,7 +353,7 @@ public class LicenseTests extends P2TestCase { Utils.storeBuildProperties(build3, properties); runBuild(build3); - Set entries = new HashSet(); + Set<String> entries = new HashSet<>(); entries.add("sub/license.html"); assertZipContents(build3, "buildRepo/features/F1_1.0.0.jar", entries); assertResourceFile(build2, "tmp/eclipse/features/F1_1.0.0/sub/license.html"); diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2TestCase.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2TestCase.java index 489582c1..f37dfa3b 100644 --- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2TestCase.java +++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2TestCase.java @@ -45,7 +45,7 @@ public abstract class P2TestCase extends PDETestCase { if (context == null) throw new IllegalStateException(); - ServiceReference reference = context.getServiceReference(IMetadataRepositoryManager.class.getName()); + ServiceReference<IMetadataRepositoryManager> reference = context.getServiceReference(IMetadataRepositoryManager.class); if (reference == null) { IProvisioningAgent agent = (IProvisioningAgent) ServiceHelper.getService(context, IProvisioningAgent.SERVICE_NAME); if (agent == null) @@ -60,12 +60,12 @@ public abstract class P2TestCase extends PDETestCase { context.ungetService(reference); metadataManager = (IMetadataRepositoryManager) result; - reference = context.getServiceReference(IArtifactRepositoryManager.class.getName()); - if (reference == null) + ServiceReference<IArtifactRepositoryManager> reference2 = context.getServiceReference(IArtifactRepositoryManager.class); + if (reference2 == null) throw new IllegalStateException(); - result = context.getService(reference); - context.ungetService(reference); + result = context.getService(reference2); + context.ungetService(reference2); artifactManager = (IArtifactRepositoryManager) result; } @@ -149,11 +149,11 @@ public abstract class P2TestCase extends PDETestCase { } public IInstallableUnit getIU(IMetadataRepository repository, String name, boolean assertNotNull) { - IQueryResult queryResult = repository.query(QueryUtil.createIUQuery(name), null); + IQueryResult<IInstallableUnit> queryResult = repository.query(QueryUtil.createIUQuery(name), null); IInstallableUnit unit = null; if (!queryResult.isEmpty()) - unit = (IInstallableUnit) queryResult.iterator().next(); + unit = queryResult.iterator().next(); if (assertNotNull) { assertEquals(1, queryResult.toUnmodifiableSet().size()); assertNotNull(unit); @@ -172,9 +172,9 @@ public abstract class P2TestCase extends PDETestCase { } public void assertTouchpoint(IInstallableUnit iu, String phase, String action) { - Collection/*<ITouchpointData>*/ data = iu.getTouchpointData(); - for (Iterator iter = data.iterator(); iter.hasNext();) { - ITouchpointInstruction instruction = ((ITouchpointData) iter.next()).getInstruction(phase); + Collection<ITouchpointData> data = iu.getTouchpointData(); + for (Iterator<ITouchpointData> iter = data.iterator(); iter.hasNext();) { + ITouchpointInstruction instruction = iter.next().getInstruction(phase); if (instruction != null && instruction.getBody().indexOf(action) > -1) return; } @@ -182,9 +182,9 @@ public abstract class P2TestCase extends PDETestCase { } public void assertProvides(IInstallableUnit iu, String namespace, String name) { - Collection/*<IProvidedCapability>*/ caps = iu.getProvidedCapabilities(); - for (Iterator iterator = caps.iterator(); iterator.hasNext();) { - IProvidedCapability cap = (IProvidedCapability) iterator.next(); + Collection<IProvidedCapability> caps = iu.getProvidedCapabilities(); + for (Iterator<IProvidedCapability> iterator = caps.iterator(); iterator.hasNext();) { + IProvidedCapability cap = iterator.next(); if (cap.getNamespace().equals(namespace) && cap.getName().equals(name)) return; @@ -193,8 +193,8 @@ public abstract class P2TestCase extends PDETestCase { } public void assertRequires(IInstallableUnit iu, String namespace, String name) { - Collection/*<IRequirement>*/ reqs = iu.getRequirements(); - for (Iterator iterator = reqs.iterator(); iterator.hasNext();) { + Collection<IRequirement> reqs = iu.getRequirements(); + for (Iterator<IRequirement> iterator = reqs.iterator(); iterator.hasNext();) { IRequiredCapability reqCap = (IRequiredCapability) iterator.next(); if (reqCap.getNamespace().equals(namespace) && reqCap.getName().equals(name)) return; @@ -203,12 +203,12 @@ public abstract class P2TestCase extends PDETestCase { assertTrue(false); } - public ArrayList assertRequires(IInstallableUnit iu, ArrayList requiredIUs, boolean requireAll) { - outer: for (Iterator iterator = requiredIUs.iterator(); iterator.hasNext();) { - IInstallableUnit reqIU = (IInstallableUnit) iterator.next(); + public ArrayList<IInstallableUnit> assertRequires(IInstallableUnit iu, ArrayList<IInstallableUnit> requiredIUs, boolean requireAll) { + outer: for (Iterator<IInstallableUnit> iterator = requiredIUs.iterator(); iterator.hasNext();) { + IInstallableUnit reqIU = iterator.next(); - Collection/*<IRequirement>*/ reqs = iu.getRequirements(); - for (Iterator iterator2 = reqs.iterator(); iterator2.hasNext();) { + Collection<IRequirement> reqs = iu.getRequirements(); + for (Iterator<IRequirement> iterator2 = reqs.iterator(); iterator2.hasNext();) { IRequiredCapability reqCap = (IRequiredCapability) iterator2.next(); if (reqCap.getNamespace().equals(IU_NAMESPACE) && reqCap.getName().equals(reqIU.getId()) && reqCap.getRange().isIncluded(reqIU.getVersion())) { iterator.remove(); diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2Tests.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2Tests.java index 415c179b..ded1dbf3 100644 --- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2Tests.java +++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2Tests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2013 IBM Corporation and others. All rights reserved. + * Copyright (c) 2008, 2017 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 @@ -67,7 +67,7 @@ public class P2Tests extends P2TestCase { assertNotNull(repository); //some basic existance - ArrayList ius = new ArrayList(); + ArrayList<IInstallableUnit> ius = new ArrayList<>(); ius.add(getIU(repository, "test")); ius.add(getIU(repository, "org.eclipse.equinox.launcher")); ius.add(getIU(repository, OSGI)); @@ -165,7 +165,7 @@ public class P2Tests extends P2TestCase { IInstallableUnit iu = getIU(repository, "FRoot"); IInstallableUnit rootIU = getIU(repository, "toolingFRoot.rootfiles"); - ArrayList ius = new ArrayList(); + ArrayList<IInstallableUnit> ius = new ArrayList<>(); ius.add(getIU(repository, OSGI)); ius.add(getIU(repository, CORE_RUNTIME)); ius.add(rootIU); @@ -208,7 +208,7 @@ public class P2Tests extends P2TestCase { assertNotNull(repository); IInstallableUnit iu = getIU(repository, "toolingrcp.product.config.win32.win32.x86"); - ArrayList requiredIUs = new ArrayList(); + ArrayList<IInstallableUnit> requiredIUs = new ArrayList<>(); IInstallableUnit rootFileCU = getIU(repository, "toolingrcp.product.rootfiles.win32.win32.x86"); requiredIUs.add(rootFileCU); requiredIUs.add(getIU(repository, "rcp.product.rootfiles.win32.win32.x86")); @@ -279,8 +279,8 @@ public class P2Tests extends P2TestCase { assertResourceFile(buildFolder, "repo/artifacts.jar"); IMetadataRepository metadata = loadMetadataRepository(repo.getLocationURI()); - IQueryResult result = metadata.query(QueryUtil.createIUQuery("new_category_1"), null); - IInstallableUnit iu = (IInstallableUnit) result.iterator().next(); + IQueryResult<IInstallableUnit> result = metadata.query(QueryUtil.createIUQuery("new_category_1"), null); + IInstallableUnit iu = result.iterator().next(); assertNotNull(iu); assertEquals(iu.getId(), "new_category_1"); assertEquals(iu.getVersion().toString(), "1.2.3.456"); @@ -354,11 +354,7 @@ public class P2Tests extends P2TestCase { runProductBuild(buildFolder); File plugins = repo.getFolder("plugins").getLocation().toFile(); - File[] bundles = plugins.listFiles(new FilenameFilter() { - public boolean accept(File dir, String name) { - return name.startsWith("org.junit_") || name.startsWith("org.eclipse.pde.build"); - } - }); + File[] bundles = plugins.listFiles((FilenameFilter) (dir, name) -> name.startsWith("org.junit_") || name.startsWith("org.eclipse.pde.build")); assertTrue(bundles.length == 2); assertJarVerifies(bundles[0]); assertJarVerifies(bundles[1]); @@ -480,7 +476,7 @@ public class P2Tests extends P2TestCase { IFolder zipped = Utils.createFolder(buildFolder, "zipped"); ZipOutputStream output = new ZipOutputStream(new FileOutputStream(new File(zipped.getLocation().toFile(), "zipped repo.zip"))); File root = buildFolder.getFolder("repo/r1").getLocation().toFile(); - FileUtils.zip(output, root, Collections.EMPTY_SET, FileUtils.createRootPathComputer(root)); + FileUtils.zip(output, root, Collections.emptySet(), FileUtils.createRootPathComputer(root)); org.eclipse.pde.internal.build.Utils.close(output); //bug 318144 @@ -550,11 +546,11 @@ public class P2Tests extends P2TestCase { IFolder repoFolder = buildFolder.getFolder("repo"); IArtifactRepository repository = loadArtifactRepository(repoLocation); - Map repoProps = repository.getProperties(); + Map<String, String> repoProps = repository.getProperties(); assertEquals(repoProps.get("publishPackFilesAsSiblings"), "true"); - IQueryResult keys = repository.query(ArtifactKeyQuery.ALL_KEYS, null); - for (Iterator iterator = keys.iterator(); iterator.hasNext();) { - IArtifactKey key = (IArtifactKey) iterator.next(); + IQueryResult<IArtifactKey> keys = repository.query(ArtifactKeyQuery.ALL_KEYS, null); + for (Iterator<IArtifactKey> iterator = keys.iterator(); iterator.hasNext();) { + IArtifactKey key = iterator.next(); IArtifactDescriptor[] descriptors = repository.getArtifactDescriptors(key); if (key.getClassifier().equals("osgi.bundle") && key.getId().equals("org.eclipse.cvs")) { diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/PublishingTests.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/PublishingTests.java index 3d96cfea..22d7179e 100644 --- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/PublishingTests.java +++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/PublishingTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2015 IBM Corporation and others. All rights reserved. + * Copyright (c) 2008, 2017 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 @@ -65,16 +65,16 @@ public class PublishingTests extends P2TestCase { assertResourceFile(buildFolder, "buildRepo/plugins/bundle_1.0.0.v1234.jar"); IFile jar = buildFolder.getFile("buildRepo/plugins/bundle_1.0.0.v1234.jar"); - ZipFile zip = new ZipFile(jar.getLocation().toFile()); - Enumeration entries = zip.entries(); - ZipEntry entry = (ZipEntry) entries.nextElement(); - assertTrue(entry.getName().equalsIgnoreCase("META-INF/MANIFEST.MF")); - Map headers = new HashMap(); - ManifestElement.parseBundleManifest(zip.getInputStream(entry), headers); - assertEquals(headers.get(Constants.BUNDLE_VERSION), "1.0.0.v1234"); - zip.close(); + try (ZipFile zip = new ZipFile(jar.getLocation().toFile())) { + Enumeration<? extends ZipEntry> entries = zip.entries(); + ZipEntry entry = entries.nextElement(); + assertTrue(entry.getName().equalsIgnoreCase("META-INF/MANIFEST.MF")); + Map<String, String> headers = new HashMap<>(); + ManifestElement.parseBundleManifest(zip.getInputStream(entry), headers); + assertEquals(headers.get(Constants.BUNDLE_VERSION), "1.0.0.v1234"); + } - HashSet contents = new HashSet(); + HashSet<String> contents = new HashSet<>(); contents.add("about.txt"); contents.add("A.class"); @@ -201,7 +201,7 @@ public class PublishingTests extends P2TestCase { } assertFalse(fail); - Set entries = new HashSet(); + Set<String> entries = new HashSet<>(); entries.add("contents/file"); entries.add("second"); assertZipContents(buildFolder, "buildRepo/binary/f_root_1.0.0", entries); @@ -304,7 +304,7 @@ public class PublishingTests extends P2TestCase { String buildXMLPath = bundle.getFile("build.xml").getLocation().toOSString(); runAntScript(buildXMLPath, new String[] {"build.jars", "publish.bin.parts"}, buildFolder.getLocation().toOSString(), properties); - HashSet contents = new HashSet(); + HashSet<String> contents = new HashSet<>(); contents.add("a.txt"); contents.add("b.txt"); assertZipContents(buildFolder, "buildRepo/plugins/bundle_1.0.0.v1234.jar", contents); @@ -364,19 +364,11 @@ public class PublishingTests extends P2TestCase { } protected File findExecutableFeature(File delta) throws Exception { - FilenameFilter filter = new FilenameFilter() { - public boolean accept(File dir, String name) { - return name.startsWith(EQUINOX_EXECUTABLE); - } - }; + FilenameFilter filter = (dir, name) -> name.startsWith(EQUINOX_EXECUTABLE); File[] features = new File(delta, "features").listFiles(filter); assertTrue(features.length > 0); - Arrays.sort(features, new Comparator() { - public int compare(Object o1, Object o2) { - return -1 * ((File) o1).getName().compareTo(((File) o2).getName()); - } - }); + Arrays.sort(features, (o1, o2) -> -1 * o1.getName().compareTo(o2.getName())); return features[0]; } @@ -413,7 +405,7 @@ public class PublishingTests extends P2TestCase { String buildXMLPath = f.getFile("build.xml").getLocation().toOSString(); runAntScript(buildXMLPath, new String[] {"publish.bin.parts"}, buildFolder.getLocation().toOSString(), properties); - HashSet contents = new HashSet(); + HashSet<String> contents = new HashSet<>(); contents.add("a.txt"); contents.add("feature.xml"); contents.add("p2.inf"); @@ -450,7 +442,7 @@ public class PublishingTests extends P2TestCase { String executable = EQUINOX_EXECUTABLE; String fileName = originalExecutable.getName(); String version = fileName.substring(fileName.indexOf('_') + 1); - Set entries = new HashSet(); + Set<String> entries = new HashSet<>(); // Linux zips contain launcher and about.html (libCairo no longer packaged in the delta pack (bug 354978)) // entries.add("libcairo-swt.so"); @@ -519,7 +511,7 @@ public class PublishingTests extends P2TestCase { runAntScript(buildXMLPath, new String[] {"build.jars", "publish.bin.parts"}, buildFolder.getLocation().toOSString(), properties); assertResourceFile(buildFolder, "buildRepo/plugins/bundle_1.0.0.v1234.jar"); - HashSet contents = new HashSet(); + HashSet<String> contents = new HashSet<>(); contents.add("A.class"); contents.add("b/B.class"); contents.add(".api_description"); @@ -545,7 +537,7 @@ public class PublishingTests extends P2TestCase { IMetadataRepository repository = loadMetadataRepository("file:" + buildFolder.getFolder("buildRepo").getLocation().toOSString()); assertNotNull(repository); - HashSet entries = new HashSet(); + HashSet<String> entries = new HashSet<>(); IInstallableUnit iu = getIU(repository, "a"); assertEquals(iu.getVersion().toString(), "1.0.0"); @@ -604,7 +596,7 @@ public class PublishingTests extends P2TestCase { runBuild(buildFolder); assertResourceFile(buildFolder, "buildRepo/plugins/bundle.source_1.0.0.jar"); - Set entries = new HashSet(); + Set<String> entries = new HashSet<>(); entries.add("A.java"); entries.add("b/B.java"); assertZipContents(buildFolder, "buildRepo/plugins/bundle.source_1.0.0.jar", entries); @@ -655,7 +647,7 @@ public class PublishingTests extends P2TestCase { runProductBuild(buildFolder); - Set entries = new HashSet(); + Set<String> entries = new HashSet<>(); entries.add("branded.app/Contents/Info.plist"); entries.add("branded.app/Contents/MacOS/branded.ini"); entries.add("branded.app/Contents/MacOS/branded"); @@ -740,7 +732,7 @@ public class PublishingTests extends P2TestCase { assertResourceFile(buildFolder, "untarred/artifacts.jar"); assertResourceFile(buildFolder, "untarred/content.jar"); - HashSet entries = new HashSet(); + HashSet<String> entries = new HashSet<>(); entries.add("license.html"); assertZipContents(buildFolder, "untarred/binary/f_root_1.0.0", entries); @@ -937,7 +929,7 @@ public class PublishingTests extends P2TestCase { assertJarVerifies(new File(buildFile, "tmp/eclipse/plugins/p_1.0.0.jar"), true); assertJarVerifies(new File(buildFile, "tmp/eclipse/features/f_1.0.0.jar"), true); - HashSet entries = new HashSet(); + HashSet<String> entries = new HashSet<>(); entries.add("META-INF/PDE_BUIL.SF"); entries.add("META-INF/PDE_BUIL.DSA"); @@ -1026,7 +1018,7 @@ public class PublishingTests extends P2TestCase { assertTouchpoint(iuA, "zipped", "true"); IInstallableUnit iuB = getIU(repo, "b"); - assertTrue(Boolean.valueOf((String) iuB.getProperties().get("pde.build")).booleanValue()); + assertTrue(Boolean.valueOf(iuB.getProperties().get("pde.build")).booleanValue()); /* * Part 2. Use the above zipped repo as input to a build to test reusing IUs (bug 259792) @@ -1076,7 +1068,7 @@ public class PublishingTests extends P2TestCase { repo = loadMetadataRepository(URIUtil.toJarURI(uri, new Path(""))); iuB = getIU(repo, "b"); - assertTrue(Boolean.valueOf((String) iuB.getProperties().get("pde.build")).booleanValue()); + assertTrue(Boolean.valueOf(iuB.getProperties().get("pde.build")).booleanValue()); repo = null; removeMetadataRepository(uri); @@ -1204,7 +1196,7 @@ public class PublishingTests extends P2TestCase { assertResourceFile(buildFolder.getFile("tmp/eclipse/plugins/e_1.0.0.jar")); assertResourceFile(buildFolder.getFile("tmp/eclipse/features/e.source_1.0.0.jar")); - Set entries = new HashSet(); + Set<String> entries = new HashSet<>(); entries.add("license.html"); assertZipContents(buildFolder, "tmp/eclipse/plugins/e.source_1.0.0.jar", entries); } @@ -1260,7 +1252,7 @@ public class PublishingTests extends P2TestCase { Utils.storeBuildProperties(buildFolder, properties); runBuild(buildFolder); - Set entries = new HashSet(); + Set<String> entries = new HashSet<>(); entries.add("license.html"); assertZipContents(buildFolder, "tmp/eclipse/binary/f_root_1.0.0", entries); @@ -1295,7 +1287,7 @@ public class PublishingTests extends P2TestCase { IInstallableUnit iu = getIU(metadata, "equinox.executable"); assertRequires(iu, "org.eclipse.equinox.p2.iu", "org.eclipse.equinox.executable.feature.jar"); assertRequires(iu, "org.eclipse.equinox.p2.iu", EQUINOX_LAUNCHER); - Set entries = new HashSet(); + Set<String> entries = new HashSet<>(); entries.add("bin/win32/win32/x86/launcher.exe"); entries.add("bin/carbon/macosx/ppc/Eclipse.app/Contents/MacOS/launcher"); entries.add("bin/gtk/linux/x86/launcher"); @@ -1364,7 +1356,7 @@ public class PublishingTests extends P2TestCase { URI repoURI = URIUtil.fromString("file:" + buildFolder.getFolder("buildRepo").getLocation().toOSString()); IMetadataRepository metadata = loadMetadataRepository(repoURI); - IQueryResult queryResult = metadata.query(QueryUtil.createIUQuery("a"), null); + IQueryResult<IInstallableUnit> queryResult = metadata.query(QueryUtil.createIUQuery("a"), null); assertTrue(queryResult.isEmpty()); getIU(metadata, "b"); } @@ -1479,7 +1471,7 @@ public class PublishingTests extends P2TestCase { assertResourceFile(finalRepo, "binary/rcp.product_root.win32.win32.x86_1.0.0"); assertResourceFile(finalRepo, "features/f_1.0.0.jar"); - HashSet entries = new HashSet(); + HashSet<String> entries = new HashSet<>(); entries.add("eclipse/eclipse.exe"); entries.add("eclipse/features/f_1.0.0/feature.xml"); entries.add("eclipse/sub/important.txt"); @@ -1562,7 +1554,7 @@ public class PublishingTests extends P2TestCase { runBuild(buildFolder); - Set entries = new HashSet(); + Set<String> entries = new HashSet<>(); entries.add("src.jar"); entries.add("foob.class"); assertZipContents(buildFolder, "tmp/eclipse/plugins/foo_1.0.0.jar", entries); @@ -1639,9 +1631,9 @@ public class PublishingTests extends P2TestCase { assertEquals(iu.getVersion().toString(), "1.0.0"); IInstallableUnit common = getIU(repo, EQUINOX_COMMON); - Collection/*<IRequirement>*/ required = iu.getRequirements(); + Collection<IRequirement> required = iu.getRequirements(); assertEquals(required.size(), 2); - Iterator it = required.iterator(); + Iterator<IRequirement> it = required.iterator(); IRequiredCapability req0 = (IRequiredCapability) it.next(); IRequiredCapability req1 = (IRequiredCapability) it.next(); if (req0.getName().equals(EQUINOX_COMMON)) @@ -1861,8 +1853,8 @@ public class PublishingTests extends P2TestCase { IMetadataRepository repo = loadMetadataRepository(buildFolder.getFolder("buildRepo").getLocationURI()); IInstallableUnit iu = getIU(repo, "foo"); - Collection/*<IRequirement>*/ required = iu.getRequirements(); - for (Iterator iterator = required.iterator(); iterator.hasNext();) { + Collection<IRequirement> required = iu.getRequirements(); + for (Iterator<IRequirement> iterator = required.iterator(); iterator.hasNext();) { IRequiredCapability reqCap = (IRequiredCapability) iterator.next(); if (reqCap.getName().equals("a")) { VersionRange range = reqCap.getRange(); @@ -1896,7 +1888,7 @@ public class PublishingTests extends P2TestCase { Utils.storeBuildProperties(buildFolder, buildProperties); runBuild(buildFolder); - Set entries = new HashSet(); + Set<String> entries = new HashSet<>(); entries.add("feature.xml"); entries.add("file1.txt"); assertZipContents(buildFolder, "tmp/eclipse/features/F1_1.0.0.jar", entries, true); diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/tests/Activator.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/tests/Activator.java index 347a2913..6bb7b92b 100644 --- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/tests/Activator.java +++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/tests/Activator.java @@ -23,28 +23,22 @@ public class Activator implements BundleActivator { // The shared instance private static Activator plugin; - + private BundleContext context; - + /** * The constructor */ public Activator() { } - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ + @Override public void start(BundleContext context) throws Exception { plugin = this; this.context = context; } - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ + @Override public void stop(BundleContext context) throws Exception { plugin = null; context = null; diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/tests/BuildConfiguration.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/tests/BuildConfiguration.java index 2532ace8..332ec961 100644 --- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/tests/BuildConfiguration.java +++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/tests/BuildConfiguration.java @@ -26,7 +26,8 @@ public class BuildConfiguration { private static Properties defaultScriptConfig = new Properties(); static { // use the template build.properties from pde.build - URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build"), new Path("/templates/headless-build/build.properties"), null); + URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build"), + new Path("/templates/headless-build/build.properties"), null); try { String buildPropertiesPath = FileLocator.toFileURL(resource).getPath(); defaultBuildConfig.load(new BufferedInputStream(new FileInputStream(buildPropertiesPath))); @@ -64,7 +65,7 @@ public class BuildConfiguration { private static Properties getBuildConfig() { Properties properties = new Properties(); - Enumeration e = defaultBuildConfig.keys(); + Enumeration<Object> e = defaultBuildConfig.keys(); while (e.hasMoreElements()) { String key = (String) e.nextElement(); properties.put(key, defaultBuildConfig.get(key)); @@ -74,7 +75,9 @@ public class BuildConfiguration { } /** - * Get a default build configuration build.properties based on the template from pde.build + * Get a default build configuration build.properties based on the template from + * pde.build + * * @param buildFolder * @return */ @@ -88,8 +91,10 @@ public class BuildConfiguration { } /** - * Get a default set of properties used for invoking the genericTargets/generateScript task - * (which invokes the eclipse.buildScript target) + * Get a default set of properties used for invoking the + * genericTargets/generateScript task (which invokes the eclipse.buildScript + * target) + * * @param buildFolder * @param type * @param id diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/tests/PDETestCase.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/tests/PDETestCase.java index 7ca8b2ad..50295a5e 100644 --- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/tests/PDETestCase.java +++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/tests/PDETestCase.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2015 IBM Corporation and others. All rights reserved. + * Copyright (c) 2007, 2017 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 @@ -56,6 +56,7 @@ public abstract class PDETestCase extends TestCase { BuildDirector.p2Gathering = false; } + @Override protected void runTest() throws Throwable { super.runTest(); @@ -171,7 +172,7 @@ public abstract class PDETestCase extends TestCase { args[idx++] = logger; } if (additionalProperties != null && additionalProperties.size() > 0) { - Enumeration e = additionalProperties.keys(); + Enumeration<Object> e = additionalProperties.keys(); while (e.hasMoreElements()) { String key = (String) e.nextElement(); String value = additionalProperties.getProperty(key); @@ -195,22 +196,21 @@ public abstract class PDETestCase extends TestCase { * @param entries * @throws Exception */ - public static void assertZipContents(IFolder buildFolder, String archive, Set entries) throws Exception { + public static void assertZipContents(IFolder buildFolder, String archive, Set<String> entries) throws Exception { assertZipContents(buildFolder, archive, entries, true); } - public static void assertZipContents(File archiveFile, Set entries) throws Exception { + public static void assertZipContents(File archiveFile, Set<String> entries) throws Exception { assertZipContents(archiveFile, entries, true); } - public static void assertZipContents(File archiveFile, Set entries, boolean assertEmpty) throws Exception { + public static void assertZipContents(File archiveFile, Set<String> entries, boolean assertEmpty) throws Exception { assertTrue(archiveFile.exists()); - ZipFile zip = new ZipFile(archiveFile); - try { - Enumeration e = zip.getEntries(); + try (ZipFile zip = new ZipFile(archiveFile)) { + Enumeration<ZipEntry> e = zip.getEntries(); while (e.hasMoreElements() && entries.size() > 0) { - ZipEntry entry = (ZipEntry) e.nextElement(); + ZipEntry entry = e.nextElement(); String name = entry.getName(); if (entries.contains(name)) { if (!entry.isDirectory()) @@ -218,14 +218,12 @@ public abstract class PDETestCase extends TestCase { entries.remove(name); } } - } finally { - zip.close(); } if (assertEmpty) assertTrue("Missing entry in archive: " + entries, entries.size() == 0); } - public static void assertZipContents(IFolder buildFolder, String archive, Set entries, boolean assertEmpty) throws Exception { + public static void assertZipContents(IFolder buildFolder, String archive, Set<String> entries, boolean assertEmpty) throws Exception { File folder = new File(buildFolder.getLocation().toOSString()); File archiveFile = new File(folder, archive); assertZipContents(archiveFile, entries, assertEmpty); @@ -280,17 +278,17 @@ public abstract class PDETestCase extends TestCase { assertTrue(logFile.length() > 0); int idx = 0; - BufferedReader reader = new BufferedReader(new FileReader(logFile)); - while (reader.ready()) { - String line = reader.readLine(); - if (line.indexOf(lines[idx]) >= 0) { - if (++idx >= lines.length) { - reader.close(); - return; + try (BufferedReader reader = new BufferedReader(new FileReader(logFile))) { + while (reader.ready()) { + String line = reader.readLine(); + if (line.indexOf(lines[idx]) >= 0) { + if (++idx >= lines.length) { + reader.close(); + return; + } } } } - reader.close(); assertTrue(false); } @@ -304,7 +302,7 @@ public abstract class PDETestCase extends TestCase { return assertValidAntScript(buildXML, null); } - public static Project assertValidAntScript(IFile buildXML, Map alternateTasks) throws Exception { + public static Project assertValidAntScript(IFile buildXML, Map<String, String> alternateTasks) throws Exception { assertResourceFile((IFolder) buildXML.getParent(), buildXML.getName()); // Parse the build file using ant @@ -315,7 +313,7 @@ public abstract class PDETestCase extends TestCase { AntXMLContext context = new AntXMLContext(project); project.addReference("ant.parsing.context", context); project.addReference("ant.targets", context.getTargets()); - context.setCurrentTargets(new HashMap()); + context.setCurrentTargets(new HashMap<>()); AntUtils.setupProject(project, alternateTasks); project.init(); @@ -331,10 +329,10 @@ public abstract class PDETestCase extends TestCase { public static void assertJarVerifies(File jarFile, boolean throwIfNotSigned) throws Exception { BundleContext context = Activator.getDefault().getContext(); - ServiceReference certRef = context.getServiceReference(SignedContentFactory.class.getName()); + ServiceReference<SignedContentFactory> certRef = context.getServiceReference(SignedContentFactory.class); if (certRef == null) throw new IllegalStateException("The SignedContentFactory service is not available"); - SignedContentFactory certFactory = (SignedContentFactory) context.getService(certRef); + SignedContentFactory certFactory = context.getService(certRef); try { SignedContent content = certFactory.getSignedContent(jarFile); if (content.isSigned()) { |