From 69d6e55f14f3f8d3cafe412c63253574a11e61a9 Mon Sep 17 00:00:00 2001 From: Andreas Penski <18-andreas.penski@users.noreply.projekte.kosit.org> Date: Thu, 3 Sep 2020 06:02:42 +0000 Subject: [PATCH] Resolve "Force formatting" --- .idea/eclipseCodeFormatter.xml | 3 +- .idea/misc.xml | 5 +- .settings/org.eclipse.jdt.core.prefs | 422 ------------------ docs/contribute.md | 11 +- formatter.xml | 366 +++++++++++++++ pom.xml | 45 ++ .../api/AcceptRecommendation.java | 2 +- .../de/kosit/validationtool/api/Check.java | 6 +- .../api/CheckConfiguration.java | 4 - .../validationtool/api/Configuration.java | 4 +- .../validationtool/api/InputFactory.java | 25 +- .../api/ResolvingConfigurationStrategy.java | 15 +- .../de/kosit/validationtool/api/Result.java | 7 +- .../cmd/CheckAssertionAction.java | 1 - .../cmd/CommandLineOptions.java | 18 + .../kosit/validationtool/cmd/Validator.java | 1 - .../kosit/validationtool/cmd/report/Grid.java | 2 - .../config/ConfigurationLoader.java | 4 +- .../config/FallbackBuilder.java | 12 +- .../de/kosit/validationtool/config/Keys.java | 5 +- .../validationtool/config/ReportBuilder.java | 12 +- .../config/ScenarioBuilder.java | 4 +- .../config/SchematronBuilder.java | 12 +- .../validationtool/daemon/BaseHandler.java | 1 - .../validationtool/daemon/CheckHandler.java | 4 +- .../validationtool/daemon/ConfigHandler.java | 2 +- .../kosit/validationtool/daemon/Daemon.java | 1 - .../validationtool/daemon/GuiHandler.java | 15 +- .../impl/ConversionService.java | 4 +- .../validationtool/impl/DateFactory.java | 6 +- .../impl/EngineInformation.java | 2 - .../impl/ScenarioRepository.java | 3 +- .../impl/tasks/CheckAction.java | 6 +- .../impl/tasks/CreateReportAction.java | 5 +- .../impl/tasks/SchemaValidationAction.java | 1 - .../impl/xml/RelativeUriResolver.java | 1 - .../cmd/ExtractHtmlActionTest.java | 1 - .../cmd/PrintReportActionTest.java | 1 - .../cmd/SerializeReportActionTest.java | 5 +- .../config/SimpleConfigTest.java | 3 - .../validationtool/daemon/GuiHandlerIT.java | 5 +- .../tasks/ComputeAcceptanceActionTest.java | 2 +- .../impl/tasks/CreateReportActionTest.java | 1 - .../impl/tasks/TestBagBuilder.java | 14 +- .../impl/xml/SaxonSecurityTest.java | 4 +- 45 files changed, 535 insertions(+), 538 deletions(-) delete mode 100644 .settings/org.eclipse.jdt.core.prefs create mode 100644 formatter.xml diff --git a/.idea/eclipseCodeFormatter.xml b/.idea/eclipseCodeFormatter.xml index 680c7c6..a63598c 100644 --- a/.idea/eclipseCodeFormatter.xml +++ b/.idea/eclipseCodeFormatter.xml @@ -8,7 +8,8 @@ diff --git a/.idea/misc.xml b/.idea/misc.xml index c874577..241632b 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -4,6 +4,9 @@ + + @@ -79,7 +82,7 @@ - + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 661b86d..0000000 --- a/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,422 +0,0 @@ -eclipse.preferences.version=1 -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.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault -org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable -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.doc.comment.support=enabled -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=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -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=disabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -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=warning -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning -org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private -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=warning -org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected -org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags -org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private -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=warning -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.nullAnnotationInferenceConflict=error -org.eclipse.jdt.core.compiler.problem.nullReference=warning -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=warning -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning -org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning -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=warning -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=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=warning -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore -org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.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=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=warning -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.processAnnotations=enabled -org.eclipse.jdt.core.compiler.release=disabled -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=18 -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_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=83 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.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=1 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=1 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert -org.eclipse.jdt.core.formatter.comment.line_length=120 -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.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=true -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_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_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=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_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.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=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_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.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_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_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=true -org.eclipse.jdt.core.formatter.join_wrapped_lines=true -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=140 -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=space -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=true -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=true -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/docs/contribute.md b/docs/contribute.md index 76d0d95..0bf56f0 100644 --- a/docs/contribute.md +++ b/docs/contribute.md @@ -22,9 +22,14 @@ For other IDEs the correct setup is up to you. We use an automatic formatting of the source code in our environment. This is based on the Eclipse code formatter functionality due to historical reasons. This not only works in Eclipse but also in IntelliJ (via plugin) and can be used standalone. -The configuration can be found in `.settings`-directory. For IntelliJ this is all set up. Additionally this should work in Eclipse out of the box. -Another potential usage scenario would be to integrate the formatter via git hooks into the commit-pipeline (e.g [Example Hook](https://gist.github.com/ktoso/708972) ). -For other IDEs you are on your own. +The configuration can be found in `.settings`-directory. For IntelliJ this is all set up. The correct formatting is validated as part of the build +process. If your IDE does not support the eclipse formatter, your can run the maven build locally prior commit like this: + +```shell script +mvn package -Pformat +``` + +This will format all changed files according to our rules. Afterwards your can commit and push your changes. ## Build diff --git a/formatter.xml b/formatter.xml new file mode 100644 index 0000000..1623387 --- /dev/null +++ b/formatter.xml @@ -0,0 +1,366 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pom.xml b/pom.xml index b290a51..2fc00c3 100644 --- a/pom.xml +++ b/pom.xml @@ -504,9 +504,54 @@ + + net.revelc.code.formatter + formatter-maven-plugin + 2.12.2 + + + validate + generate-sources + + validate + + + + + ${project.basedir}/formatter.xml + + + + + format + false + + + + net.revelc.code.formatter + formatter-maven-plugin + 2.12.2 + + + maven-formatting + initialize + + format + + + + + ${project.basedir}/formatter.xml + + + + + + + diff --git a/src/main/java/de/kosit/validationtool/api/AcceptRecommendation.java b/src/main/java/de/kosit/validationtool/api/AcceptRecommendation.java index 479733d..f330280 100644 --- a/src/main/java/de/kosit/validationtool/api/AcceptRecommendation.java +++ b/src/main/java/de/kosit/validationtool/api/AcceptRecommendation.java @@ -16,7 +16,7 @@ public enum AcceptRecommendation { ACCEPTABLE, /** - * Recommendation is to reject {@link Input} based on the evaluation of the overall validation. + * Recommendation is to reject {@link Input} based on the evaluation of the overall validation. */ REJECT } diff --git a/src/main/java/de/kosit/validationtool/api/Check.java b/src/main/java/de/kosit/validationtool/api/Check.java index dd0e6cf..9eadf53 100644 --- a/src/main/java/de/kosit/validationtool/api/Check.java +++ b/src/main/java/de/kosit/validationtool/api/Check.java @@ -24,7 +24,6 @@ import java.util.stream.Collectors; import org.w3c.dom.Document; - /** * Main validator interface for checking incoming files. * @@ -33,8 +32,8 @@ import org.w3c.dom.Document; public interface Check { /** - * Checks an incoming xml {@link Input Inputs}. The result-{@link Document} is readonly. To change the this document you - * need to copy the nodes into an new {@link Document}. + * Checks an incoming xml {@link Input Inputs}. The result-{@link Document} is readonly. To change the this document + * you need to copy the nodes into an new {@link Document}. * * @param input the resource / xml file to validate. * @return a result-{@link Document} (readonly) @@ -75,5 +74,4 @@ public interface Check { return input.stream().map(this::checkInput).collect(Collectors.toList()); } - } diff --git a/src/main/java/de/kosit/validationtool/api/CheckConfiguration.java b/src/main/java/de/kosit/validationtool/api/CheckConfiguration.java index 185ad26..45a530e 100644 --- a/src/main/java/de/kosit/validationtool/api/CheckConfiguration.java +++ b/src/main/java/de/kosit/validationtool/api/CheckConfiguration.java @@ -54,8 +54,6 @@ public class CheckConfiguration implements Configuration { */ private URI scenarioRepository; - - private Configuration delegate; private Configuration getDelegate() { @@ -95,8 +93,6 @@ public class CheckConfiguration implements Configuration { return getDelegate().getAuthor(); } - - @Override public ContentRepository getContentRepository() { return getDelegate().getContentRepository(); diff --git a/src/main/java/de/kosit/validationtool/api/Configuration.java b/src/main/java/de/kosit/validationtool/api/Configuration.java index 9aa6f70..6194c48 100644 --- a/src/main/java/de/kosit/validationtool/api/Configuration.java +++ b/src/main/java/de/kosit/validationtool/api/Configuration.java @@ -62,8 +62,8 @@ public interface Configuration { String getDate(); /** - * Add some additional parameters to the validator configuration. Parameter usage depends on actual implementation of - * {@link Check} + * Add some additional parameters to the validator configuration. Parameter usage depends on actual implementation + * of {@link Check} * * @return */ diff --git a/src/main/java/de/kosit/validationtool/api/InputFactory.java b/src/main/java/de/kosit/validationtool/api/InputFactory.java index 93bede4..113be10 100644 --- a/src/main/java/de/kosit/validationtool/api/InputFactory.java +++ b/src/main/java/de/kosit/validationtool/api/InputFactory.java @@ -79,8 +79,8 @@ public class InputFactory { } /** - * Liest einen Prüfling von dem übergebenen Pfad. Es wird der Default-Prüfsummenalgorithmus zur Ermittlung der Prüfsumme - * genutzt. + * Liest einen Prüfling von dem übergebenen Pfad. Es wird der Default-Prüfsummenalgorithmus zur Ermittlung der + * Prüfsumme genutzt. * * @param path der Prüflings * @return ein Prüf-Eingabe-Objekt @@ -114,8 +114,8 @@ public class InputFactory { } /** - * Liest einen Prüfling von der übergebenen URI. Es wird der Default-Prüfsummenalgorithmus zur Ermittlung der Prüfsumme - * genutzt. + * Liest einen Prüfling von der übergebenen URI. Es wird der Default-Prüfsummenalgorithmus zur Ermittlung der + * Prüfsumme genutzt. * * @param uri URI des Prüflings * @return ein Prüf-Eingabe-Objekt @@ -141,8 +141,8 @@ public class InputFactory { } /** - * Liest einen Prüfling von der übergebenen URL. Es wird der Default-Prüfsummenalgorithmus zur Ermittlung der Prüfsumme - * genutzt. + * Liest einen Prüfling von der übergebenen URL. Es wird der Default-Prüfsummenalgorithmus zur Ermittlung der + * Prüfsumme genutzt. * * @param url URL des Prüflings * @return ein Prüf-Eingabe-Objekt @@ -173,8 +173,9 @@ public class InputFactory { } /** - * Reads a test document from a {@link Source}. Note: computing the hashcode is only supported for {@link StreamSource}. - * You can not directly use other {@link Source Soures}. You need to supply the hashcode for identification then. + * Reads a test document from a {@link Source}. Note: computing the hashcode is only supported for + * {@link StreamSource}. You can not directly use other {@link Source Soures}. You need to supply the hashcode for + * identification then. * * @param source source * @return an {@link Input} @@ -190,8 +191,8 @@ public class InputFactory { /** * Reads a test document from a {@link Source} using a specified digest algorithm. * - * Note: computing the hashcode is only supported for {@link StreamSource}. You can not directly use other {@link Source - * Soures}. You need to supply the hashcode for identification then. + * Note: computing the hashcode is only supported for {@link StreamSource}. You can not directly use other + * {@link Source Soures}. You need to supply the hashcode for identification then. * * @param source source * @param name the digest algorithm @@ -304,8 +305,8 @@ public class InputFactory { } /** - * Reads a saxon {@link XdmNode} with a given name. Hashcode identification is based on the name of the supplied input. - * Now real hashcode is computed. + * Reads a saxon {@link XdmNode} with a given name. Hashcode identification is based on the name of the supplied + * input. Now real hashcode is computed. * * @param node the node to read * @param name the name of the {@link Input} diff --git a/src/main/java/de/kosit/validationtool/api/ResolvingConfigurationStrategy.java b/src/main/java/de/kosit/validationtool/api/ResolvingConfigurationStrategy.java index c6fd194..7833824 100644 --- a/src/main/java/de/kosit/validationtool/api/ResolvingConfigurationStrategy.java +++ b/src/main/java/de/kosit/validationtool/api/ResolvingConfigurationStrategy.java @@ -36,8 +36,8 @@ public interface ResolvingConfigurationStrategy { /** * Returns a preconfigured {@link Processor Saxon Processor} for various tasks within the Validator. The validator - * leverages the saxon s9api for internal processing e.g. xml reading and writing. So this is the main object to secure - * for reading, transforming and writing xml files. + * leverages the saxon s9api for internal processing e.g. xml reading and writing. So this is the main object to + * secure for reading, transforming and writing xml files. * * Note: you need exactly one instance for all validator related processing. * @@ -50,8 +50,8 @@ public interface ResolvingConfigurationStrategy { * dereferencing an absolute URI (after resolution) to return a {@link javax.xml.transform.Source}. It can be * used for resolving relative URIs against a base URI or restrict access to certain URIs. *

- * This URIResolver is used to dereference the URIs appearing in xsl:import, xsl:include, and - * xsl:import-schema declarations. + * This URIResolver is used to dereference the URIs appearing in xsl:import, xsl:include, + * and xsl:import-schema declarations. *

* * @param scenarioRepository an optional repository, your implementation might not need this @@ -60,7 +60,8 @@ public interface ResolvingConfigurationStrategy { URIResolver createResolver(URI scenarioRepository); /** - * Creates a specific implementation for resolving objects referenced via XSLT's unparsed-text() function. + * Creates a specific implementation for resolving objects referenced via XSLT's unparsed-text() + * function. * * @param scenarioRepository an optional repository, your implementation might not need this * @return a preconfigured {@link net.sf.saxon.lib.UnparsedTextURIResolver} or null for using saxons default @@ -68,8 +69,8 @@ public interface ResolvingConfigurationStrategy { UnparsedTextURIResolver createUnparsedTextURIResolver(URI scenarioRepository); /** - * Creates a preconfigured {@link Validator } instance for a given schema for xml file validation. The implementation - * takes care about security and reference resolving strategies. + * Creates a preconfigured {@link Validator } instance for a given schema for xml file validation. The + * implementation takes care about security and reference resolving strategies. * * @param schema the scheme to create a {@link Validator} for * @return a preconfigured {@link Validator} diff --git a/src/main/java/de/kosit/validationtool/api/Result.java b/src/main/java/de/kosit/validationtool/api/Result.java index 91617ae..af86a90 100644 --- a/src/main/java/de/kosit/validationtool/api/Result.java +++ b/src/main/java/de/kosit/validationtool/api/Result.java @@ -16,8 +16,8 @@ import net.sf.saxon.s9api.XdmNode; public interface Result { /** - * Zeigt an, ob die Verarbeitung durch den Validator erfolgreich durchlaufen wurde. Diese Funktion macht ausdrücklich - * keine Aussage über die zur Akzeptanz. + * Zeigt an, ob die Verarbeitung durch den Validator erfolgreich durchlaufen wurde. Diese Funktion macht + * ausdrücklich keine Aussage über die zur Akzeptanz. * * @return true, wenn die Verarbeitung komplett und erfolgreich durchlaufen wurde * @see #getAcceptRecommendation() @@ -92,7 +92,8 @@ public interface Result { boolean isWellformed(); /** - * Returns true, if schematron has been checked and the result does not contain any {@link FailedAssert FailedAsserts}. + * Returns true, if schematron has been checked and the result does not contain any {@link FailedAssert + * FailedAsserts}. * * @return true, if valid */ diff --git a/src/main/java/de/kosit/validationtool/cmd/CheckAssertionAction.java b/src/main/java/de/kosit/validationtool/cmd/CheckAssertionAction.java index 79d4d24..813cf4d 100644 --- a/src/main/java/de/kosit/validationtool/cmd/CheckAssertionAction.java +++ b/src/main/java/de/kosit/validationtool/cmd/CheckAssertionAction.java @@ -91,7 +91,6 @@ class CheckAssertionAction implements CheckAction { return getMapped().entrySet().stream().filter(e -> matches(e.getKey(), name)).map(Map.Entry::getValue).findFirst().orElse(null); } - private boolean check(XdmNode document, AssertionType assertion) { try { final XPathSelector selector = createSelector(assertion); diff --git a/src/main/java/de/kosit/validationtool/cmd/CommandLineOptions.java b/src/main/java/de/kosit/validationtool/cmd/CommandLineOptions.java index c7bc6d0..76ab31b 100644 --- a/src/main/java/de/kosit/validationtool/cmd/CommandLineOptions.java +++ b/src/main/java/de/kosit/validationtool/cmd/CommandLineOptions.java @@ -9,34 +9,52 @@ import org.apache.commons.cli.Option; public class CommandLineOptions { static final Option HELP = Option.builder("?").longOpt("help").argName("Help").desc("Displays this help").build(); + static final Option SCENARIOS = Option.builder("s").required().longOpt("scenarios").hasArg().desc("Location of scenarios.xml e.g.") .build(); + static final Option REPOSITORY = Option.builder("r").longOpt("repository").hasArg().desc("Directory containing scenario content") .build(); + static final Option PRINT = Option.builder("p").longOpt("print").desc("Prints the check result to stdout").build(); + static final Option OUTPUT = Option.builder("o").longOpt("output-directory") .desc("Defines the out directory for results. Defaults to cwd").hasArg().build(); + static final Option EXTRACT_HTML = Option.builder("h").longOpt("html") .desc("Extract and save any html content within result as a separate file ").build(); + static final Option DEBUG = Option.builder("d").longOpt("debug").desc("Prints some more debug information").build(); + static final Option SERIALIZE_REPORT_INPUT = Option.builder("c").longOpt("serialize-report-input") .desc("Serializes the report input to the cwd").build(); + static final Option CHECK_ASSERTIONS = Option.builder("c").longOpt("check-assertions").hasArg() .desc("Check the result using defined assertions").argName("assertions-file").build(); + static final Option SERVER = Option.builder("D").longOpt("daemon").desc("Starts a daemon listing for validation requests").build(); + static final Option HOST = Option.builder("H").longOpt("host").hasArg() .desc("The hostname / IP address to bind the daemon. Default is localhost").build(); + static final Option PORT = Option.builder("P").longOpt("port").hasArg().desc("The port to bind the daemon. Default is 8080").build(); + static final Option WORKER_COUNT = Option.builder("T").longOpt("threads").hasArg() .desc("Number of threads processing validation requests").build(); + static final Option DISABLE_GUI = Option.builder("G").longOpt("disable-gui").desc("Disables the GUI of the daemon mode").build(); + static final Option REPORT_POSTFIX = Option.builder(null).longOpt("report-postfix").hasArg() .desc("Postfix of the generated report name").build(); + static final Option REPORT_PREFIX = Option.builder(null).longOpt("report-prefix").hasArg().desc("Prefix of the generated report name") .build(); + static final Option DEBUG_LOG = Option.builder("X").longOpt("debug-logging").desc("Enables full debug log. Alias for -l debug").build(); + static final Option LOG_LEVEL = Option.builder("l").longOpt("log-level").hasArg() .desc("Enables a certain log level for debugging " + "purposes").build(); + static final Option PRINT_MEM_STATS = Option.builder("m").longOpt("memory-stats").desc("Prints some memory stats").build(); private CommandLineOptions() { diff --git a/src/main/java/de/kosit/validationtool/cmd/Validator.java b/src/main/java/de/kosit/validationtool/cmd/Validator.java index bd986ae..522e0c8 100644 --- a/src/main/java/de/kosit/validationtool/cmd/Validator.java +++ b/src/main/java/de/kosit/validationtool/cmd/Validator.java @@ -200,7 +200,6 @@ public class Validator { return check.isSuccessful(results) ? ReturnValue.SUCCESS : ReturnValue.createFailed(check.getNotAcceptableCount(results)); } - private static ConfigurationLoader getConfiguration(final CommandLine cmd) { final URI scenarioLocation = determineDefinition(cmd); final URI repositoryLocation = determineRepository(cmd); diff --git a/src/main/java/de/kosit/validationtool/cmd/report/Grid.java b/src/main/java/de/kosit/validationtool/cmd/report/Grid.java index f96b7ef..cffe4ec 100644 --- a/src/main/java/de/kosit/validationtool/cmd/report/Grid.java +++ b/src/main/java/de/kosit/validationtool/cmd/report/Grid.java @@ -183,8 +183,6 @@ public class Grid { return this; } - - } private static final Format DEFAULT_FORMAT = new Format(); diff --git a/src/main/java/de/kosit/validationtool/config/ConfigurationLoader.java b/src/main/java/de/kosit/validationtool/config/ConfigurationLoader.java index 7848c6b..5484edf 100644 --- a/src/main/java/de/kosit/validationtool/config/ConfigurationLoader.java +++ b/src/main/java/de/kosit/validationtool/config/ConfigurationLoader.java @@ -177,6 +177,7 @@ public class ConfigurationLoader { /** * Sets actual {@link ResolvingMode}, when the validator needs to resolve stuff on startup. + * * @param mode the resolving mode * @return this */ @@ -188,13 +189,14 @@ public class ConfigurationLoader { return this; } - public ConfigurationLoader setResolvingStrategy(final ResolvingConfigurationStrategy strategy){ + public ConfigurationLoader setResolvingStrategy(final ResolvingConfigurationStrategy strategy) { this.resolvingConfigurationStrategy = strategy; return this; } /** * Add a parameter to the configuration. + * * @param name the name of the parameter * @param value the parameter value object * @return this diff --git a/src/main/java/de/kosit/validationtool/config/FallbackBuilder.java b/src/main/java/de/kosit/validationtool/config/FallbackBuilder.java index d81b096..41998ca 100644 --- a/src/main/java/de/kosit/validationtool/config/FallbackBuilder.java +++ b/src/main/java/de/kosit/validationtool/config/FallbackBuilder.java @@ -48,8 +48,8 @@ public class FallbackBuilder implements Builder { } /** - * Specifices a source for this report. This is either used to compile the report transformation or as documentation for - * a precompiled tranformation. + * Specifices a source for this report. This is either used to compile the report transformation or as documentation + * for a precompiled tranformation. * * @param source the source * @return this @@ -60,8 +60,8 @@ public class FallbackBuilder implements Builder { } /** - * Specifices a source for this report. This is either used to compile the report transformation or as documentation for - * a precompiled tranformation. + * Specifices a source for this report. This is either used to compile the report transformation or as documentation + * for a precompiled tranformation. * * @param source the source * @return this @@ -72,8 +72,8 @@ public class FallbackBuilder implements Builder { } /** - * Specifices a source for this report. This is either used to compile the report transformation or as documentation for - * a precompiled tranformation. + * Specifices a source for this report. This is either used to compile the report transformation or as documentation + * for a precompiled tranformation. * * @param source the source * @return this diff --git a/src/main/java/de/kosit/validationtool/config/Keys.java b/src/main/java/de/kosit/validationtool/config/Keys.java index bd37c5c..3efb187 100644 --- a/src/main/java/de/kosit/validationtool/config/Keys.java +++ b/src/main/java/de/kosit/validationtool/config/Keys.java @@ -11,9 +11,10 @@ public final class Keys { * The actual scenarios file location as used with {@link ConfigurationLoader}. */ public static final String SCENARIOS_FILE = "scenarios_file"; + /** - * The actual scenarios configuration represented as serializable tree. This either loaded from file or build manually - * via {@link ConfigurationBuilder} + * The actual scenarios configuration represented as serializable tree. This either loaded from file or build + * manually via {@link ConfigurationBuilder} */ public static final String SCENARIO_DEFINITION = "scenario_definition"; diff --git a/src/main/java/de/kosit/validationtool/config/ReportBuilder.java b/src/main/java/de/kosit/validationtool/config/ReportBuilder.java index b512877..2c840f9 100644 --- a/src/main/java/de/kosit/validationtool/config/ReportBuilder.java +++ b/src/main/java/de/kosit/validationtool/config/ReportBuilder.java @@ -70,8 +70,8 @@ public class ReportBuilder implements Builder { /** * Add description for this scenario. This is part of the - * {@link de.kosit.validationtool.model.reportInput.CreateReportInput} configuration and can be used while creating the - * report + * {@link de.kosit.validationtool.model.reportInput.CreateReportInput} configuration and can be used while creating + * the report * * @param description the description * @return this diff --git a/src/main/java/de/kosit/validationtool/config/SchematronBuilder.java b/src/main/java/de/kosit/validationtool/config/SchematronBuilder.java index 73c187b..23f959b 100644 --- a/src/main/java/de/kosit/validationtool/config/SchematronBuilder.java +++ b/src/main/java/de/kosit/validationtool/config/SchematronBuilder.java @@ -70,8 +70,8 @@ public class SchematronBuilder implements Builderpath.toUpperCase().endsWith("."+e.name())).findFirst().orElse(Mediatype.MD); + return Arrays.stream(values()).filter(e -> path.toUpperCase().endsWith("." + e.name())).findFirst().orElse(Mediatype.MD); } } } diff --git a/src/main/java/de/kosit/validationtool/impl/ConversionService.java b/src/main/java/de/kosit/validationtool/impl/ConversionService.java index 5a362bf..2370f80 100644 --- a/src/main/java/de/kosit/validationtool/impl/ConversionService.java +++ b/src/main/java/de/kosit/validationtool/impl/ConversionService.java @@ -81,6 +81,7 @@ public class ConversionService { } private static final int MAX_LOG_CONTENT = 50; + // context setup private JAXBContext jaxbContext; @@ -233,9 +234,6 @@ public class ConversionService { } } - - - public T readDocument(final Source source, final Class type) { try { final Unmarshaller u = getJaxbContext().createUnmarshaller(); diff --git a/src/main/java/de/kosit/validationtool/impl/DateFactory.java b/src/main/java/de/kosit/validationtool/impl/DateFactory.java index 0c9fe9a..6abd95c 100644 --- a/src/main/java/de/kosit/validationtool/impl/DateFactory.java +++ b/src/main/java/de/kosit/validationtool/impl/DateFactory.java @@ -19,9 +19,9 @@ public class DateFactory { @SneakyThrows public static XMLGregorianCalendar createTimestamp() { - final GregorianCalendar cal = new GregorianCalendar(); - cal.setTime(new Date()); - return DatatypeFactory.newInstance().newXMLGregorianCalendar(cal); + final GregorianCalendar cal = new GregorianCalendar(); + cal.setTime(new Date()); + return DatatypeFactory.newInstance().newXMLGregorianCalendar(cal); } } diff --git a/src/main/java/de/kosit/validationtool/impl/EngineInformation.java b/src/main/java/de/kosit/validationtool/impl/EngineInformation.java index d781f94..85a51ad 100644 --- a/src/main/java/de/kosit/validationtool/impl/EngineInformation.java +++ b/src/main/java/de/kosit/validationtool/impl/EngineInformation.java @@ -1,7 +1,5 @@ package de.kosit.validationtool.impl; -import lombok.SneakyThrows; - import java.io.IOException; import java.io.InputStream; import java.util.Properties; diff --git a/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java b/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java index a8ddc26..522be56 100644 --- a/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java +++ b/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java @@ -74,8 +74,7 @@ public class ScenarioRepository { */ public Result selectScenario(final XdmNode document) { final Result result; - final List collect = getScenarios().stream().filter(s -> match(document, s)) - .collect(Collectors.toList()); + final List collect = getScenarios().stream().filter(s -> match(document, s)).collect(Collectors.toList()); if (collect.size() == 1) { result = new Result<>(collect.get(0)); } else if (collect.isEmpty()) { diff --git a/src/main/java/de/kosit/validationtool/impl/tasks/CheckAction.java b/src/main/java/de/kosit/validationtool/impl/tasks/CheckAction.java index 1973a5b..cae816f 100644 --- a/src/main/java/de/kosit/validationtool/impl/tasks/CheckAction.java +++ b/src/main/java/de/kosit/validationtool/impl/tasks/CheckAction.java @@ -125,9 +125,9 @@ public interface CheckAction { void check(Bag results); /** - * Ermittlung, ob ein Schritt u.U. ausgelassen werden kann. Die Funktion wird vor der eigentlichen Prüfaktion aufgerufen - * und kann somit eine Ausführung des Prüfschrittes verhindern. Entwickler können diese Funktion überschreiben, um den - * Prüfschritt bedingt auszuführen. + * Ermittlung, ob ein Schritt u.U. ausgelassen werden kann. Die Funktion wird vor der eigentlichen Prüfaktion + * aufgerufen und kann somit eine Ausführung des Prüfschrittes verhindern. Entwickler können diese Funktion + * überschreiben, um den Prüfschritt bedingt auszuführen. * * @param results die bisher gesammelten Information * @return true wenn der Schritt ausgelassen werden soll diff --git a/src/main/java/de/kosit/validationtool/impl/tasks/CreateReportAction.java b/src/main/java/de/kosit/validationtool/impl/tasks/CreateReportAction.java index 83e9554..7e49f76 100644 --- a/src/main/java/de/kosit/validationtool/impl/tasks/CreateReportAction.java +++ b/src/main/java/de/kosit/validationtool/impl/tasks/CreateReportAction.java @@ -70,8 +70,9 @@ import net.sf.saxon.s9api.XsltTransformer; public class CreateReportAction implements CheckAction { /** - * Wrapper to fix some inconsistencies between sax and saxon. Saxon tries to set some properties which has no effect on - * {@link JAXBSource}'s XMLReader, but it throws exceptions on unknown properties. This just drops this exceptions. + * Wrapper to fix some inconsistencies between sax and saxon. Saxon tries to set some properties which has no effect + * on {@link JAXBSource}'s XMLReader, but it throws exceptions on unknown properties. This just drops this + * exceptions. */ private static class ReaderWrapper implements XMLReader { diff --git a/src/main/java/de/kosit/validationtool/impl/tasks/SchemaValidationAction.java b/src/main/java/de/kosit/validationtool/impl/tasks/SchemaValidationAction.java index 22cca81..6337641 100644 --- a/src/main/java/de/kosit/validationtool/impl/tasks/SchemaValidationAction.java +++ b/src/main/java/de/kosit/validationtool/impl/tasks/SchemaValidationAction.java @@ -103,7 +103,6 @@ public class SchemaValidationAction implements CheckAction { private static class FileSerializedDocument implements SerializedDocument { - private final Path file; private final Processor processor; diff --git a/src/main/java/de/kosit/validationtool/impl/xml/RelativeUriResolver.java b/src/main/java/de/kosit/validationtool/impl/xml/RelativeUriResolver.java index 5c5d3b0..19c9828 100644 --- a/src/main/java/de/kosit/validationtool/impl/xml/RelativeUriResolver.java +++ b/src/main/java/de/kosit/validationtool/impl/xml/RelativeUriResolver.java @@ -105,5 +105,4 @@ public class RelativeUriResolver implements URIResolver, UnparsedTextURIResolver } } - } \ No newline at end of file diff --git a/src/test/java/de/kosit/validationtool/cmd/ExtractHtmlActionTest.java b/src/test/java/de/kosit/validationtool/cmd/ExtractHtmlActionTest.java index b392d27..7b8ccc7 100644 --- a/src/test/java/de/kosit/validationtool/cmd/ExtractHtmlActionTest.java +++ b/src/test/java/de/kosit/validationtool/cmd/ExtractHtmlActionTest.java @@ -44,7 +44,6 @@ import de.kosit.validationtool.impl.tasks.CheckAction; */ public class ExtractHtmlActionTest { - private ExtractHtmlContentAction action; private Path tmpDirectory; diff --git a/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java b/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java index b5b614d..5f0319c 100644 --- a/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java +++ b/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java @@ -38,7 +38,6 @@ import de.kosit.validationtool.impl.tasks.CheckAction; */ public class PrintReportActionTest { - private CommandLine commandLine; private PrintReportAction action; diff --git a/src/test/java/de/kosit/validationtool/cmd/SerializeReportActionTest.java b/src/test/java/de/kosit/validationtool/cmd/SerializeReportActionTest.java index c35d23b..5bb7994 100644 --- a/src/test/java/de/kosit/validationtool/cmd/SerializeReportActionTest.java +++ b/src/test/java/de/kosit/validationtool/cmd/SerializeReportActionTest.java @@ -42,7 +42,6 @@ import de.kosit.validationtool.impl.tasks.CheckAction; */ public class SerializeReportActionTest { - private Path tmpDirectory; private SerializeReportAction action; @@ -70,9 +69,9 @@ public class SerializeReportActionTest { assertThat(this.tmpDirectory.toFile().listFiles()).hasSize(1); } - //ERPT-83 + // ERPT-83 @Test - public void testName(){ + public void testName() { final String name = "some.name.with.dots"; final CheckAction.Bag b = new CheckAction.Bag(InputFactory.read("ega".getBytes(), name + ".xml")); assertThat(b.getName()).isEqualTo(name); diff --git a/src/test/java/de/kosit/validationtool/config/SimpleConfigTest.java b/src/test/java/de/kosit/validationtool/config/SimpleConfigTest.java index 8db79ad..f03d2fd 100644 --- a/src/test/java/de/kosit/validationtool/config/SimpleConfigTest.java +++ b/src/test/java/de/kosit/validationtool/config/SimpleConfigTest.java @@ -26,7 +26,4 @@ public class SimpleConfigTest { assertThat(result).isNotNull(); } - - - } diff --git a/src/test/java/de/kosit/validationtool/daemon/GuiHandlerIT.java b/src/test/java/de/kosit/validationtool/daemon/GuiHandlerIT.java index bd62201..3d7501c 100644 --- a/src/test/java/de/kosit/validationtool/daemon/GuiHandlerIT.java +++ b/src/test/java/de/kosit/validationtool/daemon/GuiHandlerIT.java @@ -1,9 +1,10 @@ package de.kosit.validationtool.daemon; -import io.restassured.http.ContentType; +import static io.restassured.RestAssured.given; + import org.junit.Test; -import static io.restassured.RestAssured.given; +import io.restassured.http.ContentType; public class GuiHandlerIT extends BaseIT { diff --git a/src/test/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceActionTest.java b/src/test/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceActionTest.java index 3bb04b2..4621ea6 100644 --- a/src/test/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceActionTest.java +++ b/src/test/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceActionTest.java @@ -23,6 +23,7 @@ import net.sf.saxon.s9api.XPathExecutable; public class ComputeAcceptanceActionTest { private static final String DOESNOT_EXIST = "count(//doesnotExist) = 0"; + private final ComputeAcceptanceAction action = new ComputeAcceptanceAction(); @Test @@ -103,7 +104,6 @@ public class ComputeAcceptanceActionTest { assertThat(bag.getAcceptStatus()).isEqualTo(AcceptRecommendation.REJECT); } - private static XPathExecutable createXpath(final String expression) { return new ContentRepository(ResolvingMode.STRICT_RELATIVE.getStrategy(), null).createXPath(expression, new HashMap<>()); } diff --git a/src/test/java/de/kosit/validationtool/impl/tasks/CreateReportActionTest.java b/src/test/java/de/kosit/validationtool/impl/tasks/CreateReportActionTest.java index 6425366..5cb73f6 100644 --- a/src/test/java/de/kosit/validationtool/impl/tasks/CreateReportActionTest.java +++ b/src/test/java/de/kosit/validationtool/impl/tasks/CreateReportActionTest.java @@ -35,7 +35,6 @@ public class CreateReportActionTest { private ContentRepository repository; - @Before public void setup() { this.repository = Simple.createContentRepository(); diff --git a/src/test/java/de/kosit/validationtool/impl/tasks/TestBagBuilder.java b/src/test/java/de/kosit/validationtool/impl/tasks/TestBagBuilder.java index 716023f..f8d0c37 100644 --- a/src/test/java/de/kosit/validationtool/impl/tasks/TestBagBuilder.java +++ b/src/test/java/de/kosit/validationtool/impl/tasks/TestBagBuilder.java @@ -57,13 +57,13 @@ public class TestBagBuilder { private static Scenario createScenario(final URI schemafile) { try { - final ScenarioType t = new ScenarioType(); - final ValidateWithXmlSchema v = new ValidateWithXmlSchema(); - final ResourceType r = new ResourceType(); - r.setLocation(schemafile.getRawPath()); - r.setName("invoice"); - v.getResource().add(r); - t.setValidateWithXmlSchema(v); + final ScenarioType t = new ScenarioType(); + final ValidateWithXmlSchema v = new ValidateWithXmlSchema(); + final ResourceType r = new ResourceType(); + r.setLocation(schemafile.getRawPath()); + r.setName("invoice"); + v.getResource().add(r); + t.setValidateWithXmlSchema(v); final Scenario scenario = new Scenario(t); scenario.setSchema(createSchema(schemafile.toURL())); return scenario; diff --git a/src/test/java/de/kosit/validationtool/impl/xml/SaxonSecurityTest.java b/src/test/java/de/kosit/validationtool/impl/xml/SaxonSecurityTest.java index 0a63475..b254022 100644 --- a/src/test/java/de/kosit/validationtool/impl/xml/SaxonSecurityTest.java +++ b/src/test/java/de/kosit/validationtool/impl/xml/SaxonSecurityTest.java @@ -49,7 +49,6 @@ import net.sf.saxon.s9api.XsltCompiler; import net.sf.saxon.s9api.XsltExecutable; import net.sf.saxon.s9api.XsltTransformer; - /** * Testet verschiedene Saxon Security Einstellungen. * @@ -77,7 +76,8 @@ public class SaxonSecurityTest { transformer.setDestination(result); transformer.transform(); - // wenn der Punkt erreicht wird, sollte wenigstens, das Element evil nicht mit 'bösen' Inhalten gefüllt sein! + // wenn der Punkt erreicht wird, sollte wenigstens, das Element evil nicht mit 'bösen' Inhalten gefüllt + // sein! if (StringUtils.isNotBlank(result.getXdmNode().getStringValue())) { fail(String.format("Saxon configuration should prevent expansion within %s", resource)); }