pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Lehmkuehler <andr...@lehmi.de>
Subject Re: Can't Compile: cannot find symbol method getSpaceMapping()
Date Sun, 20 Jan 2013 13:13:51 GMT
Am 18.01.2013 10:58, schrieb Thomas Fischer:
> Hello,
>
> still stuck.
>
> First:
>
>>> [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ fontbox
---
>>> [INFO] Compiling 4 source files to /SVN/PDFbox/trunk/fontbox/target/test-classes
>>> [INFO] -------------------------------------------------------------
>>> [ERROR] COMPILATION ERROR :
>>> [INFO] -------------------------------------------------------------
>>> [ERROR] /SVN/PDFbox/trunk/fontbox/src/test/java/org/apache/fontbox/cff/Type1CharStringTest.java:[46,16]
parse(byte[]) in org.apache.fontbox.cff.Type1CharStringParser cannot be applied to (byte[],org.apache.fontbox.cff.IndexData)
>>> [ERROR] /SVN/PDFbox/trunk/fontbox/src/test/java/org/apache/fontbox/cff/Type1CharStringTest.java:[65,16]
parse(byte[]) in org.apache.fontbox.cff.Type1CharStringParser cannot be applied to (byte[],org.apache.fontbox.cff.IndexData)
>> Please double check the source of Type1CharStringTest.
>
> What do you mean?
Exactly what you did, double check if your local version is identical to the svn 
version.

> I use
> /SVN/PDFbox/trunk/fontbox/src/test/java/org/apache/fontbox/cff/Type1CharStringTest.java
(identical to the svn's version).
> In Type1CharStringTest.java I have in line 44 to 46
>
>          byte[] encodedCommands = new Type1CharStringFormatter().format(commands);
>          List<Object> decodedCommands = new Type1CharStringParser()
>                  .parse(encodedCommands, new IndexData(0));
>
> and in lines 63 t0 65
>
>          byte[] encodedNumbers = new Type1CharStringFormatter().format(numbers);
>          List<Object> decodedNumbers = new Type1CharStringParser()
>                  .parse(encodedNumbers, new IndexData(0));
>
> which obviously is what the compiler is complaining about.
> I dont understand enough of the whole system why this "cannot be applied to (byte[],org.apache.fontbox.cff.IndexData)".
> Should it be?
The method in the fontbox lib which is used here contains the old
implementation with one parameter.

>> Your environment looks good, Probably your local maven repository is somehow mixed
up. Remove the pdfbox/fontbox stuff and restart mvn clean install.
>
> I erased the .m2 folder in my home directory, but that didn't change anything (only took
more time to fetch the stuff again).
>
> Just to check I erased the file Type1CharStringTest.java and then fontbox compiled and
everything went through until I hit the old error again:
>
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
(default-compile) on project pdfbox: Compilation failure
> [ERROR] /SVN/PDFbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDSimpleFont.java:[525,52]
cannot find symbol
> [ERROR] symbol  : method getSpaceMapping()
> [ERROR] location: class org.apache.fontbox.cmap.CMap
>
> which refers to
>                      int spaceMapping = toUnicodeCmap.getSpaceMapping();
> in PDSimpleFont.java
>
> Why getSpaceMapping() is not found in public class CMap I don't understand. There is
>
>      /**
>       * Returns the mapping for the space character.
>       *
>       * @return the mapped code for the space character
>       */
>      public int getSpaceMapping()
>      {
>          return spaceMapping;
>      }
>
> inside.
> But what is it supposed to do and why isn't it found?
Same issue here, old fontbox version. The getSpaceMapping method is quite new.

> I could run the compilation with the -X switch again if it would help in any way.
It looks like maven is using an old version of fontbox and not the local
fresh compiled one. Did you set your classpath to any local installed version
of fontbox/pdfbox?
The -X switch activates a lot of logging and I'm not sure if something of that
will be helpful, but give it a try.

> Best
> Thomas

BR
Andreas Lehk├╝hler


Mime
View raw message