Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 25 additions & 13 deletions .github/refactoring-mining/state.json
Original file line number Diff line number Diff line change
Expand Up @@ -1201,9 +1201,9 @@
"exhaustedCategories": []
},
"https://github.com/eclipse-jdt/eclipse.jdt.ui": {
"lastProcessedCommit": "4b2499a58db21796001ba593acf120b51e3a1466",
"lastProcessedDate": "2026-04-15T03:13:53.224379055Z",
"totalProcessed": 200,
"lastProcessedCommit": "4fd3295829fa50b7537d22c6312e61c62a66612b",
"lastProcessedDate": "2026-04-16T03:29:24.605227403Z",
"totalProcessed": 280,
"status": "CATCHING_UP",
"deferredCommits": [
{
Expand Down Expand Up @@ -1286,32 +1286,44 @@
"completedEpochs": [],
"categoryHitCounts": {
"Eclipse Specific": 1,
"JDT Internal Refactoring": 11,
"JDT Internal Refactoring": 13,
"Code Simplification": 1,
"Performance": 4,
"JDT Internal Bug Fix": 6,
"Clean-up Bug Fix": 3,
"Performance": 6,
"JDT Internal Bug Fix": 8,
"Clean-up Bug Fix": 4,
"Try-with-Resources": 2,
"JDT UI Feature Implementation": 1,
"Resource Management": 1,
"JFace API Modernization": 1,
"String-API": 1,
"Java-Modernization": 2,
"Java-Modernization": 5,
"Performance Optimization": 1,
"JDT Internal API Evolution": 1,
"Collection Performance": 1,
"Null-Safety": 2,
"Lambda-Simplification": 1,
"Null-Safety": 3,
"Lambda-Simplification": 2,
"Architectural Refactoring": 1,
"Collections": 2,
"Collections": 3,
"JDT Internal Feature Enhancement": 4,
"Clean-up Enhancement": 1,
"Internal Refactoring": 2,
"Loop Modernization": 4,
"JDT UI Bug Fix": 1,
"Type Inference": 1,
"Architecture Migration": 1,
"Code Style": 1
"Code Style": 2,
"Eclipse API Configuration": 2,
"Javadoc Generation Enhancement": 1,
"Clean-up Logic Enhancement": 1,
"JDT Internal UI Feature": 2,
"JDT Internal Architecture": 1,
"Eclipse API Migration": 1,
"JDT Internal Feature": 1,
"Type Safety": 1,
"Eclipse UI Refactoring": 1,
"Control Flow Modernization": 3,
"JDT Internal Quick Fix Implementation": 1,
"Unnecessary Annotation Removal": 1
},
"exhaustedCategories": []
},
Expand Down Expand Up @@ -1352,5 +1364,5 @@
"exhaustedCategories": []
}
},
"globalTotalProcessed": 22835
"globalTotalProcessed": 22915
}
132 changes: 132 additions & 0 deletions docs/mining-report/known-rules.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ java.lang.Runtime.getRuntime().exec($cmd)
"Class.newInstance() is deprecated — use Constructor.newInstance() instead":
java.lang.Class.forName($name).newInstance() :: sourceVersionGE(9)
;;

java.lang.Boolean.valueOf($str).booleanValue()
=> java.lang.Boolean.parseBoolean($str)
;;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
$store.setDefault(org.eclipse.jdt.ui.PreferenceConstants.CODEASSIST_NONUITHREAD_COMPUTATION, false)
=> $store.setDefault(org.eclipse.jdt.ui.PreferenceConstants.CODEASSIST_NONUITHREAD_COMPUTATION, true)
;;

@id: eclipse.jdt.ui.preference.release.restore-default
@severity: info
setDefaultValue(PREF_RELEASE, DISABLED)
=> setDefaultValue(PREF_RELEASE, complianceOptions.get(PREF_RELEASE.getName()) != null ? complianceOptions.get(PREF_RELEASE.getName()) : DISABLED)
;;
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,18 @@ new org.eclipse.core.runtime.SubProgressMonitor($monitor, $amount)
@severity: info
org.eclipse.jdt.core.dom.IModuleBinding.$moduleBinding.getOpenPackages() :: sourceVersionGE(9)
=> $moduleBinding.getOpenedPackages()
;;

/*!id: eclipse.ide.geteditordescriptor.file.add-allowinteractive*/
/*!description: Updates deprecated IDE.getEditorDescriptor(IFile) to IDE.getEditorDescriptor(IFile, boolean allowUnassociated, boolean allowInteractive), passing true and false respectively.*/
/*!severity: info*/
org.eclipse.ui.ide.IDE.getEditorDescriptor($file).getId()
=> org.eclipse.ui.ide.IDE.getEditorDescriptor($file, true, false).getId()
;;

/*!id: eclipse.ide.geteditordescriptor.name.add-allowinteractive*/
/*!description: Updates deprecated IDE.getEditorDescriptor(String name) to IDE.getEditorDescriptor(String name, boolean allowUnassociated, boolean allowInteractive), passing true and false respectively.*/
/*!severity: info*/
org.eclipse.ui.ide.IDE.getEditorDescriptor($name).getId()
=> org.eclipse.ui.ide.IDE.getEditorDescriptor($name, true, false).getId()
;;
Original file line number Diff line number Diff line change
Expand Up @@ -917,4 +917,10 @@ org.eclipse.jdt.internal.corext.util.Checks.validateModifiesFiles($files, $conte
;;

// Note: This rule assumes 'pm' is an IProgressMonitor variable available in the scope.
// The commit also implies similar changes for 'Checks.validateEdit()'.
// The commit also implies similar changes for 'Checks.validateEdit()'.

@id: jdt.internal.typo.fcomplierreleasecheck.to.fcompilerreleasecheck
@severity: info
fComplierReleaseCheck
=> fCompilerReleaseCheck
;;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$collection.stream().map($p -> $p.getName()).collect($collector)
:: instanceof($p, "org.eclipse.core.resources.IProject")
=> $collection.stream().map(org.eclipse.core.resources.IProject::getName).collect($collector)
;;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
($x == null && $y == null) || ($x != null && $x.equals($y))
=> java.util.Objects.equals($x, $y)
;;

($x == null && $y != null) || ($x != null && !$x.equals($y))
=> !java.util.Objects.equals($x, $y)
;;
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,64 @@ org.eclipse.jdt.internal.compiler.util.Util.EMPTY_STRING

new java.lang.String()
=> org.eclipse.jdt.internal.compiler.util.Util.EMPTY_STRING
;;

/*!id: java.lang.varargs.remove-redundant-class-array*/
/*!description: Removes redundant new Class[] array creation when used as a varargs argument to Class.getConstructor().*/
/*!severity: info*/
new java.lang.Class[] { $arg$ }
=> $arg$
;;

/*!id: java.lang.varargs.remove-redundant-object-array*/
/*!description: Removes redundant new Object[] array creation when used as a varargs argument (e.g., in Constructor.newInstance(), MessageFormat.format()).*/
/*!severity: info*/
new java.lang.Object[] { $arg$ }
=> $arg$
;;

/*!id: java.lang.varargs.remove-redundant-string-array*/
/*!description: Removes redundant new String[] array creation when used as a varargs argument (e.g., in Arrays.asList(), Combo.setItems()).*/
/*!severity: info*/
new java.lang.String[] { $arg$ }
=> $arg$
;;

/*!id: java.lang.varargs.remove-redundant-object-array-method-invoke*/
/*!description: Removes redundant new Object[] array creation when used as a varargs argument to Method.invoke().*/
/*!severity: info*/
java.lang.reflect.Method.$method.invoke($obj, new java.lang.Object[] { $arg$ })
=> $method.invoke($obj, $arg$)
;;

/*!id: java.util.arrays.aslist.remove-redundant-string-array*/
/*!description: Simplifies Arrays.asList(new String[] { ... }) to Arrays.asList(...) in varargs contexts.*/
/*!severity: info*/
java.util.Arrays.asList(new java.lang.String[] { $args$ })
=> java.util.Arrays.asList($args$)
;;

/*!id: java.text.messageformat.format.remove-redundant-object-array*/
/*!description: Simplifies MessageFormat.format(..., new Object[] { ... }) to MessageFormat.format(..., ...) in varargs contexts.*/
/*!severity: info*/
java.text.MessageFormat.format($pattern, new java.lang.Object[] { $args$ })
=> java.text.MessageFormat.format($pattern, $args$)
;;

/*!id: org.eclipse.jface.viewers.StructuredViewer.setinitialselections.remove-redundant-object-array*/
/*!description: Removes redundant new Object[] array creation when used as a single argument for StructuredViewer.setInitialSelections().*/
/*!severity: info*/
$viewer.setInitialSelections(new java.lang.Object[] { $selection })
=> $viewer.setInitialSelections($selection)
;;

/*!id: org.eclipse.swt.widgets.Combo.setitems.remove-redundant-string-array*/
/*!description: Simplifies Combo.setItems(new String[] { ... }) to Combo.setItems(...) in varargs contexts.*/
/*!severity: info*/
$combo.setItems(new java.lang.String[] { $items$ })
=> $combo.setItems($items$)
;;

java.lang.Integer.valueOf($int_expr).toString()
=> java.lang.Integer.toString($int_expr)
;;
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
org.eclipse.jdt.core.dom.ITypeBinding $str1 == org.eclipse.jdt.core.dom.ITypeBinding $str2 :: instanceof($str1, "java.lang.String") && instanceof($str2, "java.lang.String")
=> java.util.Objects.equals($str1, $str2)
;;

org.eclipse.jdt.core.dom.ITypeBinding $str1 != org.eclipse.jdt.core.dom.ITypeBinding $str2 :: instanceof($str1, "java.lang.String") && instanceof($str2, "java.lang.String")
=> !java.util.Objects.equals($str1, $str2)
;;

$obj1.equals($obj2) :: !isNullLiteral($obj1) && !isStringLiteral($obj1) && instanceof($obj1, "java.lang.Object") && instanceof($obj2, "java.lang.Object")
=> java.util.Objects.equals($obj1, $obj2)
;;

$obj1 == $obj2 :: !instanceof($obj1, "java.lang.String") && instanceof($obj1, "java.lang.Object") && !instanceof($obj2, "java.lang.String") && instanceof($obj2, "java.lang.Object")
=> java.util.Objects.equals($obj1, $obj2)
;;

$obj1 != $obj2 :: !instanceof($obj1, "java.lang.String") && instanceof($obj1, "java.lang.Object") && !instanceof($obj2, "java.lang.String") && instanceof($obj2, "java.lang.Object")
=> !java.util.Objects.equals($obj1, $obj2)
;;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
java.lang.Object $typeNameMatch = $init;
:: $init instanceof org.eclipse.jdt.core.search.TypeNameMatch
=> org.eclipse.jdt.core.search.TypeNameMatch $typeNameMatch = $init;
;;

java.lang.Object $modName = $init;
:: $init instanceof java.lang.String
=> java.lang.String $modName = $init;
;;
Loading