Skip to content

Commit 59aa31f

Browse files
BananeweizenCalixte
authored andcommitted
Upgrade settings and enforce common import order
Upgrade the JDT settings to the current 2023-12 values (there are some new automated cleanups). Enable a custom import order in every Java project, because there are different orders in place right now (sometimes net.sf comes first, sometimes not). Organize imports in all Java source files to enforce the new order.
1 parent 07a65b2 commit 59aa31f

File tree

145 files changed

+772
-705
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+772
-705
lines changed

net.sf.eclipsecs.checkstyle/.settings/org.eclipse.jdt.core.prefs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
eclipse.preferences.version=1
22
org.eclipse.jdt.core.builder.annotationPath.allLocations=disabled
3+
org.eclipse.jdt.core.codeComplete.argumentPrefixes=
4+
org.eclipse.jdt.core.codeComplete.argumentSuffixes=
5+
org.eclipse.jdt.core.codeComplete.fieldPrefixes=
6+
org.eclipse.jdt.core.codeComplete.fieldSuffixes=
7+
org.eclipse.jdt.core.codeComplete.localPrefixes=
8+
org.eclipse.jdt.core.codeComplete.localSuffixes=
9+
org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
10+
org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
11+
org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
12+
org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
313
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
414
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
515
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull

net.sf.eclipsecs.checkstyle/.settings/org.eclipse.jdt.ui.prefs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ formatter_profile=_Checkstyle
33
formatter_settings_version=23
44
org.eclipse.jdt.ui.exception.name=ex
55
org.eclipse.jdt.ui.gettersetter.use.is=true
6+
org.eclipse.jdt.ui.ignorelowercasenames=true
7+
org.eclipse.jdt.ui.importorder=java;javax;org;com;
68
org.eclipse.jdt.ui.javadoc=true
79
org.eclipse.jdt.ui.keywordthis=false
10+
org.eclipse.jdt.ui.ondemandthreshold=99
811
org.eclipse.jdt.ui.overrideannotation=true
9-
org.eclipse.jdt.ui.text.custom_code_templates=
12+
org.eclipse.jdt.ui.staticondemandthreshold=99

net.sf.eclipsecs.checkstyle/test/net/sf/eclipsecs/checkstyle/ChecksTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232
import java.util.Properties;
3333
import java.util.Set;
3434

35-
import net.sf.eclipsecs.checkstyle.utils.CheckUtil;
36-
import net.sf.eclipsecs.checkstyle.utils.XmlUtil;
37-
3835
import org.junit.jupiter.api.Test;
3936
import org.w3c.dom.Document;
4037
import org.w3c.dom.Node;
@@ -43,6 +40,9 @@
4340
import com.puppycrawl.tools.checkstyle.Checker;
4441
import com.puppycrawl.tools.checkstyle.TreeWalker;
4542

