Bug 46945 - Eclipse won't comple BiffViewer
Summary: Eclipse won't comple BiffViewer
Status: RESOLVED REMIND
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.5-dev
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-31 07:41 UTC by Axel Rose
Modified: 2009-03-31 09:27 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Axel Rose 2009-03-31 07:41:13 UTC
Eclipse complains about 70 ambiguous types and refuses to compile BiffViewer.

$ svn status -v src/java/org/apache/poi/hssf/dev/BiffViewer.java
           760389   722401 josh         src/java/org/apache/poi/hssf/dev/BiffViewer.java

example error message

line #111
The type AreaFormatRecord is ambiguous

suggested solutions by Eclipse:
either explicetely import 'org.apache.poi.hssf.record.AreaFormatRecord'
or 'org.apache.poi.hssf.record.chart.AreaFormatRecord'

I fear that taking the Eclipse warning off results in unreliable execution.
Comment 1 Nick Burch 2009-03-31 07:45:26 UTC
Eclipse compiles all of poi just fine for me

I suspect you've got two versions of poi on your eclipse path or something like that, and it's getting confused between the old and new versions. You'll need to just have one, consistent copy of poi
Comment 2 Axel Rose 2009-03-31 08:26:35 UTC
I cannot get around this.

POI is the only project open in Eclipse.
My .classpath looks like this:

<classpath>
        <classpathentry kind="src" path="build/ooxml-xsds/srcgen"/>
        <classpathentry kind="src" path="src/contrib/poi-ruby/java"/>
        <classpathentry kind="src" path="src/contrib/src"/>
        <classpathentry kind="src" path="src/examples/src"/>
        <classpathentry kind="src" path="src/java"/>
        <classpathentry kind="src" path="src/ooxml/interfaces-jdk15"/>
        <classpathentry kind="src" path="src/ooxml/java"/>
        <classpathentry kind="src" path="src/ooxml/testcases"/>
        <classpathentry kind="src" path="src/scratchpad/examples/src"/>
        <classpathentry kind="src" path="src/scratchpad/src"/>
        <classpathentry kind="src" path="src/scratchpad/testcases"/>
        <classpathentry kind="src" path="src/testcases"/>
        <classpathentry kind="lib" path="lib/commons-logging-1.1.jar"/>
        <classpathentry kind="lib" path="lib/junit-3.8.1.jar"/>
        <classpathentry kind="lib" path="lib/log4j-1.2.13.jar"/>
        <classpathentry kind="lib" path="ooxml-lib/dom4j-1.6.1.jar"/>
        <classpathentry kind="lib" path="ooxml-lib/geronimo-stax-api_1.0_spec-1.0.jar"/>
        <classpathentry kind="lib" path="ooxml-lib/jsr173_1.0_api.jar"/>
        <classpathentry kind="lib" path="ooxml-lib/ooxml-schemas-1.0.jar"/>
        <classpathentry kind="lib" path="ooxml-lib/ooxml-schemas.jar"/>
        <classpathentry kind="lib" path="ooxml-lib/openxml4j-1.0-beta.jar"/>
        <classpathentry kind="lib" path="ooxml-lib/xmlbeans-2.3.0.jar"/>
        <classpathentry kind="lib" path="src/contrib/poi-ruby/poi-2.0-final-20040126.jar"/>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
        <classpathentry kind="output" path="src/java"/>
</classpath>


This is what Eclipse sets up when importing a fresh svn tree.

OTOH I agree with Eclipse about the error.
BiffViewer uses
import org.apache.poi.hssf.record.*;

and references the type "AreaFormatRecord"

So I guess the import must be more explicit. AreaFormatRecord can be used
from anywhere within org.apache.poi.hssf.record, currently two places.
Comment 3 David Fisher 2009-03-31 08:49:23 UTC
Try taking out this:

path="src/contrib/poi-ruby/poi-2.0-final-20040126.jar"

That is another copy of poi. A very old one.

If Ruby support is important for you we should start a discussion on the poi dev email list. As it looks like the Ruby contribution we have is missing necessary glue.

Regards,
Dave
Comment 4 Axel Rose 2009-03-31 09:27:11 UTC
Thanks, resolved by removing the jar used by poi-ruby