Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

Scala class with function element makes Eclemma fail. #32

Closed
jolkdarr opened this issue Dec 26, 2012 · 6 comments
Closed

Scala class with function element makes Eclemma fail. #32

jolkdarr opened this issue Dec 26, 2012 · 6 comments
Assignees
Labels
Milestone

Comments

@jolkdarr
Copy link

I wanted to test a class with the following code:

    if (tree.getData.asInstanceOf[Boolean]) {
        def expand(item: TreeItem): Unit = {
            val parent_item = item.getParentItem
            if (parent_item != null)
                expand(parent_item)
            item setExpanded true
        }

        tree_items.values.asScala foreach expand
    }

I got an error message (see the image file).
If the expand function is converted to a private method, the test doesn't fail.

problem

@marchof
Copy link
Member

marchof commented Dec 26, 2012

Can you please provide the full stack trace from the .log file of your Eclipse workspace?

@jolkdarr
Copy link
Author

!ENTRY org.eclipse.core.jobs 4 2 2012-12-30 23:29:33.153
!MESSAGE An internal error occurred during: "Analyzing coverage session LINKS (30 déc. 2012 23:29:33)".
!STACK 0
java.lang.ClassCastException: scala.tools.eclipse.javaelements.ScalaFunctionElement cannot be cast to org.eclipse.jdt.core.IType
at com.mountainminds.eclemma.internal.core.analysis.TypeTraverser.processAnonymousInnerTypes(TypeTraverser.java:176)
at com.mountainminds.eclemma.internal.core.analysis.TypeTraverser.processType(TypeTraverser.java:163)
at com.mountainminds.eclemma.internal.core.analysis.TypeTraverser.processCompilationUnit(TypeTraverser.java:135)
at com.mountainminds.eclemma.internal.core.analysis.TypeTraverser.processPackageFragment(TypeTraverser.java:108)
at com.mountainminds.eclemma.internal.core.analysis.TypeTraverser.process(TypeTraverser.java:71)
at com.mountainminds.eclemma.internal.core.analysis.SessionAnalyzer.processPackageFragmentRoot(SessionAnalyzer.java:101)
at com.mountainminds.eclemma.internal.core.analysis.SessionAnalyzer.processSession(SessionAnalyzer.java:80)
at com.mountainminds.eclemma.internal.core.JavaCoverageLoader$LoadSessionJob.run(JavaCoverageLoader.java:81)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

@marchof
Copy link
Member

marchof commented Dec 31, 2012

Fixed, EclEmma now ignores non-JDT elemens. Please re-test from this update site:

https://download.eclipselab.org/eclemma/trunk/update

@Godin
Copy link
Member

Godin commented Dec 31, 2012

@marchof I have feeling that you forgot to push changes into Git repository - I don't see any commits related to this.

@marchof
Copy link
Member

marchof commented Dec 31, 2012

Sorry, you're right. Just pushed it.

@marchof marchof closed this as completed Dec 31, 2012
@jolkdarr
Copy link
Author

Hi Marc

No problem with the new patched bundle.
Thanks for the fix and all the best for the New Year.

@jacoco jacoco locked and limited conversation to collaborators Jan 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants