On Jul 20, 2016, at 2:50 PM, Meinert Schwartau
<m.schwartau(a)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(a)gmail.com>om>:
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(a)tudorgirba.com>
To: Moose-related development <moose-dev(a)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(a)list.inf.unibe.ch
https://www.list.inf.unibe.ch/listinfo/moose-dev