Skip to content

Improve refactoring mining hint quality#1178

Merged
carstenartur merged 22 commits into
mainfrom
fix/mining-hint-quality
Jul 1, 2026
Merged

Improve refactoring mining hint quality#1178
carstenartur merged 22 commits into
mainfrom
fix/mining-hint-quality

Conversation

@carstenartur

Copy link
Copy Markdown
Owner

Summary

This PR addresses the quality issues exposed by mining report PR #1177.

Hint quality changes

  • Removes broad diamond-only ArrayList / HashSet / Hashtable constructor rewrites from the active collections hint bundle.
  • Keeps only guarded empty collection factory rewrites in collections.
  • Makes Java 9/16 modernization hints conservative by turning behaviour-changing cases into hint-only review findings.
  • Fixes deprecated wrapper-constructor replacements to use valueOf(...) instead of changing object-producing constructors into primitive parsers.
  • Adds stable rule IDs to several active performance/deprecation hints so reports no longer fall back to names like collections7.
  • Removes duplicate reflexive string-equals findings from string-equals; those belong to probable-bugs.

Mining pipeline changes

  • Loads the curated bundled hints referenced by .github/refactoring-mining/repos.yml.
  • Forwards configured compiler source level into guard evaluation, so sourceVersionGE(...) behaves deterministically during mining.
  • Uses rule IDs before descriptions in generated mining reports.
  • Excludes broad style-only collections from the nightly mining configuration.

Context

PR #1177 showed that the previous setup rewarded high match count over actionable findings. Most results came from repeated collection modernization patterns such as new ArrayList(...) -> new java.util.ArrayList<>(...), including overlapping no-arg and variadic constructor rules. This PR reduces that noise and makes future reports better suited for triage into DSL-based quickfix work.

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

JUnit Test Overview Report

Generated on: 28488091203

Overall Statistics

  • Total Test Modules: 15
  • Total Test Files: 125
  • Total Tests: 1910
  • Enabled Tests: 1843 (96.5%)
  • Disabled Tests: 67 (3.5%)

Test Summary by Plugin

Plugin Test Files Total Tests Enabled Disabled Disabled %
sandbox_cleanup_application_test 1 36 36 0 0.0%
sandbox_common_test 35 353 351 2 0.6%
sandbox_css_cleanup_test 4 28 28 0 0.0%
sandbox_encoding_quickfix_test 4 16 16 0 0.0%
sandbox_functional_converter_test 31 545 519 26 4.8%
sandbox_int_to_enum_test 1 12 11 1 8.3%
sandbox_jface_cleanup_test 2 15 14 1 6.7%
sandbox_junit_cleanup_test 29 645 609 36 5.6%
sandbox_method_reuse_test 1 1 1 0 0.0%
sandbox_platform_helper_test 2 6 5 1 16.7%
sandbox_tools_test 1 2 2 0 0.0%
sandbox_triggerpattern_test 8 161 161 0 0.0%
sandbox_usage_view_test 2 23 23 0 0.0%
sandbox_use_general_type_test 1 29 29 0 0.0%
sandbox_xml_cleanup_test 3 38 38 0 0.0%

Disabled Tests Details

