Skip to content

Commit 5bfa15d

Browse files
committed
Remove useless code
Enable save actions to make sure that these happen automatically.
1 parent aa08c09 commit 5bfa15d

File tree

5 files changed

+219
-5
lines changed

5 files changed

+219
-5
lines changed
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
eclipse.preferences.version=1
2+
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
3+
sp_cleanup.add_all=false
4+
sp_cleanup.add_default_serial_version_id=true
5+
sp_cleanup.add_generated_serial_version_id=false
6+
sp_cleanup.add_missing_annotations=true
7+
sp_cleanup.add_missing_deprecated_annotations=true
8+
sp_cleanup.add_missing_methods=false
9+
sp_cleanup.add_missing_nls_tags=false
10+
sp_cleanup.add_missing_override_annotations=true
11+
sp_cleanup.add_missing_override_annotations_interface_methods=true
12+
sp_cleanup.add_serial_version_id=false
13+
sp_cleanup.always_use_blocks=true
14+
sp_cleanup.always_use_parentheses_in_expressions=false
15+
sp_cleanup.always_use_this_for_non_static_field_access=false
16+
sp_cleanup.always_use_this_for_non_static_method_access=false
17+
sp_cleanup.array_with_curly=false
18+
sp_cleanup.arrays_fill=false
19+
sp_cleanup.bitwise_conditional_expression=false
20+
sp_cleanup.boolean_literal=false
21+
sp_cleanup.boolean_value_rather_than_comparison=false
22+
sp_cleanup.break_loop=false
23+
sp_cleanup.collection_cloning=false
24+
sp_cleanup.comparing_on_criteria=false
25+
sp_cleanup.comparison_statement=false
26+
sp_cleanup.controlflow_merge=false
27+
sp_cleanup.convert_functional_interfaces=false
28+
sp_cleanup.convert_to_enhanced_for_loop=false
29+
sp_cleanup.convert_to_enhanced_for_loop_if_loop_var_used=false
30+
sp_cleanup.convert_to_switch_expressions=false
31+
sp_cleanup.correct_indentation=false
32+
sp_cleanup.do_while_rather_than_while=false
33+
sp_cleanup.double_negation=false
34+
sp_cleanup.else_if=false
35+
sp_cleanup.embedded_if=false
36+
sp_cleanup.evaluate_nullable=false
37+
sp_cleanup.extract_increment=false
38+
sp_cleanup.format_source_code=true
39+
sp_cleanup.format_source_code_changes_only=true
40+
sp_cleanup.hash=false
41+
sp_cleanup.if_condition=false
42+
sp_cleanup.insert_inferred_type_arguments=false
43+
sp_cleanup.instanceof=false
44+
sp_cleanup.instanceof_keyword=false
45+
sp_cleanup.invert_equals=false
46+
sp_cleanup.join=false
47+
sp_cleanup.lazy_logical_operator=false
48+
sp_cleanup.make_local_variable_final=true
49+
sp_cleanup.make_parameters_final=false
50+
sp_cleanup.make_private_fields_final=true
51+
sp_cleanup.make_type_abstract_if_missing_method=false
52+
sp_cleanup.make_variable_declarations_final=false
53+
sp_cleanup.map_cloning=false
54+
sp_cleanup.merge_conditional_blocks=false
55+
sp_cleanup.multi_catch=false
56+
sp_cleanup.never_use_blocks=false
57+
sp_cleanup.never_use_parentheses_in_expressions=true
58+
sp_cleanup.no_string_creation=false
59+
sp_cleanup.no_super=false
60+
sp_cleanup.number_suffix=false
61+
sp_cleanup.objects_equals=false
62+
sp_cleanup.on_save_use_additional_actions=true
63+
sp_cleanup.one_if_rather_than_duplicate_blocks_that_fall_through=false
64+
sp_cleanup.operand_factorization=false
65+
sp_cleanup.organize_imports=true
66+
sp_cleanup.overridden_assignment=false
67+
sp_cleanup.overridden_assignment_move_decl=true
68+
sp_cleanup.plain_replacement=false
69+
sp_cleanup.precompile_regex=false
70+
sp_cleanup.primitive_comparison=false
71+
sp_cleanup.primitive_parsing=false
72+
sp_cleanup.primitive_rather_than_wrapper=false
73+
sp_cleanup.primitive_serialization=false
74+
sp_cleanup.pull_out_if_from_if_else=false
75+
sp_cleanup.pull_up_assignment=false
76+
sp_cleanup.push_down_negation=false
77+
sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
78+
sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
79+
sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
80+
sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
81+
sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
82+
sp_cleanup.reduce_indentation=false
83+
sp_cleanup.redundant_comparator=false
84+
sp_cleanup.redundant_falling_through_block_end=false
85+
sp_cleanup.remove_private_constructors=true
86+
sp_cleanup.remove_redundant_modifiers=false
87+
sp_cleanup.remove_redundant_semicolons=false
88+
sp_cleanup.remove_redundant_type_arguments=false
89+
sp_cleanup.remove_trailing_whitespaces=false
90+
sp_cleanup.remove_trailing_whitespaces_all=true
91+
sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
92+
sp_cleanup.remove_unnecessary_array_creation=false
93+
sp_cleanup.remove_unnecessary_casts=true
94+
sp_cleanup.remove_unnecessary_nls_tags=false
95+
sp_cleanup.remove_unused_imports=false
96+
sp_cleanup.remove_unused_local_variables=false
97+
sp_cleanup.remove_unused_method_parameters=false
98+
sp_cleanup.remove_unused_private_fields=true
99+
sp_cleanup.remove_unused_private_members=false
100+
sp_cleanup.remove_unused_private_methods=true
101+
sp_cleanup.remove_unused_private_types=true
102+
sp_cleanup.return_expression=false
103+
sp_cleanup.simplify_lambda_expression_and_method_ref=false
104+
sp_cleanup.single_used_field=false
105+
sp_cleanup.sort_members=false
106+
sp_cleanup.sort_members_all=false
107+
sp_cleanup.standard_comparison=false
108+
sp_cleanup.static_inner_class=false
109+
sp_cleanup.strictly_equal_or_different=false
110+
sp_cleanup.stringbuffer_to_stringbuilder=false
111+
sp_cleanup.stringbuilder=false
112+
sp_cleanup.stringbuilder_for_local_vars=true
113+
sp_cleanup.stringconcat_to_textblock=false
114+
sp_cleanup.substring=false
115+
sp_cleanup.switch=false
116+
sp_cleanup.system_property=false
117+
sp_cleanup.system_property_boolean=false
118+
sp_cleanup.system_property_file_encoding=false
119+
sp_cleanup.system_property_file_separator=false
120+
sp_cleanup.system_property_line_separator=false
121+
sp_cleanup.system_property_path_separator=false
122+
sp_cleanup.ternary_operator=false
123+
sp_cleanup.try_with_resource=false
124+
sp_cleanup.unlooped_while=false
125+
sp_cleanup.unreachable_block=false
126+
sp_cleanup.use_anonymous_class_creation=false
127+
sp_cleanup.use_autoboxing=false
128+
sp_cleanup.use_blocks=false
129+
sp_cleanup.use_blocks_only_for_return_and_throw=false
130+
sp_cleanup.use_directly_map_method=false
131+
sp_cleanup.use_lambda=true
132+
sp_cleanup.use_parentheses_in_expressions=false
133+
sp_cleanup.use_string_is_blank=false
134+
sp_cleanup.use_this_for_non_static_field_access=false
135+
sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
136+
sp_cleanup.use_this_for_non_static_method_access=false
137+
sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
138+
sp_cleanup.use_unboxing=false
139+
sp_cleanup.use_var=false
140+
sp_cleanup.useless_continue=false
141+
sp_cleanup.useless_return=false
142+
sp_cleanup.valueof_rather_than_instantiation=false