43+
import net.sf.eclipsecs.checkstyle.utils.CheckUtil;
44+
import net.sf.eclipsecs.checkstyle.utils.XmlUtil;
45+
4646
public class ChecksTest {
4747

4848
@Test

net.sf.eclipsecs.checkstyle/test/net/sf/eclipsecs/checkstyle/utils/CheckUtil.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020

2121
package net.sf.eclipsecs.checkstyle.utils;
2222

23-
import com.puppycrawl.tools.checkstyle.PackageNamesLoader;
24-
import com.puppycrawl.tools.checkstyle.utils.ModuleReflectionUtil;
25-
2623
import java.util.HashSet;
2724
import java.util.Set;
2825

26+
import com.puppycrawl.tools.checkstyle.PackageNamesLoader;
27+
import com.puppycrawl.tools.checkstyle.utils.ModuleReflectionUtil;
28+
2929
public final class CheckUtil {
3030
private CheckUtil() {
3131
}

net.sf.eclipsecs.checkstyle/test/net/sf/eclipsecs/checkstyle/utils/XmlUtil.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@
2727
import java.util.LinkedHashSet;
2828
import java.util.Set;
2929

30+
import javax.xml.parsers.DocumentBuilder;
31+
import javax.xml.parsers.DocumentBuilderFactory;
32+
import javax.xml.parsers.ParserConfigurationException;
33+
3034
import org.w3c.dom.Document;
3135
import org.w3c.dom.Node;
3236
import org.xml.sax.EntityResolver;
3337
import org.xml.sax.InputSource;
3438
import org.xml.sax.SAXException;
3539

36-
import javax.xml.parsers.DocumentBuilder;
37-
import javax.xml.parsers.DocumentBuilderFactory;
38-
import javax.xml.parsers.ParserConfigurationException;
39-
4040
public final class XmlUtil {
4141

4242
private XmlUtil() {

net.sf.eclipsecs.core/.settings/org.eclipse.jdt.core.prefs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
eclipse.preferences.version=1
22
org.eclipse.jdt.core.builder.annotationPath.allLocations=disabled
3+
org.eclipse.jdt.core.codeComplete.argumentPrefixes=
4+
org.eclipse.jdt.core.codeComplete.argumentSuffixes=
5+
org.eclipse.jdt.core.codeComplete.fieldPrefixes=
6+
org.eclipse.jdt.core.codeComplete.fieldSuffixes=
7+
org.eclipse.jdt.core.codeComplete.localPrefixes=
8+
org.eclipse.jdt.core.codeComplete.localSuffixes=
9+
org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
10+
org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
11+
org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
12+
org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
313
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
414
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
515
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull

net.sf.eclipsecs.core/.settings/org.eclipse.jdt.ui.prefs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ cleanup.add_missing_nls_tags=false
88
cleanup.add_missing_override_annotations=true
99
cleanup.add_missing_override_annotations_interface_methods=true
1010
cleanup.add_serial_version_id=false
11+
cleanup.also_simplify_lambda=true
1112
cleanup.always_use_blocks=true
1213
cleanup.always_use_parentheses_in_expressions=false
1314
cleanup.always_use_this_for_non_static_field_access=false
@@ -96,6 +97,7 @@ cleanup.remove_unused_private_fields=true
9697
cleanup.remove_unused_private_members=false
9798
cleanup.remove_unused_private_methods=true
9899
cleanup.remove_unused_private_types=true
100+
cleanup.replace_deprecated_calls=false
99101
cleanup.return_expression=false
100102
cleanup.simplify_lambda_expression_and_method_ref=false
101103
cleanup.single_used_field=false
@@ -146,9 +148,13 @@ formatter_profile=_Checkstyle
146148
formatter_settings_version=23
147149
org.eclipse.jdt.ui.exception.name=ex
148150
org.eclipse.jdt.ui.gettersetter.use.is=true
151+
org.eclipse.jdt.ui.ignorelowercasenames=true
152+
org.eclipse.jdt.ui.importorder=java;javax;org;com;
149153
org.eclipse.jdt.ui.javadoc=true
150154
org.eclipse.jdt.ui.keywordthis=false
155+
org.eclipse.jdt.ui.ondemandthreshold=99
151156
org.eclipse.jdt.ui.overrideannotation=true
157+
org.eclipse.jdt.ui.staticondemandthreshold=99
152158
org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="modulecomment_context" deleted\="false" description\="Comment for modules" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.modulecomment" name\="modulecomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment"/><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">//\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\r\n//\r\n// Copyright (C) 2003-2023 the original author or authors.\r\n//\r\n// This library is free software; you can redistribute it and/or\r\n// modify it under the terms of the GNU Lesser General Public\r\n// License as published by the Free Software Foundation; either\r\n// version 2.1 of the License, or (at your option) any later version.\r\n//\r\n// This library is distributed in the hope that it will be useful,\r\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r\n// Lesser General Public License for more details.\r\n//\r\n// You should have received a copy of the GNU Lesser General Public\r\n// License along with this library; if not, write to the Free Software\r\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\r\n//\r\n//\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\r\n\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="recordbody_context" deleted\="false" description\="Code in new record type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.recordbody" name\="recordbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
153159
sp_cleanup.add_all=false
154160
sp_cleanup.add_default_serial_version_id=true
@@ -160,6 +166,7 @@ sp_cleanup.add_missing_nls_tags=false
160166
sp_cleanup.add_missing_override_annotations=true
161167
sp_cleanup.add_missing_override_annotations_interface_methods=true
162168
sp_cleanup.add_serial_version_id=false
169+
sp_cleanup.also_simplify_lambda=false
163170
sp_cleanup.always_use_blocks=true
164171
sp_cleanup.always_use_parentheses_in_expressions=false
165172
sp_cleanup.always_use_this_for_non_static_field_access=false
@@ -249,6 +256,7 @@ sp_cleanup.remove_unused_private_fields=true
249256
sp_cleanup.remove_unused_private_members=false
250257
sp_cleanup.remove_unused_private_methods=true
251258
sp_cleanup.remove_unused_private_types=true
259+
sp_cleanup.replace_deprecated_calls=false
252260
sp_cleanup.return_expression=false
253261
sp_cleanup.simplify_lambda_expression_and_method_ref=false
254262
sp_cleanup.single_used_field=false

net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/CheckstylePlugin.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@
2424
import java.util.logging.Level;
2525
import java.util.logging.Logger;
2626

27-
import net.sf.eclipsecs.core.util.CheckstyleLog;
28-
import net.sf.eclipsecs.core.util.EclipseLogHandler;
29-
import net.sf.eclipsecs.core.util.ExtensionClassLoader;
30-
3127
import org.eclipse.core.resources.IWorkspace;
3228
import org.eclipse.core.resources.ResourcesPlugin;
3329
import org.eclipse.core.runtime.Platform;
3430
import org.eclipse.core.runtime.Plugin;
3531
import org.osgi.framework.BundleContext;
3632

33+
import net.sf.eclipsecs.core.util.CheckstyleLog;
34+
import net.sf.eclipsecs.core.util.EclipseLogHandler;
35+
import net.sf.eclipsecs.core.util.ExtensionClassLoader;
36+
3737
/**
3838
* The main plugin class to be used in the desktop.
3939
*/

net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/CheckstylePluginPrefs.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020

2121
package net.sf.eclipsecs.core;
2222

23-
import net.sf.eclipsecs.core.util.CheckstyleLog;
24-
2523
import org.eclipse.core.runtime.Platform;
2624
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
2725
import org.eclipse.core.runtime.preferences.DefaultScope;
@@ -30,6 +28,8 @@
3028
import org.eclipse.core.runtime.preferences.InstanceScope;
3129
import org.osgi.service.prefs.BackingStoreException;
3230

31+
import net.sf.eclipsecs.core.util.CheckstyleLog;
32+
3333
/**
3434
* Class for handling preferences of the <code>net.sf.eclipsecs.core</code> plugin.
3535
*

net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/builder/Auditor.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@
2020

2121
package net.sf.eclipsecs.core.builder;
2222

23-
import com.puppycrawl.tools.checkstyle.Checker;
24-
import com.puppycrawl.tools.checkstyle.api.AuditEvent;
25-
import com.puppycrawl.tools.checkstyle.api.AuditListener;
26-
import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
27-
import com.puppycrawl.tools.checkstyle.api.SeverityLevel;
28-
2923
import java.io.File;
3024
import java.util.ArrayList;
3125
import java.util.HashMap;
@@ -34,15 +28,6 @@
3428
import java.util.Map;
3529
import java.util.Set;
3630

37-
import net.sf.eclipsecs.core.CheckstylePluginPrefs;
38-
import net.sf.eclipsecs.core.Messages;
39-
import net.sf.eclipsecs.core.config.ICheckConfiguration;
40-
import net.sf.eclipsecs.core.config.Module;
41-
import net.sf.eclipsecs.core.config.meta.MetadataFactory;
42-
import net.sf.eclipsecs.core.config.meta.RuleMetadata;
43-
import net.sf.eclipsecs.core.util.CheckstyleLog;
44-
import net.sf.eclipsecs.core.util.CheckstylePluginException;
45-
4631
import org.eclipse.core.filebuffers.FileBuffers;
4732
import org.eclipse.core.filebuffers.ITextFileBufferManager;
4833
import org.eclipse.core.resources.IFile;
@@ -60,6 +45,21 @@
6045
import org.eclipse.jface.text.IRegion;
6146
import org.eclipse.osgi.util.NLS;
6247

48+
import com.puppycrawl.tools.checkstyle.Checker;
49+
import com.puppycrawl.tools.checkstyle.api.AuditEvent;
50+
import com.puppycrawl.tools.checkstyle.api.AuditListener;
51+
import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
52+
import com.puppycrawl.tools.checkstyle.api.SeverityLevel;
53+
54+
import net.sf.eclipsecs.core.CheckstylePluginPrefs;
55+
import net.sf.eclipsecs.core.Messages;
56+
import net.sf.eclipsecs.core.config.ICheckConfiguration;
57+
import net.sf.eclipsecs.core.config.Module;
58+
import net.sf.eclipsecs.core.config.meta.MetadataFactory;
59+
import net.sf.eclipsecs.core.config.meta.RuleMetadata;
60+
import net.sf.eclipsecs.core.util.CheckstyleLog;
61+
import net.sf.eclipsecs.core.util.CheckstylePluginException;
62+
6363
/**
6464
* Performs checking on Java source code.
6565
*/

0 commit comments

Comments
 (0)