OK

I think I got it ...
It is in the tests and it is green

nicolas


De: "Matthias Junker" <junker.matt@gmail.com>
À: "Moose-related development" <moose-dev@iam.unibe.ch>
Envoyé: Jeudi 28 Avril 2011 19:20:58
Objet: [Moose-dev] Re: VerveineJ problem

Hey,
Will try this. I tried to parse the subprojects individually in the meantime and found another exception when parsing enums which override a method in an enum constant. Try parsing the following:

public enum TestEnum {

    A{
        @Override
        protected void foo() {
            super.foo();
        }},
    B,
    C;

    protected void foo(){

    }
}

it throws the following Exception:

Exception in thread "main" java.lang.ClassCastException: fr.inria.verveine.core.gen.famix.Enum cannot be cast to fr.inria.verveine.core.gen.famix.Class
at fr.inria.verveine.extractor.java.VerveineVisitor.visit(VerveineVisitor.java:510)
at org.eclipse.jdt.core.dom.SuperMethodInvocation.accept0(SuperMethodInvocation.java:237)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2528)
at org.eclipse.jdt.core.dom.ExpressionStatement.accept0(ExpressionStatement.java:144)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2551)
at org.eclipse.jdt.core.dom.Block.accept0(Block.java:136)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2528)
at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:504)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2551)
at org.eclipse.jdt.core.dom.AnonymousClassDeclaration.accept0(AnonymousClassDeclaration.java:143)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2528)
at org.eclipse.jdt.core.dom.EnumConstantDeclaration.accept0(EnumConstantDeclaration.java:260)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2551)
at org.eclipse.jdt.core.dom.EnumDeclaration.accept0(EnumDeclaration.java:280)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2551)
at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:219)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
at fr.inria.verveine.extractor.java.FamixRequestor.acceptAST(FamixRequestor.java:31)
at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:1016)
at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:628)
at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:982)
at fr.inria.verveine.extractor.java.VerveineJParser.parse(VerveineJParser.java:169)
at fr.inria.verveine.extractor.java.VerveineJParser.main(VerveineJParser.java:153)



On Thu, Apr 28, 2011 at 8:35 AM, Tudor Girba <tudor.girba@gmail.com> wrote:
Hi,

Nicolas, thanks for the clarification.

Matthias, could you try copying all the java files to a new folder?
For convenience, here is a bash script that would copy all files preserving the folder structure:

for file in $(find . -name '*.java'); do mkdir -p NEWFOLDER/$(dirname $file); cp $file NEWFOLDER/$(dirname $file); done

Cheers,
Doru


On 27 Apr 2011, at 23:49, Nicolas Anquetil wrote:

>
>
>>> ----- Mail original -----
>>>> De: "Tudor Girba" <tudor.girba@gmail.com>
>>>> À: "Moose-related development" <moose-dev@iam.unibe.ch>
>>>> Envoyé: Mercredi 27 Avril 2011 09:46:15
>>>> Objet: [Moose-dev] Re: VerveineJ problem
>>>> Hi,
>>>>
>>>> I had a similar problem before with the new inFusion which is also
>>>> based on JDT. In that case, the problem was due to inFusion relying
>>>> on
>>>> an Eclipse project and it got confused because of the .project file
>>>> from the root folder.
>>>>
>>>> Nicolas, would VerveineJ not be affected by a .project?
>>>
>>> You mean a .project that would not reference all the source that are
>>> in the path?
>>
>> I am just asking whether VerveineJ takes .project into account, or if
>> it always traverses deep all the sources starting from the root
>> folder. If it does consider a possible .project, it could be that the
>> problem stems from this.
>>
>> Cheers,
>> Doru
>
>
> No it dsoes not use .project afaik.
> It looks for all the java files in the directory(ies) it is given
>
> nicolas
>
> _______________________________________________
> Moose-dev mailing list
> Moose-dev@iam.unibe.ch
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"When people care, great things can happen."




_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev