[INFO] Scanning for projects... [INFO] Computing target platform for MavenProject: org.autorefactor.feature:org.autorefactor.feature:1.1.0-SNAPSHOT @ /Users/luiscruz/dev/AutoRefactor/feature/pom.xml [INFO] Fetching p2.index from http://download.eclipse.org/eclipse/updates/3.7/ (0B at 0B/s) [INFO] Adding repository http://download.eclipse.org/eclipse/updates/3.7 [INFO] Resolving dependencies of MavenProject: org.autorefactor.feature:org.autorefactor.feature:1.1.0-SNAPSHOT @ /Users/luiscruz/dev/AutoRefactor/feature/pom.xml [INFO] Resolving class path of MavenProject: org.autorefactor.feature:org.autorefactor.feature:1.1.0-SNAPSHOT @ /Users/luiscruz/dev/AutoRefactor/feature/pom.xml [INFO] Computing target platform for MavenProject: org.autorefactor.plugin:org.autorefactor.plugin:1.1.0-SNAPSHOT @ /Users/luiscruz/dev/AutoRefactor/plugin/pom.xml [INFO] Resolving dependencies of MavenProject: org.autorefactor.plugin:org.autorefactor.plugin:1.1.0-SNAPSHOT @ /Users/luiscruz/dev/AutoRefactor/plugin/pom.xml [INFO] Resolving class path of MavenProject: org.autorefactor.plugin:org.autorefactor.plugin:1.1.0-SNAPSHOT @ /Users/luiscruz/dev/AutoRefactor/plugin/pom.xml [INFO] Computing target platform for MavenProject: org.autorefactor.plugin:org.autorefactor.plugin.tests:1.1.0-SNAPSHOT @ /Users/luiscruz/dev/AutoRefactor/plugin.tests/pom.xml [INFO] Resolving dependencies of MavenProject: org.autorefactor.plugin:org.autorefactor.plugin.tests:1.1.0-SNAPSHOT @ /Users/luiscruz/dev/AutoRefactor/plugin.tests/pom.xml [INFO] Resolving class path of MavenProject: org.autorefactor.plugin:org.autorefactor.plugin.tests:1.1.0-SNAPSHOT @ /Users/luiscruz/dev/AutoRefactor/plugin.tests/pom.xml [INFO] Computing target platform for MavenProject: org.autorefactor.repository:org.autorefactor.repository:1.1.0-SNAPSHOT @ /Users/luiscruz/dev/AutoRefactor/repository/pom.xml [INFO] Resolving dependencies of MavenProject: org.autorefactor.repository:org.autorefactor.repository:1.1.0-SNAPSHOT @ /Users/luiscruz/dev/AutoRefactor/repository/pom.xml [INFO] Resolving class path of MavenProject: org.autorefactor.repository:org.autorefactor.repository:1.1.0-SNAPSHOT @ /Users/luiscruz/dev/AutoRefactor/repository/pom.xml [INFO] ------------------------------------------------------------------------ [INFO] Reactor Build Order: [INFO] [INFO] parent [INFO] org.autorefactor.plugin [INFO] org.autorefactor.feature [INFO] org.autorefactor.rules.samples [INFO] org.autorefactor.plugin.tests [INFO] org.autorefactor.repository [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building parent 1.1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ parent --- [INFO] Deleting /Users/luiscruz/dev/AutoRefactor/target [INFO] [INFO] --- maven-checkstyle-plugin:2.12.1:check (validate) @ parent --- [INFO] Starting audit... Audit done. [INFO] [INFO] --- maven-install-plugin:2.4:install (default-install) @ parent --- [INFO] Installing /Users/luiscruz/dev/AutoRefactor/pom.xml to /Users/luiscruz/.m2/repository/org/autorefactor/plugin/parent/1.1.0-SNAPSHOT/parent-1.1.0-SNAPSHOT.pom [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building org.autorefactor.plugin 1.1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ org.autorefactor.plugin --- [INFO] Deleting /Users/luiscruz/dev/AutoRefactor/plugin/target [INFO] [INFO] --- tycho-packaging-plugin:0.23.1:build-qualifier (default-build-qualifier) @ org.autorefactor.plugin --- [INFO] The project's OSGi version is 1.1.0.201610241244 [INFO] [INFO] --- tycho-packaging-plugin:0.23.1:validate-id (default-validate-id) @ org.autorefactor.plugin --- [INFO] [INFO] --- tycho-packaging-plugin:0.23.1:validate-version (default-validate-version) @ org.autorefactor.plugin --- [INFO] [INFO] --- maven-checkstyle-plugin:2.12.1:check (validate) @ org.autorefactor.plugin --- [INFO] Starting audit... Audit done. [INFO] [INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ org.autorefactor.plugin --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /Users/luiscruz/dev/AutoRefactor/plugin/src/main/resources [INFO] [INFO] --- tycho-compiler-plugin:0.23.1:compile (default-compile) @ org.autorefactor.plugin --- [INFO] Compiling 100 source files to /Users/luiscruz/dev/AutoRefactor/plugin/target/classes [INFO] [INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @ org.autorefactor.plugin --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /Users/luiscruz/dev/AutoRefactor/plugin/src/test/resources [INFO] [INFO] --- target-platform-configuration:0.23.1:target-platform (default-target-platform) @ org.autorefactor.plugin --- [INFO] [INFO] --- tycho-packaging-plugin:0.23.1:package-plugin (default-package-plugin) @ org.autorefactor.plugin --- [INFO] Building jar: /Users/luiscruz/dev/AutoRefactor/plugin/target/org.autorefactor.plugin-1.1.0-SNAPSHOT.jar [INFO] [INFO] --- tycho-p2-plugin:0.23.1:p2-metadata-default (default-p2-metadata-default) @ org.autorefactor.plugin --- [INFO] [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ org.autorefactor.plugin --- [INFO] Installing /Users/luiscruz/dev/AutoRefactor/plugin/target/org.autorefactor.plugin-1.1.0-SNAPSHOT.jar to /Users/luiscruz/.m2/repository/org/autorefactor/plugin/org.autorefactor.plugin/1.1.0-SNAPSHOT/org.autorefactor.plugin-1.1.0-SNAPSHOT.jar [INFO] Installing /Users/luiscruz/dev/AutoRefactor/plugin/pom.xml to /Users/luiscruz/.m2/repository/org/autorefactor/plugin/org.autorefactor.plugin/1.1.0-SNAPSHOT/org.autorefactor.plugin-1.1.0-SNAPSHOT.pom [INFO] Installing /Users/luiscruz/dev/AutoRefactor/plugin/target/p2content.xml to /Users/luiscruz/.m2/repository/org/autorefactor/plugin/org.autorefactor.plugin/1.1.0-SNAPSHOT/org.autorefactor.plugin-1.1.0-SNAPSHOT-p2metadata.xml [INFO] Installing /Users/luiscruz/dev/AutoRefactor/plugin/target/p2artifacts.xml to /Users/luiscruz/.m2/repository/org/autorefactor/plugin/org.autorefactor.plugin/1.1.0-SNAPSHOT/org.autorefactor.plugin-1.1.0-SNAPSHOT-p2artifacts.xml [INFO] [INFO] --- tycho-p2-plugin:0.23.1:update-local-index (default-update-local-index) @ org.autorefactor.plugin --- [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building org.autorefactor.feature 1.1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ org.autorefactor.feature --- [INFO] Deleting /Users/luiscruz/dev/AutoRefactor/feature/target [INFO] [INFO] --- tycho-packaging-plugin:0.23.1:build-qualifier-aggregator (default-build-qualifier-aggregator) @ org.autorefactor.feature --- [INFO] The project's OSGi version is 1.1.0.201610241244 [INFO] [INFO] --- tycho-packaging-plugin:0.23.1:validate-id (default-validate-id) @ org.autorefactor.feature --- [INFO] [INFO] --- tycho-packaging-plugin:0.23.1:validate-version (default-validate-version) @ org.autorefactor.feature --- [INFO] [INFO] --- maven-checkstyle-plugin:2.12.1:check (validate) @ org.autorefactor.feature --- [INFO] Starting audit... Audit done. [INFO] [INFO] --- target-platform-configuration:0.23.1:target-platform (default-target-platform) @ org.autorefactor.feature --- [INFO] [INFO] --- tycho-packaging-plugin:0.23.1:package-feature (default-package-feature) @ org.autorefactor.feature --- [INFO] Building jar: /Users/luiscruz/dev/AutoRefactor/feature/target/org.autorefactor.feature-1.1.0-SNAPSHOT.jar [INFO] [INFO] --- tycho-p2-plugin:0.23.1:p2-metadata-default (default-p2-metadata-default) @ org.autorefactor.feature --- [INFO] [INFO] --- tycho-p2-plugin:0.23.1:feature-p2-metadata (default-feature-p2-metadata) @ org.autorefactor.feature --- [INFO] [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ org.autorefactor.feature --- [INFO] Installing /Users/luiscruz/dev/AutoRefactor/feature/target/org.autorefactor.feature-1.1.0-SNAPSHOT.jar to /Users/luiscruz/.m2/repository/org/autorefactor/feature/org.autorefactor.feature/1.1.0-SNAPSHOT/org.autorefactor.feature-1.1.0-SNAPSHOT.jar [INFO] Installing /Users/luiscruz/dev/AutoRefactor/feature/pom.xml to /Users/luiscruz/.m2/repository/org/autorefactor/feature/org.autorefactor.feature/1.1.0-SNAPSHOT/org.autorefactor.feature-1.1.0-SNAPSHOT.pom [INFO] Installing /Users/luiscruz/dev/AutoRefactor/feature/target/p2content.xml to /Users/luiscruz/.m2/repository/org/autorefactor/feature/org.autorefactor.feature/1.1.0-SNAPSHOT/org.autorefactor.feature-1.1.0-SNAPSHOT-p2metadata.xml [INFO] Installing /Users/luiscruz/dev/AutoRefactor/feature/target/p2artifacts.xml to /Users/luiscruz/.m2/repository/org/autorefactor/feature/org.autorefactor.feature/1.1.0-SNAPSHOT/org.autorefactor.feature-1.1.0-SNAPSHOT-p2artifacts.xml [INFO] [INFO] --- tycho-p2-plugin:0.23.1:update-local-index (default-update-local-index) @ org.autorefactor.feature --- [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building org.autorefactor.rules.samples 1.1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ org.autorefactor.rules.samples --- [INFO] Deleting /Users/luiscruz/dev/AutoRefactor/samples/target [INFO] [INFO] --- maven-checkstyle-plugin:2.12.1:check (validate) @ org.autorefactor.rules.samples --- [INFO] Starting audit... Audit done. [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ org.autorefactor.rules.samples --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /Users/luiscruz/dev/AutoRefactor/samples/src/main/resources [INFO] [INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ org.autorefactor.rules.samples --- [INFO] No sources to compile [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ org.autorefactor.rules.samples --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /Users/luiscruz/dev/AutoRefactor/samples/src/test/resources [INFO] [INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ org.autorefactor.rules.samples --- [INFO] Changes detected - recompiling the module! [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! [INFO] Compiling 94 source files to /Users/luiscruz/dev/AutoRefactor/samples/target/test-classes [INFO] /Users/luiscruz/dev/AutoRefactor/samples/src/test/java/org/autorefactor/refactoring/rules/samples_in/ReplaceQualifiedNamesBySimpleNamesSample.java: Some input files use unchecked or unsafe operations. [INFO] /Users/luiscruz/dev/AutoRefactor/samples/src/test/java/org/autorefactor/refactoring/rules/samples_in/ReplaceQualifiedNamesBySimpleNamesSample.java: Recompile with -Xlint:unchecked for details. [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ org.autorefactor.rules.samples --- [INFO] Surefire report directory: /Users/luiscruz/dev/AutoRefactor/samples/target/surefire-reports ------------------------------------------------------- T E S T S ------------------------------------------------------- Running TestSuite Configuring TestNG with: org.apache.maven.surefire.testng.conf.TestNG652Configurator@1963006a Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.414 sec Results : Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 [INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ org.autorefactor.rules.samples --- [WARNING] JAR will be empty - no content was marked for inclusion! [INFO] Building jar: /Users/luiscruz/dev/AutoRefactor/samples/target/org.autorefactor.rules.samples-1.1.0-SNAPSHOT.jar [INFO] [INFO] --- maven-install-plugin:2.4:install (default-install) @ org.autorefactor.rules.samples --- [INFO] Installing /Users/luiscruz/dev/AutoRefactor/samples/target/org.autorefactor.rules.samples-1.1.0-SNAPSHOT.jar to /Users/luiscruz/.m2/repository/org/autorefactor/plugin/org.autorefactor.rules.samples/1.1.0-SNAPSHOT/org.autorefactor.rules.samples-1.1.0-SNAPSHOT.jar [INFO] Installing /Users/luiscruz/dev/AutoRefactor/samples/pom.xml to /Users/luiscruz/.m2/repository/org/autorefactor/plugin/org.autorefactor.rules.samples/1.1.0-SNAPSHOT/org.autorefactor.rules.samples-1.1.0-SNAPSHOT.pom [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building org.autorefactor.plugin.tests 1.1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ org.autorefactor.plugin.tests --- [INFO] Deleting /Users/luiscruz/dev/AutoRefactor/plugin.tests/target [INFO] [INFO] --- tycho-packaging-plugin:0.23.1:build-qualifier (default-build-qualifier) @ org.autorefactor.plugin.tests --- [INFO] The project's OSGi version is 1.1.0.201610241244 [INFO] [INFO] --- tycho-packaging-plugin:0.23.1:validate-id (default-validate-id) @ org.autorefactor.plugin.tests --- [INFO] [INFO] --- tycho-packaging-plugin:0.23.1:validate-version (default-validate-version) @ org.autorefactor.plugin.tests --- [INFO] [INFO] --- maven-checkstyle-plugin:2.12.1:check (validate) @ org.autorefactor.plugin.tests --- [INFO] Starting audit... Audit done. [INFO] [INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ org.autorefactor.plugin.tests --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /Users/luiscruz/dev/AutoRefactor/plugin.tests/src/main/resources [INFO] [INFO] --- tycho-compiler-plugin:0.23.1:compile (default-compile) @ org.autorefactor.plugin.tests --- [INFO] Compiling 16 source files to /Users/luiscruz/dev/AutoRefactor/plugin.tests/target/classes [INFO] [INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @ org.autorefactor.plugin.tests --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] Copying 12 resources [INFO] [INFO] --- target-platform-configuration:0.23.1:target-platform (default-target-platform) @ org.autorefactor.plugin.tests --- [INFO] [INFO] --- tycho-packaging-plugin:0.23.1:package-plugin (default-package-plugin) @ org.autorefactor.plugin.tests --- [INFO] Building jar: /Users/luiscruz/dev/AutoRefactor/plugin.tests/target/org.autorefactor.plugin.tests-1.1.0-SNAPSHOT.jar [INFO] [INFO] --- tycho-p2-plugin:0.23.1:p2-metadata-default (default-p2-metadata-default) @ org.autorefactor.plugin.tests --- [INFO] [INFO] --- tycho-surefire-plugin:0.23.1:test (default-test) @ org.autorefactor.plugin.tests --- [INFO] Expected eclipse log file: /Users/luiscruz/dev/AutoRefactor/plugin.tests/target/work/data/.metadata/.log [INFO] Command line: [/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/jre/bin/java, -Dosgi.noShutdown=false, -Dosgi.os=macosx, -Dosgi.ws=cocoa, -Dosgi.arch=x86_64, -Dosgi.clean=true, -jar, /Users/luiscruz/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.launcher/1.2.0.v20110502/org.eclipse.equinox.launcher-1.2.0.v20110502.jar, -data, /Users/luiscruz/dev/AutoRefactor/plugin.tests/target/work/data, -install, /Users/luiscruz/dev/AutoRefactor/plugin.tests/target/work, -configuration, /Users/luiscruz/dev/AutoRefactor/plugin.tests/target/work/configuration, -application, org.eclipse.tycho.surefire.osgibooter.headlesstest, -testproperties, /Users/luiscruz/dev/AutoRefactor/plugin.tests/target/surefire.properties] ------------------------------------------------------- T E S T S ------------------------------------------------------- Running org.autorefactor.cfg.CFGBuilderTest Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.327 sec - in org.autorefactor.cfg.CFGBuilderTest testCFGBuilder[0](org.autorefactor.cfg.CFGBuilderTest) Time elapsed: 0.765 sec testCFGBuilder[1](org.autorefactor.cfg.CFGBuilderTest) Time elapsed: 0.126 sec testCFGBuilder[2](org.autorefactor.cfg.CFGBuilderTest) Time elapsed: 0.103 sec testCFGBuilder[3](org.autorefactor.cfg.CFGBuilderTest) Time elapsed: 0.083 sec testCFGBuilder[4](org.autorefactor.cfg.CFGBuilderTest) Time elapsed: 0.13 sec testCFGBuilder[5](org.autorefactor.cfg.CFGBuilderTest) Time elapsed: 0.092 sec Running org.autorefactor.refactoring.JavaConstantsTest Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.011 sec - in org.autorefactor.refactoring.JavaConstantsTest validIntegerZeroLongLiteralRegexp(org.autorefactor.refactoring.JavaConstantsTest) Time elapsed: 0.001 sec invalidIntegerZeroLongLiteralRegexp(org.autorefactor.refactoring.JavaConstantsTest) Time elapsed: 0 sec validLongZeroLongLiteralRegexp(org.autorefactor.refactoring.JavaConstantsTest) Time elapsed: 0 sec validIntegerOneLongLiteralRegexp(org.autorefactor.refactoring.JavaConstantsTest) Time elapsed: 0.001 sec invalidIntegerOneLongLiteralRegexp(org.autorefactor.refactoring.JavaConstantsTest) Time elapsed: 0 sec validLongOneLongLiteralRegexp(org.autorefactor.refactoring.JavaConstantsTest) Time elapsed: 0.001 sec validIntegerTenLongLiteralRegexp(org.autorefactor.refactoring.JavaConstantsTest) Time elapsed: 0 sec invalidIntegerTenLongLiteralRegexp(org.autorefactor.refactoring.JavaConstantsTest) Time elapsed: 0 sec validLongTenLongLiteralRegexp(org.autorefactor.refactoring.JavaConstantsTest) Time elapsed: 0 sec validIntegerLiteralRegexp(org.autorefactor.refactoring.JavaConstantsTest) Time elapsed: 0 sec invalidIntegerLiteralRegexp(org.autorefactor.refactoring.JavaConstantsTest) Time elapsed: 0.001 sec validLongLiteralRegexp(org.autorefactor.refactoring.JavaConstantsTest) Time elapsed: 0.001 sec Running org.autorefactor.refactoring.ReleaseTest Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec - in org.autorefactor.refactoring.ReleaseTest javaSEFromString(org.autorefactor.refactoring.ReleaseTest) Time elapsed: 0 sec javaSEFromIntegers(org.autorefactor.refactoring.ReleaseTest) Time elapsed: 0 sec isCompatibleWith(org.autorefactor.refactoring.ReleaseTest) Time elapsed: 0 sec Running org.autorefactor.refactoring.rules.AllRefactoringRulesTest ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. Tests run: 5, Failures: 0, Errors: 5, Skipped: 0, Time elapsed: 13.389 sec <<< FAILURE! - in org.autorefactor.refactoring.rules.AllRefactoringRulesTest testRefactoring[0](org.autorefactor.refactoring.rules.AllRefactoringRulesTest) Time elapsed: 3.845 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.AllRefactoringRulesTest.testRefactoring0(AllRefactoringRulesTest.java:103) at org.autorefactor.refactoring.rules.AllRefactoringRulesTest.access$0(AllRefactoringRulesTest.java:86) testRefactoring[1](org.autorefactor.refactoring.rules.AllRefactoringRulesTest) Time elapsed: 2.791 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.AllRefactoringRulesTest.testRefactoring0(AllRefactoringRulesTest.java:103) at org.autorefactor.refactoring.rules.AllRefactoringRulesTest.access$0(AllRefactoringRulesTest.java:86) testRefactoring[2](org.autorefactor.refactoring.rules.AllRefactoringRulesTest) Time elapsed: 2.271 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.AllRefactoringRulesTest.testRefactoring0(AllRefactoringRulesTest.java:103) at org.autorefactor.refactoring.rules.AllRefactoringRulesTest.access$0(AllRefactoringRulesTest.java:86) testRefactoring[3](org.autorefactor.refactoring.rules.AllRefactoringRulesTest) Time elapsed: 2.313 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.AllRefactoringRulesTest.testRefactoring0(AllRefactoringRulesTest.java:103) at org.autorefactor.refactoring.rules.AllRefactoringRulesTest.access$0(AllRefactoringRulesTest.java:86) testRefactoring[4](org.autorefactor.refactoring.rules.AllRefactoringRulesTest) Time elapsed: 2.159 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.AllRefactoringRulesTest.testRefactoring0(AllRefactoringRulesTest.java:103) at org.autorefactor.refactoring.rules.AllRefactoringRulesTest.access$0(AllRefactoringRulesTest.java:86) Running org.autorefactor.refactoring.rules.OperatorEnumTest Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec - in org.autorefactor.refactoring.rules.OperatorEnumTest compareSamePrecedenceOperators(org.autorefactor.refactoring.rules.OperatorEnumTest) Time elapsed: 0.002 sec compareDifferentPrecedenceOperators(org.autorefactor.refactoring.rules.OperatorEnumTest) Time elapsed: 0.002 sec simpleTestCompareExpressions(org.autorefactor.refactoring.rules.OperatorEnumTest) Time elapsed: 0 sec Running org.autorefactor.refactoring.rules.RefactoringRulesTest ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. ***WARNING: Display must be created on main thread due to Cocoa restrictions. Tests run: 38, Failures: 7, Errors: 31, Skipped: 0, Time elapsed: 5.823 sec <<< FAILURE! - in org.autorefactor.refactoring.rules.RefactoringRulesTest testRefactoring[0](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.069 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[1](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.075 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[2](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.071 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[3](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.125 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[4](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.065 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[5](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.107 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[6](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.093 sec <<< FAILURE! org.junit.ComparisonFailure: Collection: wrong output; expected:<...w ArrayList([col); } public void doNotReplaceStackCtor(List col, List output) { output = new Stack(); output.addAll(col); } public List replaceNewNoArgsThenAddAll(List col) { final List output = new ArrayList(col); return output; } public List replaceNewOneArgThenAddAll(List col) { final List output = new ArrayList(col); return output; } public List replaceNewCollectionSizeThenAddAll(List col) { final List output = new ArrayList(col); return output; } public List doNotReplaceNewThenAddAllIncompatibleTypes(List col) { final List output = new ArrayList<>(); output.addAll(col); return output; } public Object replaceNewThenAddAllParameterizedType(Map map) { List> output = new ArrayList>(map.entrySet()); return output; } public void replaceAddWithForLoopByCollectionsAddAll( List output, java.util.Date[] elems1, java.sql.Date[] elems2) { java.util.Collections.addAll(output, elems1); java.util.Collections.addAll(output, elems2); } public void replaceAddWithForEachByCollectionsAddAll( List output, java.util.Date[] elems1, java.sql.Date[] elems2) { java.util.Collections.addAll(output, elems1); java.util.Collections.addAll(output, elems2); } public void doNotRefactorForEachWithListUsingLoopVariable( Map> mapToFill, List inputList) { for (String input : inputList) { mapToFill.get(input).add(input); } } public void doNotRefactorForLoopWithListUsingLoopIndex( Map> mapToFill, List inputList) { for (int i = 0; i < inputList.size(); i++) { mapToFill.get(inputList.get(i)).add(inputList.get(i)); } } public void doNotRefactorForLoopWithListUsingLoopIterator( Map> mapToFill, List inputList) { String input = null; for (Iterator it = inputList.iterator(); it.hasNext(); input = it.next()) { mapToFill.get(input).add(input); } } public void doNotRefactorForLoopWithListUsingLoopIterator(List col) { for (Iterator it = col.iterator(); it.hasNext();) { System.out.println(it.next()); } } public void doNotRefactorForEachWithArrayUsingLoopVariable( Map> mapToFill, String[] inputArray) { for (String input : inputArray) { mapToFill.get(input).add(input); } } public void doNotRefactorForLoopWithArrayUsingLoopIndex( Map> mapToFill, String[] inputArray) { for (int i = 0; i < inputArray.length; i++) { mapToFill.get(inputArray[i]).add(inputArray[i]); } } public void doNotRefactorForLoopAddMethodResult(List output, String[] elems) { for (int i = 0; i < elems.length; i++) { output.add(doSomething(elems[i])); } } public void doNotRefactorForEachAddMethodResult(List output, String[] elems) { for (String s : elems) { output.add(doSomething(s)); } } public void replaceAddWithForLoopByAddAll(List col, List output) { output.addAll(col); } public void replaceAddWithForEachByAddAll(Collection col, List output) { output.addAll(col); } public void replaceContainsWithForLoopByContainsAll(List col, List output) { output.containsAll(col); } public void replaceContainsWithForEachByContainsAll(Collection col, List output) { output.containsAll(col); } public void replaceRemoveWithForLoopByRemoveAll(List col, List output) { output.removeAll(col); } public void replaceRemoveWithForEachByRemoveAll(Collection col, List output) { output.removeAll(col); } public void doNotRefactorForLoopAddMethodResult(List output, List col) { for (int i = 0; i < col.size(); i++) { output.add(doSomething(col.get(i))); } } public void doNotRefactorForEachAddMethodResult(List output, List col) { for (String s : col) { output.add(doSomething(s)); } } private String doSomething(String s) { return null; } public void replaceChecksOnSize(Collection col) { System.out.println(!col.isEmpty()); System.out.println(true); System.out.println(col.isEmpty()); System.out.println(col.isEmpty()); System.out.println(false); System.out.println(!col.isEmpty()); System.out.println(true); System.out.println(col.isEmpty()); System.out.println(col.isEmpty()); System.out.println(false); } public void replaceCheckOnSetContainsBeforeAdd(Set col, String s) { if (col.add(s)) { System.out.println("OK"); } else { System.out.println("KO"); } } public void replaceCheckOnSetContainsBeforeAdd2(Set col, String s) { if (!col.add(s)) { System.out.println("KO"); } else { System.out.println("OK"); } } public void doNotReplaceWhenCheckedValueIsDifferent(Set col) { if (!col.contains("this")) { col.add("that"); System.out.println("OK"); } } public void doNotReplaceWhenCollectionsAreDifferent(Set col1, Set col2) { if (!col1.contains("that")) { col2.add("that"); System.out.println("OK"); } } public void doNotReplaceCheckOnListContainsBeforeAdd(List col, String s) { if (!col.contains(s)) { col.add(s); System.out.println("OK"); } else { System.out.println("KO"); } } public class MySet extends AbstractSet { public MySet(List strings) { addAll(strings); } @Override public Iterator iterator() { return null; } @Override public int size() { return 0; } } public static Set refactorCollectionWithNoTypeArgument(List strings) { class MyHashSet extends HashSet { private static final long serialVersionUID = 1L; } final MyHashSet set = new MyHashSet(); set.addAll(strings);] return set;...> but was:<...w ArrayList([); output.addAll(col); } public void doNotReplaceStackCtor(List col, List output) { output = new Stack(); output.addAll(col); } public List replaceNewNoArgsThenAddAll(List col) { final List output = new ArrayList(); output.addAll(col); return output; } public List replaceNewOneArgThenAddAll(List col) { final List output = new ArrayList(0); output.addAll(col); return output; } public List replaceNewCollectionSizeThenAddAll(List col) { final List output = new ArrayList(col.size()); output.addAll(col); return output; } public List doNotReplaceNewThenAddAllIncompatibleTypes(List col) { final List output = new ArrayList<>(); output.addAll(col); return output; } public Object replaceNewThenAddAllParameterizedType(Map map) { List> output = new ArrayList>(); output.addAll(map.entrySet()); return output; } public void replaceAddWithForLoopByCollectionsAddAll( List output, java.util.Date[] elems1, java.sql.Date[] elems2) { for (int i = 0; i < elems1.length; i++) { output.add(elems1[i]); } for (int i = 0; i < elems2.length; i++) { output.add(elems2[i]); } } public void replaceAddWithForEachByCollectionsAddAll( List output, java.util.Date[] elems1, java.sql.Date[] elems2) { for (java.util.Date d : elems1) { output.add(d); } for (java.sql.Date d : elems2) { output.add(d); } } public void doNotRefactorForEachWithListUsingLoopVariable( Map> mapToFill, List inputList) { for (String input : inputList) { mapToFill.get(input).add(input); } } public void doNotRefactorForLoopWithListUsingLoopIndex( Map> mapToFill, List inputList) { for (int i = 0; i < inputList.size(); i++) { mapToFill.get(inputList.get(i)).add(inputList.get(i)); } } public void doNotRefactorForLoopWithListUsingLoopIterator( Map> mapToFill, List inputList) { String input = null; for (Iterator it = inputList.iterator(); it.hasNext(); input = it.next()) { mapToFill.get(input).add(input); } } public void doNotRefactorForLoopWithListUsingLoopIterator(List col) { for (Iterator it = col.iterator(); it.hasNext();) { System.out.println(it.next()); } } public void doNotRefactorForEachWithArrayUsingLoopVariable( Map> mapToFill, String[] inputArray) { for (String input : inputArray) { mapToFill.get(input).add(input); } } public void doNotRefactorForLoopWithArrayUsingLoopIndex( Map> mapToFill, String[] inputArray) { for (int i = 0; i < inputArray.length; i++) { mapToFill.get(inputArray[i]).add(inputArray[i]); } } public void doNotRefactorForLoopAddMethodResult(List output, String[] elems) { for (int i = 0; i < elems.length; i++) { output.add(doSomething(elems[i])); } } public void doNotRefactorForEachAddMethodResult(List output, String[] elems) { for (String s : elems) { output.add(doSomething(s)); } } public void replaceAddWithForLoopByAddAll(List col, List output) { for (int i = 0; i < col.size(); i++) { output.add(col.get(i)); } } public void replaceAddWithForEachByAddAll(Collection col, List output) { for (String s : col) { output.add(s); } } public void replaceContainsWithForLoopByContainsAll(List col, List output) { for (int i = 0; i < col.size(); i++) { output.contains(col.get(i)); } } public void replaceContainsWithForEachByContainsAll(Collection col, List output) { for (String s : col) { output.contains(s); } } public void replaceRemoveWithForLoopByRemoveAll(List col, List output) { for (int i = 0; i < col.size(); i++) { output.remove(col.get(i)); } } public void replaceRemoveWithForEachByRemoveAll(Collection col, List output) { for (String s : col) { output.remove(s); } } public void doNotRefactorForLoopAddMethodResult(List output, List col) { for (int i = 0; i < col.size(); i++) { output.add(doSomething(col.get(i))); } } public void doNotRefactorForEachAddMethodResult(List output, List col) { for (String s : col) { output.add(doSomething(s)); } } private String doSomething(String s) { return null; } public void replaceChecksOnSize(Collection col) { System.out.println(col.size() > 0); System.out.println(col.size() >= 0); System.out.println(col.size() == 0); System.out.println(col.size() <= 0); System.out.println(col.size() < 0); System.out.println(0 < col.size()); System.out.println(0 <= col.size()); System.out.println(0 == col.size()); System.out.println(0 >= col.size()); System.out.println(0 > col.size()); } public void replaceCheckOnSetContainsBeforeAdd(Set col, String s) { if (!col.contains(s)) { col.add(s); System.out.println("OK"); } else { System.out.println("KO"); } } public void replaceCheckOnSetContainsBeforeAdd2(Set col, String s) { if (col.contains(s)) { System.out.println("KO"); } else { col.add(s); System.out.println("OK"); } } public void doNotReplaceWhenCheckedValueIsDifferent(Set col) { if (!col.contains("this")) { col.add("that"); System.out.println("OK"); } } public void doNotReplaceWhenCollectionsAreDifferent(Set col1, Set col2) { if (!col1.contains("that")) { col2.add("that"); System.out.println("OK"); } } public void doNotReplaceCheckOnListContainsBeforeAdd(List col, String s) { if (!col.contains(s)) { col.add(s); System.out.println("OK"); } else { System.out.println("KO"); } } public class MySet extends AbstractSet { public MySet(List strings) { for (String s : strings) { add(s); } } @Override public Iterator iterator() { return null; } @Override public int size() { return 0; } } public static Set refactorCollectionWithNoTypeArgument(List strings) { class MyHashSet extends HashSet { private static final long serialVersionUID = 1L; } final MyHashSet set = new MyHashSet(); for (String s : strings) { set.add(s); }] return set;...> at org.junit.Assert.assertEquals(Assert.java:123) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:125) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[7](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.182 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[8](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.079 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[9](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.066 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[10](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.073 sec <<< ERROR! java.lang.NullPointerException: null at org.autorefactor.refactoring.rules.DeadCodeEliminationRefactoring.visit(DeadCodeEliminationRefactoring.java:272) at org.autorefactor.refactoring.rules.AggregateASTVisitor.visit(AggregateASTVisitor.java:2308) at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:489) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2514) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2585) at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:484) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2514) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2585) at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:484) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2514) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2585) at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:219) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2514) at org.autorefactor.refactoring.rules.AggregateASTVisitor.getRefactorings(AggregateASTVisitor.java:259) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:220) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[11](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.083 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[12](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.064 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[13](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.101 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[14](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.06 sec <<< FAILURE! org.junit.ComparisonFailure: MapEliminateKeySetCalls: wrong output; expected:<... int x = map.[size(); if (map.containsKey("hello")) { map.remove("hello"); } map.clear(); if (map].isEmpty()) { ...> but was:<... int x = map.[keySet().size(); if (map.keySet().contains("hello")) { map.keySet().remove("hello"); } map.keySet().clear(); if (map.keySet()].isEmpty()) { ...> at org.junit.Assert.assertEquals(Assert.java:123) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:125) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[15](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.063 sec <<< FAILURE! org.junit.ComparisonFailure: Map: wrong output; expected:<...Map([map); } public Map replaceNewNoArgsThenPutAll(Map map) { final Map output = new HashMap(map); return output; } public Map replaceNew0ArgThenPutAll(Map map) { final Map output = new HashMap(map); return output; } public Map replaceNew1ArgThenPutAll(Map map) { final Map output = new HashMap(map); return output; } public Map replaceNewMapSizeThenPutAll(Map map) { final Map output = new HashMap(map); return output; } public Map doNotReplaceNewThenAddAllIncompatibleTypes(Map map) { final Map output = new HashMap<>(); output.putAll(map); return output; } public void replaceChecksOnSize(Map map) { System.out.println(!map.isEmpty()); System.out.println(true); System.out.println(map.isEmpty()); System.out.println(map.isEmpty()); System.out.println(false); System.out.println(!map.isEmpty()); System.out.println(true); System.out.println(map.isEmpty()); System.out.println(map.isEmpty()); System.out.println(false]); } }> but was:<...Map([); output.putAll(map); } public Map replaceNewNoArgsThenPutAll(Map map) { final Map output = new HashMap(); output.putAll(map); return output; } public Map replaceNew0ArgThenPutAll(Map map) { final Map output = new HashMap(0); output.putAll(map); return output; } public Map replaceNew1ArgThenPutAll(Map map) { final Map output = new HashMap(0); output.putAll(map); return output; } public Map replaceNewMapSizeThenPutAll(Map map) { final Map output = new HashMap(map.size()); output.putAll(map); return output; } public Map doNotReplaceNewThenAddAllIncompatibleTypes(Map map) { final Map output = new HashMap<>(); output.putAll(map); return output; } public void replaceChecksOnSize(Map map) { System.out.println(map.size() > 0); System.out.println(map.size() >= 0); System.out.println(map.size() == 0); System.out.println(map.size() <= 0); System.out.println(map.size() < 0); System.out.println(0 < map.size()); System.out.println(0 <= map.size()); System.out.println(0 == map.size()); System.out.println(0 >= map.size()); System.out.println(0 > map.size()]); } }> at org.junit.Assert.assertEquals(Assert.java:123) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:125) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[16](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.075 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[17](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.112 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[18](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.08 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[19](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.079 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[20](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.081 sec <<< FAILURE! org.junit.ComparisonFailure: RemoveFieldsDefaultValues: wrong output; expected:<... private Object obj[; private String st; private byte by1, by2; private boolean bo; private char c1, c2; private short sh; private int i; private long l1, l2, l3; private float f1, f2, f3, f4; private double d1, d2; public Iterable getIterable() { return new Iterable() { private Collection aField; @Override public Iterator iterator() { return aField.iterator(); } }; } private enum MyEnum { ONE, TWO; String aField]; } private...> but was:<... private Object obj[ = null; private String st = null; private byte by1 = 0x0, by2 = 0; private boolean bo = false; private char c1 = 0, c2 = '\u0000'; private short sh = 0; private int i = 0; private long l1 = 0, l2 = 0l, l3 = 0L; private float f1 = 0, f2 = 0f, f3 = 0F, f4 = 0.0f; private double d1 = 0, d2 = 0.0; public Iterable getIterable() { return new Iterable() { private Collection aField = null; @Override public Iterator iterator() { return aField.iterator(); } }; } private enum MyEnum { ONE, TWO; String aField = null]; } private...> at org.junit.Assert.assertEquals(Assert.java:123) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:125) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[21](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.086 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[22](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.095 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[23](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.07 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[24](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.068 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[25](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.072 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[26](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.075 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[27](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 2.695 sec <<< FAILURE! org.junit.ComparisonFailure: ReplaceQualifiedNamesBySimpleNames: wrong output; expected:<...Sample { public [List removeQualifiedNameForImportNoWildcard(List l) { return l; } public Calendar removeQualifiedNameForImportWithWildcard(Calendar cal) { return cal; } public int removeQualifiedNameForStaticImportWithWildcard() { return DATE; } public boolean removeQualifiedNameForStaticMethodImport() { return emptyList().containsAll(emptyList()); } public boolean removeQualifiedNameForStaticFieldImport() { return EMPTY_LIST.containsAll(EMPTY_LIST); } public void doNotRemoveQualifiedNameForGenericStaticMethodImport() { acceptListString(Collections. emptyList()); } private void acceptListString(List l) { // nothing to do } public boolean removeQualifiedNameForStaticTypeImport(Entry e) { return e.getKey() != null; } public BigDecimal doNotRemoveQualifiedNameForConflictingFieldSimpleNameFromStaticImports() { return BigDecimal.ZERO; } public BigDecimal removeQualifiedNameForOverridingFieldSimpleNameFromStaticImports() { return ONE; } public Map doNotRemoveQualifiedNameForConflictingMethodSimpleName() { return Collections.emptyMap(); } public int removeQualifiedNameForNonConflictingLocalMethodSimpleName() { return emptyMap(); } private static int emptyMap() { return 0; } public Boolean removeQualifiedNameForJavaLangPackage() { return Boolean.TRUE; } public java.lang.Integer doNotRemoveQualifiedNameForConflictingTypeFromJavaLangPackage() { return new java.lang.Integer(0); } public Integer removeQualifiedNameForNonConflictingLocalType() { return new Integer(); } private static final class Integer { } public int doNotRemoveQualifiedNameForConflictingFieldSimpleName() { return Calendar.DAY_OF_WEEK_IN_MONTH; } public String removeQualifiedNameForNonConflictingLocalField() { return DAY_OF_WEEK_IN_MONTH; } private static final String DAY_OF_WEEK_IN_MONTH = "DAY_OF_WEEK_IN_MONTH"; static class A { private int replaceFromEnclosingType() { return emptyMap(); } } static class B { private int doNotReplaceCurrentTypeDiffers() { return ReplaceQualifiedNamesBySimpleNamesSample.emptyMap(); } static int emptyMap() { return 0; } } static class C { private int replaceFromCurrentType() { return emptyMap(); } static int emptyMap() { return 0; } } static class D extends C { private int replaceFromSuperType() { return ]emptyMap(); ...> but was:<...Sample { public [java.util.List removeQualifiedNameForImportNoWildcard(List l) { return l; } public java.util.Calendar removeQualifiedNameForImportWithWildcard(Calendar cal) { return cal; } public int removeQualifiedNameForStaticImportWithWildcard() { return java.util.Calendar.DATE; } public boolean removeQualifiedNameForStaticMethodImport() { return java.util.Collections.emptyList().containsAll(Collections.emptyList()); } public boolean removeQualifiedNameForStaticFieldImport() { return java.util.Collections.EMPTY_LIST.containsAll(Collections.EMPTY_LIST); } public void doNotRemoveQualifiedNameForGenericStaticMethodImport() { acceptListString(Collections. emptyList()); } private void acceptListString(List l) { // nothing to do } public boolean removeQualifiedNameForStaticTypeImport(Map.Entry e) { return e.getKey() != null; } public BigDecimal doNotRemoveQualifiedNameForConflictingFieldSimpleNameFromStaticImports() { return BigDecimal.ZERO; } public BigDecimal removeQualifiedNameForOverridingFieldSimpleNameFromStaticImports() { return BigDecimal.ONE; } public Map doNotRemoveQualifiedNameForConflictingMethodSimpleName() { return Collections.emptyMap(); } public int removeQualifiedNameForNonConflictingLocalMethodSimpleName() { return ReplaceQualifiedNamesBySimpleNamesSample.emptyMap(); } private static int emptyMap() { return 0; } public java.lang.Boolean removeQualifiedNameForJavaLangPackage() { return java.lang.Boolean.TRUE; } public java.lang.Integer doNotRemoveQualifiedNameForConflictingTypeFromJavaLangPackage() { return new java.lang.Integer(0); } public Integer removeQualifiedNameForNonConflictingLocalType() { return new ReplaceQualifiedNamesBySimpleNamesSample.Integer(); } private static final class Integer { } public int doNotRemoveQualifiedNameForConflictingFieldSimpleName() { return Calendar.DAY_OF_WEEK_IN_MONTH; } public String removeQualifiedNameForNonConflictingLocalField() { return ReplaceQualifiedNamesBySimpleNamesSample.DAY_OF_WEEK_IN_MONTH; } private static final String DAY_OF_WEEK_IN_MONTH = "DAY_OF_WEEK_IN_MONTH"; static class A { private int replaceFromEnclosingType() { return ReplaceQualifiedNamesBySimpleNamesSample.emptyMap(); } } static class B { private int doNotReplaceCurrentTypeDiffers() { return ReplaceQualifiedNamesBySimpleNamesSample.emptyMap(); } static int emptyMap() { return 0; } } static class C { private int replaceFromCurrentType() { return C.emptyMap(); } static int emptyMap() { return 0; } } static class D extends C { private int replaceFromSuperType() { return C.]emptyMap(); ...> at org.junit.Assert.assertEquals(Assert.java:123) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:125) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[28](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.101 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[29](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.069 sec <<< FAILURE! org.junit.ComparisonFailure: StringBuilder: wrong output; expected:<... sbuf.append("[foo ").append("bar ").append(0).append(1); sbui.append("foo ").append("bar ").append(0).append(1); sbuf.append("foo").append(0).append("bar").append(1); sbui.append("foo").append(0).append("bar").append(1); } public void replaceWithStringAppend() { String s1 = "foo " + "bar " + "baz"; String s2 = "foo " + "bar " + "baz"; String s3 = "" + 0 + 1 + "bar"; String s4 = "" + 0 + 1 + "bar"; String s5 = "foo"; String s6 = "foo"; String s7 = ""; String s8 = ""; String s9 = ""; String s10 = ""; String s11 = String.valueOf(0); String s12 = String.valueOf(0); String s13 = "foo " + "bar " + "baz"; String s14 = "foo " + "bar " + "baz"; } public void doNotReplaceWithStringAppend(StringBuffer sbuf, StringBuilder sbui) { String s5 = sbuf.append("foo ").append("bar").toString(); String s6 = sbui.append("foo ").append("bar").toString(); } public void removeUselessStringConcatenation() { String s1 = Integer.toString(42); String s2 = "foo " + 0 + "bar " + 1; String s3 = 1 + "foo"; } public void doNotRemoveStringConcatenation() { String s1 = 1 + ""; } public void removeUselessCallsToValueOfWithStringBuilderAppend( Object o, boolean b, char c, int i, long l, float f, double d) { StringBuilder sb = new StringBuilder(); sb.append(o); sb.append(b); sb.append(b); sb.append(c); sb.append(c); sb.append(i); sb.append(i); sb.append(l); sb.append(l); sb.append(f); sb.append(f); sb.append(d); sb.append(d); } public void removeUselessCallsToValueOfWithStringBufferAppend( Object o, boolean b, char c, int i, long l, float f, double d) { StringBuffer sb = new StringBuffer(); sb.append(o); sb.append(b); sb.append(b); sb.append(c); sb.append(c); sb.append(i); sb.append(i); sb.append(l); sb.append(l); sb.append(f); sb.append(f); sb.append(d); sb.append(d); } public void removeUselessCallsToToStringOfWithStringBuilderAppend( Object o, boolean bo, byte by, char c, short s, int i, long l, float f, double d) { StringBuilder sb = new StringBuilder(); sb.append(this); sb.append(o); sb.append(bo); sb.append(by); sb.append(c); sb.append(s); sb.append(i); sb.append(l); sb.append(f); sb.append(d); } public void removeUselessCallsToToStringOfWithStringBufferAppend( Object o, boolean bo, byte by, char c, short s, int i, long l, float f, double d) { StringBuffer sb = new StringBuffer(); sb.append(this); sb.append(o); sb.append(bo); sb.append(by); sb.append(c); sb.append(s); sb.append(i); sb.append(l); sb.append(f); sb.append(d); } public void removeSubstringDoubleArgsCallsWithAppend(String s) { new StringBuilder().append(s, 0, 1); new StringBuffer().append(s, 0, 1); new StringBuilder().append(s, 0, 1); new StringBuffer().append(s, 0, 1); } public void doNotRemoveSubstringSingleArgCallsWithAppend(String s) { new StringBuilder().append(s.substring(1)); new StringBuffer().append(s.substring(1)); } public void removeAppendEmptyString(StringBuilder builder, StringBuffer buffer) { } public final void doNotRefactorForAppendable(Appendable buf, Object o) throws IOException { buf.append(o.toString()); } public String formatTime(int hour, int min) { return (hour < 10 ? "0" + hour : hour) + ":" + (min < 10 ? "0" + min : min]); } }> but was:<... sbuf.append("[" + "foo ").append("bar " + 0).append("" + 1); sbui.append("" + "foo ").append("bar " + 0).append("" + 1); sbuf.append("foo" + 0 + "bar" + 1); sbui.append("foo" + 0 + "bar" + 1); } public void replaceWithStringAppend() { String s1 = new StringBuffer("foo ").append("bar ").append("baz").toString(); String s2 = new StringBuilder("foo ").append("bar ").append("baz").toString(); String s3 = new StringBuffer().append(0).append(1).append("bar").toString(); String s4 = new StringBuilder().append(0).append(1).append("bar").toString(); String s5 = new StringBuffer("foo").toString(); String s6 = new StringBuilder("foo").toString(); String s7 = new StringBuffer(0).toString(); String s8 = new StringBuilder(0).toString(); String s9 = new StringBuffer().toString(); String s10 = new StringBuilder().toString(); String s11 = new StringBuffer().append(0).toString(); String s12 = new StringBuilder().append(0).toString(); String s13 = (((new StringBuffer("foo ")).append("bar ")).append("baz")).toString(); String s14 = (((new StringBuilder("foo ")).append("bar ")).append("baz")).toString(); } public void doNotReplaceWithStringAppend(StringBuffer sbuf, StringBuilder sbui) { String s5 = sbuf.append("foo ").append("bar").toString(); String s6 = sbui.append("foo ").append("bar").toString(); } public void removeUselessStringConcatenation() { String s1 = Integer.toString(42) + "" + ""; String s2 = "foo " + "" + 0 + "" + "bar " + 1 + ""; String s3 = 1 + "" + "foo"; } public void doNotRemoveStringConcatenation() { String s1 = 1 + ""; } public void removeUselessCallsToValueOfWithStringBuilderAppend( Object o, boolean b, char c, int i, long l, float f, double d) { StringBuilder sb = new StringBuilder(); sb.append(String.valueOf(o)); sb.append(String.valueOf(b)); sb.append(Boolean.valueOf(b)); sb.append(String.valueOf(c)); sb.append(Character.valueOf(c)); sb.append(String.valueOf(i)); sb.append(Integer.valueOf(i)); sb.append(String.valueOf(l)); sb.append(Long.valueOf(l)); sb.append(String.valueOf(f)); sb.append(Float.valueOf(f)); sb.append(String.valueOf(d)); sb.append(Double.valueOf(d)); } public void removeUselessCallsToValueOfWithStringBufferAppend( Object o, boolean b, char c, int i, long l, float f, double d) { StringBuffer sb = new StringBuffer(); sb.append(String.valueOf(o)); sb.append(String.valueOf(b)); sb.append(Boolean.valueOf(b)); sb.append(String.valueOf(c)); sb.append(Character.valueOf(c)); sb.append(String.valueOf(i)); sb.append(Integer.valueOf(i)); sb.append(String.valueOf(l)); sb.append(Long.valueOf(l)); sb.append(String.valueOf(f)); sb.append(Float.valueOf(f)); sb.append(String.valueOf(d)); sb.append(Double.valueOf(d)); } public void removeUselessCallsToToStringOfWithStringBuilderAppend( Object o, boolean bo, byte by, char c, short s, int i, long l, float f, double d) { StringBuilder sb = new StringBuilder(); sb.append(toString()); sb.append(o.toString()); sb.append(Boolean.toString(bo)); sb.append(Byte.toString(by)); sb.append(Character.toString(c)); sb.append(Short.toString(s)); sb.append(Integer.toString(i)); sb.append(Long.toString(l)); sb.append(Float.toString(f)); sb.append(Double.toString(d)); } public void removeUselessCallsToToStringOfWithStringBufferAppend( Object o, boolean bo, byte by, char c, short s, int i, long l, float f, double d) { StringBuffer sb = new StringBuffer(); sb.append(toString()); sb.append(o.toString()); sb.append(Boolean.toString(bo)); sb.append(Byte.toString(by)); sb.append(Character.toString(c)); sb.append(Short.toString(s)); sb.append(Integer.toString(i)); sb.append(Long.toString(l)); sb.append(Float.toString(f)); sb.append(Double.toString(d)); } public void removeSubstringDoubleArgsCallsWithAppend(String s) { new StringBuilder().append(s.substring(0, 1)); new StringBuffer().append(s.substring(0, 1)); new StringBuilder().append(s.subSequence(0, 1)); new StringBuffer().append(s.subSequence(0, 1)); } public void doNotRemoveSubstringSingleArgCallsWithAppend(String s) { new StringBuilder().append(s.substring(1)); new StringBuffer().append(s.substring(1)); } public void removeAppendEmptyString(StringBuilder builder, StringBuffer buffer) { builder.append(""); buffer.append(""); } public final void doNotRefactorForAppendable(Appendable buf, Object o) throws IOException { buf.append(o.toString()); } public String formatTime(int hour, int min) { return new StringBuilder() .append(hour < 10 ? "0" + hour : hour) .append(":") .append(min < 10 ? "0" + min : min) .toString(]); } }> at org.junit.Assert.assertEquals(Assert.java:123) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:125) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[30](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.115 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[31](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.091 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[32](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.073 sec <<< FAILURE! org.junit.ComparisonFailure: TestNGAssert: wrong output; expected:<... Assert.assert[Equals(i1, i2); Assert.assertEquals(i1, i2, "Failure message to keep"); Assert.assertNotEquals(i1, i2); Assert.assertNotEquals(i1, i2, "Failure message to keep"); Assert.assertEquals(i1, i2); Assert.assertEquals(i1, i2, "Failure message to keep"); Assert.assertNotEquals(i1, i2); Assert.assertNotEquals(i1, i2, "Failure message to keep"); assertEquals(i1, i2); assertEquals(i1, i2, "Failure message to keep"); assertNotEquals(i1, i2); assertNotEquals(i1, i2, "Failure message to keep"); assertEquals(i1, i2); assertEquals(i1, i2, "Failure message to keep"); assertNotEquals(i1, i2); assertNotEquals(i1, i2, "Failure message to keep"); } public void shouldRefactorFailures() throws Exception { Assert.fail(); Assert.fail("Failure message to keep"); Assert.fail(); Assert.fail("Failure message to keep"); fail(); fail("Failure message to keep"); fail(); fail("Failure message to keep"); } public void shouldRemoveDeadChecks() throws Exception { } public void shouldRefactorNegatedConditions(boolean b) throws Exception { Assert.assertFalse(b); Assert.assertFalse(b, "Failure message to keep"); Assert.assertTrue(b); Assert.assertTrue(b, "Failure message to keep"); assertFalse(b); assertFalse(b, "Failure message to keep"); assertTrue(b); assertTrue(b, "Failure message to keep"); } public void shouldRefactorWithObjectReferences(Object o1, Object o2) throws Exception { Assert.assertSame(o1, o2); Assert.assertSame(o1, o2, "Failure message to keep"); Assert.assertNotSame(o1, o2); Assert.assertNotSame(o1, o2, "Failure message to keep"); Assert.assertSame(o1, o2); Assert.assertSame(o1, o2, "Failure message to keep"); Assert.assertNotSame(o1, o2); Assert.assertNotSame(o1, o2, "Failure message to keep"); assertSame(o1, o2); assertSame(o1, o2, "Failure message to keep"); assertNotSame(o1, o2); assertNotSame(o1, o2, "Failure message to keep"); assertSame(o1, o2); assertSame(o1, o2, "Failure message to keep"); assertNotSame(o1, o2); assertNotSame(o1, o2, "Failure message to keep"); } public void shouldRefactorWithObjects(Object o1, Object o2) throws Exception { Assert.assertEquals(o1, o2); Assert.assertEquals(o1, o2, "Failure message to keep"); Assert.assertNotEquals(o1, o2); Assert.assertNotEquals(o1, o2, "Failure message to keep"); Assert.assertEquals(o1, o2); Assert.assertEquals(o1, o2, "Failure message to keep"); Assert.assertNotEquals(o1, o2); Assert.assertNotEquals(o1, o2, "Failure message to keep"); assertEquals(o1, o2); assertEquals(o1, o2, "Failure message to keep"); assertNotEquals(o1, o2); assertNotEquals(o1, o2, "Failure message to keep"); assertEquals(o1, o2); assertEquals(o1, o2, "Failure message to keep"); assertNotEquals(o1, o2); assertNotEquals(o1, o2, "Failure message to keep"); } public void shouldRefactorNullCheckFirstArg(Object o) throws Exception { Assert.assertNull(o); Assert.assertNull(o, "Failure message to keep"); Assert.assertNotNull(o); Assert.assertNotNull(o, "Failure message to keep"); Assert.assertNull(o); Assert.assertNull(o, "Failure message to keep"); Assert.assertNotNull(o); Assert.assertNotNull(o, "Failure message to keep"); assertNull(o); assertNull(o, "Failure message to keep"); assertNotNull(o); assertNotNull(o, "Failure message to keep"); assertNull(o); assertNull(o, "Failure message to keep"); assertNotNull(o); assertNotNull(o, "Failure message to keep"); } public void shouldRefactorNullCheckSecondArg(Object o) throws Exception { Assert.assertNull(o); Assert.assertNull(o, "Failure message to keep"); Assert.assertNotNull(o); Assert.assertNotNull(o, "Failure message to keep"); Assert.assertNull(o); Assert.assertNull(o, "Failure message to keep"); Assert.assertNotNull(o); Assert.assertNotNull(o, "Failure message to keep"); assertNull(o); assertNull(o, "Failure message to keep"); assertNotNull(o); assertNotNull(o, "Failure message to keep"); assertNull(o); assertNull(o, "Failure message to keep"); assertNotNull(o); assertNotNull(o, "Failure message to keep"); } public void shouldRefactorNullCheckFirstArgWithEquals(Object o) throws Exception { Assert.assertNull(o); Assert.assertNull(o, "Failure message to keep"); Assert.assertNotNull(o); Assert.assertNotNull(o, "Failure message to keep"); assertNull(o); assertNull(o, "Failure message to keep"); assertNotNull(o); assertNotNull(o, "Failure message to keep"); } public void shouldRefactorNullCheckSecondArgWithEquals(Object o) throws Exception { Assert.assertNull(o); Assert.assertNull(o, "Failure message to keep"); Assert.assertNotNull(o); Assert.assertNotNull(o, "Failure message to keep"); assertNull(o); assertNull(o, "Failure message to keep"); assertNotNull(o); assertNotNull(o, "Failure message to keep"); } public void shouldMoveConstantAsExpectedArgInWithEquals(Object o) throws Exception { Assert.assertEquals(o, 42); Assert.assertEquals(o, 42, "Failure message to keep"); Assert.assertNotEquals(o, 42); Assert.assertNotEquals(o, 42, "Failure message to keep"); assertEquals(o, 42); assertEquals(o, 42, "Failure message to keep"); assertNotEquals(o, 42); assertNotEquals(o, 42, "Failure message to keep"); } public void shouldMoveExpectedVariableAsExpectedArgWithEquals(Object o, int expected) throws Exception { Assert.assertEquals(o, expected); Assert.assertEquals(o, expected, "Failure message to keep"); Assert.assertNotEquals(o, expected); Assert.assertNotEquals(o, expected, "Failure message to keep"); assertEquals(o, expected); assertEquals(o, expected, "Failure message to keep"); assertNotEquals(o, expected); assertNotEquals(o, expected, "Failure message to keep"); // tests that this works according to levenshtein distance int expceted = 0; assertEquals(o, expceted); } public void shouldRefactorIfPrimitiveThenFail(int i1, int i2) throws Exception { Assert.assertNotEquals(i1, i2); Assert.assertNotEquals(i1, i2, "Failure message to keep"); Assert.assertEquals(i1, i2); Assert.assertEquals(i1, i2, "Failure message to keep"); assertNotEquals(i1, i2); assertNotEquals(i1, i2, "Failure message to keep"); assertEquals(i1, i2); assertEquals(i1, i2, "Failure message to keep"); } public void shouldRefactorIfSameObjectThenFail(Object o1, Object o2) throws Exception { Assert.assertNotSame(o1, o2); Assert.assertNotSame(o1, o2, "Failure message to keep"); Assert.assertSame(o1, o2); Assert.assertSame(o1, o2, "Failure message to keep"); assertNotSame(o1, o2); assertNotSame(o1, o2, "Failure message to keep"); assertSame(o1, o2); assertSame(o1, o2, "Failure message to keep"); } public void shouldRefactorIfNullThenFail(Object o1) throws Exception { Assert.assertNotNull(o1); Assert.assertNotNull(o1, "Failure message to keep"); Assert.assertNull(o1); Assert.assertNull(o1, "Failure message to keep"); Assert.assertNotNull(o1); Assert.assertNotNull(o1, "Failure message to keep"); Assert.assertNull(o1); Assert.assertNull(o1, "Failure message to keep"); assertNotNull(o1); assertNotNull(o1, "Failure message to keep"); assertNull(o1); assertNull(o1, "Failure message to keep"); assertNotNull(o1); assertNotNull(o1, "Failure message to keep"); assertNull(o1); assertNull(o1, "Failure message to keep"); } public void shouldRefactorIfObjectThenFail(Object o1, Object o2) throws Exception { Assert.assertNotEquals(o1, o2); Assert.assertNotEquals(o1, o2, "Failure message to keep"); Assert.assertEquals(o1, o2); Assert.assertEquals(o1, o2, "Failure message to keep"); assertNotEquals(o1, o2); assertNotEquals(o1, o2, "Failure message to keep"); assertEquals(o1, o2); assertEquals(o1, o2, "Failure message to keep");] } public v...> but was:<... Assert.assert[True(i1 == i2); Assert.assertTrue(i1 == i2, "Failure message to keep"); Assert.assertTrue(i1 != i2); Assert.assertTrue(i1 != i2, "Failure message to keep"); Assert.assertFalse(i1 != i2); Assert.assertFalse(i1 != i2, "Failure message to keep"); Assert.assertFalse(i1 == i2); Assert.assertFalse(i1 == i2, "Failure message to keep"); assertTrue(i1 == i2); assertTrue(i1 == i2, "Failure message to keep"); assertTrue(i1 != i2); assertTrue(i1 != i2, "Failure message to keep"); assertFalse(i1 != i2); assertFalse(i1 != i2, "Failure message to keep"); assertFalse(i1 == i2); assertFalse(i1 == i2, "Failure message to keep"); } public void shouldRefactorFailures() throws Exception { Assert.assertTrue(false); Assert.assertTrue(false, "Failure message to keep"); Assert.assertFalse(true); Assert.assertFalse(true, "Failure message to keep"); assertTrue(false); assertTrue(false, "Failure message to keep"); assertFalse(true); assertFalse(true, "Failure message to keep"); } public void shouldRemoveDeadChecks() throws Exception { Assert.assertTrue(true); Assert.assertTrue(true, "Failure message to keep"); Assert.assertFalse(false); Assert.assertFalse(false, "Failure message to keep"); assertTrue(true); assertTrue(true, "Failure message to keep"); assertFalse(false); assertFalse(false, "Failure message to keep"); } public void shouldRefactorNegatedConditions(boolean b) throws Exception { Assert.assertTrue(!b); Assert.assertTrue(!b, "Failure message to keep"); Assert.assertFalse(!b); Assert.assertFalse(!b, "Failure message to keep"); assertTrue(!b); assertTrue(!b, "Failure message to keep"); assertFalse(!b); assertFalse(!b, "Failure message to keep"); } public void shouldRefactorWithObjectReferences(Object o1, Object o2) throws Exception { Assert.assertTrue(o1 == o2); Assert.assertTrue(o1 == o2, "Failure message to keep"); Assert.assertTrue(o1 != o2); Assert.assertTrue(o1 != o2, "Failure message to keep"); Assert.assertFalse(o1 != o2); Assert.assertFalse(o1 != o2, "Failure message to keep"); Assert.assertFalse(o1 == o2); Assert.assertFalse(o1 == o2, "Failure message to keep"); assertTrue(o1 == o2); assertTrue(o1 == o2, "Failure message to keep"); assertTrue(o1 != o2); assertTrue(o1 != o2, "Failure message to keep"); assertFalse(o1 != o2); assertFalse(o1 != o2, "Failure message to keep"); assertFalse(o1 == o2); assertFalse(o1 == o2, "Failure message to keep"); } public void shouldRefactorWithObjects(Object o1, Object o2) throws Exception { Assert.assertTrue(o1.equals(o2)); Assert.assertTrue(o1.equals(o2), "Failure message to keep"); Assert.assertTrue(!(o1.equals(o2))); Assert.assertTrue(!(o1.equals(o2)), "Failure message to keep"); Assert.assertFalse(!(o1.equals(o2))); Assert.assertFalse(!(o1.equals(o2)), "Failure message to keep"); Assert.assertFalse(o1.equals(o2)); Assert.assertFalse(o1.equals(o2), "Failure message to keep"); assertTrue(o1.equals(o2)); assertTrue(o1.equals(o2), "Failure message to keep"); assertTrue(!(o1.equals(o2))); assertTrue(!(o1.equals(o2)), "Failure message to keep"); assertFalse(!(o1.equals(o2))); assertFalse(!(o1.equals(o2)), "Failure message to keep"); assertFalse(o1.equals(o2)); assertFalse(o1.equals(o2), "Failure message to keep"); } public void shouldRefactorNullCheckFirstArg(Object o) throws Exception { Assert.assertTrue(null == o); Assert.assertTrue(null == o, "Failure message to keep"); Assert.assertTrue(null != o); Assert.assertTrue(null != o, "Failure message to keep"); Assert.assertFalse(null != o); Assert.assertFalse(null != o, "Failure message to keep"); Assert.assertFalse(null == o); Assert.assertFalse(null == o, "Failure message to keep"); assertTrue(null == o); assertTrue(null == o, "Failure message to keep"); assertTrue(null != o); assertTrue(null != o, "Failure message to keep"); assertFalse(null != o); assertFalse(null != o, "Failure message to keep"); assertFalse(null == o); assertFalse(null == o, "Failure message to keep"); } public void shouldRefactorNullCheckSecondArg(Object o) throws Exception { Assert.assertTrue(o == null); Assert.assertTrue(o == null, "Failure message to keep"); Assert.assertTrue(o != null); Assert.assertTrue(o != null, "Failure message to keep"); Assert.assertFalse(o != null); Assert.assertFalse(o != null, "Failure message to keep"); Assert.assertFalse(o == null); Assert.assertFalse(o == null, "Failure message to keep"); assertTrue(o == null); assertTrue(o == null, "Failure message to keep"); assertTrue(o != null); assertTrue(o != null, "Failure message to keep"); assertFalse(o != null); assertFalse(o != null, "Failure message to keep"); assertFalse(o == null); assertFalse(o == null, "Failure message to keep"); } public void shouldRefactorNullCheckFirstArgWithEquals(Object o) throws Exception { Assert.assertEquals(null, o); Assert.assertEquals(null, o, "Failure message to keep"); Assert.assertNotEquals(null, o); Assert.assertNotEquals(null, o, "Failure message to keep"); assertEquals(null, o); assertEquals(null, o, "Failure message to keep"); assertNotEquals(null, o); assertNotEquals(null, o, "Failure message to keep"); } public void shouldRefactorNullCheckSecondArgWithEquals(Object o) throws Exception { Assert.assertEquals(o, null); Assert.assertEquals(o, null, "Failure message to keep"); Assert.assertNotEquals(o, null); Assert.assertNotEquals(o, null, "Failure message to keep"); assertEquals(o, null); assertEquals(o, null, "Failure message to keep"); assertNotEquals(o, null); assertNotEquals(o, null, "Failure message to keep"); } public void shouldMoveConstantAsExpectedArgInWithEquals(Object o) throws Exception { Assert.assertEquals(42, o); Assert.assertEquals(42, o, "Failure message to keep"); Assert.assertNotEquals(42, o); Assert.assertNotEquals(42, o, "Failure message to keep"); assertEquals(42, o); assertEquals(42, o, "Failure message to keep"); assertNotEquals(42, o); assertNotEquals(42, o, "Failure message to keep"); } public void shouldMoveExpectedVariableAsExpectedArgWithEquals(Object o, int expected) throws Exception { Assert.assertEquals(expected, o); Assert.assertEquals(expected, o, "Failure message to keep"); Assert.assertNotEquals(expected, o); Assert.assertNotEquals(expected, o, "Failure message to keep"); assertEquals(expected, o); assertEquals(expected, o, "Failure message to keep"); assertNotEquals(expected, o); assertNotEquals(expected, o, "Failure message to keep"); // tests that this works according to levenshtein distance int expceted = 0; assertEquals(expceted, o); } public void shouldRefactorIfPrimitiveThenFail(int i1, int i2) throws Exception { if (i1 == i2) { Assert.fail(); } if (i1 == i2) { Assert.fail("Failure message to keep"); } if (i1 != i2) { Assert.fail(); } if (i1 != i2) { Assert.fail("Failure message to keep"); } if (i1 == i2) { fail(); } if (i1 == i2) { fail("Failure message to keep"); } if (i1 != i2) { fail(); } if (i1 != i2) { fail("Failure message to keep"); } } public void shouldRefactorIfSameObjectThenFail(Object o1, Object o2) throws Exception { if (o1 == o2) { Assert.fail(); } if (o1 == o2) { Assert.fail("Failure message to keep"); } if (o1 != o2) { Assert.fail(); } if (o1 != o2) { Assert.fail("Failure message to keep"); } if (o1 == o2) { fail(); } if (o1 == o2) { fail("Failure message to keep"); } if (o1 != o2) { fail(); } if (o1 != o2) { fail("Failure message to keep"); } } public void shouldRefactorIfNullThenFail(Object o1) throws Exception { if (o1 == null) { Assert.fail(); } if (o1 == null) { Assert.fail("Failure message to keep"); } if (o1 != null) { Assert.fail(); } if (o1 != null) { Assert.fail("Failure message to keep"); } if (null == o1) { Assert.fail(); } if (null == o1) { Assert.fail("Failure message to keep"); } if (null != o1) { Assert.fail(); } if (null != o1) { Assert.fail("Failure message to keep"); } if (o1 == null) { fail(); } if (o1 == null) { fail("Failure message to keep"); } if (o1 != null) { fail(); } if (o1 != null) { fail("Failure message to keep"); } if (null == o1) { fail(); } if (null == o1) { fail("Failure message to keep"); } if (null != o1) { fail(); } if (null != o1) { fail("Failure message to keep"); } } public void shouldRefactorIfObjectThenFail(Object o1, Object o2) throws Exception { if (o1.equals(o2)) { Assert.fail(); } if (o1.equals(o2)) { Assert.fail("Failure message to keep"); } if (!o1.equals(o2)) { Assert.fail(); } if (!o1.equals(o2)) { Assert.fail("Failure message to keep"); } if (o1.equals(o2)) { fail(); } if (o1.equals(o2)) { fail("Failure message to keep"); } if (!o1.equals(o2)) { fail(); } if (!o1.equals(o2)) { fail("Failure message to keep"); }] } public v...> at org.junit.Assert.assertEquals(Assert.java:123) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:125) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[33](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.067 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[34](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.091 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[35](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.066 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[36](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.068 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) testRefactoring[37](org.autorefactor.refactoring.rules.RefactoringRulesTest) Time elapsed: 0.07 sec <<< ERROR! org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1065) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) at org.eclipse.swt.widgets.Display.create(Display.java:805) at org.eclipse.swt.graphics.Device.(Device.java:130) at org.eclipse.swt.widgets.Display.(Display.java:696) at org.eclipse.swt.widgets.Display.(Display.java:687) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) at org.autorefactor.refactoring.Refactorings.applyEditsToDocument(Refactorings.java:403) at org.autorefactor.refactoring.Refactorings.applyTo(Refactorings.java:384) at org.autorefactor.ui.ApplyRefactoringsJob.applyRefactoring(ApplyRefactoringsJob.java:228) at org.autorefactor.refactoring.rules.RefactoringRulesTest.testRefactoring0(RefactoringRulesTest.java:116) at org.autorefactor.refactoring.rules.RefactoringRulesTest.access$0(RefactoringRulesTest.java:92) Results : Failed tests: RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:125 Collection: wrong output; expected:<...w ArrayList([col); } public void doNotReplaceStackCtor(List col, List output) { output = new Stack(); output.addAll(col); } public List replaceNewNoArgsThenAddAll(List col) { final List output = new ArrayList(col); return output; } public List replaceNewOneArgThenAddAll(List col) { final List output = new ArrayList(col); return output; } public List replaceNewCollectionSizeThenAddAll(List col) { final List output = new ArrayList(col); return output; } public List doNotReplaceNewThenAddAllIncompatibleTypes(List col) { final List output = new ArrayList<>(); output.addAll(col); return output; } public Object replaceNewThenAddAllParameterizedType(Map map) { List> output = new ArrayList>(map.entrySet()); return output; } public void replaceAddWithForLoopByCollectionsAddAll( List output, java.util.Date[] elems1, java.sql.Date[] elems2) { java.util.Collections.addAll(output, elems1); java.util.Collections.addAll(output, elems2); } public void replaceAddWithForEachByCollectionsAddAll( List output, java.util.Date[] elems1, java.sql.Date[] elems2) { java.util.Collections.addAll(output, elems1); java.util.Collections.addAll(output, elems2); } public void doNotRefactorForEachWithListUsingLoopVariable( Map> mapToFill, List inputList) { for (String input : inputList) { mapToFill.get(input).add(input); } } public void doNotRefactorForLoopWithListUsingLoopIndex( Map> mapToFill, List inputList) { for (int i = 0; i < inputList.size(); i++) { mapToFill.get(inputList.get(i)).add(inputList.get(i)); } } public void doNotRefactorForLoopWithListUsingLoopIterator( Map> mapToFill, List inputList) { String input = null; for (Iterator it = inputList.iterator(); it.hasNext(); input = it.next()) { mapToFill.get(input).add(input); } } public void doNotRefactorForLoopWithListUsingLoopIterator(List col) { for (Iterator it = col.iterator(); it.hasNext();) { System.out.println(it.next()); } } public void doNotRefactorForEachWithArrayUsingLoopVariable( Map> mapToFill, String[] inputArray) { for (String input : inputArray) { mapToFill.get(input).add(input); } } public void doNotRefactorForLoopWithArrayUsingLoopIndex( Map> mapToFill, String[] inputArray) { for (int i = 0; i < inputArray.length; i++) { mapToFill.get(inputArray[i]).add(inputArray[i]); } } public void doNotRefactorForLoopAddMethodResult(List output, String[] elems) { for (int i = 0; i < elems.length; i++) { output.add(doSomething(elems[i])); } } public void doNotRefactorForEachAddMethodResult(List output, String[] elems) { for (String s : elems) { output.add(doSomething(s)); } } public void replaceAddWithForLoopByAddAll(List col, List output) { output.addAll(col); } public void replaceAddWithForEachByAddAll(Collection col, List output) { output.addAll(col); } public void replaceContainsWithForLoopByContainsAll(List col, List output) { output.containsAll(col); } public void replaceContainsWithForEachByContainsAll(Collection col, List output) { output.containsAll(col); } public void replaceRemoveWithForLoopByRemoveAll(List col, List output) { output.removeAll(col); } public void replaceRemoveWithForEachByRemoveAll(Collection col, List output) { output.removeAll(col); } public void doNotRefactorForLoopAddMethodResult(List output, List col) { for (int i = 0; i < col.size(); i++) { output.add(doSomething(col.get(i))); } } public void doNotRefactorForEachAddMethodResult(List output, List col) { for (String s : col) { output.add(doSomething(s)); } } private String doSomething(String s) { return null; } public void replaceChecksOnSize(Collection col) { System.out.println(!col.isEmpty()); System.out.println(true); System.out.println(col.isEmpty()); System.out.println(col.isEmpty()); System.out.println(false); System.out.println(!col.isEmpty()); System.out.println(true); System.out.println(col.isEmpty()); System.out.println(col.isEmpty()); System.out.println(false); } public void replaceCheckOnSetContainsBeforeAdd(Set col, String s) { if (col.add(s)) { System.out.println("OK"); } else { System.out.println("KO"); } } public void replaceCheckOnSetContainsBeforeAdd2(Set col, String s) { if (!col.add(s)) { System.out.println("KO"); } else { System.out.println("OK"); } } public void doNotReplaceWhenCheckedValueIsDifferent(Set col) { if (!col.contains("this")) { col.add("that"); System.out.println("OK"); } } public void doNotReplaceWhenCollectionsAreDifferent(Set col1, Set col2) { if (!col1.contains("that")) { col2.add("that"); System.out.println("OK"); } } public void doNotReplaceCheckOnListContainsBeforeAdd(List col, String s) { if (!col.contains(s)) { col.add(s); System.out.println("OK"); } else { System.out.println("KO"); } } public class MySet extends AbstractSet { public MySet(List strings) { addAll(strings); } @Override public Iterator iterator() { return null; } @Override public int size() { return 0; } } public static Set refactorCollectionWithNoTypeArgument(List strings) { class MyHashSet extends HashSet { private static final long serialVersionUID = 1L; } final MyHashSet set = new MyHashSet(); set.addAll(strings);] return set;...> but was:<...w ArrayList([); output.addAll(col); } public void doNotReplaceStackCtor(List col, List output) { output = new Stack(); output.addAll(col); } public List replaceNewNoArgsThenAddAll(List col) { final List output = new ArrayList(); output.addAll(col); return output; } public List replaceNewOneArgThenAddAll(List col) { final List output = new ArrayList(0); output.addAll(col); return output; } public List replaceNewCollectionSizeThenAddAll(List col) { final List output = new ArrayList(col.size()); output.addAll(col); return output; } public List doNotReplaceNewThenAddAllIncompatibleTypes(List col) { final List output = new ArrayList<>(); output.addAll(col); return output; } public Object replaceNewThenAddAllParameterizedType(Map map) { List> output = new ArrayList>(); output.addAll(map.entrySet()); return output; } public void replaceAddWithForLoopByCollectionsAddAll( List output, java.util.Date[] elems1, java.sql.Date[] elems2) { for (int i = 0; i < elems1.length; i++) { output.add(elems1[i]); } for (int i = 0; i < elems2.length; i++) { output.add(elems2[i]); } } public void replaceAddWithForEachByCollectionsAddAll( List output, java.util.Date[] elems1, java.sql.Date[] elems2) { for (java.util.Date d : elems1) { output.add(d); } for (java.sql.Date d : elems2) { output.add(d); } } public void doNotRefactorForEachWithListUsingLoopVariable( Map> mapToFill, List inputList) { for (String input : inputList) { mapToFill.get(input).add(input); } } public void doNotRefactorForLoopWithListUsingLoopIndex( Map> mapToFill, List inputList) { for (int i = 0; i < inputList.size(); i++) { mapToFill.get(inputList.get(i)).add(inputList.get(i)); } } public void doNotRefactorForLoopWithListUsingLoopIterator( Map> mapToFill, List inputList) { String input = null; for (Iterator it = inputList.iterator(); it.hasNext(); input = it.next()) { mapToFill.get(input).add(input); } } public void doNotRefactorForLoopWithListUsingLoopIterator(List col) { for (Iterator it = col.iterator(); it.hasNext();) { System.out.println(it.next()); } } public void doNotRefactorForEachWithArrayUsingLoopVariable( Map> mapToFill, String[] inputArray) { for (String input : inputArray) { mapToFill.get(input).add(input); } } public void doNotRefactorForLoopWithArrayUsingLoopIndex( Map> mapToFill, String[] inputArray) { for (int i = 0; i < inputArray.length; i++) { mapToFill.get(inputArray[i]).add(inputArray[i]); } } public void doNotRefactorForLoopAddMethodResult(List output, String[] elems) { for (int i = 0; i < elems.length; i++) { output.add(doSomething(elems[i])); } } public void doNotRefactorForEachAddMethodResult(List output, String[] elems) { for (String s : elems) { output.add(doSomething(s)); } } public void replaceAddWithForLoopByAddAll(List col, List output) { for (int i = 0; i < col.size(); i++) { output.add(col.get(i)); } } public void replaceAddWithForEachByAddAll(Collection col, List output) { for (String s : col) { output.add(s); } } public void replaceContainsWithForLoopByContainsAll(List col, List output) { for (int i = 0; i < col.size(); i++) { output.contains(col.get(i)); } } public void replaceContainsWithForEachByContainsAll(Collection col, List output) { for (String s : col) { output.contains(s); } } public void replaceRemoveWithForLoopByRemoveAll(List col, List output) { for (int i = 0; i < col.size(); i++) { output.remove(col.get(i)); } } public void replaceRemoveWithForEachByRemoveAll(Collection col, List output) { for (String s : col) { output.remove(s); } } public void doNotRefactorForLoopAddMethodResult(List output, List col) { for (int i = 0; i < col.size(); i++) { output.add(doSomething(col.get(i))); } } public void doNotRefactorForEachAddMethodResult(List output, List col) { for (String s : col) { output.add(doSomething(s)); } } private String doSomething(String s) { return null; } public void replaceChecksOnSize(Collection col) { System.out.println(col.size() > 0); System.out.println(col.size() >= 0); System.out.println(col.size() == 0); System.out.println(col.size() <= 0); System.out.println(col.size() < 0); System.out.println(0 < col.size()); System.out.println(0 <= col.size()); System.out.println(0 == col.size()); System.out.println(0 >= col.size()); System.out.println(0 > col.size()); } public void replaceCheckOnSetContainsBeforeAdd(Set col, String s) { if (!col.contains(s)) { col.add(s); System.out.println("OK"); } else { System.out.println("KO"); } } public void replaceCheckOnSetContainsBeforeAdd2(Set col, String s) { if (col.contains(s)) { System.out.println("KO"); } else { col.add(s); System.out.println("OK"); } } public void doNotReplaceWhenCheckedValueIsDifferent(Set col) { if (!col.contains("this")) { col.add("that"); System.out.println("OK"); } } public void doNotReplaceWhenCollectionsAreDifferent(Set col1, Set col2) { if (!col1.contains("that")) { col2.add("that"); System.out.println("OK"); } } public void doNotReplaceCheckOnListContainsBeforeAdd(List col, String s) { if (!col.contains(s)) { col.add(s); System.out.println("OK"); } else { System.out.println("KO"); } } public class MySet extends AbstractSet { public MySet(List strings) { for (String s : strings) { add(s); } } @Override public Iterator iterator() { return null; } @Override public int size() { return 0; } } public static Set refactorCollectionWithNoTypeArgument(List strings) { class MyHashSet extends HashSet { private static final long serialVersionUID = 1L; } final MyHashSet set = new MyHashSet(); for (String s : strings) { set.add(s); }] return set;...> RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:125 MapEliminateKeySetCalls: wrong output; expected:<... int x = map.[size(); if (map.containsKey("hello")) { map.remove("hello"); } map.clear(); if (map].isEmpty()) { ...> but was:<... int x = map.[keySet().size(); if (map.keySet().contains("hello")) { map.keySet().remove("hello"); } map.keySet().clear(); if (map.keySet()].isEmpty()) { ...> RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:125 Map: wrong output; expected:<...Map([map); } public Map replaceNewNoArgsThenPutAll(Map map) { final Map output = new HashMap(map); return output; } public Map replaceNew0ArgThenPutAll(Map map) { final Map output = new HashMap(map); return output; } public Map replaceNew1ArgThenPutAll(Map map) { final Map output = new HashMap(map); return output; } public Map replaceNewMapSizeThenPutAll(Map map) { final Map output = new HashMap(map); return output; } public Map doNotReplaceNewThenAddAllIncompatibleTypes(Map map) { final Map output = new HashMap<>(); output.putAll(map); return output; } public void replaceChecksOnSize(Map map) { System.out.println(!map.isEmpty()); System.out.println(true); System.out.println(map.isEmpty()); System.out.println(map.isEmpty()); System.out.println(false); System.out.println(!map.isEmpty()); System.out.println(true); System.out.println(map.isEmpty()); System.out.println(map.isEmpty()); System.out.println(false]); } }> but was:<...Map([); output.putAll(map); } public Map replaceNewNoArgsThenPutAll(Map map) { final Map output = new HashMap(); output.putAll(map); return output; } public Map replaceNew0ArgThenPutAll(Map map) { final Map output = new HashMap(0); output.putAll(map); return output; } public Map replaceNew1ArgThenPutAll(Map map) { final Map output = new HashMap(0); output.putAll(map); return output; } public Map replaceNewMapSizeThenPutAll(Map map) { final Map output = new HashMap(map.size()); output.putAll(map); return output; } public Map doNotReplaceNewThenAddAllIncompatibleTypes(Map map) { final Map output = new HashMap<>(); output.putAll(map); return output; } public void replaceChecksOnSize(Map map) { System.out.println(map.size() > 0); System.out.println(map.size() >= 0); System.out.println(map.size() == 0); System.out.println(map.size() <= 0); System.out.println(map.size() < 0); System.out.println(0 < map.size()); System.out.println(0 <= map.size()); System.out.println(0 == map.size()); System.out.println(0 >= map.size()); System.out.println(0 > map.size()]); } }> RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:125 RemoveFieldsDefaultValues: wrong output; expected:<... private Object obj[; private String st; private byte by1, by2; private boolean bo; private char c1, c2; private short sh; private int i; private long l1, l2, l3; private float f1, f2, f3, f4; private double d1, d2; public Iterable getIterable() { return new Iterable() { private Collection aField; @Override public Iterator iterator() { return aField.iterator(); } }; } private enum MyEnum { ONE, TWO; String aField]; } private...> but was:<... private Object obj[ = null; private String st = null; private byte by1 = 0x0, by2 = 0; private boolean bo = false; private char c1 = 0, c2 = '\u0000'; private short sh = 0; private int i = 0; private long l1 = 0, l2 = 0l, l3 = 0L; private float f1 = 0, f2 = 0f, f3 = 0F, f4 = 0.0f; private double d1 = 0, d2 = 0.0; public Iterable getIterable() { return new Iterable() { private Collection aField = null; @Override public Iterator iterator() { return aField.iterator(); } }; } private enum MyEnum { ONE, TWO; String aField = null]; } private...> RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:125 ReplaceQualifiedNamesBySimpleNames: wrong output; expected:<...Sample { public [List removeQualifiedNameForImportNoWildcard(List l) { return l; } public Calendar removeQualifiedNameForImportWithWildcard(Calendar cal) { return cal; } public int removeQualifiedNameForStaticImportWithWildcard() { return DATE; } public boolean removeQualifiedNameForStaticMethodImport() { return emptyList().containsAll(emptyList()); } public boolean removeQualifiedNameForStaticFieldImport() { return EMPTY_LIST.containsAll(EMPTY_LIST); } public void doNotRemoveQualifiedNameForGenericStaticMethodImport() { acceptListString(Collections. emptyList()); } private void acceptListString(List l) { // nothing to do } public boolean removeQualifiedNameForStaticTypeImport(Entry e) { return e.getKey() != null; } public BigDecimal doNotRemoveQualifiedNameForConflictingFieldSimpleNameFromStaticImports() { return BigDecimal.ZERO; } public BigDecimal removeQualifiedNameForOverridingFieldSimpleNameFromStaticImports() { return ONE; } public Map doNotRemoveQualifiedNameForConflictingMethodSimpleName() { return Collections.emptyMap(); } public int removeQualifiedNameForNonConflictingLocalMethodSimpleName() { return emptyMap(); } private static int emptyMap() { return 0; } public Boolean removeQualifiedNameForJavaLangPackage() { return Boolean.TRUE; } public java.lang.Integer doNotRemoveQualifiedNameForConflictingTypeFromJavaLangPackage() { return new java.lang.Integer(0); } public Integer removeQualifiedNameForNonConflictingLocalType() { return new Integer(); } private static final class Integer { } public int doNotRemoveQualifiedNameForConflictingFieldSimpleName() { return Calendar.DAY_OF_WEEK_IN_MONTH; } public String removeQualifiedNameForNonConflictingLocalField() { return DAY_OF_WEEK_IN_MONTH; } private static final String DAY_OF_WEEK_IN_MONTH = "DAY_OF_WEEK_IN_MONTH"; static class A { private int replaceFromEnclosingType() { return emptyMap(); } } static class B { private int doNotReplaceCurrentTypeDiffers() { return ReplaceQualifiedNamesBySimpleNamesSample.emptyMap(); } static int emptyMap() { return 0; } } static class C { private int replaceFromCurrentType() { return emptyMap(); } static int emptyMap() { return 0; } } static class D extends C { private int replaceFromSuperType() { return ]emptyMap(); ...> but was:<...Sample { public [java.util.List removeQualifiedNameForImportNoWildcard(List l) { return l; } public java.util.Calendar removeQualifiedNameForImportWithWildcard(Calendar cal) { return cal; } public int removeQualifiedNameForStaticImportWithWildcard() { return java.util.Calendar.DATE; } public boolean removeQualifiedNameForStaticMethodImport() { return java.util.Collections.emptyList().containsAll(Collections.emptyList()); } public boolean removeQualifiedNameForStaticFieldImport() { return java.util.Collections.EMPTY_LIST.containsAll(Collections.EMPTY_LIST); } public void doNotRemoveQualifiedNameForGenericStaticMethodImport() { acceptListString(Collections. emptyList()); } private void acceptListString(List l) { // nothing to do } public boolean removeQualifiedNameForStaticTypeImport(Map.Entry e) { return e.getKey() != null; } public BigDecimal doNotRemoveQualifiedNameForConflictingFieldSimpleNameFromStaticImports() { return BigDecimal.ZERO; } public BigDecimal removeQualifiedNameForOverridingFieldSimpleNameFromStaticImports() { return BigDecimal.ONE; } public Map doNotRemoveQualifiedNameForConflictingMethodSimpleName() { return Collections.emptyMap(); } public int removeQualifiedNameForNonConflictingLocalMethodSimpleName() { return ReplaceQualifiedNamesBySimpleNamesSample.emptyMap(); } private static int emptyMap() { return 0; } public java.lang.Boolean removeQualifiedNameForJavaLangPackage() { return java.lang.Boolean.TRUE; } public java.lang.Integer doNotRemoveQualifiedNameForConflictingTypeFromJavaLangPackage() { return new java.lang.Integer(0); } public Integer removeQualifiedNameForNonConflictingLocalType() { return new ReplaceQualifiedNamesBySimpleNamesSample.Integer(); } private static final class Integer { } public int doNotRemoveQualifiedNameForConflictingFieldSimpleName() { return Calendar.DAY_OF_WEEK_IN_MONTH; } public String removeQualifiedNameForNonConflictingLocalField() { return ReplaceQualifiedNamesBySimpleNamesSample.DAY_OF_WEEK_IN_MONTH; } private static final String DAY_OF_WEEK_IN_MONTH = "DAY_OF_WEEK_IN_MONTH"; static class A { private int replaceFromEnclosingType() { return ReplaceQualifiedNamesBySimpleNamesSample.emptyMap(); } } static class B { private int doNotReplaceCurrentTypeDiffers() { return ReplaceQualifiedNamesBySimpleNamesSample.emptyMap(); } static int emptyMap() { return 0; } } static class C { private int replaceFromCurrentType() { return C.emptyMap(); } static int emptyMap() { return 0; } } static class D extends C { private int replaceFromSuperType() { return C.]emptyMap(); ...> RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:125 StringBuilder: wrong output; expected:<... sbuf.append("[foo ").append("bar ").append(0).append(1); sbui.append("foo ").append("bar ").append(0).append(1); sbuf.append("foo").append(0).append("bar").append(1); sbui.append("foo").append(0).append("bar").append(1); } public void replaceWithStringAppend() { String s1 = "foo " + "bar " + "baz"; String s2 = "foo " + "bar " + "baz"; String s3 = "" + 0 + 1 + "bar"; String s4 = "" + 0 + 1 + "bar"; String s5 = "foo"; String s6 = "foo"; String s7 = ""; String s8 = ""; String s9 = ""; String s10 = ""; String s11 = String.valueOf(0); String s12 = String.valueOf(0); String s13 = "foo " + "bar " + "baz"; String s14 = "foo " + "bar " + "baz"; } public void doNotReplaceWithStringAppend(StringBuffer sbuf, StringBuilder sbui) { String s5 = sbuf.append("foo ").append("bar").toString(); String s6 = sbui.append("foo ").append("bar").toString(); } public void removeUselessStringConcatenation() { String s1 = Integer.toString(42); String s2 = "foo " + 0 + "bar " + 1; String s3 = 1 + "foo"; } public void doNotRemoveStringConcatenation() { String s1 = 1 + ""; } public void removeUselessCallsToValueOfWithStringBuilderAppend( Object o, boolean b, char c, int i, long l, float f, double d) { StringBuilder sb = new StringBuilder(); sb.append(o); sb.append(b); sb.append(b); sb.append(c); sb.append(c); sb.append(i); sb.append(i); sb.append(l); sb.append(l); sb.append(f); sb.append(f); sb.append(d); sb.append(d); } public void removeUselessCallsToValueOfWithStringBufferAppend( Object o, boolean b, char c, int i, long l, float f, double d) { StringBuffer sb = new StringBuffer(); sb.append(o); sb.append(b); sb.append(b); sb.append(c); sb.append(c); sb.append(i); sb.append(i); sb.append(l); sb.append(l); sb.append(f); sb.append(f); sb.append(d); sb.append(d); } public void removeUselessCallsToToStringOfWithStringBuilderAppend( Object o, boolean bo, byte by, char c, short s, int i, long l, float f, double d) { StringBuilder sb = new StringBuilder(); sb.append(this); sb.append(o); sb.append(bo); sb.append(by); sb.append(c); sb.append(s); sb.append(i); sb.append(l); sb.append(f); sb.append(d); } public void removeUselessCallsToToStringOfWithStringBufferAppend( Object o, boolean bo, byte by, char c, short s, int i, long l, float f, double d) { StringBuffer sb = new StringBuffer(); sb.append(this); sb.append(o); sb.append(bo); sb.append(by); sb.append(c); sb.append(s); sb.append(i); sb.append(l); sb.append(f); sb.append(d); } public void removeSubstringDoubleArgsCallsWithAppend(String s) { new StringBuilder().append(s, 0, 1); new StringBuffer().append(s, 0, 1); new StringBuilder().append(s, 0, 1); new StringBuffer().append(s, 0, 1); } public void doNotRemoveSubstringSingleArgCallsWithAppend(String s) { new StringBuilder().append(s.substring(1)); new StringBuffer().append(s.substring(1)); } public void removeAppendEmptyString(StringBuilder builder, StringBuffer buffer) { } public final void doNotRefactorForAppendable(Appendable buf, Object o) throws IOException { buf.append(o.toString()); } public String formatTime(int hour, int min) { return (hour < 10 ? "0" + hour : hour) + ":" + (min < 10 ? "0" + min : min]); } }> but was:<... sbuf.append("[" + "foo ").append("bar " + 0).append("" + 1); sbui.append("" + "foo ").append("bar " + 0).append("" + 1); sbuf.append("foo" + 0 + "bar" + 1); sbui.append("foo" + 0 + "bar" + 1); } public void replaceWithStringAppend() { String s1 = new StringBuffer("foo ").append("bar ").append("baz").toString(); String s2 = new StringBuilder("foo ").append("bar ").append("baz").toString(); String s3 = new StringBuffer().append(0).append(1).append("bar").toString(); String s4 = new StringBuilder().append(0).append(1).append("bar").toString(); String s5 = new StringBuffer("foo").toString(); String s6 = new StringBuilder("foo").toString(); String s7 = new StringBuffer(0).toString(); String s8 = new StringBuilder(0).toString(); String s9 = new StringBuffer().toString(); String s10 = new StringBuilder().toString(); String s11 = new StringBuffer().append(0).toString(); String s12 = new StringBuilder().append(0).toString(); String s13 = (((new StringBuffer("foo ")).append("bar ")).append("baz")).toString(); String s14 = (((new StringBuilder("foo ")).append("bar ")).append("baz")).toString(); } public void doNotReplaceWithStringAppend(StringBuffer sbuf, StringBuilder sbui) { String s5 = sbuf.append("foo ").append("bar").toString(); String s6 = sbui.append("foo ").append("bar").toString(); } public void removeUselessStringConcatenation() { String s1 = Integer.toString(42) + "" + ""; String s2 = "foo " + "" + 0 + "" + "bar " + 1 + ""; String s3 = 1 + "" + "foo"; } public void doNotRemoveStringConcatenation() { String s1 = 1 + ""; } public void removeUselessCallsToValueOfWithStringBuilderAppend( Object o, boolean b, char c, int i, long l, float f, double d) { StringBuilder sb = new StringBuilder(); sb.append(String.valueOf(o)); sb.append(String.valueOf(b)); sb.append(Boolean.valueOf(b)); sb.append(String.valueOf(c)); sb.append(Character.valueOf(c)); sb.append(String.valueOf(i)); sb.append(Integer.valueOf(i)); sb.append(String.valueOf(l)); sb.append(Long.valueOf(l)); sb.append(String.valueOf(f)); sb.append(Float.valueOf(f)); sb.append(String.valueOf(d)); sb.append(Double.valueOf(d)); } public void removeUselessCallsToValueOfWithStringBufferAppend( Object o, boolean b, char c, int i, long l, float f, double d) { StringBuffer sb = new StringBuffer(); sb.append(String.valueOf(o)); sb.append(String.valueOf(b)); sb.append(Boolean.valueOf(b)); sb.append(String.valueOf(c)); sb.append(Character.valueOf(c)); sb.append(String.valueOf(i)); sb.append(Integer.valueOf(i)); sb.append(String.valueOf(l)); sb.append(Long.valueOf(l)); sb.append(String.valueOf(f)); sb.append(Float.valueOf(f)); sb.append(String.valueOf(d)); sb.append(Double.valueOf(d)); } public void removeUselessCallsToToStringOfWithStringBuilderAppend( Object o, boolean bo, byte by, char c, short s, int i, long l, float f, double d) { StringBuilder sb = new StringBuilder(); sb.append(toString()); sb.append(o.toString()); sb.append(Boolean.toString(bo)); sb.append(Byte.toString(by)); sb.append(Character.toString(c)); sb.append(Short.toString(s)); sb.append(Integer.toString(i)); sb.append(Long.toString(l)); sb.append(Float.toString(f)); sb.append(Double.toString(d)); } public void removeUselessCallsToToStringOfWithStringBufferAppend( Object o, boolean bo, byte by, char c, short s, int i, long l, float f, double d) { StringBuffer sb = new StringBuffer(); sb.append(toString()); sb.append(o.toString()); sb.append(Boolean.toString(bo)); sb.append(Byte.toString(by)); sb.append(Character.toString(c)); sb.append(Short.toString(s)); sb.append(Integer.toString(i)); sb.append(Long.toString(l)); sb.append(Float.toString(f)); sb.append(Double.toString(d)); } public void removeSubstringDoubleArgsCallsWithAppend(String s) { new StringBuilder().append(s.substring(0, 1)); new StringBuffer().append(s.substring(0, 1)); new StringBuilder().append(s.subSequence(0, 1)); new StringBuffer().append(s.subSequence(0, 1)); } public void doNotRemoveSubstringSingleArgCallsWithAppend(String s) { new StringBuilder().append(s.substring(1)); new StringBuffer().append(s.substring(1)); } public void removeAppendEmptyString(StringBuilder builder, StringBuffer buffer) { builder.append(""); buffer.append(""); } public final void doNotRefactorForAppendable(Appendable buf, Object o) throws IOException { buf.append(o.toString()); } public String formatTime(int hour, int min) { return new StringBuilder() .append(hour < 10 ? "0" + hour : hour) .append(":") .append(min < 10 ? "0" + min : min) .toString(]); } }> RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:125 TestNGAssert: wrong output; expected:<... Assert.assert[Equals(i1, i2); Assert.assertEquals(i1, i2, "Failure message to keep"); Assert.assertNotEquals(i1, i2); Assert.assertNotEquals(i1, i2, "Failure message to keep"); Assert.assertEquals(i1, i2); Assert.assertEquals(i1, i2, "Failure message to keep"); Assert.assertNotEquals(i1, i2); Assert.assertNotEquals(i1, i2, "Failure message to keep"); assertEquals(i1, i2); assertEquals(i1, i2, "Failure message to keep"); assertNotEquals(i1, i2); assertNotEquals(i1, i2, "Failure message to keep"); assertEquals(i1, i2); assertEquals(i1, i2, "Failure message to keep"); assertNotEquals(i1, i2); assertNotEquals(i1, i2, "Failure message to keep"); } public void shouldRefactorFailures() throws Exception { Assert.fail(); Assert.fail("Failure message to keep"); Assert.fail(); Assert.fail("Failure message to keep"); fail(); fail("Failure message to keep"); fail(); fail("Failure message to keep"); } public void shouldRemoveDeadChecks() throws Exception { } public void shouldRefactorNegatedConditions(boolean b) throws Exception { Assert.assertFalse(b); Assert.assertFalse(b, "Failure message to keep"); Assert.assertTrue(b); Assert.assertTrue(b, "Failure message to keep"); assertFalse(b); assertFalse(b, "Failure message to keep"); assertTrue(b); assertTrue(b, "Failure message to keep"); } public void shouldRefactorWithObjectReferences(Object o1, Object o2) throws Exception { Assert.assertSame(o1, o2); Assert.assertSame(o1, o2, "Failure message to keep"); Assert.assertNotSame(o1, o2); Assert.assertNotSame(o1, o2, "Failure message to keep"); Assert.assertSame(o1, o2); Assert.assertSame(o1, o2, "Failure message to keep"); Assert.assertNotSame(o1, o2); Assert.assertNotSame(o1, o2, "Failure message to keep"); assertSame(o1, o2); assertSame(o1, o2, "Failure message to keep"); assertNotSame(o1, o2); assertNotSame(o1, o2, "Failure message to keep"); assertSame(o1, o2); assertSame(o1, o2, "Failure message to keep"); assertNotSame(o1, o2); assertNotSame(o1, o2, "Failure message to keep"); } public void shouldRefactorWithObjects(Object o1, Object o2) throws Exception { Assert.assertEquals(o1, o2); Assert.assertEquals(o1, o2, "Failure message to keep"); Assert.assertNotEquals(o1, o2); Assert.assertNotEquals(o1, o2, "Failure message to keep"); Assert.assertEquals(o1, o2); Assert.assertEquals(o1, o2, "Failure message to keep"); Assert.assertNotEquals(o1, o2); Assert.assertNotEquals(o1, o2, "Failure message to keep"); assertEquals(o1, o2); assertEquals(o1, o2, "Failure message to keep"); assertNotEquals(o1, o2); assertNotEquals(o1, o2, "Failure message to keep"); assertEquals(o1, o2); assertEquals(o1, o2, "Failure message to keep"); assertNotEquals(o1, o2); assertNotEquals(o1, o2, "Failure message to keep"); } public void shouldRefactorNullCheckFirstArg(Object o) throws Exception { Assert.assertNull(o); Assert.assertNull(o, "Failure message to keep"); Assert.assertNotNull(o); Assert.assertNotNull(o, "Failure message to keep"); Assert.assertNull(o); Assert.assertNull(o, "Failure message to keep"); Assert.assertNotNull(o); Assert.assertNotNull(o, "Failure message to keep"); assertNull(o); assertNull(o, "Failure message to keep"); assertNotNull(o); assertNotNull(o, "Failure message to keep"); assertNull(o); assertNull(o, "Failure message to keep"); assertNotNull(o); assertNotNull(o, "Failure message to keep"); } public void shouldRefactorNullCheckSecondArg(Object o) throws Exception { Assert.assertNull(o); Assert.assertNull(o, "Failure message to keep"); Assert.assertNotNull(o); Assert.assertNotNull(o, "Failure message to keep"); Assert.assertNull(o); Assert.assertNull(o, "Failure message to keep"); Assert.assertNotNull(o); Assert.assertNotNull(o, "Failure message to keep"); assertNull(o); assertNull(o, "Failure message to keep"); assertNotNull(o); assertNotNull(o, "Failure message to keep"); assertNull(o); assertNull(o, "Failure message to keep"); assertNotNull(o); assertNotNull(o, "Failure message to keep"); } public void shouldRefactorNullCheckFirstArgWithEquals(Object o) throws Exception { Assert.assertNull(o); Assert.assertNull(o, "Failure message to keep"); Assert.assertNotNull(o); Assert.assertNotNull(o, "Failure message to keep"); assertNull(o); assertNull(o, "Failure message to keep"); assertNotNull(o); assertNotNull(o, "Failure message to keep"); } public void shouldRefactorNullCheckSecondArgWithEquals(Object o) throws Exception { Assert.assertNull(o); Assert.assertNull(o, "Failure message to keep"); Assert.assertNotNull(o); Assert.assertNotNull(o, "Failure message to keep"); assertNull(o); assertNull(o, "Failure message to keep"); assertNotNull(o); assertNotNull(o, "Failure message to keep"); } public void shouldMoveConstantAsExpectedArgInWithEquals(Object o) throws Exception { Assert.assertEquals(o, 42); Assert.assertEquals(o, 42, "Failure message to keep"); Assert.assertNotEquals(o, 42); Assert.assertNotEquals(o, 42, "Failure message to keep"); assertEquals(o, 42); assertEquals(o, 42, "Failure message to keep"); assertNotEquals(o, 42); assertNotEquals(o, 42, "Failure message to keep"); } public void shouldMoveExpectedVariableAsExpectedArgWithEquals(Object o, int expected) throws Exception { Assert.assertEquals(o, expected); Assert.assertEquals(o, expected, "Failure message to keep"); Assert.assertNotEquals(o, expected); Assert.assertNotEquals(o, expected, "Failure message to keep"); assertEquals(o, expected); assertEquals(o, expected, "Failure message to keep"); assertNotEquals(o, expected); assertNotEquals(o, expected, "Failure message to keep"); // tests that this works according to levenshtein distance int expceted = 0; assertEquals(o, expceted); } public void shouldRefactorIfPrimitiveThenFail(int i1, int i2) throws Exception { Assert.assertNotEquals(i1, i2); Assert.assertNotEquals(i1, i2, "Failure message to keep"); Assert.assertEquals(i1, i2); Assert.assertEquals(i1, i2, "Failure message to keep"); assertNotEquals(i1, i2); assertNotEquals(i1, i2, "Failure message to keep"); assertEquals(i1, i2); assertEquals(i1, i2, "Failure message to keep"); } public void shouldRefactorIfSameObjectThenFail(Object o1, Object o2) throws Exception { Assert.assertNotSame(o1, o2); Assert.assertNotSame(o1, o2, "Failure message to keep"); Assert.assertSame(o1, o2); Assert.assertSame(o1, o2, "Failure message to keep"); assertNotSame(o1, o2); assertNotSame(o1, o2, "Failure message to keep"); assertSame(o1, o2); assertSame(o1, o2, "Failure message to keep"); } public void shouldRefactorIfNullThenFail(Object o1) throws Exception { Assert.assertNotNull(o1); Assert.assertNotNull(o1, "Failure message to keep"); Assert.assertNull(o1); Assert.assertNull(o1, "Failure message to keep"); Assert.assertNotNull(o1); Assert.assertNotNull(o1, "Failure message to keep"); Assert.assertNull(o1); Assert.assertNull(o1, "Failure message to keep"); assertNotNull(o1); assertNotNull(o1, "Failure message to keep"); assertNull(o1); assertNull(o1, "Failure message to keep"); assertNotNull(o1); assertNotNull(o1, "Failure message to keep"); assertNull(o1); assertNull(o1, "Failure message to keep"); } public void shouldRefactorIfObjectThenFail(Object o1, Object o2) throws Exception { Assert.assertNotEquals(o1, o2); Assert.assertNotEquals(o1, o2, "Failure message to keep"); Assert.assertEquals(o1, o2); Assert.assertEquals(o1, o2, "Failure message to keep"); assertNotEquals(o1, o2); assertNotEquals(o1, o2, "Failure message to keep"); assertEquals(o1, o2); assertEquals(o1, o2, "Failure message to keep");] } public v...> but was:<... Assert.assert[True(i1 == i2); Assert.assertTrue(i1 == i2, "Failure message to keep"); Assert.assertTrue(i1 != i2); Assert.assertTrue(i1 != i2, "Failure message to keep"); Assert.assertFalse(i1 != i2); Assert.assertFalse(i1 != i2, "Failure message to keep"); Assert.assertFalse(i1 == i2); Assert.assertFalse(i1 == i2, "Failure message to keep"); assertTrue(i1 == i2); assertTrue(i1 == i2, "Failure message to keep"); assertTrue(i1 != i2); assertTrue(i1 != i2, "Failure message to keep"); assertFalse(i1 != i2); assertFalse(i1 != i2, "Failure message to keep"); assertFalse(i1 == i2); assertFalse(i1 == i2, "Failure message to keep"); } public void shouldRefactorFailures() throws Exception { Assert.assertTrue(false); Assert.assertTrue(false, "Failure message to keep"); Assert.assertFalse(true); Assert.assertFalse(true, "Failure message to keep"); assertTrue(false); assertTrue(false, "Failure message to keep"); assertFalse(true); assertFalse(true, "Failure message to keep"); } public void shouldRemoveDeadChecks() throws Exception { Assert.assertTrue(true); Assert.assertTrue(true, "Failure message to keep"); Assert.assertFalse(false); Assert.assertFalse(false, "Failure message to keep"); assertTrue(true); assertTrue(true, "Failure message to keep"); assertFalse(false); assertFalse(false, "Failure message to keep"); } public void shouldRefactorNegatedConditions(boolean b) throws Exception { Assert.assertTrue(!b); Assert.assertTrue(!b, "Failure message to keep"); Assert.assertFalse(!b); Assert.assertFalse(!b, "Failure message to keep"); assertTrue(!b); assertTrue(!b, "Failure message to keep"); assertFalse(!b); assertFalse(!b, "Failure message to keep"); } public void shouldRefactorWithObjectReferences(Object o1, Object o2) throws Exception { Assert.assertTrue(o1 == o2); Assert.assertTrue(o1 == o2, "Failure message to keep"); Assert.assertTrue(o1 != o2); Assert.assertTrue(o1 != o2, "Failure message to keep"); Assert.assertFalse(o1 != o2); Assert.assertFalse(o1 != o2, "Failure message to keep"); Assert.assertFalse(o1 == o2); Assert.assertFalse(o1 == o2, "Failure message to keep"); assertTrue(o1 == o2); assertTrue(o1 == o2, "Failure message to keep"); assertTrue(o1 != o2); assertTrue(o1 != o2, "Failure message to keep"); assertFalse(o1 != o2); assertFalse(o1 != o2, "Failure message to keep"); assertFalse(o1 == o2); assertFalse(o1 == o2, "Failure message to keep"); } public void shouldRefactorWithObjects(Object o1, Object o2) throws Exception { Assert.assertTrue(o1.equals(o2)); Assert.assertTrue(o1.equals(o2), "Failure message to keep"); Assert.assertTrue(!(o1.equals(o2))); Assert.assertTrue(!(o1.equals(o2)), "Failure message to keep"); Assert.assertFalse(!(o1.equals(o2))); Assert.assertFalse(!(o1.equals(o2)), "Failure message to keep"); Assert.assertFalse(o1.equals(o2)); Assert.assertFalse(o1.equals(o2), "Failure message to keep"); assertTrue(o1.equals(o2)); assertTrue(o1.equals(o2), "Failure message to keep"); assertTrue(!(o1.equals(o2))); assertTrue(!(o1.equals(o2)), "Failure message to keep"); assertFalse(!(o1.equals(o2))); assertFalse(!(o1.equals(o2)), "Failure message to keep"); assertFalse(o1.equals(o2)); assertFalse(o1.equals(o2), "Failure message to keep"); } public void shouldRefactorNullCheckFirstArg(Object o) throws Exception { Assert.assertTrue(null == o); Assert.assertTrue(null == o, "Failure message to keep"); Assert.assertTrue(null != o); Assert.assertTrue(null != o, "Failure message to keep"); Assert.assertFalse(null != o); Assert.assertFalse(null != o, "Failure message to keep"); Assert.assertFalse(null == o); Assert.assertFalse(null == o, "Failure message to keep"); assertTrue(null == o); assertTrue(null == o, "Failure message to keep"); assertTrue(null != o); assertTrue(null != o, "Failure message to keep"); assertFalse(null != o); assertFalse(null != o, "Failure message to keep"); assertFalse(null == o); assertFalse(null == o, "Failure message to keep"); } public void shouldRefactorNullCheckSecondArg(Object o) throws Exception { Assert.assertTrue(o == null); Assert.assertTrue(o == null, "Failure message to keep"); Assert.assertTrue(o != null); Assert.assertTrue(o != null, "Failure message to keep"); Assert.assertFalse(o != null); Assert.assertFalse(o != null, "Failure message to keep"); Assert.assertFalse(o == null); Assert.assertFalse(o == null, "Failure message to keep"); assertTrue(o == null); assertTrue(o == null, "Failure message to keep"); assertTrue(o != null); assertTrue(o != null, "Failure message to keep"); assertFalse(o != null); assertFalse(o != null, "Failure message to keep"); assertFalse(o == null); assertFalse(o == null, "Failure message to keep"); } public void shouldRefactorNullCheckFirstArgWithEquals(Object o) throws Exception { Assert.assertEquals(null, o); Assert.assertEquals(null, o, "Failure message to keep"); Assert.assertNotEquals(null, o); Assert.assertNotEquals(null, o, "Failure message to keep"); assertEquals(null, o); assertEquals(null, o, "Failure message to keep"); assertNotEquals(null, o); assertNotEquals(null, o, "Failure message to keep"); } public void shouldRefactorNullCheckSecondArgWithEquals(Object o) throws Exception { Assert.assertEquals(o, null); Assert.assertEquals(o, null, "Failure message to keep"); Assert.assertNotEquals(o, null); Assert.assertNotEquals(o, null, "Failure message to keep"); assertEquals(o, null); assertEquals(o, null, "Failure message to keep"); assertNotEquals(o, null); assertNotEquals(o, null, "Failure message to keep"); } public void shouldMoveConstantAsExpectedArgInWithEquals(Object o) throws Exception { Assert.assertEquals(42, o); Assert.assertEquals(42, o, "Failure message to keep"); Assert.assertNotEquals(42, o); Assert.assertNotEquals(42, o, "Failure message to keep"); assertEquals(42, o); assertEquals(42, o, "Failure message to keep"); assertNotEquals(42, o); assertNotEquals(42, o, "Failure message to keep"); } public void shouldMoveExpectedVariableAsExpectedArgWithEquals(Object o, int expected) throws Exception { Assert.assertEquals(expected, o); Assert.assertEquals(expected, o, "Failure message to keep"); Assert.assertNotEquals(expected, o); Assert.assertNotEquals(expected, o, "Failure message to keep"); assertEquals(expected, o); assertEquals(expected, o, "Failure message to keep"); assertNotEquals(expected, o); assertNotEquals(expected, o, "Failure message to keep"); // tests that this works according to levenshtein distance int expceted = 0; assertEquals(expceted, o); } public void shouldRefactorIfPrimitiveThenFail(int i1, int i2) throws Exception { if (i1 == i2) { Assert.fail(); } if (i1 == i2) { Assert.fail("Failure message to keep"); } if (i1 != i2) { Assert.fail(); } if (i1 != i2) { Assert.fail("Failure message to keep"); } if (i1 == i2) { fail(); } if (i1 == i2) { fail("Failure message to keep"); } if (i1 != i2) { fail(); } if (i1 != i2) { fail("Failure message to keep"); } } public void shouldRefactorIfSameObjectThenFail(Object o1, Object o2) throws Exception { if (o1 == o2) { Assert.fail(); } if (o1 == o2) { Assert.fail("Failure message to keep"); } if (o1 != o2) { Assert.fail(); } if (o1 != o2) { Assert.fail("Failure message to keep"); } if (o1 == o2) { fail(); } if (o1 == o2) { fail("Failure message to keep"); } if (o1 != o2) { fail(); } if (o1 != o2) { fail("Failure message to keep"); } } public void shouldRefactorIfNullThenFail(Object o1) throws Exception { if (o1 == null) { Assert.fail(); } if (o1 == null) { Assert.fail("Failure message to keep"); } if (o1 != null) { Assert.fail(); } if (o1 != null) { Assert.fail("Failure message to keep"); } if (null == o1) { Assert.fail(); } if (null == o1) { Assert.fail("Failure message to keep"); } if (null != o1) { Assert.fail(); } if (null != o1) { Assert.fail("Failure message to keep"); } if (o1 == null) { fail(); } if (o1 == null) { fail("Failure message to keep"); } if (o1 != null) { fail(); } if (o1 != null) { fail("Failure message to keep"); } if (null == o1) { fail(); } if (null == o1) { fail("Failure message to keep"); } if (null != o1) { fail(); } if (null != o1) { fail("Failure message to keep"); } } public void shouldRefactorIfObjectThenFail(Object o1, Object o2) throws Exception { if (o1.equals(o2)) { Assert.fail(); } if (o1.equals(o2)) { Assert.fail("Failure message to keep"); } if (!o1.equals(o2)) { Assert.fail(); } if (!o1.equals(o2)) { Assert.fail("Failure message to keep"); } if (o1.equals(o2)) { fail(); } if (o1.equals(o2)) { fail("Failure message to keep"); } if (!o1.equals(o2)) { fail(); } if (!o1.equals(o2)) { fail("Failure message to keep"); }] } public v...> Tests in error: AllRefactoringRulesTest.testRefactoring:77->access$0:86->testRefactoring0:103 » SWT AllRefactoringRulesTest.testRefactoring:77->access$0:86->testRefactoring0:103 » SWT AllRefactoringRulesTest.testRefactoring:77->access$0:86->testRefactoring0:103 » SWT AllRefactoringRulesTest.testRefactoring:77->access$0:86->testRefactoring0:103 » SWT AllRefactoringRulesTest.testRefactoring:77->access$0:86->testRefactoring0:103 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » NullPointer RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT RefactoringRulesTest.testRefactoring:83->access$0:92->testRefactoring0:116 » SWT Tests run: 67, Failures: 7, Errors: 36, Skipped: 0 [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] parent ............................................. SUCCESS [ 3.007 s] [INFO] org.autorefactor.plugin ............................ SUCCESS [ 5.500 s] [INFO] org.autorefactor.feature ........................... SUCCESS [ 0.446 s] [INFO] org.autorefactor.rules.samples ..................... SUCCESS [ 4.227 s] [INFO] org.autorefactor.plugin.tests ...................... FAILURE [ 25.010 s] [INFO] org.autorefactor.repository ........................ SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 53.230 s [INFO] Finished at: 2016-10-24T13:44:49+01:00 [INFO] Final Memory: 56M/784M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:0.23.1:test (default-test) on project org.autorefactor.plugin.tests: There are test failures. [ERROR] [ERROR] Please refer to /Users/luiscruz/dev/AutoRefactor/plugin.tests/target/surefire-reports for the individual test results. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn -rf :org.autorefactor.plugin.tests