These are chat archives for JnRouvignac/AutoRefactor

24th
Oct 2016
Luis Cruz
@luiscruz
Oct 24 2016 12:34
Hi there!
I’ve just started trying to fix the issues with the PR
So I’ve exectuted `mvn clean install in the upstream/master and I am having errors
Execution summary:
Tests run: 66, Failures: 6, Errors: 36, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] parent ............................................. SUCCESS [  1.152 s]
[INFO] org.autorefactor.plugin ............................ SUCCESS [  5.622 s]
[INFO] org.autorefactor.feature ........................... SUCCESS [  0.455 s]
[INFO] org.autorefactor.rules.samples ..................... SUCCESS [  5.466 s]
[INFO] org.autorefactor.plugin.tests ...................... FAILURE [ 27.535 s]
[INFO] org.autorefactor.repository ........................ SKIPPED
[INFO] ------------------------------------------------------------------------
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 12:36
hello
yes
Luis Cruz
@luiscruz
Oct 24 2016 12:37
With my PR I have errors in a different part, but I would like to fix this before proceeding
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 12:37
I do not have enough info in what you posted :)
Luis Cruz
@luiscruz
Oct 24 2016 12:38
yea I know :sweat_smile:
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 12:38
ah
Luis Cruz
@luiscruz
Oct 24 2016 12:38
but it means you’re not expecting these errors, right?
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 12:38
nope
I think it passes on Travis CI?
and it passes locally for me
Luis Cruz
@luiscruz
Oct 24 2016 12:39
I hope I’m not messing with anything here :sweat_smile:
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 12:39
does it pass on your machine with upstream/master branch?
Luis Cruz
@luiscruz
Oct 24 2016 12:39
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
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 12:39
WTF
Luis Cruz
@luiscruz
Oct 24 2016 12:40
I will give you a txt file with the output
this is with the upstream/master indeed
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 12:41
here is what I have:
$ java -version
java version "1.7.0_111"
OpenJDK Runtime Environment (IcedTea 2.6.7) (7u111-2.6.7-0ubuntu0.14.04.3)
OpenJDK 64-Bit Server VM (build 24.111-b01, mixed mode)
$ mvn -version
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.7.0_111, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.2.0-30-generic", arch: "amd64", family: "unix"
what are yours?
Luis Cruz
@luiscruz
Oct 24 2016 12:44
java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)
mvn -version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T16:41:47+00:00)
Maven home: /Users/luiscruz/dev/apache-maven-3.3.9
Java version: 1.8.0_77, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.11.6", arch: "x86_64", family: “mac”
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 12:45
bleeding edge
Luis Cruz
@luiscruz
Oct 24 2016 12:46
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 12:46
can you install java 7 and test with it?
Luis Cruz
@luiscruz
Oct 24 2016 12:47
here’s the output. At some point I’ve noticed that the lsat commit was from september. So I’ve updated the repository and reran it, but the output is the same
sure, I’ll do that
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 12:48
hmmm
Luis Cruz
@luiscruz
Oct 24 2016 12:48
I have both installed. Is it possible to run mvn and specify java version?
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 12:48
maybe a platform specific issue
Luis Cruz
@luiscruz
Oct 24 2016 12:51
I’m now running with jdk 1.7.0_79
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 12:51
the NPE is genuine
I am about to commit a fix for it
Luis Cruz
@luiscruz
Oct 24 2016 12:53
alright
after running $ JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home mvn clean install I still get errors
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 12:55
I suspect a platform thing
Luis Cruz
@luiscruz
Oct 24 2016 12:55
Tests run: 67, Failures: 0, Errors: 43, Skipped: 0
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 12:55
seeing the error you have and that I do not have
Luis Cruz
@luiscruz
Oct 24 2016 12:55
yea
alright, if you need me to help you here just let me know.
Since in my PR I have errors at the org.autorefactor.plugin level, I will skip these errors for now and try to fix my PR
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 13:00
I think you can fix the PR without running locally
Travis CI shows the logs
it is slower than working locally, but hey
On MacOS: org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) :
     if (!NSThread.isMainThread()) {
         System.out.println ("***WARNING: Display must be created on main thread due to Cocoa restrictions."); //$NON-NLS-1$
         error(SWT.ERROR_THREAD_INVALID_ACCESS);
     }
Luis Cruz
@luiscruz
Oct 24 2016 13:02

Travis CI shows the logs

alright

Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 13:03
no such things in linux
Luis Cruz
@luiscruz
Oct 24 2016 13:03

On MacOS: org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) :

yea as you said, this is platform specific..

Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 13:03
time to split cleanly UI and backend?
arf
Luis Cruz
@luiscruz
Oct 24 2016 13:03
:D
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 13:05
Crap I do not have that much time right now :(
Luis Cruz
@luiscruz
Oct 24 2016 13:23
no worries, I don’t have a linux machine that I can use in the meantime. Do you think my changes would make aomething fail at this stage of the execution?
Luis Cruz
@luiscruz
Oct 24 2016 13:39
(since in my branch it fails at org.autorefactor.plugin...)
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 13:45
no
Luis Cruz
@luiscruz
Oct 24 2016 13:55
can you please check the PR? JnRouvignac/AutoRefactor#218
it is passing travis checks
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 13:58
merged
Luis Cruz
@luiscruz
Oct 24 2016 13:58
uhuhuhu my first contribution :sweat_smile:
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 14:02
congrats ;)
Luis Cruz
@luiscruz
Oct 24 2016 14:03
hehe just kidding :sweat_smile: I’ll try to rebase the rules one by one asap
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 14:04
I have a pushed a minor formatting change
JnRouvignac/AutoRefactor@95759b2
Luis Cruz
@luiscruz
Oct 24 2016 14:04
alright, let me check
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 14:04
I changed my mind a bit
Luis Cruz
@luiscruz
Oct 24 2016 14:04
hehe no worries ;)
I actually prefer the first style because it kinda lets me know where the statement has began, by checking identation
but it’s arguable, so I’ll try to commit with your style
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 14:07
I have never found the perfect combo for these :(
Luis Cruz
@luiscruz
Oct 24 2016 14:09
what is the reason to use your style? is it because it might be too much having a line just to close brackets?
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 14:10
I find this ugly indeed :(
we can also do that:
    public static boolean isMethod(MethodInvocation node, String typeQualifiedName,
            String methodName, String... parameterTypesQualifiedNames) {
        return node != null
            && isMethod(
                    node.resolveMethodBinding(), typeQualifiedName, methodName, parameterTypesQualifiedNames);
    }
fits the 120 lines leaving all the params on the same line
Luis Cruz
@luiscruz
Oct 24 2016 14:11
you mean 120 chars?
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 14:11
oh wait
I think the first problem in your PR was the use of tabs
fixed, but I push-forced
is it ok with you?
Luis Cruz
@luiscruz
Oct 24 2016 14:16
yea, sure!
indeed it had a tab, so it might have miscounted chars
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 14:17
8 chars I bet
Luis Cruz
@luiscruz
Oct 24 2016 14:17
;)
Luis Cruz
@luiscruz
Oct 24 2016 15:54
hey
are you aware of this failure?
org.junit.ComparisonFailure: Switch: wrong output; expected:<...
        switch (i1)[ {
        case 0:
            j = 0;
            break;
        case 1:
            j = 10;
            int k = 0;
            do {
                if (j == i1) {
                    break;
                }
                k++;
            } while (k < j);
            break;
        case 2:
            j = 20;
            for (int l = 0; l < j; l++) {
                if (j == i1) {
                    break;
                }
            }
            break;
        case 3:
            j = 25;
            j = 30;
            int m = 0;
            while (m < j) {
                if (j == i1) {
                    break;
                }
                m++;
            }
            break;
        case 4:
            j = 40;
            for (int o : new int[] { 1, 2, 3 }) {
                if (o == i1) {
                    break;
                }
            }
            break;
        case 5:
            j = 50;
            switch (j) {
            case 0:
                j = 0;
                break;
            case 1:
                j = 10;
                break;
            }
            break;
        ]}
    }

    public ...> but was:<...
        switch (i1)[{case 0:j = 0;break;case 1:j = 10;int k = 0;do {
            if (j == i1) {
                break;
            }
            k++;
        } while (k < j);break;case 2:j = 20;for (int l = 0; l < j; l++) {
            if (j == i1) {
                break;
            }
        }break;case 3:j = 25;j = 30;int m = 0;while (m < j) {
            if (j == i1) {
                break;
            }
            m++;
        }break;case 4:j = 40;for (int o : new int[] { 1, 2, 3 }) {
            if (o == i1) {
                break;
            }
        }break;case 5:j = 50;switch (j) {
        case 0:
            j = 0;
            break;
        case 1:
            j = 10;
            break;
        }break;]}
    }
this is on upstream/master
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 15:58
no
what does travis ci say?
ok?
I have not received a build failure
got to run now
chat tomorrow Luis
Luis Cruz
@luiscruz
Oct 24 2016 15:59
I can’t run it until the end but it runs the same as before
alright, no worries
chat again tomorrow
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 16:14
If your pr is building in travis ci then it is ok
Luis Cruz
@luiscruz
Oct 24 2016 16:17
yea but when I use a fresh upstream/master (or even my PR) it fails on this thins. It was working fine until today. Let me try with older commits to check whether is a problem on my side. I’ll let you know in a minute
It runs fine on commit 1c7a3a9af500eeb2d4a8ef837495cefb5f4463b7
does not pass on 56e862645227bb327c9cbda734ebe5fbeab87141
Luis Cruz
@luiscruz
Oct 24 2016 16:23
and it fails on c1cd5bad0a9346b9718b56517ff4cfa36c63ebc4
the failure is introduced in c1cd5bad0a9346b9718b56517ff4cfa36c63ebc4
JnRouvignac/AutoRefactor@c1cd5ba
you don’t have this failure while running tests with eclipse?
Jean-Noël Rouvignac
@JnRouvignac
Oct 24 2016 16:27
I need to try again