sandbox_common_test (2 disabled)

  • org.sandbox.jdt.ui.tests.quickfix.addresses.testChainedVisitorWithoutFirstMatchBug() - AstProcessorBuilder bug: chained ClassInstanceCreation visitor not called when first MethodInvocation visitor has no match (PR Fix standalone SubProgressMonitor transformation in JFace cleanup #678)
    • File: sandbox_common_test/src/org/sandbox/jdt/ui/tests/quickfix/ClassInstanceCreationVisitorTest.java:549
  • org.sandbox.jdt.ui.tests.quickfix.addresses.doWork() - AstProcessorBuilder bug: chained ClassInstanceCreation visitor not called when first MethodInvocation visitor has no match (PR Fix standalone SubProgressMonitor transformation in JFace cleanup #678)
    • File: sandbox_common_test/src/org/sandbox/jdt/ui/tests/quickfix/ClassInstanceCreationVisitorTest.java:557

sandbox_functional_converter_test (26 disabled)

  • org.sandbox.jdt.ui.tests.quickfix.validates.testLoopWithMapPut_ShouldNotConvert() - BUG: Collection modification detection not blocking conversion - Issue Functional Converter #670
    • File: sandbox_functional_converter_test/src/org/sandbox/jdt/ui/tests/quickfix/Issue670StrictLoopRefactoringTest.java:285
  • org.sandbox.jdt.ui.tests.quickfix.validates.process() - BUG: Collection modification detection not blocking conversion - Issue Functional Converter #670
    • File: sandbox_functional_converter_test/src/org/sandbox/jdt/ui/tests/quickfix/Issue670StrictLoopRefactoringTest.java:292
  • org.sandbox.jdt.ui.tests.quickfix.validates.testLoopModifyingDifferentCollection_CanConvert() - Different but acceptable behavior - converts to collect() instead of forEach()
    • File: sandbox_functional_converter_test/src/org/sandbox/jdt/ui/tests/quickfix/Issue670StrictLoopRefactoringTest.java:351
  • org.sandbox.jdt.ui.tests.quickfix.validates.process() - Different but acceptable behavior - converts to collect() instead of forEach()
    • File: sandbox_functional_converter_test/src/org/sandbox/jdt/ui/tests/quickfix/Issue670StrictLoopRefactoringTest.java:358
  • org.sandbox.jdt.ui.tests.quickfix.validates.testConcurrentCollection_SimpleIteration_CanConvert() - Different but acceptable behavior - converts to stream instead of enhanced-for
    • File: sandbox_functional_converter_test/src/org/sandbox/jdt/ui/tests/quickfix/Issue670StrictLoopRefactoringTest.java:434
  • org.sandbox.jdt.ui.tests.quickfix.validates.testFieldAccessReceiverModification_ShouldNotConvert() - BUG: Field access modification detection not blocking conversion - Issue Functional Converter #670
    • File: sandbox_functional_converter_test/src/org/sandbox/jdt/ui/tests/quickfix/Issue670StrictLoopRefactoringTest.java:547
  • org.sandbox.jdt.ui.tests.quickfix.validates.testGetterMethodReceiverModification_ShouldNotConvert() - BUG: IllegalArgumentException - Invalid identifier : >getList()< - needs fix in EnhancedForHandler
    • File: sandbox_functional_converter_test/src/org/sandbox/jdt/ui/tests/quickfix/Issue670StrictLoopRefactoringTest.java:593
  • org.sandbox.jdt.ui.tests.quickfix.focuses.testIterator_collectToList() - Iterator collect-to-List pipeline not yet implemented; re-enable when iterator patterns support collect/map/filter/reduce
    • File: sandbox_functional_converter_test/src/org/sandbox/jdt/ui/tests/quickfix/IteratorLoopToStreamTest.java:210
  • org.sandbox.jdt.ui.tests.quickfix.focuses.testIterator_collectToSet() - Iterator collect-to-Set pipeline not yet implemented; re-enable when iterator patterns support collect/map/filter/reduce
    • File: sandbox_functional_converter_test/src/org/sandbox/jdt/ui/tests/quickfix/IteratorLoopToStreamTest.java:258
  • org.sandbox.jdt.ui.tests.quickfix.focuses.testIterator_mapAndCollect() - Iterator map+collect pipeline not yet implemented; re-enable when iterator patterns support collect/map/filter/reduce
    • File: sandbox_functional_converter_test/src/org/sandbox/jdt/ui/tests/quickfix/IteratorLoopToStreamTest.java:310
  • org.sandbox.jdt.ui.tests.quickfix.focuses.testIterator_mapWithMethodReference() - Iterator map pipeline not yet implemented; re-enable when iterator patterns support collect/map/filter/reduce
    • File: sandbox_functional_converter_test/src/org/sandbox/jdt/ui/tests/quickfix/IteratorLoopToStreamTest.java:360
  • org.sandbox.jdt.ui.tests.quickfix.focuses.testIterator_filterAndCollect() - Iterator filter+collect pipeline not yet implemented; re-enable when iterator patterns support collect/map/filter/reduce
    • File: sandbox_functional_converter_test/src/org/sandbox/jdt/ui/tests/quickfix/IteratorLoopToStreamTest.java:414
  • org.sandbox.jdt.ui.tests.quickfix.focuses.testIterator_filterMapAndCollect() - Iterator filter+map+collect pipeline not yet implemented; re-enable when iterator patterns support collect/map/filter/reduce
    • File: sandbox_functional_converter_test/src/org/sandbox/jdt/ui/tests/quickfix/IteratorLoopToStreamTest.java:470
  • org.sandbox.jdt.ui.tests.quickfix.focuses.testIterator_sumReduction() - Iterator reduce pipeline not yet implemented; re-enable when iterator patterns support collect/map/filter/reduce
    • File: sandbox_functional_converter_test/src/org/sandbox/jdt/ui/tests/quickfix/IteratorLoopToStreamTest.java:527
  • org.sandbox.jdt.ui.tests.quickfix.focuses.calculateSum() - Iterator reduce pipeline not yet implemented; re-enable when iterator patterns support collect/map/filter/reduce
    • File: sandbox_functional_converter_test/src/org/sandbox/jdt/ui/tests/quickfix/IteratorLoopToStreamTest.java:534
  • org.sandbox.jdt.ui.tests.quickfix.focuses.testIterator_withExternalModification_notConverted() - No reason specified
    • File: sandbox_functional_converter_test/src/org/sandbox/jdt/ui/tests/quickfix/IteratorLoopToStreamTest.java:698
  • org.sandbox.jdt.ui.tests.quickfix.focuses.trackLast() - No reason specified
    • File: sandbox_functional_converter_test/src/org/sandbox/jdt/ui/tests/quickfix/IteratorLoopToStreamTest.java:705
  • org.sandbox.jdt.ui.tests.quickfix.focuses.testArraySourceCollect() - No reason specified
    • File: sandbox_functional_converter_test/src/org/sandbox/jdt/ui/tests/quickfix/LoopRefactoringCollectTest.java:484
  • org.sandbox.jdt.ui.tests.quickfix.focuses.process() - No reason specified
    • File: sandbox_functional_converter_test/src/org/sandbox/jdt/ui/tests/quickfix/LoopRefactoringCollectTest.java:489
  • org.sandbox.jdt.ui.tests.quickfix.focuses.testArraySourceMapCollect() - No reason specified
    • File: sandbox_functional_converter_test/src/org/sandbox/jdt/ui/tests/quickfix/LoopRefactoringCollectTest.java:527
  • org.sandbox.jdt.ui.tests.quickfix.focuses.process() - No reason specified
    • File: sandbox_functional_converter_test/src/org/sandbox/jdt/ui/tests/quickfix/LoopRefactoringCollectTest.java:532
  • org.sandbox.jdt.ui.tests.quickfix.focuses.testCollectWithSideEffects_ShouldNotConvert() - V2 incorrectly wraps counter++ as side-effect map instead of detecting external state modification
    • File: sandbox_functional_converter_test/src/org/sandbox/jdt/ui/tests/quickfix/LoopRefactoringCollectTest.java:576
  • org.sandbox.jdt.ui.tests.quickfix.focuses.process() - V2 incorrectly wraps counter++ as side-effect map instead of detecting external state modification
    • File: sandbox_functional_converter_test/src/org/sandbox/jdt/ui/tests/quickfix/LoopRefactoringCollectTest.java:582
  • org.sandbox.jdt.ui.tests.quickfix.focuses.testUnusedElement() - Pattern not converting in V1 - needs investigation
    • File: sandbox_functional_converter_test/src/org/sandbox/jdt/ui/tests/quickfix/LoopRefactoringEdgeCasesTest.java:633
  • org.sandbox.jdt.ui.tests.quickfix.focuses.main() - Pattern not converting in V1 - needs investigation
    • File: sandbox_functional_converter_test/src/org/sandbox/jdt/ui/tests/quickfix/LoopRefactoringEdgeCasesTest.java:639
  • org.sandbox.jdt.ui.tests.quickfix.focuses.MyTest() - Pattern not converting in V1 - needs investigation
    • File: sandbox_functional_converter_test/src/org/sandbox/jdt/ui/tests/quickfix/LoopRefactoringEdgeCasesTest.java:640

sandbox_int_to_enum_test (1 disabled)

  • org.eclipse.jdt.ui.tests.quickfix.Java22.IntToEnumCleanUpTest.testBasicIfElseToEnumSwitch() - Transformation logic not yet implemented - test documents expected behavior
    • File: sandbox_int_to_enum_test/src/org/eclipse/jdt/ui/tests/quickfix/Java22/IntToEnumCleanUpTest.java:80

sandbox_jface_cleanup_test (1 disabled)

  • org.sandbox.jdt.ui.tests.quickfix.method.testMissingSuperDisposeCleanup() - Requires TriggerPattern engine enhancements: override detection and body constraints
    • File: sandbox_jface_cleanup_test/src/org/sandbox/jdt/ui/tests/quickfix/MissingSuperDisposePluginTest.java:233

sandbox_junit_cleanup_test (36 disabled)

  • org.eclipse.jdt.ui.tests.quickfix.Java8.LostTestFinderTest.testNotYetImplemented() - No reason specified
    • File: sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/LostTestFinderTest.java:186
  • org.eclipse.jdt.ui.tests.quickfix.Java8.MigrationCombinationsTest.ignoredTest() - No reason specified
    • File: sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MigrationCombinationsTest.java:131
  • org.eclipse.jdt.ui.tests.quickfix.Java8.MigrationCombinationsTest.testWithAssertions() - No reason specified
    • File: sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MigrationCombinationsTest.java:136
  • org.eclipse.jdt.ui.tests.quickfix.Java8.MigrationCombinationsTest.migrates_suite_with_assertions_and_lifecycle() - @RunWith(Suite.class) to @suite transformation not fully working - actual output retains @RunWith
    • File: sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MigrationCombinationsTest.java:216
  • org.eclipse.jdt.ui.tests.quickfix.Java8.MigrationCombinationsTest.testIgnored() - Not ready
    • File: sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MigrationCombinationsTest.java:434
  • org.eclipse.jdt.ui.tests.quickfix.Java8.MigrationEdgeCasesTest.handles_combined_test_expected_and_timeout() - Combined @test(expected + timeout) transformation not yet implemented - both parameters need simultaneous migration
    • File: sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MigrationEdgeCasesTest.java:52
  • org.eclipse.jdt.ui.tests.quickfix.Java8.MigrationEdgeCasesTest.testIgnored() - Not yet implemented
    • File: sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MigrationEdgeCasesTest.java:176
  • org.eclipse.jdt.ui.tests.quickfix.Java8.MigrationEdgeCasesTest.handles_wildcard_static_imports() - Not yet implemented
    • File: sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MigrationEdgeCasesTest.java:184
  • org.eclipse.jdt.ui.tests.quickfix.Java8.MigrationIgnoreTest.ignoredTest() - No reason specified
    • File: sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MigrationIgnoreTest.java:73
  • org.eclipse.jdt.ui.tests.quickfix.Java8.MigrationIgnoreTest.migrates_ignore_with_message() - No reason specified
    • File: sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MigrationIgnoreTest.java:81
  • org.eclipse.jdt.ui.tests.quickfix.Java8.MigrationIgnoreTest.ignoredTestWithMessage() - Not yet implemented
    • File: sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MigrationIgnoreTest.java:110
  • org.eclipse.jdt.ui.tests.quickfix.Java8.MigrationIgnoreTest.migrates_multiple_ignored_tests() - Not yet implemented
    • File: sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MigrationIgnoreTest.java:118
  • org.eclipse.jdt.ui.tests.quickfix.Java8.MigrationIgnoreTest.ignoredTest1() - No reason specified
    • File: sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MigrationIgnoreTest.java:156
  • org.eclipse.jdt.ui.tests.quickfix.Java8.MigrationIgnoreTest.ignoredTest2() - Temporarily disabled
    • File: sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MigrationIgnoreTest.java:161
  • org.eclipse.jdt.ui.tests.quickfix.Java8.MigrationIgnoreTest.activeTest() - Temporarily disabled
    • File: sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MigrationIgnoreTest.java:165
  • org.eclipse.jdt.ui.tests.quickfix.Java8.MigrationIgnoreTest.ignoredTestWithExplicitValue() - explicit value attribute
    • File: sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MigrationIgnoreTest.java:202
  • org.eclipse.jdt.ui.tests.quickfix.Java8.MigrationRulesToExtensionsTest.migrates_junit4_rules_to_junit5_extensions() - Rule migration parameterized test - TemporaryFolder output mismatch, ErrorCollector requires hamcrest not on test classpath
    • File: sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MigrationRulesToExtensionsTest.java:50
  • org.eclipse.jdt.ui.tests.quickfix.Java8.MigrationRunnersAdvancedTest.migrates_runWith_theories_to_parameterizedTest() - @RunWith(Theories.class) to @ParameterizedTest transformation not yet implemented
    • File: sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MigrationRunnersAdvancedTest.java:106
  • org.eclipse.jdt.ui.tests.quickfix.Java8.MigrationRunnersAdvancedTest.migrates_runWith_categories_to_suite_with_tags() - @RunWith(Categories.class) to @suite with @IncludeTags/@ExcludeTags transformation not yet implemented
    • File: sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MigrationRunnersAdvancedTest.java:157
  • org.eclipse.jdt.ui.tests.quickfix.Java8.MigrationTestAnnotationTest.migrates_test_timeout_with_other_parameters() - Combined @test(expected + timeout) transformation not yet implemented - both parameters need simultaneous migration
    • File: sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MigrationTestAnnotationTest.java:299
  • org.eclipse.jdt.ui.tests.quickfix.Java8.TriggerPatternPluginTest.testIgnored() - Not ready yet
    • File: sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/TriggerPatternPluginTest.java:296
  • org.eclipse.jdt.ui.tests.quickfix.Java8.TriggerPatternPluginTest.ignoreJUnitPlugin_migrates_without_reason() - Not ready yet
    • File: sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/TriggerPatternPluginTest.java:304
  • org.eclipse.jdt.ui.tests.quickfix.Java8.TriggerPatternPluginTest.testIgnored() - No reason specified
    • File: sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/TriggerPatternPluginTest.java:333
  • org.eclipse.jdt.ui.tests.quickfix.Java8.TriggerPatternPluginTest.v2_plugins_work_together_in_complex_class() - No reason specified
    • File: sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/TriggerPatternPluginTest.java:341
  • org.eclipse.jdt.ui.tests.quickfix.Java8.TriggerPatternPluginTest.testIgnored() - Not ready
    • File: sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/TriggerPatternPluginTest.java:422
  • org.sandbox.jdt.internal.corext.fix.helper.RewriteRuleTest.testRewriteRule_defaultValues() - No reason specified
    • File: sandbox_junit_cleanup_test/src/org/sandbox/jdt/internal/corext/fix/helper/RewriteRuleTest.java:130
  • org.sandbox.jdt.internal.corext.fix.helper.verifies.testSomething() - not implemented
    • File: sandbox_junit_cleanup_test/src/org/sandbox/jdt/internal/corext/fix/helper/TriggerPatternCleanupFrameworkTest.java:181
  • org.sandbox.jdt.internal.corext.fix.helper.verifies.testSomething() - not ready
    • File: sandbox_junit_cleanup_test/src/org/sandbox/jdt/internal/corext/fix/helper/TriggerPatternCleanupFrameworkTest.java:253
  • org.sandbox.jdt.internal.corext.fix.helper.verifies.testSingleMemberAnnotation_IgnoreToDisabled() - No reason specified
    • File: sandbox_junit_cleanup_test/src/org/sandbox/jdt/internal/corext/fix/helper/TriggerPatternCleanupFrameworkTest.java:428
  • org.sandbox.jdt.internal.corext.fix.helper.verifies.testFeature() - Feature not ready
    • File: sandbox_junit_cleanup_test/src/org/sandbox/jdt/internal/corext/fix/helper/TriggerPatternCleanupFrameworkTest.java:457
  • org.sandbox.jdt.internal.corext.fix.helper.verifies.testSomething() - TODO: implement
    • File: sandbox_junit_cleanup_test/src/org/sandbox/jdt/internal/corext/fix/helper/TriggerPatternCleanupFrameworkTest.java:495
  • org.sandbox.jdt.internal.corext.fix.helper.verifies.testSomething() - not ready
    • File: sandbox_junit_cleanup_test/src/org/sandbox/jdt/internal/corext/fix/helper/TriggerPatternCleanupFrameworkTest.java:651
  • org.sandbox.jdt.internal.corext.fix.helper.verifies.testSomething() - No reason specified
    • File: sandbox_junit_cleanup_test/src/org/sandbox/jdt/internal/corext/fix/helper/TriggerPatternCleanupFrameworkTest.java:689
  • org.sandbox.jdt.internal.corext.fix.helper.verifies.testSomething() - TODO: fix\nline breaks & special chars
    • File: sandbox_junit_cleanup_test/src/org/sandbox/jdt/internal/corext/fix/helper/TriggerPatternCleanupFrameworkTest.java:758
  • org.sandbox.jdt.internal.corext.fix.helper.verifies.testDsl_ignoreAnnotation_preservesValue() - No reason specified
    • File: sandbox_junit_cleanup_test/src/org/sandbox/jdt/internal/corext/fix/helper/TriggerPatternCleanupFrameworkTest.java:908
  • org.sandbox.jdt.internal.corext.fix.helper.verifies.testFeature() - Feature not ready
    • File: sandbox_junit_cleanup_test/src/org/sandbox/jdt/internal/corext/fix/helper/TriggerPatternCleanupFrameworkTest.java:937

sandbox_platform_helper_test (1 disabled)

  • org.sandbox.jdt.ui.tests.quickfix.Java9CleanUpTest.testPlatformStatusParametrized() - Temporary disable - import handling needs investigation
    • File: sandbox_platform_helper_test/src/org/sandbox/jdt/ui/tests/quickfix/Java9CleanUpTest.java:90

This report is automatically generated by the Test Report workflow

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Test Results

  235 files    235 suites   4m 29s ⏱️
2 866 tests 2 829 ✅ 37 💤 0 ❌
2 863 runs  2 826 ✅ 37 💤 0 ❌

Results for commit 38bda1d.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

✅ All Tests Passed

No test failures detected.


This comment is automatically updated with test failure details for each commit.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the signal-to-noise ratio of refactoring mining by curating bundled hint sets, making behavior-changing modernizations hint-only, stabilizing rule IDs, and ensuring guard evaluation is deterministic by forwarding the configured Java source level into mining.

Changes:

  • Refines bundled hint libraries (collections/modernize/deprecations/performance/etc.) to reduce noisy rewrites, avoid duplicate findings, and add stable @id rule identifiers.
  • Updates the mining CLI/scanner pipeline to forward compiler source options into guard evaluation and prefer rule IDs in reports.
  • Adds targeted tests to validate source-version parsing/forwarding and bundled-hint behavior expectations.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
sandbox_mining_cli/src/test/java/org/sandbox/mining/scanner/SourceScannerTest.java Adds regression test ensuring compiler source options affect sourceVersionGE(...) guard evaluation.
sandbox_mining_cli/src/test/java/org/sandbox/mining/config/MiningConfigTest.java Adds tests for parsing/defaulting the configured mining source version.
sandbox_mining_cli/src/main/java/org/sandbox/mining/scanner/SourceScanner.java Adds scan overload that forwards compiler options into hint processing and prefers rule IDs for reporting.
sandbox_mining_cli/src/main/java/org/sandbox/mining/MiningCli.java Loads curated bundled hints, forwards source level into scanning, and adjusts CLI messaging/cleanup behavior.
sandbox_mining_cli/src/main/java/org/sandbox/mining/config/MiningConfig.java Introduces sourceVersion configuration with defaults and YAML parsing.
sandbox_common_core/src/test/java/org/sandbox/jdt/triggerpattern/test/HintRuleTestSupport.java Extends rule-test harness to pass source version/compiler options and improves replacement application correctness.
sandbox_common_core/src/test/java/org/sandbox/jdt/triggerpattern/test/BundledHintRuleBehaviorTest.java Adds behavior tests for stable IDs, conservative rewrites, hint-only migrations, and de-duplication across bundles.
sandbox_common_core/src/main/resources/org/sandbox/jdt/triggerpattern/internal/string-equals.sandbox-hint Removes reflexive-equals duplicates and adds stable IDs/severity metadata for remaining rules.
sandbox_common_core/src/main/resources/org/sandbox/jdt/triggerpattern/internal/stream-performance.sandbox-hint Adds stable IDs/severity and clarifies hint-only messaging for review-only findings.
sandbox_common_core/src/main/resources/org/sandbox/jdt/triggerpattern/internal/probable-bugs.sandbox-hint Adds stable IDs/severity and removes binding-unsafe active rules to avoid false positives in mining.
sandbox_common_core/src/main/resources/org/sandbox/jdt/triggerpattern/internal/modernize-java9.sandbox-hint Makes risky migrations hint-only and adds guards/IDs to keep modernization conservative.
sandbox_common_core/src/main/resources/org/sandbox/jdt/triggerpattern/internal/io-performance.sandbox-hint Adds stable IDs/severity and improves rule descriptions for mining output clarity.
sandbox_common_core/src/main/resources/org/sandbox/jdt/triggerpattern/internal/deprecations.sandbox-hint Updates deprecated wrapper-constructor replacements to use valueOf(...) and adds stable IDs.
sandbox_common_core/src/main/resources/org/sandbox/jdt/triggerpattern/internal/collections.sandbox-hint Removes broad diamond-only constructor rewrite noise and keeps only guarded empty-factory rewrites with stable IDs.
sandbox_common_core/src/main/resources/org/sandbox/jdt/triggerpattern/internal/collection-performance.sandbox-hint Adds stable IDs and documents why keySet().remove(...) rewrite is intentionally excluded.
sandbox_common_core/src/main/resources/org/sandbox/jdt/triggerpattern/internal/arrays.sandbox-hint Adds stable IDs and documents binding-safety constraints for array-related rules.
.github/refactoring-mining/repos.yml Switches nightly mining to curated hints and sets source-version: "21" for deterministic guard behavior.

Comment on lines +343 to +345
Files.walk(dir)
.sorted((a, b) -> b.compareTo(a)) // delete children first
.forEach(p -> {
}
}

private static void printUsage() {
private static final String FORMAT_MARKDOWN = "markdown"; //$NON-NLS-1$
private static final String FORMAT_JSON = "json"; //$NON-NLS-1$
private static final String FORMAT_BOTH = "both"; //$NON-NLS-1$
private static final String COMPILER_SOURCE_OPTION = "org.eclipse.jdt.core.compiler.source"; //$NON-NLS-1$
Comment on lines +119 to +122
Object source = settings.get("source-version"); //$NON-NLS-1$
if (source != null && !source.toString().isBlank()) {
config.sourceVersion = source.toString();
}
}

public void setSourceVersion(String sourceVersion) {
this.sourceVersion = sourceVersion != null && !sourceVersion.isBlank() ? sourceVersion : "1.8"; //$NON-NLS-1$
@carstenartur

Copy link
Copy Markdown
Owner Author

@copilot Consider Review comments and fix build

Copilot AI commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@copilot Consider Review comments and fix build

Implemented the review fixes and build-related test adjustment in commit 38bda1d. This includes the MiningCli resource/usage fixes, source-version trimming, modernize-java9 rule ID correction, and updated collections bundled-library threshold.

@carstenartur carstenartur merged commit 8c9af00 into main Jul 1, 2026
12 checks passed
@carstenartur carstenartur deleted the fix/mining-hint-quality branch July 1, 2026 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants