Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Becker2021-01-13 12:36:38 +0000
committerMatthias Becker2021-01-13 15:44:37 +0000
commitd3c7bcc5db4f2ab02b86bbe2ae7ca69a0e8dfe76 (patch)
treeec8be335785a76c33e0f1c822624759680279471
parent400b61d09607765450168fee74b50a6ce073bf83 (diff)
downloadeclipse.platform.ui-d3c7bcc5db4f2ab02b86bbe2ae7ca69a0e8dfe76.tar.gz
eclipse.platform.ui-d3c7bcc5db4f2ab02b86bbe2ae7ca69a0e8dfe76.tar.xz
eclipse.platform.ui-d3c7bcc5db4f2ab02b86bbe2ae7ca69a0e8dfe76.zip
Configure Clean Ups for urischeme BundlesI20210114-0510I20210114-0310
-rw-r--r--bundles/org.eclipse.urischeme/.settings/org.eclipse.jdt.ui.prefs167
-rw-r--r--bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/AutoRegisterSchemeHandlersJob.java6
-rw-r--r--bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/UriSchemeExtensionReader.java2
-rw-r--r--bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/UriSchemeProcessor.java4
-rw-r--r--bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/IRegistryWriter.java5
-rw-r--r--bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/RegistrationLinux.java13
-rw-r--r--bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/RegistrationMacOsX.java3
-rw-r--r--bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/RegistrationWindows.java7
-rw-r--r--bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/SchemeInformation.java1
-rw-r--r--tests/org.eclipse.tests.urischeme/.settings/org.eclipse.jdt.ui.prefs169
-rw-r--r--tests/org.eclipse.tests.urischeme/META-INF/MANIFEST.MF2
-rw-r--r--tests/org.eclipse.tests.urischeme/pom.xml2
-rw-r--r--tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/TestUnitAutoRegisterSchemeHandlersJob.java16
-rw-r--r--tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/UriSchemeExtensionReaderUnitTest.java9
-rw-r--r--tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/UriSchemeHandlerSpy.java8
-rw-r--r--tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/registration/TestUnitPlistFileWriter.java167
-rw-r--r--tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/registration/TestUnitRegistrationLinux.java4
-rw-r--r--tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/registration/WinRegistryMock.java1
-rw-r--r--tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/suite/AllUnitTests.java6
19 files changed, 410 insertions, 182 deletions
diff --git a/bundles/org.eclipse.urischeme/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.urischeme/.settings/org.eclipse.jdt.ui.prefs
index 60532b229ec..3018e0d8de5 100644
--- a/bundles/org.eclipse.urischeme/.settings/org.eclipse.jdt.ui.prefs
+++ b/bundles/org.eclipse.urischeme/.settings/org.eclipse.jdt.ui.prefs
@@ -1,5 +1,109 @@
+cleanup.add_all=true
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.arrays_fill=true
+cleanup.bitwise_conditional_expression=false
+cleanup.boolean_literal=true
+cleanup.break_loop=true
+cleanup.collection_cloning=true
+cleanup.comparison_statement=true
+cleanup.convert_functional_interfaces=true
+cleanup.convert_to_enhanced_for_loop=true
+cleanup.convert_to_enhanced_for_loop_if_loop_var_used=false
+cleanup.convert_to_switch_expressions=false
+cleanup.correct_indentation=true
+cleanup.double_negation=true
+cleanup.else_if=true
+cleanup.embedded_if=true
+cleanup.evaluate_nullable=true
+cleanup.format_source_code=true
+cleanup.format_source_code_changes_only=false
+cleanup.hash=true
+cleanup.if_condition=true
+cleanup.insert_inferred_type_arguments=false
+cleanup.instanceof=false
+cleanup.join=true
+cleanup.lazy_logical_operator=true
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.map_cloning=true
+cleanup.merge_conditional_blocks=true
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.no_string_creation=true
+cleanup.no_super=true
+cleanup.number_suffix=true
+cleanup.objects_equals=true
+cleanup.organize_imports=true
+cleanup.overridden_assignment=true
+cleanup.precompile_regex=true
+cleanup.primitive_serialization=true
+cleanup.pull_up_assignment=false
+cleanup.push_down_negation=false
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.redundant_falling_through_block_end=true
+cleanup.remove_private_constructors=true
+cleanup.remove_redundant_modifiers=true
+cleanup.remove_redundant_semicolons=true
+cleanup.remove_redundant_type_arguments=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_array_creation=true
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.simplify_lambda_expression_and_method_ref=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.strictly_equal_or_different=true
+cleanup.stringbuilder=true
+cleanup.switch=true
+cleanup.ternary_operator=true
+cleanup.try_with_resource=true
+cleanup.use_anonymous_class_creation=false
+cleanup.use_autoboxing=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_directly_map_method=true
+cleanup.use_lambda=true
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup.use_unboxing=false
+cleanup.use_var=false
+cleanup.useless_continue=true
+cleanup.useless_return=true
+cleanup_profile=_Project Specific
+cleanup_settings_version=2
eclipse.preferences.version=1
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+sp_cleanup.add_all=true
sp_cleanup.add_default_serial_version_id=true
sp_cleanup.add_generated_serial_version_id=false
sp_cleanup.add_missing_annotations=true
@@ -11,34 +115,65 @@ sp_cleanup.add_missing_override_annotations_interface_methods=true
sp_cleanup.add_serial_version_id=false
sp_cleanup.always_use_blocks=true
sp_cleanup.always_use_parentheses_in_expressions=false
-sp_cleanup.always_use_this_for_non_static_field_access=false
-sp_cleanup.always_use_this_for_non_static_method_access=false
-sp_cleanup.convert_functional_interfaces=false
-sp_cleanup.convert_to_enhanced_for_loop=false
-sp_cleanup.correct_indentation=false
+sp_cleanup.always_use_this_for_non_static_field_access=true
+sp_cleanup.always_use_this_for_non_static_method_access=true
+sp_cleanup.arrays_fill=true
+sp_cleanup.bitwise_conditional_expression=false
+sp_cleanup.boolean_literal=true
+sp_cleanup.break_loop=true
+sp_cleanup.collection_cloning=true
+sp_cleanup.comparison_statement=true
+sp_cleanup.convert_functional_interfaces=true
+sp_cleanup.convert_to_enhanced_for_loop=true
+sp_cleanup.convert_to_enhanced_for_loop_if_loop_var_used=false
+sp_cleanup.convert_to_switch_expressions=false
+sp_cleanup.correct_indentation=true
+sp_cleanup.double_negation=true
+sp_cleanup.else_if=true
+sp_cleanup.embedded_if=true
+sp_cleanup.evaluate_nullable=true
sp_cleanup.format_source_code=true
sp_cleanup.format_source_code_changes_only=true
+sp_cleanup.hash=true
+sp_cleanup.if_condition=false
sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.instanceof=false
+sp_cleanup.join=true
+sp_cleanup.lazy_logical_operator=true
sp_cleanup.make_local_variable_final=true
sp_cleanup.make_parameters_final=false
sp_cleanup.make_private_fields_final=true
sp_cleanup.make_type_abstract_if_missing_method=false
sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.map_cloning=true
+sp_cleanup.merge_conditional_blocks=true
sp_cleanup.never_use_blocks=false
sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.no_string_creation=true
+sp_cleanup.no_super=true
+sp_cleanup.number_suffix=true
+sp_cleanup.objects_equals=true
sp_cleanup.on_save_use_additional_actions=true
sp_cleanup.organize_imports=true
+sp_cleanup.overridden_assignment=true
+sp_cleanup.precompile_regex=true
+sp_cleanup.primitive_serialization=true
+sp_cleanup.pull_up_assignment=false
+sp_cleanup.push_down_negation=false
sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=true
sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.redundant_falling_through_block_end=false
sp_cleanup.remove_private_constructors=true
sp_cleanup.remove_redundant_modifiers=true
-sp_cleanup.remove_redundant_type_arguments=false
+sp_cleanup.remove_redundant_semicolons=true
+sp_cleanup.remove_redundant_type_arguments=true
sp_cleanup.remove_trailing_whitespaces=true
sp_cleanup.remove_trailing_whitespaces_all=true
sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_array_creation=true
sp_cleanup.remove_unnecessary_casts=true
sp_cleanup.remove_unnecessary_nls_tags=true
sp_cleanup.remove_unused_imports=true
@@ -47,14 +182,26 @@ sp_cleanup.remove_unused_private_fields=true
sp_cleanup.remove_unused_private_members=false
sp_cleanup.remove_unused_private_methods=true
sp_cleanup.remove_unused_private_types=true
+sp_cleanup.simplify_lambda_expression_and_method_ref=true
sp_cleanup.sort_members=false
sp_cleanup.sort_members_all=false
+sp_cleanup.strictly_equal_or_different=false
+sp_cleanup.stringbuilder=true
+sp_cleanup.switch=true
+sp_cleanup.ternary_operator=false
+sp_cleanup.try_with_resource=true
sp_cleanup.use_anonymous_class_creation=false
-sp_cleanup.use_blocks=false
+sp_cleanup.use_autoboxing=false
+sp_cleanup.use_blocks=true
sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_directly_map_method=true
sp_cleanup.use_lambda=true
sp_cleanup.use_parentheses_in_expressions=false
sp_cleanup.use_this_for_non_static_field_access=false
-sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=false
sp_cleanup.use_this_for_non_static_method_access=false
-sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=false
+sp_cleanup.use_unboxing=false
+sp_cleanup.use_var=false
+sp_cleanup.useless_continue=true
+sp_cleanup.useless_return=true
diff --git a/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/AutoRegisterSchemeHandlersJob.java b/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/AutoRegisterSchemeHandlersJob.java
index 51f2ea23ab3..330c5462220 100644
--- a/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/AutoRegisterSchemeHandlersJob.java
+++ b/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/AutoRegisterSchemeHandlersJob.java
@@ -70,10 +70,10 @@ public class AutoRegisterSchemeHandlersJob extends Job {
IPreferencesService preferences = Platform.getPreferencesService();
String schemes = testPreferenceNode != null ? testPreferenceNode.get(PROCESSED_SCHEMES_PREFERENCE, "") //$NON-NLS-1$
: preferences.getString(UriSchemeExtensionReader.PLUGIN_ID, PROCESSED_SCHEMES_PREFERENCE, "", //$NON-NLS-1$
- null);
+ null);
- Collection<String> processedSchemes = new LinkedHashSet<>(Arrays
- .asList(schemes.split(SCHEME_LIST_PREFERENCE_SEPARATOR)));
+ Collection<String> processedSchemes = new LinkedHashSet<>(
+ Arrays.asList(schemes.split(SCHEME_LIST_PREFERENCE_SEPARATOR)));
Collection<IScheme> toProcessSchemes = new LinkedHashSet<>(extensionReader.getSchemes());
toProcessSchemes.removeIf(scheme -> processedSchemes.contains(scheme.getName()));
if (toProcessSchemes.isEmpty()) {
diff --git a/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/UriSchemeExtensionReader.java b/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/UriSchemeExtensionReader.java
index 901fd6740b2..4e323d368ce 100644
--- a/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/UriSchemeExtensionReader.java
+++ b/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/UriSchemeExtensionReader.java
@@ -68,7 +68,6 @@ public class UriSchemeExtensionReader implements IUriSchemeExtensionReader {
return schemes;
}
-
@Override
public IUriSchemeHandler getHandlerFromExtensionPoint(String uriScheme) throws CoreException {
IConfigurationElement[] elements = getOrReadConfigurationElements();
@@ -104,7 +103,6 @@ public class UriSchemeExtensionReader implements IUriSchemeExtensionReader {
private String uriSchemeDescription;
public Scheme(String uriScheme, String uriSchemeDescription) {
- super();
this.uriScheme = uriScheme;
this.uriSchemeDescription = uriSchemeDescription;
}
diff --git a/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/UriSchemeProcessor.java b/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/UriSchemeProcessor.java
index 77fe0b8f268..032bbf2c4a8 100644
--- a/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/UriSchemeProcessor.java
+++ b/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/UriSchemeProcessor.java
@@ -43,9 +43,7 @@ public class UriSchemeProcessor implements IUriSchemeProcessor {
*/
@Override
public void handleUri(String uriScheme, String uri) throws CoreException {
- IUriSchemeHandler handler = null;
-
- handler = getHandler(uriScheme);
+ IUriSchemeHandler handler = getHandler(uriScheme);
if (handler != null) {
handler.handle(uri);
}
diff --git a/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/IRegistryWriter.java b/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/IRegistryWriter.java
index dde10d10ad0..6f912a4367f 100644
--- a/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/IRegistryWriter.java
+++ b/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/IRegistryWriter.java
@@ -29,15 +29,14 @@ public interface IRegistryWriter {
/**
* Adds scheme and handler path to the OS.
*
- * @param scheme The uri scheme which should be handled by the application
- * mentioned in the OS.
+ * @param scheme The uri scheme which should be handled by the application
+ * mentioned in the OS.
* @param launcherPath The path to the launcher binary
* @throws WinRegistryException if Windows Registry I/O error occurred
*
*/
void addScheme(String scheme, String launcherPath) throws WinRegistryException;
-
/**
* Removes the scheme and handler path from the OS.
*
diff --git a/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/RegistrationLinux.java b/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/RegistrationLinux.java
index bb63549dd28..ae440fb1cfd 100644
--- a/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/RegistrationLinux.java
+++ b/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/RegistrationLinux.java
@@ -57,8 +57,7 @@ public class RegistrationLinux implements IOperatingSystemRegistration {
}
@Override
- public void handleSchemes(Collection<IScheme> toAdd, Collection<IScheme> toRemove)
- throws Exception {
+ public void handleSchemes(Collection<IScheme> toAdd, Collection<IScheme> toRemove) throws Exception {
String desktopFileName = getDesktopFileName();
changeDesktopFile(toAdd, toRemove, PATH_TO_LOCAL_SHARE_APPS + desktopFileName);
@@ -72,8 +71,7 @@ public class RegistrationLinux implements IOperatingSystemRegistration {
String eclipseLauncher = getEclipseLauncher();
for (IScheme scheme : schemes) {
- SchemeInformation schemeInfo = new SchemeInformation(scheme.getName(),
- scheme.getDescription());
+ SchemeInformation schemeInfo = new SchemeInformation(scheme.getName(), scheme.getDescription());
String location = determineHandlerLocation(scheme.getName());
if (location.equals(eclipseLauncher)) {
@@ -93,8 +91,8 @@ public class RegistrationLinux implements IOperatingSystemRegistration {
return ""; //$NON-NLS-1$
}
- private void changeDesktopFile(Iterable<IScheme> toAdd, Iterable<IScheme> toRemove,
- String desktopFilePath) throws IOException {
+ private void changeDesktopFile(Iterable<IScheme> toAdd, Iterable<IScheme> toRemove, String desktopFilePath)
+ throws IOException {
List<String> lines = readFileOrGetInitialContent(desktopFilePath);
if (lines.isEmpty()) {
@@ -120,8 +118,7 @@ public class RegistrationLinux implements IOperatingSystemRegistration {
}
}
- private void registerSchemesWithXdgMime(Collection<IScheme> schemes, String desktopFilePath)
- throws Exception {
+ private void registerSchemesWithXdgMime(Collection<IScheme> schemes, String desktopFilePath) throws Exception {
if (schemes.isEmpty()) {
return;
}
diff --git a/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/RegistrationMacOsX.java b/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/RegistrationMacOsX.java
index 25bcae1d795..3dcaec50a68 100644
--- a/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/RegistrationMacOsX.java
+++ b/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/RegistrationMacOsX.java
@@ -104,8 +104,7 @@ public class RegistrationMacOsX implements IOperatingSystemRegistration {
Pattern pattern = Pattern.compile(
"^" + ANY_LINES + "\\s*" + PATH_WITH_CAPTURING_GROUP + "\\n" + ANY_LINES + "\\s*" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- + keyOfSchemeList
- + ".*" //$NON-NLS-1$
+ + keyOfSchemeList + ".*" //$NON-NLS-1$
+ Pattern.quote(scheme) + ":", //$NON-NLS-1$
Pattern.MULTILINE);
diff --git a/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/RegistrationWindows.java b/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/RegistrationWindows.java
index 34d16e57c4e..5374aea3305 100644
--- a/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/RegistrationWindows.java
+++ b/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/RegistrationWindows.java
@@ -23,6 +23,7 @@ import org.eclipse.core.runtime.Assert;
import org.eclipse.urischeme.IOperatingSystemRegistration;
import org.eclipse.urischeme.IScheme;
import org.eclipse.urischeme.ISchemeInformation;
+
/**
* Windows OS specific handling of schemes
*
@@ -55,8 +56,7 @@ public class RegistrationWindows implements IOperatingSystemRegistration {
}
@Override
- public void handleSchemes(Collection<IScheme> toAdd, Collection<IScheme> toRemove)
- throws Exception {
+ public void handleSchemes(Collection<IScheme> toAdd, Collection<IScheme> toRemove) throws Exception {
String eclipseLauncher = getEclipseLauncher();
if (eclipseLauncher != null) {
for (IScheme scheme : toAdd) {
@@ -85,8 +85,7 @@ public class RegistrationWindows implements IOperatingSystemRegistration {
List<ISchemeInformation> schemeInformations = new ArrayList<>();
for (IScheme scheme : schemes) {
- SchemeInformation schemeInfo = new SchemeInformation(scheme.getName(),
- scheme.getDescription());
+ SchemeInformation schemeInfo = new SchemeInformation(scheme.getName(), scheme.getDescription());
String path = registryWriter.getRegisteredHandlerPath(schemeInfo.getName());
if (path == null) {
path = ""; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/SchemeInformation.java b/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/SchemeInformation.java
index 9e4543f7b52..554886a8470 100644
--- a/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/SchemeInformation.java
+++ b/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/SchemeInformation.java
@@ -27,7 +27,6 @@ public class SchemeInformation implements ISchemeInformation {
@SuppressWarnings("javadoc")
public SchemeInformation(String schemeName, String schemeDescription) {
- super();
this.name = schemeName;
this.description = schemeDescription;
}
diff --git a/tests/org.eclipse.tests.urischeme/.settings/org.eclipse.jdt.ui.prefs b/tests/org.eclipse.tests.urischeme/.settings/org.eclipse.jdt.ui.prefs
index ead105a7d22..3018e0d8de5 100644
--- a/tests/org.eclipse.tests.urischeme/.settings/org.eclipse.jdt.ui.prefs
+++ b/tests/org.eclipse.tests.urischeme/.settings/org.eclipse.jdt.ui.prefs
@@ -1,5 +1,109 @@
+cleanup.add_all=true
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.arrays_fill=true
+cleanup.bitwise_conditional_expression=false
+cleanup.boolean_literal=true
+cleanup.break_loop=true
+cleanup.collection_cloning=true
+cleanup.comparison_statement=true
+cleanup.convert_functional_interfaces=true
+cleanup.convert_to_enhanced_for_loop=true
+cleanup.convert_to_enhanced_for_loop_if_loop_var_used=false
+cleanup.convert_to_switch_expressions=false
+cleanup.correct_indentation=true
+cleanup.double_negation=true
+cleanup.else_if=true
+cleanup.embedded_if=true
+cleanup.evaluate_nullable=true
+cleanup.format_source_code=true
+cleanup.format_source_code_changes_only=false
+cleanup.hash=true
+cleanup.if_condition=true
+cleanup.insert_inferred_type_arguments=false
+cleanup.instanceof=false
+cleanup.join=true
+cleanup.lazy_logical_operator=true
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.map_cloning=true
+cleanup.merge_conditional_blocks=true
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.no_string_creation=true
+cleanup.no_super=true
+cleanup.number_suffix=true
+cleanup.objects_equals=true
+cleanup.organize_imports=true
+cleanup.overridden_assignment=true
+cleanup.precompile_regex=true
+cleanup.primitive_serialization=true
+cleanup.pull_up_assignment=false
+cleanup.push_down_negation=false
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.redundant_falling_through_block_end=true
+cleanup.remove_private_constructors=true
+cleanup.remove_redundant_modifiers=true
+cleanup.remove_redundant_semicolons=true
+cleanup.remove_redundant_type_arguments=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_array_creation=true
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.simplify_lambda_expression_and_method_ref=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.strictly_equal_or_different=true
+cleanup.stringbuilder=true
+cleanup.switch=true
+cleanup.ternary_operator=true
+cleanup.try_with_resource=true
+cleanup.use_anonymous_class_creation=false
+cleanup.use_autoboxing=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_directly_map_method=true
+cleanup.use_lambda=true
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup.use_unboxing=false
+cleanup.use_var=false
+cleanup.useless_continue=true
+cleanup.useless_return=true
+cleanup_profile=_Project Specific
+cleanup_settings_version=2
eclipse.preferences.version=1
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+sp_cleanup.add_all=true
sp_cleanup.add_default_serial_version_id=true
sp_cleanup.add_generated_serial_version_id=false
sp_cleanup.add_missing_annotations=true
@@ -11,34 +115,65 @@ sp_cleanup.add_missing_override_annotations_interface_methods=true
sp_cleanup.add_serial_version_id=false
sp_cleanup.always_use_blocks=true
sp_cleanup.always_use_parentheses_in_expressions=false
-sp_cleanup.always_use_this_for_non_static_field_access=false
-sp_cleanup.always_use_this_for_non_static_method_access=false
-sp_cleanup.convert_functional_interfaces=false
-sp_cleanup.convert_to_enhanced_for_loop=false
-sp_cleanup.correct_indentation=false
+sp_cleanup.always_use_this_for_non_static_field_access=true
+sp_cleanup.always_use_this_for_non_static_method_access=true
+sp_cleanup.arrays_fill=true
+sp_cleanup.bitwise_conditional_expression=false
+sp_cleanup.boolean_literal=true
+sp_cleanup.break_loop=true
+sp_cleanup.collection_cloning=true
+sp_cleanup.comparison_statement=true
+sp_cleanup.convert_functional_interfaces=true
+sp_cleanup.convert_to_enhanced_for_loop=true
+sp_cleanup.convert_to_enhanced_for_loop_if_loop_var_used=false
+sp_cleanup.convert_to_switch_expressions=false
+sp_cleanup.correct_indentation=true
+sp_cleanup.double_negation=true
+sp_cleanup.else_if=true
+sp_cleanup.embedded_if=true
+sp_cleanup.evaluate_nullable=true
sp_cleanup.format_source_code=true
sp_cleanup.format_source_code_changes_only=true
+sp_cleanup.hash=true
+sp_cleanup.if_condition=false
sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.instanceof=false
+sp_cleanup.join=true
+sp_cleanup.lazy_logical_operator=true
sp_cleanup.make_local_variable_final=true
sp_cleanup.make_parameters_final=false
sp_cleanup.make_private_fields_final=true
sp_cleanup.make_type_abstract_if_missing_method=false
sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.map_cloning=true
+sp_cleanup.merge_conditional_blocks=true
sp_cleanup.never_use_blocks=false
sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.no_string_creation=true
+sp_cleanup.no_super=true
+sp_cleanup.number_suffix=true
+sp_cleanup.objects_equals=true
sp_cleanup.on_save_use_additional_actions=true
sp_cleanup.organize_imports=true
+sp_cleanup.overridden_assignment=true
+sp_cleanup.precompile_regex=true
+sp_cleanup.primitive_serialization=true
+sp_cleanup.pull_up_assignment=false
+sp_cleanup.push_down_negation=false
sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=true
sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.redundant_falling_through_block_end=false
sp_cleanup.remove_private_constructors=true
-sp_cleanup.remove_redundant_modifiers=false
-sp_cleanup.remove_redundant_type_arguments=false
+sp_cleanup.remove_redundant_modifiers=true
+sp_cleanup.remove_redundant_semicolons=true
+sp_cleanup.remove_redundant_type_arguments=true
sp_cleanup.remove_trailing_whitespaces=true
sp_cleanup.remove_trailing_whitespaces_all=true
sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_array_creation=true
sp_cleanup.remove_unnecessary_casts=true
sp_cleanup.remove_unnecessary_nls_tags=true
sp_cleanup.remove_unused_imports=true
@@ -47,14 +182,26 @@ sp_cleanup.remove_unused_private_fields=true
sp_cleanup.remove_unused_private_members=false
sp_cleanup.remove_unused_private_methods=true
sp_cleanup.remove_unused_private_types=true
+sp_cleanup.simplify_lambda_expression_and_method_ref=true
sp_cleanup.sort_members=false
sp_cleanup.sort_members_all=false
+sp_cleanup.strictly_equal_or_different=false
+sp_cleanup.stringbuilder=true
+sp_cleanup.switch=true
+sp_cleanup.ternary_operator=false
+sp_cleanup.try_with_resource=true
sp_cleanup.use_anonymous_class_creation=false
-sp_cleanup.use_blocks=false
+sp_cleanup.use_autoboxing=false
+sp_cleanup.use_blocks=true
sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_directly_map_method=true
sp_cleanup.use_lambda=true
sp_cleanup.use_parentheses_in_expressions=false
sp_cleanup.use_this_for_non_static_field_access=false
-sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=false
sp_cleanup.use_this_for_non_static_method_access=false
-sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=false
+sp_cleanup.use_unboxing=false
+sp_cleanup.use_var=false
+sp_cleanup.useless_continue=true
+sp_cleanup.useless_return=true
diff --git a/tests/org.eclipse.tests.urischeme/META-INF/MANIFEST.MF b/tests/org.eclipse.tests.urischeme/META-INF/MANIFEST.MF
index d0d260ba8e8..ea0ceba2a32 100644
--- a/tests/org.eclipse.tests.urischeme/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.tests.urischeme/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %Plugin.name
Bundle-Vendor: %Plugin.Providername
Bundle-SymbolicName: org.eclipse.tests.urischeme
-Bundle-Version: 1.0.900.qualifier
+Bundle-Version: 1.0.1000.qualifier
Fragment-Host: org.eclipse.urischeme;bundle-version="1.1.100"
Automatic-Module-Name: org.eclipse.urischeme.tests
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/tests/org.eclipse.tests.urischeme/pom.xml b/tests/org.eclipse.tests.urischeme/pom.xml
index 896d0a2ea1c..7f068fd8495 100644
--- a/tests/org.eclipse.tests.urischeme/pom.xml
+++ b/tests/org.eclipse.tests.urischeme/pom.xml
@@ -19,7 +19,7 @@
</parent>
<groupId>org.eclipse.ui</groupId>
<artifactId>org.eclipse.tests.urischeme</artifactId>
- <version>1.0.900-SNAPSHOT</version>
+ <version>1.0.1000-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
</project> \ No newline at end of file
diff --git a/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/TestUnitAutoRegisterSchemeHandlersJob.java b/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/TestUnitAutoRegisterSchemeHandlersJob.java
index 07a81604b7f..df6f60405ca 100644
--- a/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/TestUnitAutoRegisterSchemeHandlersJob.java
+++ b/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/TestUnitAutoRegisterSchemeHandlersJob.java
@@ -72,7 +72,8 @@ public class TestUnitAutoRegisterSchemeHandlersJob {
public void newSchemeRegistersNewScheme() throws Exception {
SchemeInformation helloSchemeInfo = new SchemeInformation(helloScheme.getName(), helloScheme.getDescription());
helloSchemeInfo.setHandled(true);
- SchemeInformation hello1SchemeInfo = new SchemeInformation(hello1Scheme.getName(), hello1Scheme.getDescription());
+ SchemeInformation hello1SchemeInfo = new SchemeInformation(hello1Scheme.getName(),
+ hello1Scheme.getDescription());
hello1SchemeInfo.setHandled(false);
List<ISchemeInformation> schemeInfos = Arrays.asList(hello1SchemeInfo);
@@ -81,8 +82,7 @@ public class TestUnitAutoRegisterSchemeHandlersJob {
job.run(new NullProgressMonitor());
- assertEquals("Wrong values written to preferences",
- helloScheme.getName() + "," + hello1Scheme.getName(),
+ assertEquals("Wrong values written to preferences", helloScheme.getName() + "," + hello1Scheme.getName(),
preferenceNode.writtenValue);
assertTrue("Preferences not flushed", preferenceNode.flushed);
assertEquals("Wrong schemes have been registered", hello1SchemeInfo,
@@ -150,18 +150,20 @@ public class TestUnitAutoRegisterSchemeHandlersJob {
@Override
public String get(String key, String defaultValue) {
- if (PROCESSED_SCHEMES_PREFERENCE.equals(key))
+ if (PROCESSED_SCHEMES_PREFERENCE.equals(key)) {
return currentValue;
- else
+ } else {
throw new IllegalArgumentException("Wrong key provided");
+ }
}
@Override
public void put(String key, String newValue) {
- if (PROCESSED_SCHEMES_PREFERENCE.equals(key))
+ if (PROCESSED_SCHEMES_PREFERENCE.equals(key)) {
writtenValue = newValue;
- else
+ } else {
throw new IllegalArgumentException("Wrong key provided");
+ }
}
@Override
diff --git a/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/UriSchemeExtensionReaderUnitTest.java b/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/UriSchemeExtensionReaderUnitTest.java
index ca05cd1863e..14b3866f5b4 100644
--- a/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/UriSchemeExtensionReaderUnitTest.java
+++ b/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/UriSchemeExtensionReaderUnitTest.java
@@ -52,8 +52,7 @@ public class UriSchemeExtensionReaderUnitTest {
@Test
public void callsFirstOfTwoHandlersForSameScheme() throws Exception {
- IConfigurationElement second = new ConfigurationElementMock("abc", "abc Scheme",
- new UriSchemeHandlerSpy());
+ IConfigurationElement second = new ConfigurationElementMock("abc", "abc Scheme", new UriSchemeHandlerSpy());
setExtensionsInReader(configElementForAbc, second);
assertEquals(abcHandler, extensionReader.getHandlerFromExtensionPoint("abc"));
@@ -180,10 +179,12 @@ public class UriSchemeExtensionReaderUnitTest {
@Override
public String getAttribute(String name) throws InvalidRegistryObjectException {
- if (name.equals("uriScheme"))
+ if (name.equals("uriScheme")) {
return uriScheme;
- if (name.equals("uriSchemeDescription"))
+ }
+ if (name.equals("uriSchemeDescription")) {
return uriSchemeDescription;
+ }
return null;
}
diff --git a/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/UriSchemeHandlerSpy.java b/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/UriSchemeHandlerSpy.java
index c03da6c591d..8478188e1aa 100644
--- a/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/UriSchemeHandlerSpy.java
+++ b/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/UriSchemeHandlerSpy.java
@@ -19,8 +19,8 @@ public class UriSchemeHandlerSpy implements IUriSchemeHandler {
public Collection<String> uris = new ArrayList<>();
- @Override
- public void handle(String uri) {
- uris.add(uri);
- }
+ @Override
+ public void handle(String uri) {
+ uris.add(uri);
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/registration/TestUnitPlistFileWriter.java b/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/registration/TestUnitPlistFileWriter.java
index 898a41d0598..901503e6358 100644
--- a/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/registration/TestUnitPlistFileWriter.java
+++ b/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/registration/TestUnitPlistFileWriter.java
@@ -40,7 +40,7 @@ public class TestUnitPlistFileWriter {
writer.addScheme("adt", "adtScheme");
writer.addScheme("other", "otherScheme");
- assertSchemesInOrder(writer, "adt", "other" );
+ assertSchemesInOrder(writer, "adt", "other");
}
@Test
@@ -49,7 +49,7 @@ public class TestUnitPlistFileWriter {
writer.addScheme("adt", "adtScheme");
- assertSchemesInOrder(writer, "adt" );
+ assertSchemesInOrder(writer, "adt");
}
@Test
@@ -70,7 +70,7 @@ public class TestUnitPlistFileWriter {
assertSchemesInOrder(writer, "adt");
}
- @Test(expected=IllegalArgumentException.class)
+ @Test(expected = IllegalArgumentException.class)
public void addFailsOnIllegalScheme() {
PlistFileWriter writer = getWriterWithSchemes("adt");
@@ -79,51 +79,31 @@ public class TestUnitPlistFileWriter {
@Test
public void doesntRemoveCommentAfterEndArrayTag() {
- String xml = getPlistStartXmlSnippet() +
- " <key>CFBundleURLTypes</key>\n" +
- " <array>\n" +
- getSchemeXmlSnippet("other") +
- " </array>\n" +
- "<!--comment-->\n"+
- getPlistEndXmlSnippet();
+ String xml = getPlistStartXmlSnippet() + " <key>CFBundleURLTypes</key>\n" + " <array>\n"
+ + getSchemeXmlSnippet("other") + " </array>\n" + "<!--comment-->\n" + getPlistEndXmlSnippet();
PlistFileWriter writer = new PlistFileWriter(new StringReader(xml));
writer.addScheme("adt", "adtScheme");
- String expectedXml = getPlistStartXmlSnippet() +
- " <key>CFBundleURLTypes</key>\n" +
- " <array>\n" +
- getSchemeXmlSnippet("other") +
- getSchemeXmlSnippet("adt") +
- " </array>\n" +
- "<!--comment-->\n"+
- getPlistEndXmlSnippet();
+ String expectedXml = getPlistStartXmlSnippet() + " <key>CFBundleURLTypes</key>\n" + " <array>\n"
+ + getSchemeXmlSnippet("other") + getSchemeXmlSnippet("adt") + " </array>\n" + "<!--comment-->\n"
+ + getPlistEndXmlSnippet();
assertXml(expectedXml, writer);
}
@Test
public void doesntRemoveCommentBeforeEndArrayTag() {
- String xml = getPlistStartXmlSnippet() +
- " <key>CFBundleURLTypes</key>\n" +
- " <array>\n" +
- getSchemeXmlSnippet("other") +
- "<!--comment-->"+
- " </array>\n" +
- getPlistEndXmlSnippet();
+ String xml = getPlistStartXmlSnippet() + " <key>CFBundleURLTypes</key>\n" + " <array>\n"
+ + getSchemeXmlSnippet("other") + "<!--comment-->" + " </array>\n" + getPlistEndXmlSnippet();
PlistFileWriter writer = new PlistFileWriter(new StringReader(xml));
writer.addScheme("adt", "adtScheme");
- String expectedXml = getPlistStartXmlSnippet() +
- " <key>CFBundleURLTypes</key>\n" +
- " <array>\n" +
- getSchemeXmlSnippet("other") +
- "<!--comment-->\n"+
- getSchemeXmlSnippet("adt") +
- " </array>\n" +
- getPlistEndXmlSnippet();
+ String expectedXml = getPlistStartXmlSnippet() + " <key>CFBundleURLTypes</key>\n" + " <array>\n"
+ + getSchemeXmlSnippet("other") + "<!--comment-->\n" + getSchemeXmlSnippet("adt") + " </array>\n"
+ + getPlistEndXmlSnippet();
assertXml(expectedXml, writer);
}
@@ -134,9 +114,7 @@ public class TestUnitPlistFileWriter {
writer.removeScheme("adt");
- String expectedXml = getPlistStartXmlSnippet() +
- " \n" +
- " \n" + getPlistEndXmlSnippet();
+ String expectedXml = getPlistStartXmlSnippet() + " \n" + " \n" + getPlistEndXmlSnippet();
assertXml(expectedXml, writer);
}
@@ -147,7 +125,7 @@ public class TestUnitPlistFileWriter {
writer.removeScheme("adt");
- assertSchemesInOrder(writer, "other" );
+ assertSchemesInOrder(writer, "other");
}
@Test
@@ -156,7 +134,7 @@ public class TestUnitPlistFileWriter {
writer.removeScheme("other");
- assertSchemesInOrder(writer, "adt" );
+ assertSchemesInOrder(writer, "adt");
}
@Test
@@ -174,10 +152,10 @@ public class TestUnitPlistFileWriter {
writer.removeScheme("other");
- assertSchemesInOrder(writer, "adt" );
+ assertSchemesInOrder(writer, "adt");
}
- @Test(expected=IllegalArgumentException.class)
+ @Test(expected = IllegalArgumentException.class)
public void removeFailsOnIllegalScheme() {
PlistFileWriter writer = getWriterWithSchemes("adt");
@@ -188,7 +166,7 @@ public class TestUnitPlistFileWriter {
public void doesNothing() {
PlistFileWriter writer = getWriterWithSchemes("adt");
- assertSchemesInOrder(writer, "adt" );
+ assertSchemesInOrder(writer, "adt");
}
@Test
@@ -198,9 +176,7 @@ public class TestUnitPlistFileWriter {
writer.removeScheme("adt");
// some text nodes stay, we don't care
- String expectedXml = getPlistStartXmlSnippet() +
- " \n" +
- " \n" + getPlistEndXmlSnippet();
+ String expectedXml = getPlistStartXmlSnippet() + " \n" + " \n" + getPlistEndXmlSnippet();
assertXml(expectedXml, writer);
}
@@ -210,17 +186,15 @@ public class TestUnitPlistFileWriter {
new PlistFileWriter(new StringReader(""));
}
- @Test(expected=IllegalStateException.class)
+ @Test(expected = IllegalStateException.class)
public void throwsExceptionOnWrongPlistFile() {
- String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" +
- "<plist version=\"1.0\"/>";
+ String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" + "<plist version=\"1.0\"/>";
new PlistFileWriter(new StringReader(xml));
}
- @Test(expected=IllegalStateException.class)
+ @Test(expected = IllegalStateException.class)
public void throwsExceptionOnWrongXmlFile() {
- String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" +
- "<foo/>";
+ String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" + "<foo/>";
new PlistFileWriter(new StringReader(xml));
}
@@ -253,7 +227,7 @@ public class TestUnitPlistFileWriter {
writer.isRegisteredScheme("&/%");
}
- private void assertSchemesInOrder(PlistFileWriter writer, String... schemes ) {
+ private void assertSchemesInOrder(PlistFileWriter writer, String... schemes) {
assertXml(getXml(schemes), writer);
}
@@ -276,79 +250,50 @@ public class TestUnitPlistFileWriter {
}
private String getXml(String[] schemes) {
- String snippets = "";
+ StringBuilder snippets = new StringBuilder();
if (schemes != null) {
for (String scheme : schemes) {
- snippets += getSchemeXmlSnippet(scheme);
+ snippets.append(getSchemeXmlSnippet(scheme));
}
}
- return getPlistStartXmlSnippet() +
- " <key>CFBundleURLTypes</key>\n" +
- " <array>\n" +
- snippets+
- " </array>\n" +
- getPlistEndXmlSnippet();
+ return getPlistStartXmlSnippet() + " <key>CFBundleURLTypes</key>\n" + " <array>\n"
+ + snippets.append(" </array>\n").append(getPlistEndXmlSnippet()).toString();
}
private String getPlistStartXmlSnippet() {
- return "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" +
- "<plist version=\"1.0\">\n" +
- "\n" +
- "<dict>\n" +
- " <key>CFBundleExecutable</key>\n" +
- " <string>eclipse</string>\n" +
- " <key>CFBundleGetInfoString</key>\n" +
- " <string>Eclipse 4.8 for Mac OS X, Copyright IBM Corp. and others 2002, 2017. All rights reserved.</string>\n" +
- " <key>CFBundleIconFile</key>\n" +
- " <string>Eclipse.icns</string>\n" +
- " <key>CFBundleIdentifier</key>\n" +
- " <string>org.eclipse.sdk.ide</string>\n" +
- " <key>CFBundleInfoDictionaryVersion</key>\n" +
- " <string>6.0</string>\n" +
- " <key>CFBundleName</key>\n" +
- " <string>Eclipse</string>\n" +
- " <key>CFBundlePackageType</key>\n" +
- " <string>APPL</string>\n" +
- " <key>CFBundleShortVersionString</key>\n" +
- " <string>4.8.0</string>\n" +
- " <key>CFBundleSignature</key>\n" +
- " <string>????</string>\n" +
- " <key>CFBundleVersion</key>\n" +
- " <string>4.8.0.I20180516-2000</string>\n" +
- " <key>NSHighResolutionCapable</key>\n" +
- " <true/>\n" +
- " <key>CFBundleDevelopmentRegion</key>\n" +
- " <string>English</string> \n" +
- " <key>Eclipse</key>\n" +
- " <array>\n" +
- " <!-- to use a specific Java version (instead of the platform's default) uncomment one of the following options,\n" +
- " or add a VM found via $/usr/libexec/java_home -V\n" +
- " <string>-vm</string><string>/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Commands/java</string>\n" +
- " <string>-vm</string><string>/Library/Java/JavaVirtualMachines/1.8.0.jdk/Contents/Home/bin/java</string>\n" +
- " -->\n" +
- " <string>-keyring</string>\n" +
- " <string>~/.eclipse_keyring</string>\n" +
- " </array>\n" +
- " <key>CFBundleDisplayName</key>\n" +
- " <string>Eclipse</string>\n";
+ return "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" + "<plist version=\"1.0\">\n" + "\n"
+ + "<dict>\n" + " <key>CFBundleExecutable</key>\n" + " <string>eclipse</string>\n"
+ + " <key>CFBundleGetInfoString</key>\n"
+ + " <string>Eclipse 4.8 for Mac OS X, Copyright IBM Corp. and others 2002, 2017. All rights reserved.</string>\n"
+ + " <key>CFBundleIconFile</key>\n" + " <string>Eclipse.icns</string>\n"
+ + " <key>CFBundleIdentifier</key>\n" + " <string>org.eclipse.sdk.ide</string>\n"
+ + " <key>CFBundleInfoDictionaryVersion</key>\n" + " <string>6.0</string>\n"
+ + " <key>CFBundleName</key>\n" + " <string>Eclipse</string>\n"
+ + " <key>CFBundlePackageType</key>\n" + " <string>APPL</string>\n"
+ + " <key>CFBundleShortVersionString</key>\n" + " <string>4.8.0</string>\n"
+ + " <key>CFBundleSignature</key>\n" + " <string>????</string>\n"
+ + " <key>CFBundleVersion</key>\n" + " <string>4.8.0.I20180516-2000</string>\n"
+ + " <key>NSHighResolutionCapable</key>\n" + " <true/>\n"
+ + " <key>CFBundleDevelopmentRegion</key>\n" + " <string>English</string> \n"
+ + " <key>Eclipse</key>\n" + " <array>\n"
+ + " <!-- to use a specific Java version (instead of the platform's default) uncomment one of the following options,\n"
+ + " or add a VM found via $/usr/libexec/java_home -V\n"
+ + " <string>-vm</string><string>/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Commands/java</string>\n"
+ + " <string>-vm</string><string>/Library/Java/JavaVirtualMachines/1.8.0.jdk/Contents/Home/bin/java</string>\n"
+ + " -->\n" + " <string>-keyring</string>\n"
+ + " <string>~/.eclipse_keyring</string>\n" + " </array>\n"
+ + " <key>CFBundleDisplayName</key>\n" + " <string>Eclipse</string>\n";
}
private String getPlistEndXmlSnippet() {
- return "</dict>\n" +
- "\n" +
- "</plist>";
+ return "</dict>\n" + "\n" + "</plist>";
}
private String getSchemeXmlSnippet(String scheme) {
- return " <dict>\n" +
- " <key>CFBundleURLName</key>\n" +
- " <string>"+scheme+"Scheme</string>\n" +
- " <key>CFBundleURLSchemes</key>\n" +
- " <array>\n" +
- " <string>"+scheme+"</string>\n" +
- " </array>\n" +
- " </dict>\n";
+ return " <dict>\n" + " <key>CFBundleURLName</key>\n" + " <string>"
+ + scheme + "Scheme</string>\n" + " <key>CFBundleURLSchemes</key>\n"
+ + " <array>\n" + " <string>" + scheme + "</string>\n"
+ + " </array>\n" + " </dict>\n";
}
-
}
diff --git a/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/registration/TestUnitRegistrationLinux.java b/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/registration/TestUnitRegistrationLinux.java
index f8350f1fcb4..7f89af3dbd5 100644
--- a/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/registration/TestUnitRegistrationLinux.java
+++ b/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/registration/TestUnitRegistrationLinux.java
@@ -38,7 +38,7 @@ public class TestUnitRegistrationLinux {
private static final String USER_HOME = System.getProperty("user.home");
private static final String ECLIPSE_LAUNCHER = "eclipse.launcher";
private static final String ECLIPSE_HOME_LOCATION = "eclipse.home.location";
- private static final String OTHER_APP_EXECUTABLE_PATH = "/home/myuser/otherApp/app";
+ private static final String OTHER_APP_EXECUTABLE_PATH = "/home/myuser/otherApp/app";
private static final String OTHER_APP_DESKTOP_FILE = "otherApp.desktop";
private static final String PATH_OTHER_APP_DESKTOP_FILE = USER_HOME + "/.local/share/applications/"
+ OTHER_APP_DESKTOP_FILE;
@@ -184,7 +184,7 @@ public class TestUnitRegistrationLinux {
getFileLines(OTHER_APP_EXECUTABLE_PATH, "MimeType=x-scheme-handler/adt;"));
processStub.result = OTHER_APP_DESKTOP_FILE; // this is returned by xdg-mime query default
- // x-scheme-handler/adt
+ // x-scheme-handler/adt
List<ISchemeInformation> infos = registration.getSchemesInformation(Arrays.asList(ADT_SCHEME));
diff --git a/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/registration/WinRegistryMock.java b/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/registration/WinRegistryMock.java
index 05f8384c9db..8259e50816b 100644
--- a/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/registration/WinRegistryMock.java
+++ b/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/registration/WinRegistryMock.java
@@ -54,7 +54,6 @@ public class WinRegistryMock implements IWinRegistry {
public String value;
public Entry(String key, String attribute, String value) {
- super();
this.key = key;
this.attribute = attribute;
this.value = value;
diff --git a/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/suite/AllUnitTests.java b/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/suite/AllUnitTests.java
index 77a929e8445..fb9638b51c2 100644
--- a/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/suite/AllUnitTests.java
+++ b/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/suite/AllUnitTests.java
@@ -27,8 +27,7 @@ import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
-@SuiteClasses({
- UriSchemeProcessorUnitTest.class, //
+@SuiteClasses({ UriSchemeProcessorUnitTest.class, //
TestUnitPlistFileWriter.class, //
TestUnitDesktopFileWriter.class, //
TestUnitRegistrationMacOsX.class, //
@@ -36,7 +35,6 @@ import org.junit.runners.Suite.SuiteClasses;
TestUnitRegistrationWindows.class, //
TestUnitRegistryWriter.class, //
TestUnitWinRegistry.class, //
- TestUnitAutoRegisterSchemeHandlersJob.class
-})
+ TestUnitAutoRegisterSchemeHandlersJob.class })
public class AllUnitTests {
}

Back to the top