Am 22.07.2016 um 14:35 schrieb Tudor Girba <tudor@tudorgirba.com>:
Hi,
I created test cases out of the ArgoUML and Guava systems.
There is still a problem with spring-core, but I did not figure it out yet.
Nevertheless, it would be great if you could try again and perhaps extend the analysis to other systems.
@Meinert: one thing that would be cool even if we do not have the all github would be to prepare a set of scripts like you offered for the Guava case. The thing is that for Guava, I tried to get the Maven dependencies and it did not work (at least not on the head of development). This means that I could not see what happens in the best case scenario when we have all libraries and we can resolve the dependencies.
What do you think?
Cheers,
Doru
On Jul 20, 2016, at 2:57 PM, Tudor Girba <tudor@tudorgirba.com> wrote:
Thanks! I will look at these.
Cheers,
Doru
On Jul 20, 2016, at 2:50 PM, Meinert Schwartau <m.schwartau@gmail.com> wrote:
Wie analysing guava I had similar problems:
git clone https://github.com/google/guava.git
cd guava
mvn dependency:copy-dependencies -DoutputDirectory=dependencies -DoverWriteSnapshots=true -DoverWriteReleases=false``
../jdt2famix/release/jdt2famix.sh
Then I got the following exception:
jdt2famix - parsing started - /Users/meinert/Develop/moose_parser/guava
jdt2famix - importing - /Users/meinert/Develop/moose_parser/guava/guava/src/com/google/common/annotations/Beta.java
jdt2famix - importing - /Users/meinert/Develop/moose_parser/guava/guava/src/com/google/common/annotations/GwtCompatible.java
jdt2famix - importing - /Users/meinert/Develop/moose_parser/guava/guava/src/com/google/common/annotations/GwtIncompatible.java
jdt2famix - importing - /Users/meinert/Develop/moose_parser/guava/guava/src/com/google/common/annotations/package-info.java
jdt2famix - importing - /Users/meinert/Develop/moose_parser/guava/guava/src/com/google/common/annotations/VisibleForTesting.java
jdt2famix - importing - /Users/meinert/Develop/moose_parser/guava/guava/src/com/google/common/base/Absent.java
jdt2famix - importing - /Users/meinert/Develop/moose_parser/guava/guava/src/com/google/common/base/AbstractIterator.java
jdt2famix - importing - /Users/meinert/Develop/moose_parser/guava/guava/src/com/google/common/base/Ascii.java
jdt2famix - importing - /Users/meinert/Develop/moose_parser/guava/guava/src/com/google/common/base/CaseFormat.java
Exception in thread "main" java.lang.ClassCastException: com.feenk.jdt2famix.model.famix.Enum cannot be cast to com.feenk.jdt2famix.model.famix.Method
at com.feenk.jdt2famix.injava.InJavaImporter.createInvocationFromMethodBinding(InJavaImporter.java:598)
at com.feenk.jdt2famix.injava.AstVisitor.visit(AstVisitor.java:293)
at org.eclipse.jdt.core.dom.MethodInvocation.accept0(MethodInvocation.java:231)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2782)
at org.eclipse.jdt.core.dom.EnumConstantDeclaration.accept0(EnumConstantDeclaration.java:260)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2782)
at org.eclipse.jdt.core.dom.EnumDeclaration.accept0(EnumDeclaration.java:281)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2782)
at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:212)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
at com.feenk.jdt2famix.injava.AstRequestor.acceptAST(AstRequestor.java:17)
at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:1029)
at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:636)
at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:990)
at com.feenk.jdt2famix.Importer.run(Importer.java:28)
at com.feenk.jdt2famix.injava.Main.main(Main.java:25)
Best regards
Meinert
2016-07-20 22:33 GMT+02:00 Meinert Schwartau <m.schwartau@gmail.com>:
As a first test I tried to import the spring framework from github (https://github.com/spring-projects/spring-framework) and got some exceptions e.g when I tried to import spring-core:
jdt2famix - importing - /Users/meinert/Develop/moose_parser/spring-framework/spring-core/src/main/java/org/springframework/util/SocketUtils.java
Exception in thread "main" java.lang.ClassCastException: org.eclipse.jdt.core.dom.EnumConstantDeclaration cannot be cast to org.eclipse.jdt.core.dom.ClassInstanceCreation
at com.feenk.jdt2famix.injava.InJavaImporter.ensureTypeFromAnonymousDeclaration(InJavaImporter.java:303)
at com.feenk.jdt2famix.injava.AstVisitor.visit(AstVisitor.java:119)
at org.eclipse.jdt.core.dom.AnonymousClassDeclaration.accept0(AnonymousClassDeclaration.java:141)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
---------- Weitergeleitete Nachricht ----------
From: Tudor Girba <tudor@tudorgirba.com>
To: Moose-related development <moose-dev@list.inf.unibe.ch>
Cc:
Date: Tue, 19 Jul 2016 07:41:05 -0600
Subject: [Moose-dev] [ann] jdt2famix standalone - alpha version
improve the error handling. As Java has a ton of edge cases, it would be great if you would use it to parse your systems and report possible errors. We would then manufacture test cases out of those.
I'll definitely give it a try. Because the number of people who'll try this out will be limited, to be sure that there aren't any bugs in this parser I suggest that we let it parse all java github projects. Then we could group the resulting errors (if there exists any ;-)) per error type, write tests for these edge cases and then fix them. If all of the java git hub projects can per parsed without errors then we could be really sure this parser can is at least to parse the edge cases without exceptions. For sure, we don't know if the result makes sense but at least it produces a result.
Getting the download url for all java github projects is very easy:
https://api.github.com/search/repositories?q=language:Java
Further optional parameters for this url for paging: {&page,per_page,sort,order}. Documentation for this request: https://developer.github.com/v3/search/#search-repositories
How do you think about it?
Best regards
Meinert
_______________________________________________
Moose-dev mailing list
Moose-dev@list.inf.unibe.ch
https://www.list.inf.unibe.ch/listinfo/moose-dev
--
www.tudorgirba.com
www.feenk.com
"We are all great at making mistakes."
--
www.tudorgirba.com
www.feenk.com
"One cannot do more than one can do."
Hi,
I created test cases out of the ArgoUML and Guava systems.
There is still a problem with spring-core, but I did not figure it out yet.
Nevertheless, it would be great if you could try again and perhaps extend the analysis to other systems.
@Meinert: one thing that would be cool even if we do not have the all github would be to prepare a set of scripts like you offered for the Guava case. The thing is that for Guava, I tried to get the Maven dependencies and it did not work (at least not on the head of development). This means that I could not see what happens in the best case scenario when we have all libraries and we can resolve the dependencies.
What do you think?
Cheers,
DoruOn Jul 20, 2016, at 2:57 PM, Tudor Girba <tudor@tudorgirba.com> wrote:Thanks! I will look at these.Cheers,DoruOn Jul 20, 2016, at 2:50 PM, Meinert Schwartau <m.schwartau@gmail.com> wrote:Wie analysing guava I had similar problems:git clone https://github.com/google/guava.gitcd guavamvn dependency:copy-dependencies -DoutputDirectory=dependencies -DoverWriteSnapshots=true -DoverWriteReleases=false``../jdt2famix/release/jdt2famix.shThen I got the following exception:jdt2famix - parsing started - /Users/meinert/Develop/moose_parser/guavajdt2famix - importing - /Users/meinert/Develop/moose_parser/guava/guava/src/com/google/common/annotations/Beta.javajdt2famix - importing - /Users/meinert/Develop/moose_parser/guava/guava/src/com/google/common/annotations/GwtCompatible.javajdt2famix - importing - /Users/meinert/Develop/moose_parser/guava/guava/src/com/google/common/annotations/GwtIncompatible.javajdt2famix - importing - /Users/meinert/Develop/moose_parser/guava/guava/src/com/google/common/annotations/package-info.javajdt2famix - importing - /Users/meinert/Develop/moose_parser/guava/guava/src/com/google/common/annotations/VisibleForTesting.javajdt2famix - importing - /Users/meinert/Develop/moose_parser/guava/guava/src/com/google/common/base/Absent.javajdt2famix - importing - /Users/meinert/Develop/moose_parser/guava/guava/src/com/google/common/base/AbstractIterator.javajdt2famix - importing - /Users/meinert/Develop/moose_parser/guava/guava/src/com/google/common/base/Ascii.javajdt2famix - importing - /Users/meinert/Develop/moose_parser/guava/guava/src/com/google/common/base/CaseFormat.javaException in thread "main" java.lang.ClassCastException: com.feenk.jdt2famix.model.famix.Enum cannot be cast to com.feenk.jdt2famix.model.famix.Methodat com.feenk.jdt2famix.injava.InJavaImporter.createInvocationFromMethodBinding(InJavaImporter.java:598)at com.feenk.jdt2famix.injava.AstVisitor.visit(AstVisitor.java:293)at org.eclipse.jdt.core.dom.MethodInvocation.accept0(MethodInvocation.java:231)at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2782)at org.eclipse.jdt.core.dom.EnumConstantDeclaration.accept0(EnumConstantDeclaration.java:260)at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2782)at org.eclipse.jdt.core.dom.EnumDeclaration.accept0(EnumDeclaration.java:281)at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2782)at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:212)at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)at com.feenk.jdt2famix.injava.AstRequestor.acceptAST(AstRequestor.java:17)at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:1029)at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:636)at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:990)at com.feenk.jdt2famix.Importer.run(Importer.java:28)at com.feenk.jdt2famix.injava.Main.main(Main.java:25)Best regardsMeinert2016-07-20 22:33 GMT+02:00 Meinert Schwartau <m.schwartau@gmail.com>:As a first test I tried to import the spring framework from github (https://github.com/spring-projects/spring-framework) and got some exceptions e.g when I tried to import spring-core:jdt2famix - importing - /Users/meinert/Develop/moose_parser/spring-framework/spring-core/src/main/java/org/springframework/util/SocketUtils.javaException in thread "main" java.lang.ClassCastException: org.eclipse.jdt.core.dom.EnumConstantDeclaration cannot be cast to org.eclipse.jdt.core.dom.ClassInstanceCreationat com.feenk.jdt2famix.injava.InJavaImporter.ensureTypeFromAnonymousDeclaration(InJavaImporter.java:303)at com.feenk.jdt2famix.injava.AstVisitor.visit(AstVisitor.java:119)at org.eclipse.jdt.core.dom.AnonymousClassDeclaration.accept0(AnonymousClassDeclaration.java:141)at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)---------- Weitergeleitete Nachricht ----------From: Tudor Girba <tudor@tudorgirba.com>To: Moose-related development <moose-dev@list.inf.unibe.ch>Cc:Date: Tue, 19 Jul 2016 07:41:05 -0600Subject: [Moose-dev] [ann] jdt2famix standalone - alpha versionimprove the error handling. As Java has a ton of edge cases, it would be great if you would use it to parse your systems and report possible errors. We would then manufacture test cases out of those.I'll definitely give it a try. Because the number of people who'll try this out will be limited, to be sure that there aren't any bugs in this parser I suggest that we let it parse all java github projects. Then we could group the resulting errors (if there exists any ;-)) per error type, write tests for these edge cases and then fix them. If all of the java git hub projects can per parsed without errors then we could be really sure this parser can is at least to parse the edge cases without exceptions. For sure, we don't know if the result makes sense but at least it produces a result.Getting the download url for all java github projects is very easy:https://api.github.com/search/repositories?q=language:JavaFurther optional parameters for this url for paging: {&page,per_page,sort,order}. Documentation for this request: https://developer.github.com/v3/search/#search-repositoriesHow do you think about it?Best regardsMeinert_______________________________________________Moose-dev mailing listMoose-dev@list.inf.unibe.chhttps://www.list.inf.unibe.ch/listinfo/moose-dev--www.tudorgirba.comwww.feenk.com"We are all great at making mistakes."
--
www.tudorgirba.com
www.feenk.com
"One cannot do more than one can do."