org.eclipse.jface.text.examples/src/org/eclipse/jface/text/examples/codemining/ToEchoWithHeaderAndInlineCodeMiningProvider.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@
1919
import org.eclipse.jface.text.Position;
2020
import org.eclipse.jface.text.codemining.AbstractCodeMiningProvider;
2121
import org.eclipse.jface.text.codemining.ICodeMining;
22-
import org.eclipse.jface.text.codemining.ICodeMiningProvider;
2322
import org.eclipse.jface.text.codemining.LineContentCodeMining;
2423

25-
public class ToEchoWithHeaderAndInlineCodeMiningProvider extends AbstractCodeMiningProvider
26-
implements ICodeMiningProvider {
24+
public class ToEchoWithHeaderAndInlineCodeMiningProvider extends AbstractCodeMiningProvider {
2725

2826
private final String toEcho;
2927

org.eclipse.jface.text.tests/.settings/org.eclipse.jdt.ui.prefs

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ org.eclipse.jdt.ui.keywordthis=false
1010
org.eclipse.jdt.ui.ondemandthreshold=99
1111
org.eclipse.jdt.ui.overrideannotation=true
1212
org.eclipse.jdt.ui.staticondemandthreshold=99
13+
sp_cleanup.add_all=false
1314
sp_cleanup.add_default_serial_version_id=true
1415
sp_cleanup.add_generated_serial_version_id=false
1516
sp_cleanup.add_missing_annotations=true
@@ -23,28 +24,74 @@ sp_cleanup.always_use_blocks=true
2324
sp_cleanup.always_use_parentheses_in_expressions=false
2425
sp_cleanup.always_use_this_for_non_static_field_access=false
2526
sp_cleanup.always_use_this_for_non_static_method_access=false
27+
sp_cleanup.array_with_curly=false
28+
sp_cleanup.arrays_fill=false
29+
sp_cleanup.bitwise_conditional_expression=false
30+
sp_cleanup.boolean_literal=false
31+
sp_cleanup.boolean_value_rather_than_comparison=false
32+
sp_cleanup.break_loop=false
33+
sp_cleanup.collection_cloning=false
34+
sp_cleanup.comparing_on_criteria=false
35+
sp_cleanup.comparison_statement=false
36+
sp_cleanup.controlflow_merge=false
2637
sp_cleanup.convert_functional_interfaces=false
2738
sp_cleanup.convert_to_enhanced_for_loop=false
39+
sp_cleanup.convert_to_enhanced_for_loop_if_loop_var_used=false
40+
sp_cleanup.convert_to_switch_expressions=false
2841
sp_cleanup.correct_indentation=false
42+
sp_cleanup.do_while_rather_than_while=false
43+
sp_cleanup.double_negation=false
44+
sp_cleanup.else_if=false
45+
sp_cleanup.embedded_if=false
46+
sp_cleanup.evaluate_nullable=false
47+
sp_cleanup.extract_increment=false
2948
sp_cleanup.format_source_code=true
3049
sp_cleanup.format_source_code_changes_only=true
50+
sp_cleanup.hash=false
51+
sp_cleanup.if_condition=false
3152
sp_cleanup.insert_inferred_type_arguments=false
53+
sp_cleanup.instanceof=false
54+
sp_cleanup.instanceof_keyword=false
55+
sp_cleanup.invert_equals=false
56+
sp_cleanup.join=false
57+
sp_cleanup.lazy_logical_operator=false
3258
sp_cleanup.make_local_variable_final=true
3359
sp_cleanup.make_parameters_final=false
3460
sp_cleanup.make_private_fields_final=true
3561
sp_cleanup.make_type_abstract_if_missing_method=false
3662
sp_cleanup.make_variable_declarations_final=false
63+
sp_cleanup.map_cloning=false
64+
sp_cleanup.merge_conditional_blocks=false
65+
sp_cleanup.multi_catch=false
3766
sp_cleanup.never_use_blocks=false
3867
sp_cleanup.never_use_parentheses_in_expressions=true
68+
sp_cleanup.no_string_creation=false
69+
sp_cleanup.no_super=false
3970
sp_cleanup.number_suffix=false
71+
sp_cleanup.objects_equals=false
4072
sp_cleanup.on_save_use_additional_actions=true
73+
sp_cleanup.one_if_rather_than_duplicate_blocks_that_fall_through=false
74+
sp_cleanup.operand_factorization=false
4175
sp_cleanup.organize_imports=true
76+
sp_cleanup.overridden_assignment=false
77+
sp_cleanup.overridden_assignment_move_decl=false
78+
sp_cleanup.plain_replacement=false
79+
sp_cleanup.precompile_regex=false
80+
sp_cleanup.primitive_comparison=false
81+
sp_cleanup.primitive_parsing=false
82+
sp_cleanup.primitive_rather_than_wrapper=false
83+
sp_cleanup.primitive_serialization=false
84+
sp_cleanup.pull_out_if_from_if_else=false
85+
sp_cleanup.pull_up_assignment=false
4286
sp_cleanup.push_down_negation=false
4387
sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
4488
sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
4589
sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
4690
sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
4791
sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
92+
sp_cleanup.reduce_indentation=false
93+
sp_cleanup.redundant_comparator=false
94+
sp_cleanup.redundant_falling_through_block_end=false
4895
sp_cleanup.remove_private_constructors=true
4996
sp_cleanup.remove_redundant_modifiers=true
5097
sp_cleanup.remove_redundant_semicolons=true
@@ -57,22 +104,49 @@ sp_cleanup.remove_unnecessary_casts=true
57104
sp_cleanup.remove_unnecessary_nls_tags=true
58105
sp_cleanup.remove_unused_imports=false
59106
sp_cleanup.remove_unused_local_variables=false
107+
sp_cleanup.remove_unused_method_parameters=false
60108
sp_cleanup.remove_unused_private_fields=true
61109
sp_cleanup.remove_unused_private_members=false
62110
sp_cleanup.remove_unused_private_methods=true
63111
sp_cleanup.remove_unused_private_types=true
112+
sp_cleanup.return_expression=false
64113
sp_cleanup.simplify_lambda_expression_and_method_ref=false
114+
sp_cleanup.single_used_field=false
65115
sp_cleanup.sort_members=false
66116
sp_cleanup.sort_members_all=false
117+
sp_cleanup.standard_comparison=false
118+
sp_cleanup.static_inner_class=false
119+
sp_cleanup.strictly_equal_or_different=false
120+
sp_cleanup.stringbuffer_to_stringbuilder=false
121+
sp_cleanup.stringbuilder=false
122+
sp_cleanup.stringbuilder_for_local_vars=false
123+
sp_cleanup.stringconcat_to_textblock=false
124+
sp_cleanup.substring=false
125+
sp_cleanup.switch=false
126+
sp_cleanup.system_property=false
127+
sp_cleanup.system_property_boolean=false
128+
sp_cleanup.system_property_file_encoding=false
129+
sp_cleanup.system_property_file_separator=false
130+
sp_cleanup.system_property_line_separator=false
131+
sp_cleanup.system_property_path_separator=false
132+
sp_cleanup.ternary_operator=false
133+
sp_cleanup.try_with_resource=false
134+
sp_cleanup.unlooped_while=false
135+
sp_cleanup.unreachable_block=false
67136
sp_cleanup.use_anonymous_class_creation=false
68137
sp_cleanup.use_autoboxing=false
69138
sp_cleanup.use_blocks=false
70139
sp_cleanup.use_blocks_only_for_return_and_throw=false
71140
sp_cleanup.use_directly_map_method=false
72141
sp_cleanup.use_lambda=true
73142
sp_cleanup.use_parentheses_in_expressions=false
143+
sp_cleanup.use_string_is_blank=false
74144
sp_cleanup.use_this_for_non_static_field_access=false
75145
sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
76146
sp_cleanup.use_this_for_non_static_method_access=false
77147
sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
78148
sp_cleanup.use_unboxing=false
149+
sp_cleanup.use_var=false
150+
sp_cleanup.useless_continue=false
151+
sp_cleanup.useless_return=false
152+
sp_cleanup.valueof_rather_than_instantiation=false

org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/multiselection/AbstractMultiSelectionHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ private int moveOffsetByLines(int offset, int lineDelta) throws BadLocationExcep
331331
return newOffset;
332332
}
333333

334-
private int moveWidgetOffsetByLines(int widgetOffset, int lineDelta) throws BadLocationException {
334+
private int moveWidgetOffsetByLines(int widgetOffset, int lineDelta) {
335335
Point location = getWidget().getLocationAtOffset(widgetOffset);
336336
Point newLocation = new Point(location.x, location.y + lineDelta * getWidget().getLineHeight(widgetOffset));
337337
return getWidget().getOffsetAtPoint(newLocation);

org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/multiselection/StopMultiSelectionHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public void execute() throws ExecutionException {
2929
}
3030
}
3131

32-
private void stopMultiSelection() throws ExecutionException {
32+
private void stopMultiSelection() {
3333
int caretOffset = getCaretOffset();
3434
selectRegion(offsetAsCaretRegion(caretOffset));
3535
setAnchorRegion(null);

0 commit comments

Comments
 (0)