Reformat all code with the exception of the slf4j-android module to use 4 space indentation and max line width of 160.

This commit is contained in:
Ceki Gulcu 2015-03-26 12:59:25 +01:00
parent 32d133d01e
commit 3121243572
213 changed files with 15053 additions and 15765 deletions

View File

@ -1,295 +1,295 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="12">
<profile kind="CodeFormatterProfile" name="slf4jCodeStyle" version="12">
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
<setting id="org.eclipse.jdt.core.compiler.source" value="1.8"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="8"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.8"/>
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="8"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.8"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120"/>
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/>
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.compiler.source" value="1.8"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.8"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.8"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="160"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
</profile>
</profiles>

View File

@ -50,10 +50,9 @@ public class CompatibilityAssertionTest extends TestCase {
System.setErr(old);
}
public void test() throws Exception {
Logger logger = LoggerFactory.getLogger(this.getClass());
String msg = "hello world "+diff;
String msg = "hello world " + diff;
logger.info(msg);
assertEquals(1, sps.stringList.size());
String s0 = (String) sps.stringList.get(0);

View File

@ -63,8 +63,7 @@ public class IncompatibleMultiBindingAssertionTest extends TestCase {
assertMsgContains(list, 1, "Found binding in");
assertMsgContains(list, 2, "Found binding in");
assertMsgContains(list, 3, "See http://www.slf4j.org/codes.html");
assertMsgContains(list, 4,
"slf4j-api 1.6.x (or later) is incompatible with this binding");
assertMsgContains(list, 4, "slf4j-api 1.6.x (or later) is incompatible with this binding");
assertMsgContains(list, 5, "Your binding is version 1.5.5 or earlier.");
}

View File

@ -58,10 +58,8 @@ public class MissingSingletonMethodAssertionTest extends TestCase {
} catch (NoSuchMethodError e) {
}
int lineCount = sps.stringList
.size();
assertTrue("number of lines should be 3 but was "+lineCount, lineCount == 3);
int lineCount = sps.stringList.size();
assertTrue("number of lines should be 3 but was " + lineCount, lineCount == 3);
// expected output:
// SLF4J: slf4j-api 1.6.x (or later) is incompatible with this binding.
@ -70,8 +68,7 @@ public class MissingSingletonMethodAssertionTest extends TestCase {
{
String s = (String) sps.stringList.get(0);
assertTrue(s
.contains("SLF4J: slf4j-api 1.6.x (or later) is incompatible with this binding."));
assertTrue(s.contains("SLF4J: slf4j-api 1.6.x (or later) is incompatible with this binding."));
}
{
String s = (String) sps.stringList.get(1);
@ -79,8 +76,7 @@ public class MissingSingletonMethodAssertionTest extends TestCase {
}
{
String s = (String) sps.stringList.get(2);
assertTrue(s
.contains("SLF4J: Upgrade your binding to version 1.6.x."));
assertTrue(s.contains("SLF4J: Upgrade your binding to version 1.6.x."));
}
}

View File

@ -54,4 +54,3 @@ public class StringPrintStream extends PrintStream {
stringList.add(o.toString());
}
}

View File

@ -46,11 +46,11 @@ public class BundleTest extends TestCase {
}
public void testSmoke() {
System.out.println("==========="+new File(".").getAbsolutePath());
System.out.println("===========" + new File(".").getAbsolutePath());
mbl.dumpAll();
// check that the bundle was installed
assertTrue(mbl.exists("iBundle"));
if(fel.errorList.size() != 0) {
if (fel.errorList.size() != 0) {
fel.dumpAll();
}
// check that no errors occured

View File

@ -40,8 +40,7 @@ public class CheckingBundleListener implements BundleListener {
}
private void dump(BundleEvent be) {
System.out.println("BE:" + ", source " + be.getSource() + ", bundle="
+ be.getBundle() + ", type=" + be.getType());
System.out.println("BE:" + ", source " + be.getSource() + ", bundle=" + be.getBundle() + ", type=" + be.getType());
}
@ -56,7 +55,7 @@ public class CheckingBundleListener implements BundleListener {
for (int i = 0; i < eventList.size(); i++) {
BundleEvent fe = (BundleEvent) eventList.get(i);
Bundle b = fe.getBundle();
System.out.println("===["+b+"]");
System.out.println("===[" + b + "]");
if (bundleName.equals(b.getSymbolicName())) {
return true;
}

View File

@ -52,8 +52,7 @@ public class FelixHost {
final FrameworkErrorListener frameworkErrorListener;
final CheckingBundleListener myBundleListener;
public FelixHost(FrameworkErrorListener frameworkErrorListener,
CheckingBundleListener myBundleListener) {
public FelixHost(FrameworkErrorListener frameworkErrorListener, CheckingBundleListener myBundleListener) {
this.frameworkErrorListener = frameworkErrorListener;
this.myBundleListener = myBundleListener;
}
@ -65,14 +64,10 @@ public class FelixHost {
// configMap.put(FelixConstants.EMBEDDED_EXECUTION_PROP, "true");
// Add core OSGi packages to be exported from the class path
// via the system bundle.
configMap.put(Constants.FRAMEWORK_SYSTEMPACKAGES,
"org.osgi.framework; version=1.3.0,"
+ "org.osgi.service.packageadmin; version=1.2.0,"
+ "org.osgi.service.startlevel; version=1.0.0,"
+ "org.osgi.service.url; version=1.0.0");
configMap.put(Constants.FRAMEWORK_SYSTEMPACKAGES, "org.osgi.framework; version=1.3.0," + "org.osgi.service.packageadmin; version=1.2.0,"
+ "org.osgi.service.startlevel; version=1.0.0," + "org.osgi.service.url; version=1.0.0");
configMap.put(Constants.FRAMEWORK_STORAGE_CLEAN,
Constants.FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT);
configMap.put(Constants.FRAMEWORK_STORAGE_CLEAN, Constants.FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT);
// Explicitly specify the directory to use for caching bundles.
// configMap.put(BundleCache.CACHE_PROFILE_DIR_PROP, "cache");
@ -83,8 +78,7 @@ public class FelixHost {
List<Object> list = new ArrayList<Object>();
// list.add(new HostActivator());
configMap.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA,
"org.xml.sax, org.xml.sax.helpers, javax.xml.parsers, javax.naming");
configMap.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, "org.xml.sax, org.xml.sax.helpers, javax.xml.parsers, javax.naming");
configMap.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP, list);
configMap.put("felix.log.level", "4");
@ -95,11 +89,8 @@ public class FelixHost {
// otherProps.put(Constants.FRAMEWORK_STORAGE, "bundles");
otherProps.put(AutoProcessor.AUTO_DEPLOY_DIR_PROPERY,
AutoProcessor.AUTO_DEPLOY_DIR_VALUE);
otherProps.put(AutoProcessor.AUTO_DEPLOY_ACTION_PROPERY,
AutoProcessor.AUTO_DEPLOY_START_VALUE + ","
+ AutoProcessor.AUTO_DEPLOY_INSTALL_VALUE);
otherProps.put(AutoProcessor.AUTO_DEPLOY_DIR_PROPERY, AutoProcessor.AUTO_DEPLOY_DIR_VALUE);
otherProps.put(AutoProcessor.AUTO_DEPLOY_ACTION_PROPERY, AutoProcessor.AUTO_DEPLOY_START_VALUE + "," + AutoProcessor.AUTO_DEPLOY_INSTALL_VALUE);
BundleContext felixBudleContext = felix.getBundleContext();

View File

@ -47,15 +47,14 @@ public class FrameworkErrorListener implements FrameworkListener {
if (t != null) {
tString = t.toString();
}
System.out.println("Framework ERROR:" + ", source " + fe.getSource()
+ ", bundle=" + fe.getBundle() + ", ex=" + tString);
if(t != null) {
System.out.println("Framework ERROR:" + ", source " + fe.getSource() + ", bundle=" + fe.getBundle() + ", ex=" + tString);
if (t != null) {
t.printStackTrace();
}
}
public void dumpAll() {
for(int i = 0; i < errorList.size(); i++) {
for (int i = 0; i < errorList.size(); i++) {
FrameworkEvent fe = (FrameworkEvent) errorList.get(i);
dump(fe);
}

View File

@ -62,10 +62,8 @@ package org.apache.commons.logging;
*/
public interface Log {
// ----------------------------------------------------- Logging Properties
/**
* <p> Is debug logging currently enabled? </p>
*
@ -75,7 +73,6 @@ public interface Log {
*/
public boolean isDebugEnabled();
/**
* <p> Is error logging currently enabled? </p>
*
@ -85,7 +82,6 @@ public interface Log {
*/
public boolean isErrorEnabled();
/**
* <p> Is fatal logging currently enabled? </p>
*
@ -95,7 +91,6 @@ public interface Log {
*/
public boolean isFatalEnabled();
/**
* <p> Is info logging currently enabled? </p>
*
@ -107,7 +102,6 @@ public interface Log {
*/
public boolean isInfoEnabled();
/**
* <p> Is trace logging currently enabled? </p>
*
@ -119,7 +113,6 @@ public interface Log {
*/
public boolean isTraceEnabled();
/**
* <p> Is warn logging currently enabled? </p>
*
@ -129,10 +122,8 @@ public interface Log {
*/
public boolean isWarnEnabled();
// -------------------------------------------------------- Logging Methods
/**
* <p> Log a message with trace log level. </p>
*
@ -140,7 +131,6 @@ public interface Log {
*/
public void trace(Object message);
/**
* <p> Log an error with trace log level. </p>
*
@ -149,7 +139,6 @@ public interface Log {
*/
public void trace(Object message, Throwable t);
/**
* <p> Log a message with debug log level. </p>
*
@ -157,7 +146,6 @@ public interface Log {
*/
public void debug(Object message);
/**
* <p> Log an error with debug log level. </p>
*
@ -166,7 +154,6 @@ public interface Log {
*/
public void debug(Object message, Throwable t);
/**
* <p> Log a message with info log level. </p>
*
@ -174,7 +161,6 @@ public interface Log {
*/
public void info(Object message);
/**
* <p> Log an error with info log level. </p>
*
@ -183,7 +169,6 @@ public interface Log {
*/
public void info(Object message, Throwable t);
/**
* <p> Log a message with warn log level. </p>
*
@ -191,7 +176,6 @@ public interface Log {
*/
public void warn(Object message);
/**
* <p> Log an error with warn log level. </p>
*
@ -200,7 +184,6 @@ public interface Log {
*/
public void warn(Object message, Throwable t);
/**
* <p> Log a message with error log level. </p>
*
@ -208,7 +191,6 @@ public interface Log {
*/
public void error(Object message);
/**
* <p> Log an error with error log level. </p>
*
@ -217,7 +199,6 @@ public interface Log {
*/
public void error(Object message, Throwable t);
/**
* <p> Log a message with fatal log level. </p>
*
@ -225,7 +206,6 @@ public interface Log {
*/
public void fatal(Object message);
/**
* <p> Log an error with fatal log level. </p>
*
@ -234,5 +214,4 @@ public interface Log {
*/
public void fatal(Object message, Throwable t);
}

View File

@ -84,15 +84,13 @@ public abstract class LogFactory {
*/
public static final String FACTORY_PROPERTIES = "commons-logging.properties";
/**
* JDK1.3+ <a href="http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#Service%20Provider">
* 'Service Provider' specification</a>.
* <p>
* This property is not used but preserved here for compatibility.
*/
protected static final String SERVICE_ID =
"META-INF/services/org.apache.commons.logging.LogFactory";
protected static final String SERVICE_ID = "META-INF/services/org.apache.commons.logging.LogFactory";
/**
* The name (<code>org.apache.commons.logging.diagnostics.dest</code>) of
@ -347,8 +345,7 @@ public abstract class LogFactory {
* This method exists to ensure signature compatibility.
*/
protected static Object createFactory(String factoryClass, ClassLoader classLoader) {
throw new UnsupportedOperationException(
"Operation [factoryClass] is not supported in jcl-over-slf4j. See also "
throw new UnsupportedOperationException("Operation [factoryClass] is not supported in jcl-over-slf4j. See also "
+ UNSUPPORTED_OPERATION_IN_JCL_OVER_SLF4J);
}
@ -356,18 +353,15 @@ public abstract class LogFactory {
* This method exists to ensure signature compatibility.
*/
protected static ClassLoader directGetContextClassLoader() {
throw new UnsupportedOperationException(
"Operation [directGetContextClassLoader] is not supported in jcl-over-slf4j. See also "
throw new UnsupportedOperationException("Operation [directGetContextClassLoader] is not supported in jcl-over-slf4j. See also "
+ UNSUPPORTED_OPERATION_IN_JCL_OVER_SLF4J);
}
/**
* This method exists to ensure signature compatibility.
*/
protected static ClassLoader getContextClassLoader()
throws LogConfigurationException {
throw new UnsupportedOperationException(
"Operation [getContextClassLoader] is not supported in jcl-over-slf4j. See also "
protected static ClassLoader getContextClassLoader() throws LogConfigurationException {
throw new UnsupportedOperationException("Operation [getContextClassLoader] is not supported in jcl-over-slf4j. See also "
+ UNSUPPORTED_OPERATION_IN_JCL_OVER_SLF4J);
}
@ -375,8 +369,7 @@ public abstract class LogFactory {
* This method exists to ensure signature compatibility.
*/
protected static ClassLoader getClassLoader(Class clazz) {
throw new UnsupportedOperationException(
"Operation [getClassLoader] is not supported in jcl-over-slf4j. See also "
throw new UnsupportedOperationException("Operation [getClassLoader] is not supported in jcl-over-slf4j. See also "
+ UNSUPPORTED_OPERATION_IN_JCL_OVER_SLF4J);
}
@ -384,8 +377,7 @@ public abstract class LogFactory {
* This method exists to ensure signature compatibility.
*/
protected static boolean isDiagnosticsEnabled() {
throw new UnsupportedOperationException(
"Operation [isDiagnosticsEnabled] is not supported in jcl-over-slf4j. See also "
throw new UnsupportedOperationException("Operation [isDiagnosticsEnabled] is not supported in jcl-over-slf4j. See also "
+ UNSUPPORTED_OPERATION_IN_JCL_OVER_SLF4J);
}
@ -393,30 +385,24 @@ public abstract class LogFactory {
* This method exists to ensure signature compatibility.
*/
protected static void logRawDiagnostic(String msg) {
throw new UnsupportedOperationException(
"Operation [logRawDiagnostic] is not supported in jcl-over-slf4j. See also "
throw new UnsupportedOperationException("Operation [logRawDiagnostic] is not supported in jcl-over-slf4j. See also "
+ UNSUPPORTED_OPERATION_IN_JCL_OVER_SLF4J);
}
/**
* This method exists to ensure signature compatibility.
*/
protected static LogFactory newFactory(final String factoryClass,
final ClassLoader classLoader, final ClassLoader contextClassLoader) {
throw new UnsupportedOperationException(
"Operation [logRawDiagnostic] is not supported in jcl-over-slf4j. See also "
protected static LogFactory newFactory(final String factoryClass, final ClassLoader classLoader, final ClassLoader contextClassLoader) {
throw new UnsupportedOperationException("Operation [logRawDiagnostic] is not supported in jcl-over-slf4j. See also "
+ UNSUPPORTED_OPERATION_IN_JCL_OVER_SLF4J);
}
/**
* This method exists to ensure signature compatibility.
*/
protected static LogFactory newFactory(final String factoryClass,
final ClassLoader classLoader) {
throw new UnsupportedOperationException(
"Operation [newFactory] is not supported in jcl-over-slf4j. See also "
protected static LogFactory newFactory(final String factoryClass, final ClassLoader classLoader) {
throw new UnsupportedOperationException("Operation [newFactory] is not supported in jcl-over-slf4j. See also "
+ UNSUPPORTED_OPERATION_IN_JCL_OVER_SLF4J);
}
}

View File

@ -104,8 +104,7 @@ public class SLF4JLocationAwareLog implements Log, Serializable {
* the message to log. Converted to {@link String}
*/
public void trace(Object message) {
logger.log(null, FQCN, LocationAwareLogger.TRACE_INT, String
.valueOf(message), null, null);
logger.log(null, FQCN, LocationAwareLogger.TRACE_INT, String.valueOf(message), null, null);
}
/**
@ -118,8 +117,7 @@ public class SLF4JLocationAwareLog implements Log, Serializable {
* the exception to log
*/
public void trace(Object message, Throwable t) {
logger.log(null, FQCN, LocationAwareLogger.TRACE_INT, String
.valueOf(message), null, t);
logger.log(null, FQCN, LocationAwareLogger.TRACE_INT, String.valueOf(message), null, t);
}
/**
@ -130,8 +128,7 @@ public class SLF4JLocationAwareLog implements Log, Serializable {
* the message to log. Converted to {@link String}
*/
public void debug(Object message) {
logger.log(null, FQCN, LocationAwareLogger.DEBUG_INT, String
.valueOf(message), null, null);
logger.log(null, FQCN, LocationAwareLogger.DEBUG_INT, String.valueOf(message), null, null);
}
/**
@ -144,8 +141,7 @@ public class SLF4JLocationAwareLog implements Log, Serializable {
* the exception to log
*/
public void debug(Object message, Throwable t) {
logger.log(null, FQCN, LocationAwareLogger.DEBUG_INT, String
.valueOf(message), null, t);
logger.log(null, FQCN, LocationAwareLogger.DEBUG_INT, String.valueOf(message), null, t);
}
/**
@ -156,8 +152,7 @@ public class SLF4JLocationAwareLog implements Log, Serializable {
* the message to log. Converted to {@link String}
*/
public void info(Object message) {
logger.log(null, FQCN, LocationAwareLogger.INFO_INT, String
.valueOf(message), null, null);
logger.log(null, FQCN, LocationAwareLogger.INFO_INT, String.valueOf(message), null, null);
}
/**
@ -170,8 +165,7 @@ public class SLF4JLocationAwareLog implements Log, Serializable {
* the exception to log
*/
public void info(Object message, Throwable t) {
logger.log(null, FQCN, LocationAwareLogger.INFO_INT, String
.valueOf(message), null, t);
logger.log(null, FQCN, LocationAwareLogger.INFO_INT, String.valueOf(message), null, t);
}
/**
@ -182,8 +176,7 @@ public class SLF4JLocationAwareLog implements Log, Serializable {
* the message to log. Converted to {@link String}
*/
public void warn(Object message) {
logger.log(null, FQCN, LocationAwareLogger.WARN_INT, String
.valueOf(message), null, null);
logger.log(null, FQCN, LocationAwareLogger.WARN_INT, String.valueOf(message), null, null);
}
/**
@ -196,8 +189,7 @@ public class SLF4JLocationAwareLog implements Log, Serializable {
* the exception to log
*/
public void warn(Object message, Throwable t) {
logger.log(null, FQCN, LocationAwareLogger.WARN_INT, String
.valueOf(message), null, t);
logger.log(null, FQCN, LocationAwareLogger.WARN_INT, String.valueOf(message), null, t);
}
/**
@ -208,8 +200,7 @@ public class SLF4JLocationAwareLog implements Log, Serializable {
* the message to log. Converted to {@link String}
*/
public void error(Object message) {
logger.log(null, FQCN, LocationAwareLogger.ERROR_INT, String
.valueOf(message), null, null);
logger.log(null, FQCN, LocationAwareLogger.ERROR_INT, String.valueOf(message), null, null);
}
/**
@ -222,8 +213,7 @@ public class SLF4JLocationAwareLog implements Log, Serializable {
* the exception to log
*/
public void error(Object message, Throwable t) {
logger.log(null, FQCN, LocationAwareLogger.ERROR_INT, String
.valueOf(message), null, t);
logger.log(null, FQCN, LocationAwareLogger.ERROR_INT, String.valueOf(message), null, t);
}
/**
@ -234,8 +224,7 @@ public class SLF4JLocationAwareLog implements Log, Serializable {
* the message to log. Converted to {@link String}
*/
public void fatal(Object message) {
logger.log(null, FQCN, LocationAwareLogger.ERROR_INT, String
.valueOf(message), null, null);
logger.log(null, FQCN, LocationAwareLogger.ERROR_INT, String.valueOf(message), null, null);
}
/**
@ -248,8 +237,7 @@ public class SLF4JLocationAwareLog implements Log, Serializable {
* the exception to log
*/
public void fatal(Object message, Throwable t) {
logger.log(null, FQCN, LocationAwareLogger.ERROR_INT, String
.valueOf(message), null, t);
logger.log(null, FQCN, LocationAwareLogger.ERROR_INT, String.valueOf(message), null, t);
}
/**

View File

@ -179,10 +179,8 @@ public class SLF4JLogFactory extends LogFactory {
// possible
// for the parent class loader to mask the classes shipping in
// jcl-over-slf4j.jar.
System.out.println("WARN: The method " + SLF4JLogFactory.class
+ "#release() was invoked.");
System.out
.println("WARN: Please see http://www.slf4j.org/codes.html#release for an explanation.");
System.out.println("WARN: The method " + SLF4JLogFactory.class + "#release() was invoked.");
System.out.println("WARN: Please see http://www.slf4j.org/codes.html#release for an explanation.");
System.out.flush();
}

View File

@ -164,14 +164,11 @@ public class SimpleLog implements Log, Serializable {
}
showLogName = getBooleanProperty(systemPrefix + "showlogname", showLogName);
showShortName = getBooleanProperty(systemPrefix + "showShortLogname",
showShortName);
showDateTime = getBooleanProperty(systemPrefix + "showdatetime",
showDateTime);
showShortName = getBooleanProperty(systemPrefix + "showShortLogname", showShortName);
showDateTime = getBooleanProperty(systemPrefix + "showdatetime", showDateTime);
if (showDateTime) {
dateTimeFormat = getStringProperty(systemPrefix + "dateTimeFormat",
dateTimeFormat);
dateTimeFormat = getStringProperty(systemPrefix + "dateTimeFormat", dateTimeFormat);
try {
dateFormatter = new SimpleDateFormat(dateTimeFormat);
} catch (IllegalArgumentException e) {
@ -319,8 +316,7 @@ public class SimpleLog implements Log, Serializable {
if (shortLogName == null) {
// Cut all but the last component of the name for both styles
shortLogName = logName.substring(logName.lastIndexOf(".") + 1);
shortLogName = shortLogName
.substring(shortLogName.lastIndexOf("/") + 1);
shortLogName = shortLogName.substring(shortLogName.lastIndexOf("/") + 1);
}
buf.append(String.valueOf(shortLogName)).append(" - ");
} else if (showLogName) {
@ -654,8 +650,7 @@ public class SimpleLog implements Log, Serializable {
} else {
// Capture 'e.getTargetException()' exception for details
// alternate: log 'e.getTargetException()', and pass back 'e'.
throw new LogConfigurationException(
"Unexpected InvocationTargetException", e.getTargetException());
throw new LogConfigurationException("Unexpected InvocationTargetException", e.getTargetException());
}
}
} catch (NoSuchMethodException e) {

View File

@ -27,7 +27,6 @@ package org.apache.commons.logging;
import junit.framework.TestCase;
public class InvokeJCLTest extends TestCase {
public void testIsEnabledAPI() {
@ -63,7 +62,6 @@ public class InvokeJCLTest extends TestCase {
log.fatal(null);
log.fatal("fatal message");
log.trace(null, e);
log.trace("trace message", e);

View File

@ -82,8 +82,7 @@ public class SerializationTest extends TestCase {
public void testLocationAware() throws Exception {
JDK14LoggerFactory factory = new JDK14LoggerFactory();
SLF4JLocationAwareLog log = new SLF4JLocationAwareLog(
(LocationAwareLogger) factory.getLogger("x"));
SLF4JLocationAwareLog log = new SLF4JLocationAwareLog((LocationAwareLogger) factory.getLogger("x"));
oos.writeObject(log);
verify();
}

View File

@ -117,8 +117,7 @@ public class SLF4JBridgeHandler extends Handler {
* reach SLF4JBridgeHandler and cannot be redirected.
*/
public static void install() {
LogManager.getLogManager().getLogger("").addHandler(
new SLF4JBridgeHandler());
LogManager.getLogManager().getLogger("").addHandler(new SLF4JBridgeHandler());
}
private static java.util.logging.Logger getRootLogger() {
@ -172,7 +171,6 @@ public class SLF4JBridgeHandler extends Handler {
}
}
/**
* Initialize this handler.
*/
@ -204,8 +202,7 @@ public class SLF4JBridgeHandler extends Handler {
return LoggerFactory.getLogger(name);
}
protected void callLocationAwareLogger(LocationAwareLogger lal,
LogRecord record) {
protected void callLocationAwareLogger(LocationAwareLogger lal, LogRecord record) {
int julLevelValue = record.getLevel().intValue();
int slf4jLevel;
@ -240,7 +237,6 @@ public class SLF4JBridgeHandler extends Handler {
}
}
/**
* Get the record's message, possibly via a resource bundle.
*

View File

@ -38,7 +38,7 @@ public class ListAppender extends AppenderSkeleton {
protected void append(LoggingEvent event) {
list.add(event);
if(extractLocationInfo) {
if (extractLocationInfo) {
event.getLocationInformation();
}
}

View File

@ -36,19 +36,16 @@ import org.slf4j.LoggerFactory;
public class SLF4JBridgeHandlerPerfTest extends TestCase {
static String LOGGER_NAME = "yay";
static int RUN_LENGTH = 100*1000;
static int RUN_LENGTH = 100 * 1000;
// set to false to test enabled logging performance
boolean disabledLogger = true;
FileAppender fileAppender;
org.apache.log4j.Logger log4jRoot;
java.util.logging.Logger julRootLogger = LogManager.getLogManager()
.getLogger("");
java.util.logging.Logger julRootLogger = LogManager.getLogManager().getLogger("");
java.util.logging.Logger julLogger = java.util.logging.Logger
.getLogger(LOGGER_NAME);
java.util.logging.Logger julLogger = java.util.logging.Logger.getLogger(LOGGER_NAME);
org.slf4j.Logger slf4jLogger = LoggerFactory.getLogger(LOGGER_NAME);
Handler[] existingHandlers;
@ -100,16 +97,16 @@ public class SLF4JBridgeHandlerPerfTest extends TestCase {
public void testPerf() {
SLF4JBridgeHandler.install();
if(disabledLogger) {
if (disabledLogger) {
log4jRoot.setLevel(org.apache.log4j.Level.ERROR);
}
julLoggerLoop();
double julAvg=julLoggerLoop();
System.out.println("Average cost per call (JUL->SLF4J->log4j): "+julAvg +" nanos");
double julAvg = julLoggerLoop();
System.out.println("Average cost per call (JUL->SLF4J->log4j): " + julAvg + " nanos");
slf4jLoggerLoop();
double slf4jAvg=slf4jLoggerLoop();
System.out.println("Average cost per call (SLF4J->log4j): "+slf4jAvg +" nanos");
System.out.println("Ratio "+(julAvg/slf4jAvg));
double slf4jAvg = slf4jLoggerLoop();
System.out.println("Average cost per call (SLF4J->log4j): " + slf4jAvg + " nanos");
System.out.println("Ratio " + (julAvg / slf4jAvg));
}
}

View File

@ -39,8 +39,7 @@ public class SLF4JBridgeHandlerTest extends TestCase {
ListAppender listAppender = new ListAppender();
org.apache.log4j.Logger log4jRoot;
java.util.logging.Logger julLogger = java.util.logging.Logger
.getLogger("yay");
java.util.logging.Logger julLogger = java.util.logging.Logger.getLogger("yay");
public SLF4JBridgeHandlerTest(String arg0) {
super(arg0);
@ -110,8 +109,7 @@ public class SLF4JBridgeHandlerTest extends TestCase {
String expectedMsg = bundle.getString(resourceKey);
String msg = resourceKey;
java.util.logging.Logger julResourceBundleLogger = java.util.logging.Logger
.getLogger("yay", resourceBundleName);
java.util.logging.Logger julResourceBundleLogger = java.util.logging.Logger.getLogger("yay", resourceBundleName);
julResourceBundleLogger.info(msg);
assertEquals(1, listAppender.list.size());
@ -126,8 +124,7 @@ public class SLF4JBridgeHandlerTest extends TestCase {
String resourceBundleName = "org.slf4j.bridge.testLogStrings";
ResourceBundle bundle = ResourceBundle.getBundle(resourceBundleName);
java.util.logging.Logger julResourceBundleLogger = java.util.logging.Logger
.getLogger("foo", resourceBundleName);
java.util.logging.Logger julResourceBundleLogger = java.util.logging.Logger.getLogger("foo", resourceBundleName);
String resourceKey1 = "resource_key_1";
String expectedMsg1 = bundle.getString(resourceKey1);
@ -135,11 +132,9 @@ public class SLF4JBridgeHandlerTest extends TestCase {
String resourceKey2 = "resource_key_2";
Object[] params2 = new Object[] { "foo", "bar" };
String expectedMsg2 = MessageFormat.format(bundle.getString(resourceKey2),
params2);
String expectedMsg2 = MessageFormat.format(bundle.getString(resourceKey2), params2);
julResourceBundleLogger.log(Level.INFO, resourceKey2, params2); // 2nd log
String resourceKey3 = "invalidKey {0}";
Object[] params3 = new Object[] { "John" };
String expectedMsg3 = MessageFormat.format(resourceKey3, params3);

View File

@ -69,14 +69,12 @@ public interface Appender {
*/
public void doAppend(LoggingEvent event);
/**
* Get the name of this appender. The name uniquely identifies the
* appender.
*/
public String getName();
/**
* Set the {@link ErrorHandler} for this appender.
*
@ -105,7 +103,6 @@ public interface Appender {
*/
public Layout getLayout();
/**
* Set the name of this appender. The name is used by other
* components to identify this appender.

View File

@ -68,7 +68,9 @@ public class Category {
return Log4jLoggerFactory.getLogger(name);
}
public final Category getParent() { return null; }
public final Category getParent() {
return null;
}
/**
* Returns the obvious.
@ -79,7 +81,6 @@ public class Category {
return name;
}
public Enumeration getAllAppenders() {
return NullEnumeration.getInstance();
}
@ -181,8 +182,7 @@ public class Category {
return false;
}
void differentiatedLog(Marker marker, String fqcn, int level, Object message,
Throwable t) {
void differentiatedLog(Marker marker, String fqcn, int level, Object message, Throwable t) {
String m = convertToString(message);
if (locationAwareLogger != null) {
@ -212,8 +212,7 @@ public class Category {
* Delegates to {@link org.slf4j.Logger#debug(String)} method of SLF4J.
*/
public void debug(Object message) {
differentiatedLog(null, CATEGORY_FQCN, LocationAwareLogger.DEBUG_INT,
message, null);
differentiatedLog(null, CATEGORY_FQCN, LocationAwareLogger.DEBUG_INT, message, null);
}
/**
@ -221,16 +220,14 @@ public class Category {
* SLF4J.
*/
public void debug(Object message, Throwable t) {
differentiatedLog(null, CATEGORY_FQCN, LocationAwareLogger.DEBUG_INT,
message, t);
differentiatedLog(null, CATEGORY_FQCN, LocationAwareLogger.DEBUG_INT, message, t);
}
/**
* Delegates to {@link org.slf4j.Logger#info(String)} method in SLF4J.
*/
public void info(Object message) {
differentiatedLog(null, CATEGORY_FQCN, LocationAwareLogger.INFO_INT,
message, null);
differentiatedLog(null, CATEGORY_FQCN, LocationAwareLogger.INFO_INT, message, null);
}
/**
@ -238,16 +235,14 @@ public class Category {
* SLF4J.
*/
public void info(Object message, Throwable t) {
differentiatedLog(null, CATEGORY_FQCN, LocationAwareLogger.INFO_INT,
message, t);
differentiatedLog(null, CATEGORY_FQCN, LocationAwareLogger.INFO_INT, message, t);
}
/**
* Delegates to {@link org.slf4j.Logger#warn(String)} method in SLF4J.
*/
public void warn(Object message) {
differentiatedLog(null, CATEGORY_FQCN, LocationAwareLogger.WARN_INT,
message, null);
differentiatedLog(null, CATEGORY_FQCN, LocationAwareLogger.WARN_INT, message, null);
}
/**
@ -255,16 +250,14 @@ public class Category {
* SLF4J.
*/
public void warn(Object message, Throwable t) {
differentiatedLog(null, CATEGORY_FQCN, LocationAwareLogger.WARN_INT,
message, t);
differentiatedLog(null, CATEGORY_FQCN, LocationAwareLogger.WARN_INT, message, t);
}
/**
* Delegates to {@link org.slf4j.Logger#error(String)} method in SLF4J.
*/
public void error(Object message) {
differentiatedLog(null, CATEGORY_FQCN, LocationAwareLogger.ERROR_INT,
message, null);
differentiatedLog(null, CATEGORY_FQCN, LocationAwareLogger.ERROR_INT, message, null);
}
/**
@ -272,16 +265,14 @@ public class Category {
* SLF4J.
*/
public void error(Object message, Throwable t) {
differentiatedLog(null, CATEGORY_FQCN, LocationAwareLogger.ERROR_INT,
message, t);
differentiatedLog(null, CATEGORY_FQCN, LocationAwareLogger.ERROR_INT, message, t);
}
/**
* Delegates to {@link org.slf4j.Logger#error(String)} method in SLF4J.
*/
public void fatal(Object message) {
differentiatedLog(FATAL_MARKER, CATEGORY_FQCN,
LocationAwareLogger.ERROR_INT, message, null);
differentiatedLog(FATAL_MARKER, CATEGORY_FQCN, LocationAwareLogger.ERROR_INT, message, null);
}
/**
@ -289,8 +280,7 @@ public class Category {
* SLF4J. In addition, the call is marked with a marker named "FATAL".
*/
public void fatal(Object message, Throwable t) {
differentiatedLog(FATAL_MARKER, CATEGORY_FQCN,
LocationAwareLogger.ERROR_INT, message, t);
differentiatedLog(FATAL_MARKER, CATEGORY_FQCN, LocationAwareLogger.ERROR_INT, message, t);
}
protected void forcedLog(String FQCN, Priority p, Object msg, Throwable t) {

View File

@ -18,6 +18,7 @@
// Nicholas Wolff
package org.apache.log4j;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
@ -87,7 +88,6 @@ public class Level extends Priority implements Serializable {
*/
public static final Level TRACE = new Level(TRACE_INT, "TRACE", 7);
/**
The <code>ALL</code> has the lowest possible rank and is intended to
turn on all logging. */
@ -101,19 +101,15 @@ public class Level extends Priority implements Serializable {
/**
Instantiate a Level object.
*/
protected
Level(int level, String levelStr, int syslogEquivalent) {
protected Level(int level, String levelStr, int syslogEquivalent) {
super(level, levelStr, syslogEquivalent);
}
/**
Convert the string passed as argument to a level. If the
conversion fails, then this method returns {@link #DEBUG}.
*/
public
static
Level toLevel(String sArg) {
public static Level toLevel(String sArg) {
return (Level) toLevel(sArg, Level.DEBUG);
}
@ -122,9 +118,7 @@ public class Level extends Priority implements Serializable {
conversion fails, then this method returns {@link #DEBUG}.
*/
public
static
Level toLevel(int val) {
public static Level toLevel(int val) {
return (Level) toLevel(val, Level.DEBUG);
}
@ -132,19 +126,26 @@ public class Level extends Priority implements Serializable {
Convert an integer passed as argument to a level. If the
conversion fails, then this method returns the specified default.
*/
public
static
Level toLevel(int val, Level defaultLevel) {
switch(val) {
case ALL_INT: return ALL;
case DEBUG_INT: return Level.DEBUG;
case INFO_INT: return Level.INFO;
case WARN_INT: return Level.WARN;
case ERROR_INT: return Level.ERROR;
case FATAL_INT: return Level.FATAL;
case OFF_INT: return OFF;
case TRACE_INT: return Level.TRACE;
default: return defaultLevel;
public static Level toLevel(int val, Level defaultLevel) {
switch (val) {
case ALL_INT:
return ALL;
case DEBUG_INT:
return Level.DEBUG;
case INFO_INT:
return Level.INFO;
case WARN_INT:
return Level.WARN;
case ERROR_INT:
return Level.ERROR;
case FATAL_INT:
return Level.FATAL;
case OFF_INT:
return OFF;
case TRACE_INT:
return Level.TRACE;
default:
return defaultLevel;
}
}
@ -153,22 +154,28 @@ public class Level extends Priority implements Serializable {
conversion fails, then this method returns the value of
<code>defaultLevel</code>.
*/
public
static
Level toLevel(String sArg, Level defaultLevel) {
if(sArg == null)
public static Level toLevel(String sArg, Level defaultLevel) {
if (sArg == null)
return defaultLevel;
String s = sArg.toUpperCase();
if(s.equals("ALL")) return Level.ALL;
if(s.equals("DEBUG")) return Level.DEBUG;
if(s.equals("INFO")) return Level.INFO;
if(s.equals("WARN")) return Level.WARN;
if(s.equals("ERROR")) return Level.ERROR;
if(s.equals("FATAL")) return Level.FATAL;
if(s.equals("OFF")) return Level.OFF;
if(s.equals("TRACE")) return Level.TRACE;
if (s.equals("ALL"))
return Level.ALL;
if (s.equals("DEBUG"))
return Level.DEBUG;
if (s.equals("INFO"))
return Level.INFO;
if (s.equals("WARN"))
return Level.WARN;
if (s.equals("ERROR"))
return Level.ERROR;
if (s.equals("FATAL"))
return Level.FATAL;
if (s.equals("OFF"))
return Level.OFF;
if (s.equals("TRACE"))
return Level.TRACE;
return defaultLevel;
}

View File

@ -43,8 +43,7 @@ class Log4jLoggerFactory {
try {
Class.forName("org.slf4j.impl.Log4jLoggerFactory");
String part1 = "Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError. ";
String part2 = "See also " + LOG4J_DELEGATION_LOOP_URL
+ " for more details.";
String part2 = "See also " + LOG4J_DELEGATION_LOOP_URL + " for more details.";
Util.report(part1);
Util.report(part2);

View File

@ -42,7 +42,7 @@ public class Logger extends Category {
}
public static Logger getLogger(String name, LoggerFactory loggerFactory) {
return Log4jLoggerFactory.getLogger(name,loggerFactory);
return Log4jLoggerFactory.getLogger(name, loggerFactory);
}
public static Logger getLogger(Class clazz) {
@ -58,7 +58,6 @@ public class Logger extends Category {
return Log4jLoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
}
/**
* Delegates to {@link org.slf4j.Logger#isTraceEnabled}
* method of SLF4J.

View File

@ -57,8 +57,7 @@ public class MDC {
if (map != null) {
return new Hashtable(map);
}
else {
} else {
return new Hashtable();
}
}

View File

@ -37,7 +37,7 @@ public class Priority {
public final static int WARN_INT = 30000;
public final static int INFO_INT = 20000;
public final static int DEBUG_INT = 10000;
//public final static int FINE_INT = DEBUG_INT;
// public final static int FINE_INT = DEBUG_INT;
public final static int ALL_INT = Integer.MIN_VALUE;
/**
@ -65,7 +65,6 @@ public class Priority {
*/
final static public Priority DEBUG = new Level(DEBUG_INT, "DEBUG", 7);
/**
* Default constructor for deserialization.
*/
@ -78,8 +77,7 @@ public class Priority {
/**
Instantiate a level object.
*/
protected
Priority(int level, String levelStr, int syslogEquivalent) {
protected Priority(int level, String levelStr, int syslogEquivalent) {
this.level = level;
this.levelStr = levelStr;
this.syslogEquivalent = syslogEquivalent;
@ -89,9 +87,8 @@ public class Priority {
Two priorities are equal if their level fields are equal.
@since 1.2
*/
public
boolean equals(Object o) {
if(o instanceof Priority) {
public boolean equals(Object o) {
if (o instanceof Priority) {
Priority r = (Priority) o;
return (this.level == r.level);
} else {
@ -102,14 +99,10 @@ public class Priority {
/**
Return the syslog equivalent of this priority as an integer.
*/
public
final
int getSyslogEquivalent() {
public final int getSyslogEquivalent() {
return syslogEquivalent;
}
/**
Returns <code>true</code> if this level has a higher or equal
level than the level passed as argument, <code>false</code>
@ -119,8 +112,7 @@ public class Priority {
implementation of <code>isGreaterOrEqual</code> method.
*/
public
boolean isGreaterOrEqual(Priority r) {
public boolean isGreaterOrEqual(Priority r) {
return level >= r.level;
}
@ -130,65 +122,49 @@ public class Priority {
@deprecated This method will be removed with no replacement.
*/
public
static
Priority[] getAllPossiblePriorities() {
return new Priority[] {Priority.FATAL, Priority.ERROR, Level.WARN,
Priority.INFO, Priority.DEBUG};
public static Priority[] getAllPossiblePriorities() {
return new Priority[] { Priority.FATAL, Priority.ERROR, Level.WARN, Priority.INFO, Priority.DEBUG };
}
/**
Returns the string representation of this priority.
*/
final
public
String toString() {
final public String toString() {
return levelStr;
}
/**
Returns the integer representation of this level.
*/
public
final
int toInt() {
public final int toInt() {
return level;
}
/**
* @deprecated Please use the {@link Level#toLevel(String)} method instead.
*/
public
static
Priority toPriority(String sArg) {
public static Priority toPriority(String sArg) {
return Level.toLevel(sArg);
}
/**
* @deprecated Please use the {@link Level#toLevel(int)} method instead.
*/
public
static
Priority toPriority(int val) {
public static Priority toPriority(int val) {
return toPriority(val, Priority.DEBUG);
}
/**
* @deprecated Please use the {@link Level#toLevel(int, Level)} method instead.
*/
public
static
Priority toPriority(int val, Priority defaultPriority) {
public static Priority toPriority(int val, Priority defaultPriority) {
return Level.toLevel(val, (Level) defaultPriority);
}
/**
* @deprecated Please use the {@link Level#toLevel(String, Level)} method instead.
*/
public
static
Priority toPriority(String sArg, Priority defaultPriority) {
public static Priority toPriority(String sArg, Priority defaultPriority) {
return Level.toLevel(sArg, (Level) defaultPriority);
}
}

View File

@ -34,8 +34,7 @@ public class RollingFileAppender {
super();
}
public RollingFileAppender(Layout layout, String filename, boolean append)
throws IOException {
public RollingFileAppender(Layout layout, String filename, boolean append) throws IOException {
super();
}

View File

@ -41,8 +41,7 @@ public class LogLog {
<p> The value of this string is <b>log4j.debug</b>.
<p>Note that the search for all option names is case sensitive. */
public static final String DEBUG_KEY="log4j.debug";
public static final String DEBUG_KEY = "log4j.debug";
/**
Defining this value makes log4j components print log4j-internal
@ -54,7 +53,7 @@ public class LogLog {
@deprecated Use {@link #DEBUG_KEY} instead.
*/
public static final String CONFIG_DEBUG_KEY="log4j.configDebug";
public static final String CONFIG_DEBUG_KEY = "log4j.configDebug";
protected static boolean debugEnabled = false;
@ -73,9 +72,7 @@ public class LogLog {
/**
Allows to enable/disable log4j internal logging.
*/
static
public
void setInternalDebugging(boolean enabled) {
static public void setInternalDebugging(boolean enabled) {
debugEnabled = enabled;
}
@ -83,11 +80,9 @@ public class LogLog {
This method is used to output log4j internal debug
statements. Output goes to <code>System.out</code>.
*/
public
static
void debug(String msg) {
if(debugEnabled && !quietMode) {
System.out.println(PREFIX+msg);
public static void debug(String msg) {
if (debugEnabled && !quietMode) {
System.out.println(PREFIX + msg);
}
}
@ -95,28 +90,23 @@ public class LogLog {
This method is used to output log4j internal debug
statements. Output goes to <code>System.out</code>.
*/
public
static
void debug(String msg, Throwable t) {
if(debugEnabled && !quietMode) {
System.out.println(PREFIX+msg);
if(t != null)
public static void debug(String msg, Throwable t) {
if (debugEnabled && !quietMode) {
System.out.println(PREFIX + msg);
if (t != null)
t.printStackTrace(System.out);
}
}
/**
This method is used to output log4j internal error
statements. There is no way to disable error statements.
Output goes to <code>System.err</code>.
*/
public
static
void error(String msg) {
if(quietMode)
public static void error(String msg) {
if (quietMode)
return;
System.err.println(ERR_PREFIX+msg);
System.err.println(ERR_PREFIX + msg);
}
/**
@ -124,14 +114,12 @@ public class LogLog {
statements. There is no way to disable error statements.
Output goes to <code>System.err</code>.
*/
public
static
void error(String msg, Throwable t) {
if(quietMode)
public static void error(String msg, Throwable t) {
if (quietMode)
return;
System.err.println(ERR_PREFIX+msg);
if(t != null) {
System.err.println(ERR_PREFIX + msg);
if (t != null) {
t.printStackTrace();
}
}
@ -142,9 +130,7 @@ public class LogLog {
@param quietMode A true for not
*/
public
static
void setQuietMode(boolean quietMode) {
public static void setQuietMode(boolean quietMode) {
LogLog.quietMode = quietMode;
}
@ -152,27 +138,23 @@ public class LogLog {
This method is used to output log4j internal warning
statements. There is no way to disable warning statements.
Output goes to <code>System.err</code>. */
public
static
void warn(String msg) {
if(quietMode)
public static void warn(String msg) {
if (quietMode)
return;
System.err.println(WARN_PREFIX+msg);
System.err.println(WARN_PREFIX + msg);
}
/**
This method is used to output log4j internal warnings. There is
no way to disable warning statements. Output goes to
<code>System.err</code>. */
public
static
void warn(String msg, Throwable t) {
if(quietMode)
public static void warn(String msg, Throwable t) {
if (quietMode)
return;
System.err.println(WARN_PREFIX+msg);
if(t != null) {
System.err.println(WARN_PREFIX + msg);
if (t != null) {
t.printStackTrace();
}
}

View File

@ -16,7 +16,6 @@
package org.apache.log4j.spi;
import org.apache.log4j.spi.LoggerRepository;
import java.net.URL;
@ -40,8 +39,6 @@ public interface Configurator {
<b>null</b>. */
public static final String NULL = "null";
/**
Interpret a resource pointed by a URL and set up log4j accordingly.

View File

@ -28,16 +28,11 @@ import org.apache.log4j.*;
*/
public interface HierarchyEventListener {
// public
// void categoryCreationEvent(Category cat);
//public
//void categoryCreationEvent(Category cat);
public
void addAppenderEvent(Category cat, Appender appender);
public
void removeAppenderEvent(Category cat, Appender appender);
public void addAppenderEvent(Category cat, Appender appender);
public void removeAppenderEvent(Category cat, Appender appender);
}

View File

@ -31,7 +31,6 @@ import org.apache.log4j.Logger;
*/
public interface LoggerFactory {
public
Logger makeNewLoggerInstance(String name);
public Logger makeNewLoggerInstance(String name);
}

View File

@ -75,11 +75,9 @@ public interface LoggerRepository {
public Logger getRootLogger();
public
abstract Logger exists(String name);
public abstract Logger exists(String name);
public
abstract void shutdown();
public abstract void shutdown();
@SuppressWarnings("rawtypes")
public Enumeration getCurrentLoggers();
@ -90,11 +88,8 @@ public interface LoggerRepository {
@SuppressWarnings("rawtypes")
public Enumeration getCurrentCategories();
public abstract void fireAddAppenderEvent(Category logger, Appender appender);
public
abstract void fireAddAppenderEvent(Category logger, Appender appender);
public
abstract void resetConfiguration();
public abstract void resetConfiguration();
}

View File

@ -25,7 +25,6 @@ import java.io.Reader;
import java.net.URL;
import java.util.Properties;
import org.w3c.dom.Element;
public class DOMConfigurator implements Configurator {

View File

@ -31,7 +31,6 @@ import junit.framework.TestCase;
*/
public class NDCTest extends TestCase {
public void setUp() {
assertEquals(0, NDC.getDepth());
}

View File

@ -45,22 +45,22 @@ public class Bug131 extends TestCase {
int n = 0;
log4jLogger.trace("msg" +(n++));
log4jLogger.debug("msg" +(n++));
log4jLogger.info("msg" +(n++));
log4jLogger.warn("msg" +(n++));
log4jLogger.error("msg" +(n++));
log4jLogger.fatal("msg" +(n++));
log4jLogger.trace("msg" + (n++));
log4jLogger.debug("msg" + (n++));
log4jLogger.info("msg" + (n++));
log4jLogger.warn("msg" + (n++));
log4jLogger.error("msg" + (n++));
log4jLogger.fatal("msg" + (n++));
log4jCategory.debug("msg" +(n++));
log4jCategory.info("msg" +(n++));
log4jCategory.warn("msg" +(n++));
log4jCategory.error("msg" +(n++));
log4jCategory.fatal("msg" +(n++));
log4jCategory.debug("msg" + (n++));
log4jCategory.info("msg" + (n++));
log4jCategory.warn("msg" + (n++));
log4jCategory.error("msg" + (n++));
log4jCategory.fatal("msg" + (n++));
assertEquals(n, listHandler.list.size());
for(int i = 0; i < n; i++) {
for (int i = 0; i < n; i++) {
LogRecord logRecord = (LogRecord) listHandler.list.get(i);
assertEquals("testBug131", logRecord.getSourceMethodName());
}

View File

@ -44,8 +44,8 @@ public class Bug139 extends TestCase {
int n = 0;
log4jLogger.log(org.apache.log4j.Level.DEBUG, "hello"+(++n));
log4jCategory.log(org.apache.log4j.Level.DEBUG, "world"+(++n));
log4jLogger.log(org.apache.log4j.Level.DEBUG, "hello" + (++n));
log4jCategory.log(org.apache.log4j.Level.DEBUG, "world" + (++n));
assertEquals(n, listHandler.list.size());

View File

@ -43,18 +43,23 @@ import org.osgi.framework.ServiceRegistration;
* @version $Rev$, $Date$
*/
public class LogServiceFactory implements ServiceFactory {
/* (non-Javadoc)
* @see org.osgi.framework.ServiceFactory#getService(org.osgi.framework.Bundle, org.osgi.framework.ServiceRegistration)
/*
* (non-Javadoc)
*
* @see org.osgi.framework.ServiceFactory#getService(org.osgi.framework.Bundle,
* org.osgi.framework.ServiceRegistration)
*/
public Object getService(Bundle bundle, ServiceRegistration arg1) {
return new LogServiceImpl(bundle);
}
/* (non-Javadoc)
* @see org.osgi.framework.ServiceFactory#ungetService(org.osgi.framework.Bundle, org.osgi.framework.ServiceRegistration, java.lang.Object)
/*
* (non-Javadoc)
*
* @see org.osgi.framework.ServiceFactory#ungetService(org.osgi.framework.Bundle,
* org.osgi.framework.ServiceRegistration, java.lang.Object)
*/
public void ungetService(Bundle bundle, ServiceRegistration arg1, Object arg2) {
//nothing to do.
// nothing to do.
}
}

View File

@ -52,7 +52,6 @@ public class LogServiceImpl implements LogService {
private final Logger delegate;
/**
* Creates a new instance of LogServiceImpl.
*
@ -96,8 +95,7 @@ public class LogServiceImpl implements LogService {
/*
* (non-Javadoc)
*
* @see org.osgi.service.log.LogService#log(int, java.lang.String,
* java.lang.Throwable)
* @see org.osgi.service.log.LogService#log(int, java.lang.String, java.lang.Throwable)
*/
public void log(int level, String message, Throwable exception) {
@ -122,29 +120,28 @@ public class LogServiceImpl implements LogService {
/*
* (non-Javadoc)
*
* @see org.osgi.service.log.LogService#log(org.osgi.framework.ServiceReference,
* int, java.lang.String)
* @see org.osgi.service.log.LogService#log(org.osgi.framework.ServiceReference, int, java.lang.String)
*/
public void log(ServiceReference sr, int level, String message) {
switch (level) {
case LOG_DEBUG:
if(delegate.isDebugEnabled()){
if (delegate.isDebugEnabled()) {
delegate.debug(createMessage(sr, message));
}
break;
case LOG_ERROR:
if(delegate.isErrorEnabled()){
if (delegate.isErrorEnabled()) {
delegate.error(createMessage(sr, message));
}
break;
case LOG_INFO:
if(delegate.isInfoEnabled()){
if (delegate.isInfoEnabled()) {
delegate.info(createMessage(sr, message));
}
break;
case LOG_WARNING:
if(delegate.isWarnEnabled()){
if (delegate.isWarnEnabled()) {
delegate.warn(createMessage(sr, message));
}
break;
@ -176,29 +173,29 @@ public class LogServiceImpl implements LogService {
/*
* (non-Javadoc)
*
* @see org.osgi.service.log.LogService#log(org.osgi.framework.ServiceReference,
* int, java.lang.String, java.lang.Throwable)
* @see org.osgi.service.log.LogService#log(org.osgi.framework.ServiceReference, int, java.lang.String,
* java.lang.Throwable)
*/
public void log(ServiceReference sr, int level, String message, Throwable exception) {
switch (level) {
case LOG_DEBUG:
if(delegate.isDebugEnabled()){
if (delegate.isDebugEnabled()) {
delegate.debug(createMessage(sr, message), exception);
}
break;
case LOG_ERROR:
if(delegate.isErrorEnabled()){
if (delegate.isErrorEnabled()) {
delegate.error(createMessage(sr, message), exception);
}
break;
case LOG_INFO:
if(delegate.isInfoEnabled()){
if (delegate.isInfoEnabled()) {
delegate.info(createMessage(sr, message), exception);
}
break;
case LOG_WARNING:
if(delegate.isWarnEnabled()){
if (delegate.isWarnEnabled()) {
delegate.warn(createMessage(sr, message), exception);
}
break;

View File

@ -24,7 +24,6 @@
*/
package org.slf4j;
/**
* Implementations of this interface are used to manufacture {@link Marker}
* instances.
@ -71,7 +70,6 @@ public interface IMarkerFactory {
*/
boolean detachMarker(String name);
/**
* Create a marker which is detached (even at birth) from this IMarkerFactory.
*

View File

@ -63,7 +63,6 @@ package org.slf4j;
*/
public interface Logger {
/**
* Case insensitive String constant used to retrieve the name of the root logger.
*
@ -86,7 +85,6 @@ public interface Logger {
*/
public boolean isTraceEnabled();
/**
* Log a message at the TRACE level.
*
@ -95,7 +93,6 @@ public interface Logger {
*/
public void trace(String msg);
/**
* Log a message at the TRACE level according to the specified format
* and argument.
@ -109,7 +106,6 @@ public interface Logger {
*/
public void trace(String format, Object arg);
/**
* Log a message at the TRACE level according to the specified format
* and arguments.
@ -150,7 +146,6 @@ public interface Logger {
*/
public void trace(String msg, Throwable t);
/**
* Similar to {@link #isTraceEnabled()} method except that the
* marker data is also taken into account.
@ -183,7 +178,6 @@ public interface Logger {
*/
public void trace(Marker marker, String format, Object arg);
/**
* This method is similar to {@link #trace(String, Object, Object)}
* method except that the marker data is also taken into
@ -209,7 +203,6 @@ public interface Logger {
*/
public void trace(Marker marker, String format, Object... argArray);
/**
* This method is similar to {@link #trace(String, Throwable)} method except that the
* marker data is also taken into consideration.
@ -221,7 +214,6 @@ public interface Logger {
*/
public void trace(Marker marker, String msg, Throwable t);
/**
* Is the logger instance enabled for the DEBUG level?
*
@ -230,7 +222,6 @@ public interface Logger {
*/
public boolean isDebugEnabled();
/**
* Log a message at the DEBUG level.
*
@ -238,7 +229,6 @@ public interface Logger {
*/
public void debug(String msg);
/**
* Log a message at the DEBUG level according to the specified format
* and argument.
@ -251,7 +241,6 @@ public interface Logger {
*/
public void debug(String format, Object arg);
/**
* Log a message at the DEBUG level according to the specified format
* and arguments.
@ -290,7 +279,6 @@ public interface Logger {
*/
public void debug(String msg, Throwable t);
/**
* Similar to {@link #isDebugEnabled()} method except that the
* marker data is also taken into account.
@ -319,7 +307,6 @@ public interface Logger {
*/
public void debug(Marker marker, String format, Object arg);
/**
* This method is similar to {@link #debug(String, Object, Object)}
* method except that the marker data is also taken into
@ -343,7 +330,6 @@ public interface Logger {
*/
public void debug(Marker marker, String format, Object... arguments);
/**
* This method is similar to {@link #debug(String, Throwable)} method except that the
* marker data is also taken into consideration.
@ -354,7 +340,6 @@ public interface Logger {
*/
public void debug(Marker marker, String msg, Throwable t);
/**
* Is the logger instance enabled for the INFO level?
*
@ -363,7 +348,6 @@ public interface Logger {
*/
public boolean isInfoEnabled();
/**
* Log a message at the INFO level.
*
@ -371,7 +355,6 @@ public interface Logger {
*/
public void info(String msg);
/**
* Log a message at the INFO level according to the specified format
* and argument.
@ -384,7 +367,6 @@ public interface Logger {
*/
public void info(String format, Object arg);
/**
* Log a message at the INFO level according to the specified format
* and arguments.
@ -462,7 +444,6 @@ public interface Logger {
*/
public void info(Marker marker, String format, Object arg1, Object arg2);
/**
* This method is similar to {@link #info(String, Object...)}
* method except that the marker data is also taken into
@ -474,7 +455,6 @@ public interface Logger {
*/
public void info(Marker marker, String format, Object... arguments);
/**
* This method is similar to {@link #info(String, Throwable)} method
* except that the marker data is also taken into consideration.
@ -485,7 +465,6 @@ public interface Logger {
*/
public void info(Marker marker, String msg, Throwable t);
/**
* Is the logger instance enabled for the WARN level?
*
@ -513,7 +492,6 @@ public interface Logger {
*/
public void warn(String format, Object arg);
/**
* Log a message at the WARN level according to the specified format
* and arguments.
@ -552,7 +530,6 @@ public interface Logger {
*/
public void warn(String msg, Throwable t);
/**
* Similar to {@link #isWarnEnabled()} method except that the marker
* data is also taken into consideration.
@ -604,7 +581,6 @@ public interface Logger {
*/
public void warn(Marker marker, String format, Object... arguments);
/**
* This method is similar to {@link #warn(String, Throwable)} method
* except that the marker data is also taken into consideration.
@ -615,7 +591,6 @@ public interface Logger {
*/
public void warn(Marker marker, String msg, Throwable t);
/**
* Is the logger instance enabled for the ERROR level?
*
@ -681,7 +656,6 @@ public interface Logger {
*/
public void error(String msg, Throwable t);
/**
* Similar to {@link #isErrorEnabled()} method except that the
* marker data is also taken into consideration.
@ -733,7 +707,6 @@ public interface Logger {
*/
public void error(Marker marker, String format, Object... arguments);
/**
* This method is similar to {@link #error(String, Throwable)}
* method except that the marker data is also taken into

View File

@ -71,8 +71,7 @@ public final class LoggerFactory {
static final String LOGGER_NAME_MISMATCH_URL = CODES_PREFIX + "#loggerNameMismatch";
static final String UNSUCCESSFUL_INIT_URL = CODES_PREFIX + "#unsuccessfulInit";
static final String UNSUCCESSFUL_INIT_MSG = "org.slf4j.LoggerFactory could not be successfully initialized. See also "
+ UNSUCCESSFUL_INIT_URL;
static final String UNSUCCESSFUL_INIT_MSG = "org.slf4j.LoggerFactory could not be successfully initialized. See also " + UNSUCCESSFUL_INIT_URL;
static final int UNINITIALIZED = 0;
static final int ONGOING_INITIALIZATION = 1;
@ -306,8 +305,8 @@ public final class LoggerFactory {
if (DETECT_LOGGER_NAME_MISMATCH) {
Class<?> autoComputedCallingClass = Util.getCallingClass();
if (nonMatchingClasses(clazz, autoComputedCallingClass)) {
Util.report(String.format("Detected logger name mismatch. Given name: \"%s\"; computed name: \"%s\".",
logger.getName(), autoComputedCallingClass.getName()));
Util.report(String.format("Detected logger name mismatch. Given name: \"%s\"; computed name: \"%s\".", logger.getName(),
autoComputedCallingClass.getName()));
Util.report("See " + LOGGER_NAME_MISMATCH_URL + " for an explanation");
}
}

View File

@ -119,14 +119,12 @@ public class MDC {
* @throws IllegalArgumentException
* in case the "key" parameter is null
*/
public static void put(String key, String val)
throws IllegalArgumentException {
public static void put(String key, String val) throws IllegalArgumentException {
if (key == null) {
throw new IllegalArgumentException("key parameter cannot be null");
}
if (mdcAdapter == null) {
throw new IllegalStateException("MDCAdapter cannot be null. See also "
+ NULL_MDCA_URL);
throw new IllegalStateException("MDCAdapter cannot be null. See also " + NULL_MDCA_URL);
}
mdcAdapter.put(key, val);
}
@ -159,8 +157,7 @@ public class MDC {
* @throws IllegalArgumentException
* in case the "key" parameter is null
*/
public static MDCCloseable putCloseable(String key, String val)
throws IllegalArgumentException {
public static MDCCloseable putCloseable(String key, String val) throws IllegalArgumentException {
put(key, val);
return new MDCCloseable(key);
}
@ -183,8 +180,7 @@ public class MDC {
}
if (mdcAdapter == null) {
throw new IllegalStateException("MDCAdapter cannot be null. See also "
+ NULL_MDCA_URL);
throw new IllegalStateException("MDCAdapter cannot be null. See also " + NULL_MDCA_URL);
}
return mdcAdapter.get(key);
}
@ -205,8 +201,7 @@ public class MDC {
}
if (mdcAdapter == null) {
throw new IllegalStateException("MDCAdapter cannot be null. See also "
+ NULL_MDCA_URL);
throw new IllegalStateException("MDCAdapter cannot be null. See also " + NULL_MDCA_URL);
}
mdcAdapter.remove(key);
}
@ -216,8 +211,7 @@ public class MDC {
*/
public static void clear() {
if (mdcAdapter == null) {
throw new IllegalStateException("MDCAdapter cannot be null. See also "
+ NULL_MDCA_URL);
throw new IllegalStateException("MDCAdapter cannot be null. See also " + NULL_MDCA_URL);
}
mdcAdapter.clear();
}
@ -231,8 +225,7 @@ public class MDC {
*/
public static Map<String, String> getCopyOfContextMap() {
if (mdcAdapter == null) {
throw new IllegalStateException("MDCAdapter cannot be null. See also "
+ NULL_MDCA_URL);
throw new IllegalStateException("MDCAdapter cannot be null. See also " + NULL_MDCA_URL);
}
return mdcAdapter.getCopyOfContextMap();
}
@ -248,8 +241,7 @@ public class MDC {
*/
public static void setContextMap(Map<String, String> contextMap) {
if (mdcAdapter == null) {
throw new IllegalStateException("MDCAdapter cannot be null. See also "
+ NULL_MDCA_URL);
throw new IllegalStateException("MDCAdapter cannot be null. See also " + NULL_MDCA_URL);
}
mdcAdapter.setContextMap(contextMap);
}

View File

@ -43,14 +43,13 @@ import java.util.Map;
*/
public class BasicMDCAdapter implements MDCAdapter {
private InheritableThreadLocal<Map<String, String>> inheritableThreadLocal
= new InheritableThreadLocal<Map<String, String>>();
private InheritableThreadLocal<Map<String, String>> inheritableThreadLocal = new InheritableThreadLocal<Map<String, String>>();
static boolean isJDK14() {
try {
String javaVersion = System.getProperty("java.version");
return javaVersion.startsWith("1.4");
} catch(SecurityException se) {
} catch (SecurityException se) {
// punt and assume JDK 1.5 or later
return false;
}
@ -58,7 +57,6 @@ public class BasicMDCAdapter implements MDCAdapter {
static boolean IS_JDK14 = isJDK14();
/**
* Put a context value (the <code>val</code> parameter) as identified with
* the <code>key</code> parameter into the current thread's context map.
@ -77,7 +75,7 @@ public class BasicMDCAdapter implements MDCAdapter {
}
Map<String, String> map = (Map<String, String>) inheritableThreadLocal.get();
if (map == null) {
map = Collections.<String, String>synchronizedMap(new HashMap<String, String>());
map = Collections.<String, String> synchronizedMap(new HashMap<String, String>());
inheritableThreadLocal.set(map);
}
map.put(key, val);
@ -114,7 +112,7 @@ public class BasicMDCAdapter implements MDCAdapter {
map.clear();
// the InheritableThreadLocal.remove method was introduced in JDK 1.5
// Thus, invoking clear() on previous JDK 1.4 will fail
if(isJDK14()) {
if (isJDK14()) {
inheritableThreadLocal.set(null);
} else {
inheritableThreadLocal.remove();
@ -136,6 +134,7 @@ public class BasicMDCAdapter implements MDCAdapter {
return null;
}
}
/**
* Return a copy of the current thread's context map.
* Returned value may be null.
@ -144,7 +143,7 @@ public class BasicMDCAdapter implements MDCAdapter {
public Map<String, String> getCopyOfContextMap() {
Map<String, String> oldMap = (Map<String, String>) inheritableThreadLocal.get();
if (oldMap != null) {
Map<String, String> newMap = Collections.<String, String>synchronizedMap(new HashMap<String, String>());
Map<String, String> newMap = Collections.<String, String> synchronizedMap(new HashMap<String, String>());
synchronized (oldMap) {
newMap.putAll(oldMap);
}
@ -155,7 +154,7 @@ public class BasicMDCAdapter implements MDCAdapter {
}
public void setContextMap(Map<String, String> contextMap) {
Map<String, String> map = Collections.<String, String>synchronizedMap(new HashMap<String, String>(contextMap));
Map<String, String> map = Collections.<String, String> synchronizedMap(new HashMap<String, String>(contextMap));
inheritableThreadLocal.set(map);
}

View File

@ -57,8 +57,7 @@ public class BasicMarker implements Marker {
public synchronized void add(Marker reference) {
if (reference == null) {
throw new IllegalArgumentException(
"A null value cannot be added to a Marker as reference.");
throw new IllegalArgumentException("A null value cannot be added to a Marker as reference.");
}
// no point in adding the reference multiple times
@ -158,7 +157,6 @@ public class BasicMarker implements Marker {
private static String CLOSE = " ]";
private static String SEP = ", ";
public boolean equals(Object obj) {
if (this == obj)
return true;

View File

@ -86,17 +86,14 @@ public class BasicMarkerFactory implements IMarkerFactory {
}
public boolean detachMarker(String name) {
if(name == null) {
if (name == null) {
return false;
}
return (markerMap.remove(name) != null);
}
public Marker getDetachedMarker(String name) {
return new BasicMarker(name);
}
}

View File

@ -31,7 +31,6 @@ package org.slf4j.helpers;
*/
public class FormattingTuple {
static public FormattingTuple NULL = new FormattingTuple(null);
private String message;
@ -45,7 +44,7 @@ public class FormattingTuple {
public FormattingTuple(String message, Object[] argArray, Throwable throwable) {
this.message = message;
this.throwable = throwable;
if(throwable == null) {
if (throwable == null) {
this.argArray = argArray;
} else {
this.argArray = trimmedCopy(argArray);
@ -53,10 +52,10 @@ public class FormattingTuple {
}
static Object[] trimmedCopy(Object[] argArray) {
if(argArray == null || argArray.length == 0) {
if (argArray == null || argArray.length == 0) {
throw new IllegalStateException("non-sensical empty or null argument array");
}
final int trimemdLen = argArray.length -1;
final int trimemdLen = argArray.length - 1;
Object[] trimmed = new Object[trimemdLen];
System.arraycopy(argArray, 0, trimmed, 0, trimemdLen);
return trimmed;

View File

@ -27,7 +27,6 @@ package org.slf4j.helpers;
import org.slf4j.Logger;
import org.slf4j.Marker;
/**
* This class serves as base for adapters or native implementations of logging systems
* lacking Marker support. In this implementation, methods taking marker data
@ -136,7 +135,6 @@ public abstract class MarkerIgnoringBase extends NamedLoggerBase implements Logg
warn(msg, t);
}
public boolean isErrorEnabled(Marker marker) {
return isErrorEnabled();
}
@ -162,7 +160,7 @@ public abstract class MarkerIgnoringBase extends NamedLoggerBase implements Logg
}
public String toString() {
return this.getClass().getName()+"("+getName()+")";
return this.getClass().getName() + "(" + getName() + ")";
}
}

View File

@ -147,8 +147,7 @@ final public class MessageFormatter {
* anchor
* @return The formatted message
*/
final public static FormattingTuple format(final String messagePattern,
Object arg1, Object arg2) {
final public static FormattingTuple format(final String messagePattern, Object arg1, Object arg2) {
return arrayFormat(messagePattern, new Object[] { arg1, arg2 });
}
@ -176,8 +175,7 @@ final public class MessageFormatter {
* anchors
* @return The formatted message
*/
final public static FormattingTuple arrayFormat(final String messagePattern,
final Object[] argArray) {
final public static FormattingTuple arrayFormat(final String messagePattern, final Object[] argArray) {
Throwable throwableCandidate = getThrowableCandidate(argArray);
@ -202,13 +200,11 @@ final public class MessageFormatter {
if (j == -1) {
// no more variables
if (i == 0) { // this is a simple string
return new FormattingTuple(messagePattern, argArray,
throwableCandidate);
return new FormattingTuple(messagePattern, argArray, throwableCandidate);
} else { // add the tail string which contains no variables and return
// the result.
sbuf.append(messagePattern.substring(i, messagePattern.length()));
return new FormattingTuple(sbuf.toString(), argArray,
throwableCandidate);
return new FormattingTuple(sbuf.toString(), argArray, throwableCandidate);
}
} else {
if (isEscapedDelimeter(messagePattern, j)) {
@ -242,8 +238,7 @@ final public class MessageFormatter {
}
}
final static boolean isEscapedDelimeter(String messagePattern,
int delimeterStartIndex) {
final static boolean isEscapedDelimeter(String messagePattern, int delimeterStartIndex) {
if (delimeterStartIndex == 0) {
return false;
@ -256,10 +251,8 @@ final public class MessageFormatter {
}
}
final static boolean isDoubleEscaped(String messagePattern,
int delimeterStartIndex) {
if (delimeterStartIndex >= 2
&& messagePattern.charAt(delimeterStartIndex - 2) == ESCAPE_CHAR) {
final static boolean isDoubleEscaped(String messagePattern, int delimeterStartIndex) {
if (delimeterStartIndex >= 2 && messagePattern.charAt(delimeterStartIndex - 2) == ESCAPE_CHAR) {
return true;
} else {
return false;
@ -267,8 +260,7 @@ final public class MessageFormatter {
}
// special treatment of array values was suggested by 'lizongbo'
private static void deeplyAppendParameter(StringBuilder sbuf, Object o,
Map<Object[], Object> seenMap) {
private static void deeplyAppendParameter(StringBuilder sbuf, Object o, Map<Object[], Object> seenMap) {
if (o == null) {
sbuf.append("null");
return;
@ -305,17 +297,14 @@ final public class MessageFormatter {
String oAsString = o.toString();
sbuf.append(oAsString);
} catch (Throwable t) {
System.err
.println("SLF4J: Failed toString() invocation on an object of type ["
+ o.getClass().getName() + "]");
System.err.println("SLF4J: Failed toString() invocation on an object of type [" + o.getClass().getName() + "]");
t.printStackTrace();
sbuf.append("[FAILED toString()]");
}
}
private static void objectArrayAppend(StringBuilder sbuf, Object[] a,
Map<Object[], Object> seenMap) {
private static void objectArrayAppend(StringBuilder sbuf, Object[] a, Map<Object[], Object> seenMap) {
sbuf.append('[');
if (!seenMap.containsKey(a)) {
seenMap.put(a, null);

View File

@ -27,7 +27,6 @@ package org.slf4j.helpers;
import org.slf4j.Logger;
import org.slf4j.helpers.MarkerIgnoringBase;
/**
* A direct NOP (no operation) implementation of {@link Logger}.
*
@ -117,8 +116,6 @@ public class NOPLogger extends MarkerIgnoringBase {
// NOP
}
/** A NOP implementation. */
final public void debug(String msg, Throwable t) {
// NOP
@ -133,7 +130,6 @@ public class NOPLogger extends MarkerIgnoringBase {
return false;
}
/** A NOP implementation. */
final public void info(String msg) {
// NOP
@ -154,13 +150,11 @@ public class NOPLogger extends MarkerIgnoringBase {
// NOP
}
/** A NOP implementation. */
final public void info(String msg, Throwable t) {
// NOP
}
/**
* Always returns false.
* @return always false
@ -189,13 +183,11 @@ public class NOPLogger extends MarkerIgnoringBase {
// NOP
}
/** A NOP implementation. */
final public void warn(String msg, Throwable t) {
// NOP
}
/** A NOP implementation. */
final public boolean isErrorEnabled() {
return false;
@ -221,7 +213,6 @@ public class NOPLogger extends MarkerIgnoringBase {
// NOP
}
/** A NOP implementation. */
final public void error(String msg, Throwable t) {
// NOP

View File

@ -28,7 +28,6 @@ import org.slf4j.ILoggerFactory;
import org.slf4j.Logger;
import org.slf4j.helpers.NOPLogger;
/**
* NOPLoggerFactory is an trivial implementation of {@link
* ILoggerFactory} which always returns the unique instance of

View File

@ -292,12 +292,15 @@ public class SubstituteLogger implements Logger {
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
SubstituteLogger that = (SubstituteLogger) o;
if (!name.equals(that.name)) return false;
if (!name.equals(that.name))
return false;
return true;
}

View File

@ -24,7 +24,6 @@
*/
package org.slf4j.helpers;
/**
* An internal utility class.
*
@ -33,7 +32,8 @@ package org.slf4j.helpers;
*/
public final class Util {
private Util() {}
private Util() {
}
/**
* In order to call {@link SecurityManager#getClassContext()}, which is a
@ -59,16 +59,14 @@ public final class Util {
// Advance until Util is found
int i;
for(i = 0; i < trace.length; i++) {
if(thisClassName.equals(trace[i].getName()))
for (i = 0; i < trace.length; i++) {
if (thisClassName.equals(trace[i].getName()))
break;
}
// trace[i] = Util; trace[i+1] = caller; trace[i+2] = caller's caller
if(i >= trace.length || i + 2 >= trace.length) {
throw new IllegalStateException(
"Failed to find org.slf4j.helpers.Util or its caller in the stack; " +
"this should not happen");
if (i >= trace.length || i + 2 >= trace.length) {
throw new IllegalStateException("Failed to find org.slf4j.helpers.Util or its caller in the stack; " + "this should not happen");
}
return trace[i + 2];

View File

@ -26,7 +26,6 @@ package org.slf4j.impl;
import org.slf4j.spi.MDCAdapter;
/**
* This class is only a stub. Real implementations are found in
* each SLF4J binding project, e.g. slf4j-nop, slf4j-log4j12 etc.
@ -35,7 +34,6 @@ import org.slf4j.spi.MDCAdapter;
*/
public class StaticMDCBinder {
/**
* The unique instance of this class.
*/

View File

@ -67,5 +67,4 @@ public class StaticMarkerBinder implements MarkerFactoryBinder {
throw new UnsupportedOperationException("This code should never make it into the jar");
}
}

View File

@ -45,7 +45,6 @@ public interface LocationAwareLogger extends Logger {
final public int WARN_INT = 30;
final public int ERROR_INT = 40;
/**
* Printing method with support for location information.
*

View File

@ -26,7 +26,6 @@ package org.slf4j.spi;
import org.slf4j.IMarkerFactory;
/**
* An internal interface which helps the static {@link org.slf4j.MarkerFactory}
* class bind with the appropriate {@link IMarkerFactory} instance.

View File

@ -143,7 +143,7 @@ public class BasicMarkerTest extends TestCase {
}
public void testSelfRecursion() {
final String diffPrefix = "NEW_"+diff;
final String diffPrefix = "NEW_" + diff;
final String PARENT_NAME = diffPrefix + PARENT_MARKER_STR;
final String NOT_CONTAINED_NAME = diffPrefix + NOT_CONTAINED_MARKER_STR;
Marker parent = factory.getMarker(PARENT_NAME);
@ -156,10 +156,10 @@ public class BasicMarkerTest extends TestCase {
}
public void testIndirectRecursion() {
final String diffPrefix = "NEW_"+diff;
final String PARENT_NAME=diffPrefix+PARENT_MARKER_STR;
final String CHILD_NAME=diffPrefix+CHILD_MARKER_STR;
final String NOT_CONTAINED_NAME=diffPrefix+NOT_CONTAINED_MARKER_STR;
final String diffPrefix = "NEW_" + diff;
final String PARENT_NAME = diffPrefix + PARENT_MARKER_STR;
final String CHILD_NAME = diffPrefix + CHILD_MARKER_STR;
final String NOT_CONTAINED_NAME = diffPrefix + NOT_CONTAINED_MARKER_STR;
Marker parent = factory.getMarker(PARENT_NAME);
Marker child = factory.getMarker(CHILD_NAME);
@ -176,9 +176,9 @@ public class BasicMarkerTest extends TestCase {
}
public void testHomonyms() {
final String diffPrefix = "homonym"+diff;
final String PARENT_NAME=diffPrefix+PARENT_MARKER_STR;
final String CHILD_NAME=diffPrefix+CHILD_MARKER_STR;
final String diffPrefix = "homonym" + diff;
final String PARENT_NAME = diffPrefix + PARENT_MARKER_STR;
final String CHILD_NAME = diffPrefix + CHILD_MARKER_STR;
Marker parent = factory.getMarker(PARENT_NAME);
Marker child = factory.getMarker(CHILD_NAME);
parent.add(child);

View File

@ -37,17 +37,17 @@ public class NoBindingTest extends TestCase {
public void testLogger() {
Logger logger = LoggerFactory.getLogger(NoBindingTest.class);
logger.debug("hello"+diff);
logger.debug("hello" + diff);
assertTrue(logger instanceof NOPLogger);
}
public void testMDC() {
MDC.put("k"+diff, "v");
MDC.put("k" + diff, "v");
assertNull(MDC.get("k"));
}
public void testMarker() {
Marker m = MarkerFactory.getMarker("a"+diff);
Marker m = MarkerFactory.getMarker("a" + diff);
assertTrue(m instanceof BasicMarker);
}
}

View File

@ -113,13 +113,10 @@ public class BogoPerf {
* @param referenceBIPS
* @throws AssertionFailedError
*/
public static void assertDuration(double currentDuration,
long referenceDuration, double referenceBIPS) throws AssertionFailedError {
double ajustedDuration = adjustExpectedDuration(referenceDuration,
referenceBIPS);
public static void assertDuration(double currentDuration, long referenceDuration, double referenceBIPS) throws AssertionFailedError {
double ajustedDuration = adjustExpectedDuration(referenceDuration, referenceBIPS);
if (currentDuration > ajustedDuration * SLACK_FACTOR) {
throw new AssertionFailedError("current duration " + currentDuration
+ " exceeded expected " + ajustedDuration + " (adjusted reference), "
throw new AssertionFailedError("current duration " + currentDuration + " exceeded expected " + ajustedDuration + " (adjusted reference), "
+ referenceDuration + " (raw reference)");
}
}
@ -133,25 +130,19 @@ public class BogoPerf {
* @param referenceBIPS
* @throws AssertionFailedError
*/
public static void assertPerformance(double currentPerformance,
long referencePerformance, double referenceBIPS)
throws AssertionFailedError {
double ajustedPerf = adjustExpectedPerformance(referencePerformance,
referenceBIPS);
public static void assertPerformance(double currentPerformance, long referencePerformance, double referenceBIPS) throws AssertionFailedError {
double ajustedPerf = adjustExpectedPerformance(referencePerformance, referenceBIPS);
if (currentPerformance * SLACK_FACTOR < ajustedPerf) {
throw new AssertionFailedError(currentPerformance + " below expected "
+ ajustedPerf + " (adjusted), " + referencePerformance + " (raw)");
throw new AssertionFailedError(currentPerformance + " below expected " + ajustedPerf + " (adjusted), " + referencePerformance + " (raw)");
}
}
private static double adjustExpectedPerformance(long referenceDuration,
double referenceBIPS) {
private static double adjustExpectedPerformance(long referenceDuration, double referenceBIPS) {
double currentBIPS = currentBIPS();
return referenceDuration * (currentBIPS / referenceBIPS);
}
private static double adjustExpectedDuration(long referenceDuration,
double referenceBIPS) {
private static double adjustExpectedDuration(long referenceDuration, double referenceBIPS) {
double currentBIPS = currentBIPS();
System.out.println("currentBIPS=" + currentBIPS + " BIPS");
return referenceDuration * (referenceBIPS / currentBIPS);

View File

@ -42,6 +42,7 @@ class BubbleSort {
}
}
}
static void swap(int[] a, int i, int j) {
int t = a[i];
a[i] = a[j];

View File

@ -38,7 +38,7 @@ import junit.framework.TestCase;
public class BubbleSortTest extends TestCase {
public void testSmoke() {
int[] a = new int[] {5,3,2,7};
int[] a = new int[] { 5, 3, 2, 7 };
BubbleSort.sort(a);
int i = 0;
assertEquals(2, a[i++]);
@ -53,7 +53,7 @@ public class BubbleSortTest extends TestCase {
}
public void testSorted() {
int[] a = new int[] {3,30,300,3000};
int[] a = new int[] { 3, 30, 300, 3000 };
BubbleSort.sort(a);
int i = 0;
assertEquals(3, a[i++]);
@ -63,7 +63,7 @@ public class BubbleSortTest extends TestCase {
}
public void testInverted() {
int[] a = new int[] {3000,300,30,3};
int[] a = new int[] { 3000, 300, 30, 3 };
BubbleSort.sort(a);
int i = 0;
assertEquals(3, a[i++]);
@ -73,7 +73,7 @@ public class BubbleSortTest extends TestCase {
}
public void testWithSameEntry() {
int[] a = new int[] {10,20,10,20};
int[] a = new int[] { 10, 20, 10, 20 };
BubbleSort.sort(a);
int i = 0;
assertEquals(10, a[i++]);
@ -82,13 +82,12 @@ public class BubbleSortTest extends TestCase {
assertEquals(20, a[i++]);
}
public void testRandom() {
int len = 100;
Random random = new Random(156);
int[] a = new int[len];
int[] witness = new int[len];
for(int i = 0; i < len; i++) {
for (int i = 0; i < len; i++) {
int r = random.nextInt();
a[i] = r;
witness[i] = r;

View File

@ -69,7 +69,6 @@ public class MessageFormatterPerfTest extends TestCase {
BogoPerf.assertDuration(duration, referencePerf, REFERENCE_BIPS);
}
public double slf4jMessageFormatter_OneArg(long len) {
long start = System.nanoTime();
for (int i = 0; i < len; i++) {
@ -81,24 +80,21 @@ public class MessageFormatterPerfTest extends TestCase {
MessageFormatter.format("This is some rather short message {} ", i1);
}
long end = System.nanoTime();
return (end - start)/(1000*1000.0);
return (end - start) / (1000 * 1000.0);
}
public double slf4jMessageFormatter_TwoArg(long len) {
long start = System.nanoTime();
for (int i = 0; i < len; i++) {
final FormattingTuple tp = MessageFormatter.format(
"This is some {} short message {} ", i1, i2);
final FormattingTuple tp = MessageFormatter.format("This is some {} short message {} ", i1, i2);
tp.getMessage();
tp.getArgArray();
tp.getThrowable();
}
long end = System.nanoTime();
return (end - start)/(1000*1000.0);
return (end - start) / (1000 * 1000.0);
}
public double jdkMessageFormatter(long len) {
@SuppressWarnings("unused")
String s = "";

View File

@ -39,8 +39,7 @@ public class MessageFormatterTest {
Integer i2 = new Integer(2);
Integer i3 = new Integer(3);
Integer[] ia0 = new Integer[] { i1, i2, i3 };
Integer[] ia1 = new Integer[] { new Integer(10), new Integer(20),
new Integer(30) };
Integer[] ia1 = new Integer[] { new Integer(10), new Integer(20), new Integer(30) };
String result;
@ -55,28 +54,22 @@ public class MessageFormatterTest {
result = MessageFormatter.format("Value is {}.", null).getMessage();
assertEquals("Value is null.", result);
result = MessageFormatter.format("Val1 is {}, val2 is {}.", null, null)
.getMessage();
result = MessageFormatter.format("Val1 is {}, val2 is {}.", null, null).getMessage();
assertEquals("Val1 is null, val2 is null.", result);
result = MessageFormatter.format("Val1 is {}, val2 is {}.", i1, null)
.getMessage();
result = MessageFormatter.format("Val1 is {}, val2 is {}.", i1, null).getMessage();
assertEquals("Val1 is 1, val2 is null.", result);
result = MessageFormatter.format("Val1 is {}, val2 is {}.", null, i2)
.getMessage();
result = MessageFormatter.format("Val1 is {}, val2 is {}.", null, i2).getMessage();
assertEquals("Val1 is null, val2 is 2.", result);
result = MessageFormatter.arrayFormat("Val1 is {}, val2 is {}, val3 is {}",
new Integer[] { null, null, null }).getMessage();
result = MessageFormatter.arrayFormat("Val1 is {}, val2 is {}, val3 is {}", new Integer[] { null, null, null }).getMessage();
assertEquals("Val1 is null, val2 is null, val3 is null", result);
result = MessageFormatter.arrayFormat("Val1 is {}, val2 is {}, val3 is {}",
new Integer[] { null, i2, i3 }).getMessage();
result = MessageFormatter.arrayFormat("Val1 is {}, val2 is {}, val3 is {}", new Integer[] { null, i2, i3 }).getMessage();
assertEquals("Val1 is null, val2 is 2, val3 is 3", result);
result = MessageFormatter.arrayFormat("Val1 is {}, val2 is {}, val3 is {}",
new Integer[] { null, null, i3 }).getMessage();
result = MessageFormatter.arrayFormat("Val1 is {}, val2 is {}, val3 is {}", new Integer[] { null, null, i3 }).getMessage();
assertEquals("Val1 is null, val2 is null, val3 is 3", result);
}
@ -109,24 +102,20 @@ public class MessageFormatterTest {
result = MessageFormatter.format("\\{}Escaped", i3).getMessage();
assertEquals("{}Escaped", result);
result = MessageFormatter.format("File name is {{}}.", "App folder.zip")
.getMessage();
result = MessageFormatter.format("File name is {{}}.", "App folder.zip").getMessage();
assertEquals("File name is {App folder.zip}.", result);
// escaping the escape character
result = MessageFormatter
.format("File name is C:\\\\{}.", "App folder.zip").getMessage();
result = MessageFormatter.format("File name is C:\\\\{}.", "App folder.zip").getMessage();
assertEquals("File name is C:\\App folder.zip.", result);
}
@Test
public void testTwoParameters() {
result = MessageFormatter.format("Value {} is smaller than {}.", i1, i2)
.getMessage();
result = MessageFormatter.format("Value {} is smaller than {}.", i1, i2).getMessage();
assertEquals("Value 1 is smaller than 2.", result);
result = MessageFormatter.format("Value {} is smaller than {}", i1, i2)
.getMessage();
result = MessageFormatter.format("Value {} is smaller than {}", i1, i2).getMessage();
assertEquals("Value 1 is smaller than 2", result);
result = MessageFormatter.format("{}{}", i1, i2).getMessage();
@ -135,24 +124,19 @@ public class MessageFormatterTest {
result = MessageFormatter.format("Val1={}, Val2={", i1, i2).getMessage();
assertEquals("Val1=1, Val2={", result);
result = MessageFormatter.format("Value {} is smaller than \\{}", i1, i2)
.getMessage();
result = MessageFormatter.format("Value {} is smaller than \\{}", i1, i2).getMessage();
assertEquals("Value 1 is smaller than {}", result);
result = MessageFormatter.format("Value {} is smaller than \\{} tail", i1,
i2).getMessage();
result = MessageFormatter.format("Value {} is smaller than \\{} tail", i1, i2).getMessage();
assertEquals("Value 1 is smaller than {} tail", result);
result = MessageFormatter.format("Value {} is smaller than \\{", i1, i2)
.getMessage();
result = MessageFormatter.format("Value {} is smaller than \\{", i1, i2).getMessage();
assertEquals("Value 1 is smaller than \\{", result);
result = MessageFormatter.format("Value {} is smaller than {tail", i1, i2)
.getMessage();
result = MessageFormatter.format("Value {} is smaller than {tail", i1, i2).getMessage();
assertEquals("Value 1 is smaller than {tail", result);
result = MessageFormatter.format("Value \\{} is smaller than {}", i1, i2)
.getMessage();
result = MessageFormatter.format("Value \\{} is smaller than {}", i1, i2).getMessage();
assertEquals("Value {} is smaller than 1", result);
}
@ -193,27 +177,22 @@ public class MessageFormatterTest {
// tests the case when the parameters are supplied in a single array
@Test
public void testArrayFormat() {
result = MessageFormatter.arrayFormat(
"Value {} is smaller than {} and {}.", ia0).getMessage();
result = MessageFormatter.arrayFormat("Value {} is smaller than {} and {}.", ia0).getMessage();
assertEquals("Value 1 is smaller than 2 and 3.", result);
result = MessageFormatter.arrayFormat("{}{}{}", ia0).getMessage();
assertEquals("123", result);
result = MessageFormatter.arrayFormat("Value {} is smaller than {}.", ia0)
.getMessage();
result = MessageFormatter.arrayFormat("Value {} is smaller than {}.", ia0).getMessage();
assertEquals("Value 1 is smaller than 2.", result);
result = MessageFormatter.arrayFormat("Value {} is smaller than {}", ia0)
.getMessage();
result = MessageFormatter.arrayFormat("Value {} is smaller than {}", ia0).getMessage();
assertEquals("Value 1 is smaller than 2", result);
result = MessageFormatter.arrayFormat("Val={}, {, Val={}", ia0)
.getMessage();
result = MessageFormatter.arrayFormat("Val={}, {, Val={}", ia0).getMessage();
assertEquals("Val=1, {, Val=2", result);
result = MessageFormatter.arrayFormat("Val={}, {, Val={}", ia0)
.getMessage();
result = MessageFormatter.arrayFormat("Val={}, {, Val={}", ia0).getMessage();
assertEquals("Val=1, {, Val=2", result);
result = MessageFormatter.arrayFormat("Val1={}, Val2={", ia0).getMessage();
@ -229,28 +208,23 @@ public class MessageFormatterTest {
assertEquals("1[2, 3]", result);
// Integer[]
result = MessageFormatter.arrayFormat("{}{}", new Object[] { "a", p1 })
.getMessage();
result = MessageFormatter.arrayFormat("{}{}", new Object[] { "a", p1 }).getMessage();
assertEquals("a[2, 3]", result);
// byte[]
result = MessageFormatter.arrayFormat("{}{}",
new Object[] { "a", new byte[] { 1, 2 } }).getMessage();
result = MessageFormatter.arrayFormat("{}{}", new Object[] { "a", new byte[] { 1, 2 } }).getMessage();
assertEquals("a[1, 2]", result);
// int[]
result = MessageFormatter.arrayFormat("{}{}",
new Object[] { "a", new int[] { 1, 2 } }).getMessage();
result = MessageFormatter.arrayFormat("{}{}", new Object[] { "a", new int[] { 1, 2 } }).getMessage();
assertEquals("a[1, 2]", result);
// float[]
result = MessageFormatter.arrayFormat("{}{}",
new Object[] { "a", new float[] { 1, 2 } }).getMessage();
result = MessageFormatter.arrayFormat("{}{}", new Object[] { "a", new float[] { 1, 2 } }).getMessage();
assertEquals("a[1.0, 2.0]", result);
// double[]
result = MessageFormatter.arrayFormat("{}{}",
new Object[] { "a", new double[] { 1, 2 } }).getMessage();
result = MessageFormatter.arrayFormat("{}{}", new Object[] { "a", new double[] { 1, 2 } }).getMessage();
assertEquals("a[1.0, 2.0]", result);
}
@ -258,30 +232,24 @@ public class MessageFormatterTest {
@Test
public void testMultiDimensionalArrayValues() {
Integer[][] multiIntegerA = new Integer[][] { ia0, ia1 };
result = MessageFormatter.arrayFormat("{}{}",
new Object[] { "a", multiIntegerA }).getMessage();
result = MessageFormatter.arrayFormat("{}{}", new Object[] { "a", multiIntegerA }).getMessage();
assertEquals("a[[1, 2, 3], [10, 20, 30]]", result);
int[][] multiIntA = new int[][] { { 1, 2 }, { 10, 20 } };
result = MessageFormatter.arrayFormat("{}{}",
new Object[] { "a", multiIntA }).getMessage();
result = MessageFormatter.arrayFormat("{}{}", new Object[] { "a", multiIntA }).getMessage();
assertEquals("a[[1, 2], [10, 20]]", result);
float[][] multiFloatA = new float[][] { { 1, 2 }, { 10, 20 } };
result = MessageFormatter.arrayFormat("{}{}",
new Object[] { "a", multiFloatA }).getMessage();
result = MessageFormatter.arrayFormat("{}{}", new Object[] { "a", multiFloatA }).getMessage();
assertEquals("a[[1.0, 2.0], [10.0, 20.0]]", result);
Object[][] multiOA = new Object[][] { ia0, ia1 };
result = MessageFormatter
.arrayFormat("{}{}", new Object[] { "a", multiOA }).getMessage();
result = MessageFormatter.arrayFormat("{}{}", new Object[] { "a", multiOA }).getMessage();
assertEquals("a[[1, 2, 3], [10, 20, 30]]", result);
Object[][][] _3DOA = new Object[][][] { multiOA, multiOA };
result = MessageFormatter.arrayFormat("{}{}", new Object[] { "a", _3DOA })
.getMessage();
assertEquals("a[[[1, 2, 3], [10, 20, 30]], [[1, 2, 3], [10, 20, 30]]]",
result);
result = MessageFormatter.arrayFormat("{}{}", new Object[] { "a", _3DOA }).getMessage();
assertEquals("a[[[1, 2, 3], [10, 20, 30]], [[1, 2, 3], [10, 20, 30]]]", result);
}
@Test
@ -289,8 +257,7 @@ public class MessageFormatterTest {
{
Object[] cyclicA = new Object[1];
cyclicA[0] = cyclicA;
assertEquals("[[...]]", MessageFormatter.arrayFormat("{}", cyclicA)
.getMessage());
assertEquals("[[...]]", MessageFormatter.arrayFormat("{}", cyclicA).getMessage());
}
{
Object[] a = new Object[2];
@ -298,8 +265,7 @@ public class MessageFormatterTest {
Object[] c = new Object[] { i3, a };
Object[] b = new Object[] { i2, c };
a[1] = b;
assertEquals("1[2, [3, [1, [...]]]]", MessageFormatter.arrayFormat(
"{}{}", a).getMessage());
assertEquals("1[2, [3, [1, [...]]]]", MessageFormatter.arrayFormat("{}{}", a).getMessage());
}
}
@ -310,8 +276,7 @@ public class MessageFormatterTest {
Object[] ia = new Object[] { i1, i2, i3, t };
Object[] iaWitness = new Object[] { i1, i2, i3 };
ft = MessageFormatter
.arrayFormat("Value {} is smaller than {} and {}.", ia);
ft = MessageFormatter.arrayFormat("Value {} is smaller than {} and {}.", ia);
assertEquals("Value 1 is smaller than 2 and 3.", ft.getMessage());
assertTrue(Arrays.equals(iaWitness, ft.getArgArray()));
assertEquals(t, ft.getThrowable());
@ -346,10 +311,8 @@ public class MessageFormatterTest {
assertTrue(Arrays.equals(iaWitness, ft.getArgArray()));
assertEquals(t, ft.getThrowable());
ft = MessageFormatter.arrayFormat(
"Value {} is smaller than {} and {} -- {} .", ia);
assertEquals("Value 1 is smaller than 2 and 3 -- " + t.toString() + " .",
ft.getMessage());
ft = MessageFormatter.arrayFormat("Value {} is smaller than {} and {} -- {} .", ia);
assertEquals("Value 1 is smaller than 2 and 3 -- " + t.toString() + " .", ft.getMessage());
assertTrue(Arrays.equals(ia, ft.getArgArray()));
assertNull(ft.getThrowable());

View File

@ -24,7 +24,6 @@
*/
package org.slf4j.helpers;
class MyRandom {
private final static long m = 200000000041L; // a prime number
@ -38,17 +37,15 @@ class MyRandom {
this(System.nanoTime());
}
public MyRandom(long seed) {
this.y = seed;
}
int nextInt() {
// we don't really care about the randomness of this
// generator
y = (a*y + 1) % m;
unused = y >>> (48-bits); // just exercise the >>> operator
return (int)(y);
y = (a * y + 1) % m;
unused = y >>> (48 - bits); // just exercise the >>> operator
return (int) (y);
}
}

View File

@ -49,13 +49,12 @@ public class SubstitutableLoggerTest extends TestCase {
Set<String> expectedMethodSignatures = determineMethodSignatures(Logger.class);
LoggerInvocationHandler ih = new LoggerInvocationHandler();
Logger proxyLogger = (Logger) Proxy.newProxyInstance(getClass().getClassLoader(),
new Class[]{Logger.class}, ih);
Logger proxyLogger = (Logger) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] { Logger.class }, ih);
log.setDelegate(proxyLogger);
invokeMethods(log);
//Assert that all methods are delegated
// Assert that all methods are delegated
expectedMethodSignatures.removeAll(ih.getInvokedMethodSignatures());
if (!expectedMethodSignatures.isEmpty()) {
fail("Following methods are not delegated " + expectedMethodSignatures.toString());

View File

@ -31,7 +31,7 @@ import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
public class SubstituteLoggerFactoryTest extends TestCase{
public class SubstituteLoggerFactoryTest extends TestCase {
private SubstituteLoggerFactory factory = new SubstituteLoggerFactory();
public void testFactory() {
@ -39,14 +39,14 @@ public class SubstituteLoggerFactoryTest extends TestCase{
assertNotNull(log);
Logger log2 = factory.getLogger("foo");
assertTrue("Loggers with same name must be same",log == log2);
assertTrue("Loggers with same name must be same", log == log2);
}
public void testLoggerNameList() {
factory.getLogger("foo1");
factory.getLogger("foo2");
Set<String> expectedNames = new HashSet<String>(Arrays.asList("foo1","foo2"));
Set<String> expectedNames = new HashSet<String>(Arrays.asList("foo1", "foo2"));
Set<String> actualNames = new HashSet<String>(factory.getLoggerNames());
assertEquals(expectedNames, actualNames);
@ -56,10 +56,10 @@ public class SubstituteLoggerFactoryTest extends TestCase{
factory.getLogger("foo1");
factory.getLogger("foo2");
Set<String> expectedNames = new HashSet<String>(Arrays.asList("foo1","foo2"));
Set<String> expectedNames = new HashSet<String>(Arrays.asList("foo1", "foo2"));
Set<String> actualNames = new HashSet<String>();
for(SubstituteLogger slog : factory.getLoggers()){
for (SubstituteLogger slog : factory.getLoggers()) {
actualNames.add(slog.getName());
}

View File

@ -49,11 +49,11 @@ public class NDC {
public static String pop() {
int next = size();
if(next == 0) {
if (next == 0) {
return "";
}
int last = next-1;
String key = PREFIX+last;
int last = next - 1;
String key = PREFIX + last;
String val = MDC.get(key);
MDC.remove(key);
return val;

View File

@ -49,8 +49,7 @@ public class AgentPremain {
* @param instrumentation
* instrumentation environment provided by the JVM
*/
public static void premain(String agentArgument,
Instrumentation instrumentation) {
public static void premain(String agentArgument, Instrumentation instrumentation) {
// We cannot do sanity checks for slf4j here as the jars loaded
// by the application are not visible here.
@ -94,8 +93,7 @@ public class AgentPremain {
* String to convert to line feeds
* @return argument converted to properties
*/
private static Properties parseArguments(String agentArgument,
String separator) {
private static Properties parseArguments(String agentArgument, String separator) {
Properties p = new Properties();
try {
String argumentAsLines = agentArgument.replaceAll(separator, "\n");
@ -122,8 +120,7 @@ public class AgentPremain {
@Override
public void run() {
long timePassed = System.currentTimeMillis() - start;
System.err.println("Stop at " + new Date()
+ ", execution time = " + timePassed + " ms");
System.err.println("Stop at " + new Date() + ", execution time = " + timePassed + " ms");
}
};
Runtime.getRuntime().addShutdownHook(hook);

View File

@ -76,8 +76,7 @@ public class LocLogger extends LoggerWrapper implements Logger {
MessageParameterObj mpo = new MessageParameterObj(key, args);
if (instanceofLAL) {
((LocationAwareLogger) logger).log(LOCALIZED, FQCN,
LocationAwareLogger.TRACE_INT, translatedMsg, args, null);
((LocationAwareLogger) logger).log(LOCALIZED, FQCN, LocationAwareLogger.TRACE_INT, translatedMsg, args, null);
} else {
logger.trace(LOCALIZED, translatedMsg, mpo);
}
@ -99,8 +98,7 @@ public class LocLogger extends LoggerWrapper implements Logger {
MessageParameterObj mpo = new MessageParameterObj(key, args);
if (instanceofLAL) {
((LocationAwareLogger) logger).log(LOCALIZED, FQCN,
LocationAwareLogger.DEBUG_INT, translatedMsg, args, null);
((LocationAwareLogger) logger).log(LOCALIZED, FQCN, LocationAwareLogger.DEBUG_INT, translatedMsg, args, null);
} else {
logger.debug(LOCALIZED, translatedMsg, mpo);
}
@ -122,8 +120,7 @@ public class LocLogger extends LoggerWrapper implements Logger {
MessageParameterObj mpo = new MessageParameterObj(key, args);
if (instanceofLAL) {
((LocationAwareLogger) logger).log(LOCALIZED, FQCN,
LocationAwareLogger.INFO_INT, translatedMsg, args, null);
((LocationAwareLogger) logger).log(LOCALIZED, FQCN, LocationAwareLogger.INFO_INT, translatedMsg, args, null);
} else {
logger.info(LOCALIZED, translatedMsg, mpo);
}
@ -145,8 +142,7 @@ public class LocLogger extends LoggerWrapper implements Logger {
MessageParameterObj mpo = new MessageParameterObj(key, args);
if (instanceofLAL) {
((LocationAwareLogger) logger).log(LOCALIZED, FQCN,
LocationAwareLogger.WARN_INT, translatedMsg, args, null);
((LocationAwareLogger) logger).log(LOCALIZED, FQCN, LocationAwareLogger.WARN_INT, translatedMsg, args, null);
} else {
logger.warn(LOCALIZED, translatedMsg, mpo);
}
@ -168,8 +164,7 @@ public class LocLogger extends LoggerWrapper implements Logger {
MessageParameterObj mpo = new MessageParameterObj(key, args);
if (instanceofLAL) {
((LocationAwareLogger) logger).log(LOCALIZED, FQCN,
LocationAwareLogger.ERROR_INT, translatedMsg, args, null);
((LocationAwareLogger) logger).log(LOCALIZED, FQCN, LocationAwareLogger.ERROR_INT, translatedMsg, args, null);
} else {
logger.error(LOCALIZED, translatedMsg, mpo);
}

View File

@ -288,8 +288,7 @@ public class EventData implements Serializable {
if (!(o instanceof EventData || o instanceof Map)) {
return false;
}
Map<String, Object> map = (o instanceof EventData) ? ((EventData) o)
.getEventMap() : (Map<String, Object>) o;
Map<String, Object> map = (o instanceof EventData) ? ((EventData) o).getEventMap() : (Map<String, Object>) o;
return this.eventData.equals(map);
}

View File

@ -41,8 +41,7 @@ public class EventLogger {
static Marker EVENT_MARKER = MarkerFactory.getMarker("EVENT");
private static LoggerWrapper eventLogger =
new LoggerWrapper(LoggerFactory.getLogger("EventLogger"), FQCN);
private static LoggerWrapper eventLogger = new LoggerWrapper(LoggerFactory.getLogger("EventLogger"), FQCN);
/**
* There can only be a single EventLogger.
@ -57,8 +56,7 @@ public class EventLogger {
*/
public static void logEvent(EventData data) {
if (eventLogger.instanceofLAL) {
((LocationAwareLogger) eventLogger.logger).log(EVENT_MARKER, FQCN,
LocationAwareLogger.INFO_INT, data.toXML(), new Object[] {data}, null);
((LocationAwareLogger) eventLogger.logger).log(EVENT_MARKER, FQCN, LocationAwareLogger.INFO_INT, data.toXML(), new Object[] { data }, null);
} else {
eventLogger.logger.info(EVENT_MARKER, data.toXML(), data);
}

View File

@ -84,8 +84,7 @@ public class LoggerWrapper implements Logger {
return;
if (instanceofLAL) {
((LocationAwareLogger) logger).log(null, fqcn,
LocationAwareLogger.TRACE_INT, msg, null, null);
((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.TRACE_INT, msg, null, null);
} else {
logger.trace(msg);
}
@ -99,11 +98,8 @@ public class LoggerWrapper implements Logger {
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.format(format, arg)
.getMessage();
((LocationAwareLogger) logger).log(null, fqcn,
LocationAwareLogger.TRACE_INT, formattedMessage,
new Object[] { arg }, null);
String formattedMessage = MessageFormatter.format(format, arg).getMessage();
((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.TRACE_INT, formattedMessage, new Object[] { arg }, null);
} else {
logger.trace(format, arg);
}
@ -117,11 +113,8 @@ public class LoggerWrapper implements Logger {
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.format(format, arg1, arg2)
.getMessage();
((LocationAwareLogger) logger).log(null, fqcn,
LocationAwareLogger.TRACE_INT, formattedMessage, new Object[] { arg1,
arg2 }, null);
String formattedMessage = MessageFormatter.format(format, arg1, arg2).getMessage();
((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.TRACE_INT, formattedMessage, new Object[] { arg1, arg2 }, null);
} else {
logger.trace(format, arg1, arg2);
}
@ -135,10 +128,8 @@ public class LoggerWrapper implements Logger {
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.arrayFormat(format, args)
.getMessage();
((LocationAwareLogger) logger).log(null, fqcn,
LocationAwareLogger.TRACE_INT, formattedMessage, args, null);
String formattedMessage = MessageFormatter.arrayFormat(format, args).getMessage();
((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.TRACE_INT, formattedMessage, args, null);
} else {
logger.trace(format, args);
}
@ -152,8 +143,7 @@ public class LoggerWrapper implements Logger {
return;
if (instanceofLAL) {
((LocationAwareLogger) logger).log(null, fqcn,
LocationAwareLogger.TRACE_INT, msg, null, t);
((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.TRACE_INT, msg, null, t);
} else {
logger.trace(msg, t);
}
@ -166,8 +156,7 @@ public class LoggerWrapper implements Logger {
if (!logger.isTraceEnabled(marker))
return;
if (instanceofLAL) {
((LocationAwareLogger) logger).log(marker, fqcn,
LocationAwareLogger.TRACE_INT, msg, null, null);
((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.TRACE_INT, msg, null, null);
} else {
logger.trace(marker, msg);
}
@ -180,11 +169,8 @@ public class LoggerWrapper implements Logger {
if (!logger.isTraceEnabled(marker))
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.format(format, arg)
.getMessage();
((LocationAwareLogger) logger).log(marker, fqcn,
LocationAwareLogger.TRACE_INT, formattedMessage,
new Object[] { arg }, null);
String formattedMessage = MessageFormatter.format(format, arg).getMessage();
((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.TRACE_INT, formattedMessage, new Object[] { arg }, null);
} else {
logger.trace(marker, format, arg);
}
@ -197,11 +183,8 @@ public class LoggerWrapper implements Logger {
if (!logger.isTraceEnabled(marker))
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.format(format, arg1, arg2)
.getMessage();
((LocationAwareLogger) logger).log(marker, fqcn,
LocationAwareLogger.TRACE_INT, formattedMessage, new Object[] { arg1,
arg2 }, null);
String formattedMessage = MessageFormatter.format(format, arg1, arg2).getMessage();
((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.TRACE_INT, formattedMessage, new Object[] { arg1, arg2 }, null);
} else {
logger.trace(marker, format, arg1, arg2);
}
@ -214,10 +197,8 @@ public class LoggerWrapper implements Logger {
if (!logger.isTraceEnabled(marker))
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.arrayFormat(format, args)
.getMessage();
((LocationAwareLogger) logger).log(marker, fqcn,
LocationAwareLogger.TRACE_INT, formattedMessage, args, null);
String formattedMessage = MessageFormatter.arrayFormat(format, args).getMessage();
((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.TRACE_INT, formattedMessage, args, null);
} else {
logger.trace(marker, format, args);
}
@ -230,8 +211,7 @@ public class LoggerWrapper implements Logger {
if (!logger.isTraceEnabled(marker))
return;
if (instanceofLAL) {
((LocationAwareLogger) logger).log(marker, fqcn,
LocationAwareLogger.TRACE_INT, msg, null, t);
((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.TRACE_INT, msg, null, t);
} else {
logger.trace(marker, msg, t);
}
@ -259,8 +239,7 @@ public class LoggerWrapper implements Logger {
return;
if (instanceofLAL) {
((LocationAwareLogger) logger).log(null, fqcn,
LocationAwareLogger.DEBUG_INT, msg, null, null);
((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.DEBUG_INT, msg, null, null);
} else {
logger.debug(msg);
}
@ -274,11 +253,8 @@ public class LoggerWrapper implements Logger {
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.format(format, arg)
.getMessage();
((LocationAwareLogger) logger).log(null, fqcn,
LocationAwareLogger.DEBUG_INT, formattedMessage,
new Object[] { arg }, null);
String formattedMessage = MessageFormatter.format(format, arg).getMessage();
((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.DEBUG_INT, formattedMessage, new Object[] { arg }, null);
} else {
logger.debug(format, arg);
}
@ -292,11 +268,8 @@ public class LoggerWrapper implements Logger {
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.format(format, arg1, arg2)
.getMessage();
((LocationAwareLogger) logger).log(null, fqcn,
LocationAwareLogger.DEBUG_INT, formattedMessage, new Object[] { arg1,
arg2 }, null);
String formattedMessage = MessageFormatter.format(format, arg1, arg2).getMessage();
((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.DEBUG_INT, formattedMessage, new Object[] { arg1, arg2 }, null);
} else {
logger.debug(format, arg1, arg2);
}
@ -311,9 +284,7 @@ public class LoggerWrapper implements Logger {
if (instanceofLAL) {
FormattingTuple ft = MessageFormatter.arrayFormat(format, argArray);
((LocationAwareLogger) logger).log(null, fqcn,
LocationAwareLogger.DEBUG_INT, ft.getMessage(), ft.getArgArray(), ft
.getThrowable());
((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.DEBUG_INT, ft.getMessage(), ft.getArgArray(), ft.getThrowable());
} else {
logger.debug(format, argArray);
}
@ -327,8 +298,7 @@ public class LoggerWrapper implements Logger {
return;
if (instanceofLAL) {
((LocationAwareLogger) logger).log(null, fqcn,
LocationAwareLogger.DEBUG_INT, msg, null, t);
((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.DEBUG_INT, msg, null, t);
} else {
logger.debug(msg, t);
}
@ -341,8 +311,7 @@ public class LoggerWrapper implements Logger {
if (!logger.isDebugEnabled(marker))
return;
if (instanceofLAL) {
((LocationAwareLogger) logger).log(marker, fqcn,
LocationAwareLogger.DEBUG_INT, msg, null, null);
((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.DEBUG_INT, msg, null, null);
} else {
logger.debug(marker, msg);
}
@ -356,9 +325,7 @@ public class LoggerWrapper implements Logger {
return;
if (instanceofLAL) {
FormattingTuple ft = MessageFormatter.format(format, arg);
((LocationAwareLogger) logger).log(marker, fqcn,
LocationAwareLogger.DEBUG_INT, ft.getMessage(), ft.getArgArray(), ft
.getThrowable());
((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.DEBUG_INT, ft.getMessage(), ft.getArgArray(), ft.getThrowable());
} else {
logger.debug(marker, format, arg);
}
@ -371,11 +338,8 @@ public class LoggerWrapper implements Logger {
if (!logger.isDebugEnabled(marker))
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.format(format, arg1, arg2)
.getMessage();
((LocationAwareLogger) logger).log(marker, fqcn,
LocationAwareLogger.DEBUG_INT, formattedMessage, new Object[] { arg1,
arg2 }, null);
String formattedMessage = MessageFormatter.format(format, arg1, arg2).getMessage();
((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.DEBUG_INT, formattedMessage, new Object[] { arg1, arg2 }, null);
} else {
logger.debug(marker, format, arg1, arg2);
}
@ -390,9 +354,7 @@ public class LoggerWrapper implements Logger {
if (instanceofLAL) {
FormattingTuple ft = MessageFormatter.arrayFormat(format, argArray);
((LocationAwareLogger) logger).log(marker, fqcn,
LocationAwareLogger.DEBUG_INT, ft.getMessage(), argArray, ft
.getThrowable());
((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.DEBUG_INT, ft.getMessage(), argArray, ft.getThrowable());
} else {
logger.debug(marker, format, argArray);
}
@ -405,8 +367,7 @@ public class LoggerWrapper implements Logger {
if (!logger.isDebugEnabled(marker))
return;
if (instanceofLAL) {
((LocationAwareLogger) logger).log(marker, fqcn,
LocationAwareLogger.DEBUG_INT, msg, null, t);
((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.DEBUG_INT, msg, null, t);
} else {
logger.debug(marker, msg, t);
}
@ -434,8 +395,7 @@ public class LoggerWrapper implements Logger {
return;
if (instanceofLAL) {
((LocationAwareLogger) logger).log(null, fqcn,
LocationAwareLogger.INFO_INT, msg, null, null);
((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.INFO_INT, msg, null, null);
} else {
logger.info(msg);
}
@ -449,11 +409,8 @@ public class LoggerWrapper implements Logger {
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.format(format, arg)
.getMessage();
((LocationAwareLogger) logger).log(null, fqcn,
LocationAwareLogger.INFO_INT, formattedMessage, new Object[] { arg },
null);
String formattedMessage = MessageFormatter.format(format, arg).getMessage();
((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.INFO_INT, formattedMessage, new Object[] { arg }, null);
} else {
logger.info(format, arg);
}
@ -467,11 +424,8 @@ public class LoggerWrapper implements Logger {
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.format(format, arg1, arg2)
.getMessage();
((LocationAwareLogger) logger).log(null, fqcn,
LocationAwareLogger.INFO_INT, formattedMessage, new Object[] { arg1,
arg2 }, null);
String formattedMessage = MessageFormatter.format(format, arg1, arg2).getMessage();
((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.INFO_INT, formattedMessage, new Object[] { arg1, arg2 }, null);
} else {
logger.info(format, arg1, arg2);
}
@ -485,10 +439,8 @@ public class LoggerWrapper implements Logger {
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.arrayFormat(format, args)
.getMessage();
((LocationAwareLogger) logger).log(null, fqcn,
LocationAwareLogger.INFO_INT, formattedMessage, args, null);
String formattedMessage = MessageFormatter.arrayFormat(format, args).getMessage();
((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.INFO_INT, formattedMessage, args, null);
} else {
logger.info(format, args);
}
@ -502,8 +454,7 @@ public class LoggerWrapper implements Logger {
return;
if (instanceofLAL) {
((LocationAwareLogger) logger).log(null, fqcn,
LocationAwareLogger.INFO_INT, msg, null, t);
((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.INFO_INT, msg, null, t);
} else {
logger.info(msg, t);
}
@ -516,8 +467,7 @@ public class LoggerWrapper implements Logger {
if (!logger.isInfoEnabled(marker))
return;
if (instanceofLAL) {
((LocationAwareLogger) logger).log(marker, fqcn,
LocationAwareLogger.INFO_INT, msg, null, null);
((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.INFO_INT, msg, null, null);
} else {
logger.info(marker, msg);
}
@ -530,11 +480,8 @@ public class LoggerWrapper implements Logger {
if (!logger.isInfoEnabled(marker))
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.format(format, arg)
.getMessage();
((LocationAwareLogger) logger).log(marker, fqcn,
LocationAwareLogger.INFO_INT, formattedMessage, new Object[] { arg },
null);
String formattedMessage = MessageFormatter.format(format, arg).getMessage();
((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.INFO_INT, formattedMessage, new Object[] { arg }, null);
} else {
logger.info(marker, format, arg);
}
@ -547,11 +494,8 @@ public class LoggerWrapper implements Logger {
if (!logger.isInfoEnabled(marker))
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.format(format, arg1, arg2)
.getMessage();
((LocationAwareLogger) logger).log(marker, fqcn,
LocationAwareLogger.INFO_INT, formattedMessage, new Object[] { arg1,
arg2 }, null);
String formattedMessage = MessageFormatter.format(format, arg1, arg2).getMessage();
((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.INFO_INT, formattedMessage, new Object[] { arg1, arg2 }, null);
} else {
logger.info(marker, format, arg1, arg2);
}
@ -564,10 +508,8 @@ public class LoggerWrapper implements Logger {
if (!logger.isInfoEnabled(marker))
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.arrayFormat(format, args)
.getMessage();
((LocationAwareLogger) logger).log(marker, fqcn,
LocationAwareLogger.INFO_INT, formattedMessage, args, null);
String formattedMessage = MessageFormatter.arrayFormat(format, args).getMessage();
((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.INFO_INT, formattedMessage, args, null);
} else {
logger.info(marker, format, args);
}
@ -580,8 +522,7 @@ public class LoggerWrapper implements Logger {
if (!logger.isInfoEnabled(marker))
return;
if (instanceofLAL) {
((LocationAwareLogger) logger).log(marker, fqcn,
LocationAwareLogger.INFO_INT, msg, null, t);
((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.INFO_INT, msg, null, t);
} else {
logger.info(marker, msg, t);
}
@ -606,8 +547,7 @@ public class LoggerWrapper implements Logger {
return;
if (instanceofLAL) {
((LocationAwareLogger) logger).log(null, fqcn,
LocationAwareLogger.WARN_INT, msg, null, null);
((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.WARN_INT, msg, null, null);
} else {
logger.warn(msg);
}
@ -621,11 +561,8 @@ public class LoggerWrapper implements Logger {
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.format(format, arg)
.getMessage();
((LocationAwareLogger) logger).log(null, fqcn,
LocationAwareLogger.WARN_INT, formattedMessage, new Object[] { arg },
null);
String formattedMessage = MessageFormatter.format(format, arg).getMessage();
((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.WARN_INT, formattedMessage, new Object[] { arg }, null);
} else {
logger.warn(format, arg);
}
@ -639,11 +576,8 @@ public class LoggerWrapper implements Logger {
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.format(format, arg1, arg2)
.getMessage();
((LocationAwareLogger) logger).log(null, fqcn,
LocationAwareLogger.WARN_INT, formattedMessage, new Object[] { arg1,
arg2 }, null);
String formattedMessage = MessageFormatter.format(format, arg1, arg2).getMessage();
((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.WARN_INT, formattedMessage, new Object[] { arg1, arg2 }, null);
} else {
logger.warn(format, arg1, arg2);
}
@ -657,10 +591,8 @@ public class LoggerWrapper implements Logger {
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.arrayFormat(format, args)
.getMessage();
((LocationAwareLogger) logger).log(null, fqcn,
LocationAwareLogger.WARN_INT, formattedMessage, args, null);
String formattedMessage = MessageFormatter.arrayFormat(format, args).getMessage();
((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.WARN_INT, formattedMessage, args, null);
} else {
logger.warn(format, args);
}
@ -674,8 +606,7 @@ public class LoggerWrapper implements Logger {
return;
if (instanceofLAL) {
((LocationAwareLogger) logger).log(null, fqcn,
LocationAwareLogger.WARN_INT, msg, null, t);
((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.WARN_INT, msg, null, t);
} else {
logger.warn(msg, t);
}
@ -688,8 +619,7 @@ public class LoggerWrapper implements Logger {
if (!logger.isWarnEnabled(marker))
return;
if (instanceofLAL) {
((LocationAwareLogger) logger).log(marker, fqcn,
LocationAwareLogger.WARN_INT, msg, null, null);
((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.WARN_INT, msg, null, null);
} else {
logger.warn(marker, msg);
}
@ -702,11 +632,8 @@ public class LoggerWrapper implements Logger {
if (!logger.isWarnEnabled(marker))
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.format(format, arg)
.getMessage();
((LocationAwareLogger) logger).log(marker, fqcn,
LocationAwareLogger.WARN_INT, formattedMessage, new Object[] { arg },
null);
String formattedMessage = MessageFormatter.format(format, arg).getMessage();
((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.WARN_INT, formattedMessage, new Object[] { arg }, null);
} else {
logger.warn(marker, format, arg);
}
@ -719,11 +646,8 @@ public class LoggerWrapper implements Logger {
if (!logger.isWarnEnabled(marker))
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.format(format, arg1, arg2)
.getMessage();
((LocationAwareLogger) logger).log(marker, fqcn,
LocationAwareLogger.WARN_INT, formattedMessage, new Object[] { arg1,
arg2 }, null);
String formattedMessage = MessageFormatter.format(format, arg1, arg2).getMessage();
((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.WARN_INT, formattedMessage, new Object[] { arg1, arg2 }, null);
} else {
logger.warn(marker, format, arg1, arg2);
}
@ -736,10 +660,8 @@ public class LoggerWrapper implements Logger {
if (!logger.isWarnEnabled(marker))
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.arrayFormat(format, args)
.getMessage();
((LocationAwareLogger) logger).log(marker, fqcn,
LocationAwareLogger.WARN_INT, formattedMessage, args, null);
String formattedMessage = MessageFormatter.arrayFormat(format, args).getMessage();
((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.WARN_INT, formattedMessage, args, null);
} else {
logger.warn(marker, format, args);
}
@ -752,8 +674,7 @@ public class LoggerWrapper implements Logger {
if (!logger.isWarnEnabled(marker))
return;
if (instanceofLAL) {
((LocationAwareLogger) logger).log(marker, fqcn,
LocationAwareLogger.WARN_INT, msg, null, t);
((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.WARN_INT, msg, null, t);
} else {
logger.warn(marker, msg, t);
}
@ -781,8 +702,7 @@ public class LoggerWrapper implements Logger {
return;
if (instanceofLAL) {
((LocationAwareLogger) logger).log(null, fqcn,
LocationAwareLogger.ERROR_INT, msg, null, null);
((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.ERROR_INT, msg, null, null);
} else {
logger.error(msg);
}
@ -796,11 +716,8 @@ public class LoggerWrapper implements Logger {
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.format(format, arg)
.getMessage();
((LocationAwareLogger) logger).log(null, fqcn,
LocationAwareLogger.ERROR_INT, formattedMessage,
new Object[] { arg }, null);
String formattedMessage = MessageFormatter.format(format, arg).getMessage();
((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.ERROR_INT, formattedMessage, new Object[] { arg }, null);
} else {
logger.error(format, arg);
}
@ -814,11 +731,8 @@ public class LoggerWrapper implements Logger {
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.format(format, arg1, arg2)
.getMessage();
((LocationAwareLogger) logger).log(null, fqcn,
LocationAwareLogger.ERROR_INT, formattedMessage, new Object[] { arg1,
arg2 }, null);
String formattedMessage = MessageFormatter.format(format, arg1, arg2).getMessage();
((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.ERROR_INT, formattedMessage, new Object[] { arg1, arg2 }, null);
} else {
logger.error(format, arg1, arg2);
}
@ -832,10 +746,8 @@ public class LoggerWrapper implements Logger {
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.arrayFormat(format, args)
.getMessage();
((LocationAwareLogger) logger).log(null, fqcn,
LocationAwareLogger.ERROR_INT, formattedMessage, args, null);
String formattedMessage = MessageFormatter.arrayFormat(format, args).getMessage();
((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.ERROR_INT, formattedMessage, args, null);
} else {
logger.error(format, args);
}
@ -849,8 +761,7 @@ public class LoggerWrapper implements Logger {
return;
if (instanceofLAL) {
((LocationAwareLogger) logger).log(null, fqcn,
LocationAwareLogger.ERROR_INT, msg, null, t);
((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.ERROR_INT, msg, null, t);
} else {
logger.error(msg, t);
}
@ -863,8 +774,7 @@ public class LoggerWrapper implements Logger {
if (!logger.isErrorEnabled(marker))
return;
if (instanceofLAL) {
((LocationAwareLogger) logger).log(marker, fqcn,
LocationAwareLogger.ERROR_INT, msg, null, null);
((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.ERROR_INT, msg, null, null);
} else {
logger.error(marker, msg);
}
@ -877,11 +787,8 @@ public class LoggerWrapper implements Logger {
if (!logger.isErrorEnabled(marker))
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.format(format, arg)
.getMessage();
((LocationAwareLogger) logger).log(marker, fqcn,
LocationAwareLogger.ERROR_INT, formattedMessage,
new Object[] { arg }, null);
String formattedMessage = MessageFormatter.format(format, arg).getMessage();
((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.ERROR_INT, formattedMessage, new Object[] { arg }, null);
} else {
logger.error(marker, format, arg);
}
@ -894,11 +801,8 @@ public class LoggerWrapper implements Logger {
if (!logger.isErrorEnabled(marker))
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.format(format, arg1, arg2)
.getMessage();
((LocationAwareLogger) logger).log(marker, fqcn,
LocationAwareLogger.ERROR_INT, formattedMessage, new Object[] { arg1,
arg2 }, null);
String formattedMessage = MessageFormatter.format(format, arg1, arg2).getMessage();
((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.ERROR_INT, formattedMessage, new Object[] { arg1, arg2 }, null);
} else {
logger.error(marker, format, arg1, arg2);
}
@ -911,10 +815,8 @@ public class LoggerWrapper implements Logger {
if (!logger.isErrorEnabled(marker))
return;
if (instanceofLAL) {
String formattedMessage = MessageFormatter.arrayFormat(format, args)
.getMessage();
((LocationAwareLogger) logger).log(marker, fqcn,
LocationAwareLogger.ERROR_INT, formattedMessage, args, null);
String formattedMessage = MessageFormatter.arrayFormat(format, args).getMessage();
((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.ERROR_INT, formattedMessage, args, null);
} else {
logger.error(marker, format, args);
}
@ -927,8 +829,7 @@ public class LoggerWrapper implements Logger {
if (!logger.isErrorEnabled(marker))
return;
if (instanceofLAL) {
((LocationAwareLogger) logger).log(marker, fqcn,
LocationAwareLogger.ERROR_INT, msg, null, t);
((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.ERROR_INT, msg, null, t);
} else {
logger.error(marker, msg, t);
}

View File

@ -27,7 +27,6 @@ package org.slf4j.ext;
import org.apache.commons.lang.text.StrLookup;
import org.slf4j.MDC;
/**
* This class can be used with the Commons Lang StrSubstitutor to replace
* tokens that occur in Strings with their values in the MDC.

View File

@ -73,11 +73,8 @@ public class XLogger extends LoggerWrapper implements Logger {
}
public enum Level {
TRACE("TRACE", LocationAwareLogger.TRACE_INT), DEBUG("DEBUG",
LocationAwareLogger.DEBUG_INT), INFO("INFO",
LocationAwareLogger.INFO_INT), WARN("WARN",
LocationAwareLogger.WARN_INT), ERROR("ERROR",
LocationAwareLogger.ERROR_INT);
TRACE("TRACE", LocationAwareLogger.TRACE_INT), DEBUG("DEBUG", LocationAwareLogger.DEBUG_INT), INFO("INFO", LocationAwareLogger.INFO_INT), WARN("WARN",
LocationAwareLogger.WARN_INT), ERROR("ERROR", LocationAwareLogger.ERROR_INT);
private final String name;
private final int level;
@ -124,8 +121,7 @@ public class XLogger extends LoggerWrapper implements Logger {
messagePattern = buildMessagePattern(argArray.length);
}
FormattingTuple tp = MessageFormatter.arrayFormat(messagePattern, argArray);
((LocationAwareLogger) logger).log(ENTRY_MARKER, FQCN,
LocationAwareLogger.TRACE_INT, tp.getMessage(), argArray, tp.getThrowable());
((LocationAwareLogger) logger).log(ENTRY_MARKER, FQCN, LocationAwareLogger.TRACE_INT, tp.getMessage(), argArray, tp.getThrowable());
}
}
@ -134,8 +130,7 @@ public class XLogger extends LoggerWrapper implements Logger {
*/
public void exit() {
if (instanceofLAL && logger.isTraceEnabled(ENTRY_MARKER)) {
((LocationAwareLogger) logger).log(EXIT_MARKER, FQCN,
LocationAwareLogger.TRACE_INT, EXIT_MESSAGE_0, null, null);
((LocationAwareLogger) logger).log(EXIT_MARKER, FQCN, LocationAwareLogger.TRACE_INT, EXIT_MESSAGE_0, null, null);
}
}
@ -148,9 +143,7 @@ public class XLogger extends LoggerWrapper implements Logger {
public <T> T exit(T result) {
if (instanceofLAL && logger.isTraceEnabled(ENTRY_MARKER)) {
FormattingTuple tp = MessageFormatter.format(EXIT_MESSAGE_1, result);
((LocationAwareLogger) logger).log(EXIT_MARKER, FQCN,
LocationAwareLogger.TRACE_INT, tp.getMessage(),
new Object[] { result }, tp.getThrowable());
((LocationAwareLogger) logger).log(EXIT_MARKER, FQCN, LocationAwareLogger.TRACE_INT, tp.getMessage(), new Object[] { result }, tp.getThrowable());
}
return result;
}
@ -163,8 +156,7 @@ public class XLogger extends LoggerWrapper implements Logger {
*/
public <T extends Throwable> T throwing(T throwable) {
if (instanceofLAL) {
((LocationAwareLogger) logger).log(THROWING_MARKER, FQCN,
LocationAwareLogger.ERROR_INT, "throwing", null, throwable);
((LocationAwareLogger) logger).log(THROWING_MARKER, FQCN, LocationAwareLogger.ERROR_INT, "throwing", null, throwable);
}
return throwable;
}
@ -179,8 +171,7 @@ public class XLogger extends LoggerWrapper implements Logger {
*/
public <T extends Throwable> T throwing(Level level, T throwable) {
if (instanceofLAL) {
((LocationAwareLogger) logger).log(THROWING_MARKER, FQCN, level.level,
"throwing", null, throwable);
((LocationAwareLogger) logger).log(THROWING_MARKER, FQCN, level.level, "throwing", null, throwable);
}
return throwable;
}
@ -193,8 +184,7 @@ public class XLogger extends LoggerWrapper implements Logger {
*/
public void catching(Throwable throwable) {
if (instanceofLAL) {
((LocationAwareLogger) logger).log(CATCHING_MARKER, FQCN,
LocationAwareLogger.ERROR_INT, "catching", null, throwable);
((LocationAwareLogger) logger).log(CATCHING_MARKER, FQCN, LocationAwareLogger.ERROR_INT, "catching", null, throwable);
}
}
@ -208,8 +198,7 @@ public class XLogger extends LoggerWrapper implements Logger {
*/
public void catching(Level level, Throwable throwable) {
if (instanceofLAL) {
((LocationAwareLogger) logger).log(CATCHING_MARKER, FQCN, level.level,
"catching", null, throwable);
((LocationAwareLogger) logger).log(CATCHING_MARKER, FQCN, level.level, "catching", null, throwable);
}
}

View File

@ -49,8 +49,7 @@ public class JavassistHelper {
* @return source snippet
* @throws NotFoundException
*/
public static String returnValue(CtBehavior method)
throws NotFoundException {
public static String returnValue(CtBehavior method) throws NotFoundException {
String returnValue = "";
if (methodReturnsValue(method)) {
@ -67,8 +66,7 @@ public class JavassistHelper {
* @return
* @throws NotFoundException
*/
private static boolean methodReturnsValue(CtBehavior method)
throws NotFoundException {
private static boolean methodReturnsValue(CtBehavior method) throws NotFoundException {
if (method instanceof CtMethod == false) {
return false;
@ -92,8 +90,7 @@ public class JavassistHelper {
* @return
* @throws NotFoundException
*/
public static String getSignature(CtBehavior method)
throws NotFoundException {
public static String getSignature(CtBehavior method) throws NotFoundException {
CtClass parameterTypes[] = method.getParameterTypes();
@ -157,8 +154,7 @@ public class JavassistHelper {
* @param i
* @return the name of the parameter if available or a number if not.
*/
static String parameterNameFor(CtBehavior method,
LocalVariableAttribute locals, int i) {
static String parameterNameFor(CtBehavior method, LocalVariableAttribute locals, int i) {
if (locals == null) {
return Integer.toString(i + 1);

View File

@ -125,8 +125,7 @@ public class LogTransformer implements ClassFileTransformer {
public Builder level(String level) {
level = level.toLowerCase();
if (level.equals("info") || level.equals("debug")
|| level.equals("trace")) {
if (level.equals("info") || level.equals("debug") || level.equals("trace")) {
this.level = level;
} else {
if (verbose) {
@ -155,8 +154,7 @@ public class LogTransformer implements ClassFileTransformer {
this.verbose = builder.verbose;
this.ignore = builder.ignore;
this.level = builder.level;
this.levelEnabled = "is" + builder.level.substring(0, 1).toUpperCase()
+ builder.level.substring(1) + "Enabled";
this.levelEnabled = "is" + builder.level.substring(0, 1).toUpperCase() + builder.level.substring(1) + "Enabled";
}
private boolean addEntryExit;
@ -164,8 +162,7 @@ public class LogTransformer implements ClassFileTransformer {
private boolean verbose;
private String[] ignore;
public byte[] transform(ClassLoader loader, String className, Class<?> clazz,
ProtectionDomain domain, byte[] bytes) {
public byte[] transform(ClassLoader loader, String className, Class<?> clazz, ProtectionDomain domain, byte[] bytes) {
try {
return transform0(className, clazz, domain, bytes);
@ -188,8 +185,7 @@ public class LogTransformer implements ClassFileTransformer {
* @return
*/
private byte[] transform0(String className, Class<?> clazz,
ProtectionDomain domain, byte[] bytes) {
private byte[] transform0(String className, Class<?> clazz, ProtectionDomain domain, byte[] bytes) {
try {
for (int i = 0; i < ignore.length; i++) {
@ -203,15 +199,13 @@ public class LogTransformer implements ClassFileTransformer {
domain.getClassLoader().loadClass(slf4jName);
} else {
if (verbose) {
System.err.println("Skipping " + className
+ " as it doesn't have a domain or a class loader.");
System.err.println("Skipping " + className + " as it doesn't have a domain or a class loader.");
}
return bytes;
}
} catch (ClassNotFoundException e) {
if (verbose) {
System.err.println("Skipping " + className
+ " as slf4j is not available to it");
System.err.println("Skipping " + className + " as slf4j is not available to it");
}
return bytes;
}
@ -297,26 +291,21 @@ public class LogTransformer implements ClassFileTransformer {
* @throws NotFoundException
* @throws CannotCompileException
*/
private void doMethod(CtBehavior method) throws NotFoundException,
CannotCompileException {
private void doMethod(CtBehavior method) throws NotFoundException, CannotCompileException {
String signature = JavassistHelper.getSignature(method);
String returnValue = JavassistHelper.returnValue(method);
if (addEntryExit) {
String messagePattern = "if ({}.{}()) {}.{}(\">> {}\");";
Object[] arg1 = new Object[] { loggerName, levelEnabled, loggerName,
level, signature };
String before = MessageFormatter.arrayFormat(messagePattern, arg1)
.getMessage();
Object[] arg1 = new Object[] { loggerName, levelEnabled, loggerName, level, signature };
String before = MessageFormatter.arrayFormat(messagePattern, arg1).getMessage();
// System.out.println(before);
method.insertBefore(before);
String messagePattern2 = "if ({}.{}()) {}.{}(\"<< {}{}\");";
Object[] arg2 = new Object[] { loggerName, levelEnabled, loggerName,
level, signature, returnValue };
String after = MessageFormatter.arrayFormat(messagePattern2, arg2)
.getMessage();
Object[] arg2 = new Object[] { loggerName, levelEnabled, loggerName, level, signature, returnValue };
String after = MessageFormatter.arrayFormat(messagePattern2, arg2).getMessage();
// System.out.println(after);
method.insertAfter(after);
}

View File

@ -86,8 +86,7 @@ public class ToStringHelper {
} catch (Exception e) {
Long now = new Long(System.currentTimeMillis());
System.err.println("Disabling exception throwing class "
+ objectClass.getName() + ", " + e.getMessage());
System.err.println("Disabling exception throwing class " + objectClass.getName() + ", " + e.getMessage());
unrenderableClasses.put(objectClass, now);
}

View File

@ -31,7 +31,6 @@ import org.slf4j.Logger;
import org.slf4j.Marker;
import org.slf4j.MarkerFactory;
// + Profiler [BAS]
// |-- elapsed time [doX] 0 milliseconds.
// |-- elapsed time [doYYYYY] 56 milliseconds.
@ -42,7 +41,6 @@ import org.slf4j.MarkerFactory;
// |-- elapsed time [doZ] 21 milliseconds.
// |-- Total elapsed time [BAS] 78 milliseconds.
/**
* A poor man's profiler to measure the time elapsed performing some lengthy
* task.
@ -155,8 +153,7 @@ public class Profiler implements TimeInstrument {
*/
void sanityCheck() throws IllegalStateException {
if (getStatus() != TimeInstrumentStatus.STOPPED) {
throw new IllegalStateException("time instrument [" + getName()
+ " is not stopped");
throw new IllegalStateException("time instrument [" + getName() + " is not stopped");
}
long totalElapsed = globalStopWatch.elapsedTime();
@ -165,8 +162,7 @@ public class Profiler implements TimeInstrument {
for (TimeInstrument ti : childTimeInstrumentList) {
childTotal += ti.elapsedTime();
if (ti.getStatus() != TimeInstrumentStatus.STOPPED) {
throw new IllegalStateException("time instrument [" + ti.getName()
+ " is not stopped");
throw new IllegalStateException("time instrument [" + ti.getName() + " is not stopped");
}
if (ti instanceof Profiler) {
Profiler nestedProfiler = (Profiler) ti;
@ -174,8 +170,7 @@ public class Profiler implements TimeInstrument {
}
}
if (totalElapsed < childTotal) {
throw new IllegalStateException(
"children have a higher accumulated elapsed time");
throw new IllegalStateException("children have a higher accumulated elapsed time");
}
}
@ -198,18 +193,15 @@ public class Profiler implements TimeInstrument {
public void log() {
Marker profilerMarker = MarkerFactory.getMarker(PROFILER_MARKER_NAME);
if (logger == null) {
throw new NullPointerException(
"If you invoke the log() method, then you must associate a logger with this profiler.");
throw new NullPointerException("If you invoke the log() method, then you must associate a logger with this profiler.");
}
if (logger.isDebugEnabled(profilerMarker)) {
DurationUnit du = Util.selectDurationUnitForDisplay(globalStopWatch);
String r = buildProfilerString(du, TOP_PROFILER_FIRST_PREFIX,
TOTAL_ELAPSED, "");
String r = buildProfilerString(du, TOP_PROFILER_FIRST_PREFIX, TOTAL_ELAPSED, "");
logger.debug(profilerMarker, SpacePadder.LINE_SEP + r);
}
}
/**
* Return a copy of the child instrument list for this Profiler instance.
*
@ -232,8 +224,7 @@ public class Profiler implements TimeInstrument {
return copy;
}
private String buildProfilerString(DurationUnit du, String firstPrefix,
String label, String indentation) {
private String buildProfilerString(DurationUnit du, String firstPrefix, String label, String indentation) {
StringBuilder buf = new StringBuilder();
buf.append(firstPrefix);
@ -243,24 +234,19 @@ public class Profiler implements TimeInstrument {
buf.append(SpacePadder.LINE_SEP);
for (TimeInstrument child : childTimeInstrumentList) {
if (child instanceof StopWatch) {
buildStopWatchString(buf, du, ELAPSED_TIME, indentation,
(StopWatch) child);
buildStopWatchString(buf, du, ELAPSED_TIME, indentation, (StopWatch) child);
} else if (child instanceof Profiler) {
Profiler profiler = (Profiler) child;
String subString = profiler.buildProfilerString(du,
NESTED_PROFILER_FIRST_PREFIX, SUBTOTAL_ELAPSED, indentation
+ " ");
String subString = profiler.buildProfilerString(du, NESTED_PROFILER_FIRST_PREFIX, SUBTOTAL_ELAPSED, indentation + " ");
buf.append(subString);
buildStopWatchString(buf, du, ELAPSED_TIME, indentation,
profiler.globalStopWatch);
buildStopWatchString(buf, du, ELAPSED_TIME, indentation, profiler.globalStopWatch);
}
}
buildStopWatchString(buf, du, label, indentation, globalStopWatch);
return buf.toString();
}
private static void buildStopWatchString(StringBuilder buf, DurationUnit du,
String prefix, String indentation, StopWatch sw) {
private static void buildStopWatchString(StringBuilder buf, DurationUnit du, String prefix, String indentation, StopWatch sw) {
buf.append(indentation);
buf.append("|--");

View File

@ -36,7 +36,6 @@ public class ProfilerRegistry {
private static final InheritableThreadLocal<ProfilerRegistry> inheritableThreadLocal = new InheritableThreadLocal<ProfilerRegistry>();
Map<String, Profiler> profilerMap = new HashMap<String, Profiler>();
public void put(Profiler profiler) {
@ -47,10 +46,9 @@ public class ProfilerRegistry {
profilerMap.put(name, profiler);
}
public static ProfilerRegistry getThreadContextInstance() {
ProfilerRegistry pr = inheritableThreadLocal.get();
if(pr == null) {
if (pr == null) {
pr = new ProfilerRegistry();
inheritableThreadLocal.set(pr);
}

View File

@ -49,7 +49,6 @@ public class StopWatch implements TimeInstrument {
this.status = original.status;
}
public void start(String name) {
this.name = name;
startTime = System.nanoTime();
@ -61,7 +60,7 @@ public class StopWatch implements TimeInstrument {
}
public TimeInstrument stop() {
if(status == TimeInstrumentStatus.STOPPED) {
if (status == TimeInstrumentStatus.STOPPED) {
return this;
}
return stop(System.nanoTime());

View File

@ -24,7 +24,6 @@
*/
package org.slf4j.profiler;
/**
* This interface sets the methods that must be implemented by
* {@link Profiler} and {@link StopWatch} classes. It settles the
@ -41,7 +40,6 @@ public interface TimeInstrument {
*/
String getName();
TimeInstrumentStatus getStatus();
/**

View File

@ -23,7 +23,6 @@
*
*/
/**
* A StopWatch can be in two states: STARTED or STOPPED.
*/

View File

@ -37,7 +37,7 @@ class Util {
static final long NANOS_IN_ONE_MICROSECOND = 1000;
static final long NANOS_IN_ONE_MILLISECOND = NANOS_IN_ONE_MICROSECOND * 1000;
static final long NANOS_IN_ONE_SECOND =NANOS_IN_ONE_MILLISECOND * 1000;
static final long NANOS_IN_ONE_SECOND = NANOS_IN_ONE_MILLISECOND * 1000;
private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("0.000");
static DurationUnit selectDurationUnitForDisplay(StopWatch sw) {
@ -45,11 +45,11 @@ class Util {
}
static DurationUnit selectDurationUnitForDisplay(long durationInNanos) {
if (durationInNanos < 10*NANOS_IN_ONE_MICROSECOND) {
if (durationInNanos < 10 * NANOS_IN_ONE_MICROSECOND) {
return DurationUnit.NANOSECOND;
} else if (durationInNanos < 10*NANOS_IN_ONE_MILLISECOND) {
} else if (durationInNanos < 10 * NANOS_IN_ONE_MILLISECOND) {
return DurationUnit.MICROSECOND;
} else if (durationInNanos < 10*NANOS_IN_ONE_SECOND) {
} else if (durationInNanos < 10 * NANOS_IN_ONE_SECOND) {
return DurationUnit.MILLISSECOND;
} else {
return DurationUnit.SECOND;

View File

@ -44,7 +44,7 @@ public class NDCTest extends TestCase {
public void testSmoke() {
NDC.push("a");
String result = NDC.pop();
assertEquals("a",result);
assertEquals("a", result);
}
public void testSmoke2() {
@ -52,7 +52,7 @@ public class NDCTest extends TestCase {
NDC.push("b");
String result1 = NDC.pop();
String result0 = NDC.pop();
assertEquals("b",result1);
assertEquals("a",result0);
assertEquals("b", result1);
assertEquals("a", result0);
}
}

View File

@ -43,7 +43,6 @@ public class MyApplication {
// create a locLogger
LocLogger locLogger = llFactory_uk.getLocLogger(this.getClass());
public void applicationStart() {
locLogger.info(Production.APPLICATION_STARTED);
// ..

View File

@ -29,10 +29,7 @@ import ch.qos.cal10n.Locale;
import ch.qos.cal10n.BaseName;
@BaseName("production")
@LocaleData( { @Locale("en_UK"), @Locale("fr") })
@LocaleData({ @Locale("en_UK"), @Locale("fr") })
public enum Production {
APPLICATION_STARTED,
APPLICATION_STOPPED,
DB_CONNECTION,
DB_CONNECTION_FAILURE;
APPLICATION_STARTED, APPLICATION_STOPPED, DB_CONNECTION, DB_CONNECTION_FAILURE;
}

View File

@ -54,8 +54,7 @@ public class EventLoggerTest extends TestCase {
listAppender = new ListAppender();
listAppender.extractLocationInfo = true;
org.apache.log4j.Logger eventLogger =
org.apache.log4j.Logger.getLogger("EventLogger");
org.apache.log4j.Logger eventLogger = org.apache.log4j.Logger.getLogger("EventLogger");
eventLogger.addAppender(listAppender);
eventLogger.setLevel(org.apache.log4j.Level.TRACE);
eventLogger.setAdditivity(false);
@ -79,7 +78,6 @@ public class EventLoggerTest extends TestCase {
assertEquals(EXPECTED_FILE_NAME, le.getLocationInformation().getFileName());
}
public void testEventLogger() {
EventData data[] = new EventData[2];
data[0] = new EventData();
@ -97,7 +95,7 @@ public class EventLoggerTest extends TestCase {
EventLogger.logEvent(data[1]);
assertEquals(2, listAppender.list.size());
for (int i=0; i < 2; ++i) {
for (int i = 0; i < 2; ++i) {
LoggingEvent event = listAppender.list.get(i);
verify(event, data[i].toXML());
LocationInfo li = event.getLocationInformation();

View File

@ -38,7 +38,7 @@ public class ListAppender extends AppenderSkeleton {
protected void append(LoggingEvent event) {
list.add(event);
if(extractLocationInfo) {
if (extractLocationInfo) {
event.getLocationInformation();
}
}
@ -51,4 +51,3 @@ public class ListAppender extends AppenderSkeleton {
}
}

View File

@ -31,7 +31,6 @@ import org.slf4j.ext.MDCStrLookup;
public class MDCStrLookupTest extends TestCase {
public MDCStrLookupTest(String name) {
super(name);
}

View File

@ -105,12 +105,11 @@ public class XLoggerTest extends TestCase {
XLogger logger = XLoggerFactory.getXLogger("UnitTest");
Throwable t = new UnsupportedOperationException("Test");
assertEquals(t, logger.throwing(t));
assertEquals(t, logger.throwing(XLogger.Level.DEBUG,t));
assertEquals(t, logger.throwing(XLogger.Level.DEBUG, t));
assertEquals(2, listAppender.list.size());
verifyWithException((LoggingEvent) listAppender.list.get(0), "throwing", t);
LoggingEvent event = (LoggingEvent)listAppender.list.get(1);
verifyWithLevelAndException(event, XLogger.Level.DEBUG,
"throwing", t);
LoggingEvent event = (LoggingEvent) listAppender.list.get(1);
verifyWithLevelAndException(event, XLogger.Level.DEBUG, "throwing", t);
}
public void testCaught() {
@ -126,14 +125,13 @@ public class XLoggerTest extends TestCase {
logger.catching(XLogger.Level.DEBUG, ex);
}
verifyWithException((LoggingEvent) listAppender.list.get(0), "catching", t);
verifyWithLevelAndException((LoggingEvent) listAppender.list.get(1), XLogger.Level.DEBUG,
"catching", t);
verifyWithLevelAndException((LoggingEvent) listAppender.list.get(1), XLogger.Level.DEBUG, "catching", t);
}
// See http://bugzilla.slf4j.org/show_bug.cgi?id=114
public void testLocationExtraction_Bug114() {
XLogger logger = XLoggerFactory.getXLogger("UnitTest");
int line = 137; // next line is line number 134
int line = 135; // requires update if line numbers change
logger.exit();
logger.debug("hello");
@ -143,14 +141,14 @@ public class XLoggerTest extends TestCase {
LoggingEvent e = listAppender.list.get(0);
LocationInfo li = e.getLocationInformation();
assertEquals(this.getClass().getName(), li.getClassName());
assertEquals(""+line, li.getLineNumber());
assertEquals("" + line, li.getLineNumber());
}
{
LoggingEvent e = listAppender.list.get(1);
LocationInfo li = e.getLocationInformation();
assertEquals(this.getClass().getName(), li.getClassName());
assertEquals(""+(line+1), li.getLineNumber());
assertEquals("" + (line + 1), li.getLineNumber());
}
}

View File

@ -35,44 +35,31 @@ public class ToStringHelperTest extends TestCase {
assertEquals("", "[a]", ToStringHelper.render(new String[] { "a" }));
assertEquals("", "[a, b]", ToStringHelper.render(new String[] { "a",
"b" }));
assertEquals("", "[a, b]", ToStringHelper.render(new String[] { "a", "b" }));
assertEquals("", "[a, b, c]", ToStringHelper.render(new String[] { "a",
"b", "c" }));
assertEquals("", "[a, b, c]", ToStringHelper.render(new String[] { "a", "b", "c" }));
assertEquals("", "[[a], [b, c]]", ToStringHelper.render(new String[][] {
{ "a" }, { "b", "c" } }));
assertEquals("", "[[a], [b, c]]", ToStringHelper.render(new String[][] { { "a" }, { "b", "c" } }));
assertEquals("", "[0, [a], [b, c]]", ToStringHelper
.render(new Object[] { "0", new String[] { "a" },
new Object[] { "b", "c" } }));
assertEquals("", "[0, [a], [b, c]]", ToStringHelper.render(new Object[] { "0", new String[] { "a" }, new Object[] { "b", "c" } }));
assertEquals("", "[1]", ToStringHelper.render(new int[] { 1 }));
assertEquals("", "[1, 2, 3]", ToStringHelper
.render(new int[] { 1, 2, 3 }));
assertEquals("", "[1, 2, 3]", ToStringHelper.render(new int[] { 1, 2, 3 }));
assertEquals("", "[1, 2, 3]", ToStringHelper.render(new long[] { 1, 2,
3 }));
assertEquals("", "[1, 2, 3]", ToStringHelper.render(new long[] { 1, 2, 3 }));
assertEquals("", "[1, 2, 3]", ToStringHelper.render(new short[] { 1, 2,
3 }));
assertEquals("", "[1, 2, 3]", ToStringHelper.render(new short[] { 1, 2, 3 }));
assertEquals("", "[[1, 2], [], [3, 4]]", ToStringHelper
.render(new byte[][] { { 1, 2 }, {}, { 3, 4 } }));
assertEquals("", "[[1, 2], [], [3, 4]]", ToStringHelper.render(new byte[][] { { 1, 2 }, {}, { 3, 4 } }));
assertEquals("", "[1.0, 2.0, 3.0]", ToStringHelper.render(new float[] {
1, 2, 3 }));
assertEquals("", "[1.0, 2.0, 3.0]", ToStringHelper.render(new float[] { 1, 2, 3 }));
assertEquals("", "[1.0, 2.0, 3.0]", ToStringHelper.render(new double[] {
1, 2, 3 }));
assertEquals("", "[1.0, 2.0, 3.0]", ToStringHelper.render(new double[] { 1, 2, 3 }));
assertEquals("", "[[1.0, 2.0, 3.0]]", ToStringHelper
.render(new double[][] { { 1, 2, 3 } }));
assertEquals("", "[[1.0, 2.0, 3.0]]", ToStringHelper.render(new double[][] { { 1, 2, 3 } }));
assertEquals("", "[true, false, true]", ToStringHelper
.render(new boolean[] { true, false, true }));
assertEquals("", "[true, false, true]", ToStringHelper.render(new boolean[] { true, false, true }));
}
}

View File

@ -24,8 +24,6 @@
*/
package org.slf4j.profiler;
/**
*
* This demo illustrates usage of SLF4J profilers.
@ -67,7 +65,7 @@ public class NestedProfilerDemo {
// start a stopwatch called "RANDOM"
profiler.start("RANDOM");
RandomIntegerArrayGenerator riaGenerator = new RandomIntegerArrayGenerator();
int n = 10*1000;
int n = 10 * 1000;
int[] randomArray = riaGenerator.generate(n);
// create and start a nested profiler called "SORT_AND_PRUNE"

View File

@ -27,8 +27,6 @@ package org.slf4j.profiler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* This demo illustrates usage of SLF4J profilers. It is almost identical to
@ -52,7 +50,7 @@ public class NestedProfilerDemo2 {
profiler.start("RANDOM");
RandomIntegerArrayGenerator riaGenerator = new RandomIntegerArrayGenerator();
int n = 10*1000;
int n = 10 * 1000;
int[] randomArray = riaGenerator.generate(n);
profiler.startNested(SortAndPruneComposites.NESTED_PROFILER_NAME);

View File

@ -24,7 +24,6 @@
*/
package org.slf4j.profiler;
import junit.framework.*;
public class PackageTest extends TestCase {

View File

@ -36,6 +36,7 @@ public class ProfilerTest extends TestCase {
public void setUp() throws Exception {
super.setUp();
}
public void testSmoke() {
Profiler profiler = new Profiler("SMOKE");
profiler.stop();
@ -100,7 +101,7 @@ public class ProfilerTest extends TestCase {
profiler.sanityCheck();
StopWatch gSW = profiler.globalStopWatch;
assertEquals(TimeInstrumentStatus.STOPPED, gSW.status);
//assertEquals(3, profiler.stopwatchList.size());
// assertEquals(3, profiler.stopwatchList.size());
assertEquals(4, profiler.childTimeInstrumentList.size());
assertNotNull(profiler.getLastTimeInstrument());
assertEquals("doZ", profiler.getLastTimeInstrument().getName());
@ -110,9 +111,11 @@ public class ProfilerTest extends TestCase {
private void doX(int millis) {
delay(millis);
}
private void doY(int millis) {
delay(millis);
}
private void doZ(int millis) {
delay(millis);
}
@ -126,7 +129,6 @@ public class ProfilerTest extends TestCase {
nested.stop();
}
void delay(int millis) {
try {
Thread.sleep(millis);

View File

@ -31,7 +31,7 @@ public class RandomIntegerArrayGenerator {
int[] generate(int size) {
int[] result = new int[size];
for(int i = 0; i < size; i++) {
for (int i = 0; i < size; i++) {
int r = rand.nextInt();
result[i] = r;
}

View File

@ -64,30 +64,30 @@ public class SortAndPruneComposites {
int[] pruneComposites(int[] sortedArray) {
ArrayList<Integer> primesArray = new ArrayList<Integer>();
for(int i = 0; i < originalArrrayLength; i++) {
for (int i = 0; i < originalArrrayLength; i++) {
int n = sortedArray[i];
if(isPrime(n)) {
if (isPrime(n)) {
primesArray.add(n);
}
}
int resultSize = primesArray.size();
int[] result = new int[resultSize];
for(int i = 0; i < resultSize; i++) {
for (int i = 0; i < resultSize; i++) {
result[i] = primesArray.get(i);
}
return result;
}
public boolean isPrime(int n) {
if(n < 2) {
if (n < 2) {
return false;
}
if(n%2 == 0) {
if (n % 2 == 0) {
return false;
}
for(int i = 3; i*i <=n; i += 2) {
if(n%i ==0) {
for (int i = 3; i * i <= n; i += 2) {
if (n % i == 0) {
return false;
}
}

View File

@ -42,11 +42,11 @@ public class UtilTest extends TestCase {
public void testSelectDurationUnitForDisplay() throws InterruptedException {
assertEquals(DurationUnit.NANOSECOND, Util.selectDurationUnitForDisplay(10));
assertEquals(DurationUnit.NANOSECOND, Util.selectDurationUnitForDisplay(9*Util.NANOS_IN_ONE_MICROSECOND));
assertEquals(DurationUnit.MICROSECOND, Util.selectDurationUnitForDisplay(11*Util.NANOS_IN_ONE_MICROSECOND));
assertEquals(DurationUnit.MICROSECOND, Util.selectDurationUnitForDisplay(9*Util.NANOS_IN_ONE_MILLISECOND));
assertEquals(DurationUnit.MILLISSECOND, Util.selectDurationUnitForDisplay(11*Util.NANOS_IN_ONE_MILLISECOND));
assertEquals(DurationUnit.SECOND, Util.selectDurationUnitForDisplay(11*Util.NANOS_IN_ONE_SECOND));
assertEquals(DurationUnit.NANOSECOND, Util.selectDurationUnitForDisplay(9 * Util.NANOS_IN_ONE_MICROSECOND));
assertEquals(DurationUnit.MICROSECOND, Util.selectDurationUnitForDisplay(11 * Util.NANOS_IN_ONE_MICROSECOND));
assertEquals(DurationUnit.MICROSECOND, Util.selectDurationUnitForDisplay(9 * Util.NANOS_IN_ONE_MILLISECOND));
assertEquals(DurationUnit.MILLISSECOND, Util.selectDurationUnitForDisplay(11 * Util.NANOS_IN_ONE_MILLISECOND));
assertEquals(DurationUnit.SECOND, Util.selectDurationUnitForDisplay(11 * Util.NANOS_IN_ONE_SECOND));
}
}

View File

@ -114,7 +114,6 @@ public final class JCLLoggerAdapter extends MarkerIgnoringBase {
}
}
/**
* Delegates to the {@link Log#trace(java.lang.Object)} method of the underlying
* {@link Log} instance.
@ -147,7 +146,6 @@ public final class JCLLoggerAdapter extends MarkerIgnoringBase {
log.trace(msg, t);
}
/**
* Delegates to the {@link Log#isDebugEnabled} method of the underlying
* {@link Log} instance.
@ -212,7 +210,6 @@ public final class JCLLoggerAdapter extends MarkerIgnoringBase {
}
}
/**
* Delegates to the {@link Log#debug(java.lang.Object)} method of the underlying
* {@link Log} instance.
@ -284,6 +281,7 @@ public final class JCLLoggerAdapter extends MarkerIgnoringBase {
log.info(ft.getMessage(), ft.getThrowable());
}
}
/**
* Delegates to the {@link Log#info(java.lang.Object)} method of the underlying
* {@link Log} instance.
@ -327,7 +325,6 @@ public final class JCLLoggerAdapter extends MarkerIgnoringBase {
}
}
/**
* Delegates to the {@link Log#info(java.lang.Object, java.lang.Throwable)} method of
* the underlying {@link Log} instance.
@ -422,7 +419,6 @@ public final class JCLLoggerAdapter extends MarkerIgnoringBase {
}
}
/**
* Delegates to the {@link Log#warn(java.lang.Object, java.lang.Throwable)} method of
* the underlying {@link Log} instance.
@ -437,7 +433,6 @@ public final class JCLLoggerAdapter extends MarkerIgnoringBase {
log.warn(msg, t);
}
/**
* Delegates to the {@link Log#isErrorEnabled} method of the underlying
* {@link Log} instance.
@ -519,7 +514,6 @@ public final class JCLLoggerAdapter extends MarkerIgnoringBase {
}
}
/**
* Delegates to the {@link Log#error(java.lang.Object, java.lang.Throwable)} method of
* the underlying {@link Log} instance.

Some files were not shown because too many files have changed in this diff Show More