Results 1 to 6 of 6
  1. #1
    yangxin1204 is offline Member
    Join Date
    Dec 2011
    Posts
    4
    Rep Power
    0

    Cool Help: StringBuffer.java error on mac laptop

    Dear experts

    Right now we faced an annoying issue only happening on mac laptop.
    Any suggestion or tips is very much appreciated.

    It happens on some mac while doesn't appear on others'. With same java version and build environment.

    The java version is:
    java version "1.6.0_24"
    Java(TM) SE Runtime Environment (build 1.6.0_24-b07-334-9M3326)
    Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02-334, mixed mode)

    The error is something like this.

    Install: out/target/product/cdma_spyder-p1c_spyder/system/framework/framework.jarCompiling SDK Stubs: out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/classes.jar
    out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src/java/lang/StringBuffer.java:60: reverse() is already defined in java.lang.StringBuffer

    We checked and found that, intermediate file out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src/java/lang/StringBuffer.java is different in my mac server and Ted's laptop.

    In my out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src/java/lang/StringBuffer.java
    function reverse() is only once.

    public synchronized java.lang.StringBuffer reverse() { throw new RuntimeException("Stub!"); }

    However in Ted's out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src/java/lang/StringBuffer.java, it is twice.

    public synchronized int lastIndexOf(java.lang.String arg0, int arg1) { throw new RuntimeException("Stub!"); }
    public synchronized java.lang.StringBuffer reverse() { throw new RuntimeException("Stub!"); }
    public synchronized java.lang.String toString() { throw new RuntimeException("Stub!"); }
    public java.lang.AbstractStringBuilder reverse() { throw new RuntimeException("Stub!"); }


    Do you know how this file java/lang/StringBuffer.java gets generated?

  2. #2
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,792
    Rep Power
    19

    Default Re: Help: StringBuffer.java error on mac laptop

    Considering that appears to be an Android thing, I suspect you have two different versions of Android there.

  3. #3
    yangxin1204 is offline Member
    Join Date
    Dec 2011
    Posts
    4
    Rep Power
    0

    Default Re: Help: StringBuffer.java error on mac laptop

    Hi Tolls,

    Thanks a lot for your reply.
    Yes we met this issue during the upmerge of google ics drop.
    Source code is same...

  4. #4
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,792
    Rep Power
    19

    Default Re: Help: StringBuffer.java error on mac laptop

    So this is an Android installation (or whatever) thing then?
    I'd have thought you'd have better luck in an Android forum?
    There is one here further down, but I'm not sure how much traffic it gets.

  5. #5
    yangxin1204 is offline Member
    Join Date
    Dec 2011
    Posts
    4
    Rep Power
    0

    Default Re: Help: StringBuffer.java error on mac laptop

    Thank you very much Tolls.
    I'll go to Android Forum to have a try.

  6. #6
    yangxin1204 is offline Member
    Join Date
    Dec 2011
    Posts
    4
    Rep Power
    0

    Default Re: Help: StringBuffer.java error on mac laptop

    Hi Tolls,

    One of my colleagues found a workaround but he still can't get a final solution.
    I copied it here:

    However, there seem to be a workaround, by manually invoking "javadoc" when the error happens, and then continue building.

    I used "strace" to monitor the "make -j2" command, to find that the files under "out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src" are created by "javadoc".

    Then when the build error happens, I find the intermediate file "out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src/java/io/PrintStream.java" is invalid (it has duplicated method declaration, one from super interface class, one from the class itself).

    Then, I manually run:
    javadoc \
    \@out/target/common/obj/JAVA_LIBRARIES/api-stubs_intermediates/droiddoc-src-list \
    -J-Xmx1280m \
    -doclet com.google.doclava.Doclava \
    -docletpath out/host/linux-x86/framework/jsilver.jar:out/host/linux-x86/framework/doclava.jar \
    -templatedir build/tools/droiddoc/templates-sdk \
    -htmldir frameworks/base/docs/html \
    -bootclasspath /opt/java/jdk6/lib/../jre/lib/rt.jar \
    -classpath out/target/common/obj/JAVA_LIBRARIES/bouncycastle_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar \
    -sourcepath frameworks/base/core/java:frameworks/base/graphics/java:frameworks/base/location/java:frameworks/base/media/java:frameworks/base/drm/java:frameworks/base/ethernet/java:frameworks/base/opengl/java:frameworks/base/sax/java:frameworks/base/telephony/java:frameworks/base/wifi/java:frameworks/base/keystore/java:frameworks/base/icu4j/java:frameworks/base/voip/java:out/target/common/obj/JAVA_LIBRARIES/bouncycastle_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar \
    -d out/target/common/docs/api-stubs \
    -hdf page.build 7.7.0_22-eng.w20048.20111209.152233 -hdf page.now "09 12 2011 15:23" \
    -knowntags ./frameworks/base/docs/knowntags.txt -since ./frameworks/base/api/1.xml 1 -since ./frameworks/base/api/2.xml 2 -since ./frameworks/base/api/3.xml 3 -since ./frameworks/base/api/4.xml 4 -since ./frameworks/base/api/5.xml 5 -since ./frameworks/base/api/6.xml 6 -since ./frameworks/base/api/7.xml 7 -since ./frameworks/base/api/8.xml 8 -since ./frameworks/base/api/9.xml 9 -since ./frameworks/base/api/10.xml 10 -since ./frameworks/base/api/11.xml 11 -since ./frameworks/base/api/12.xml 12 -since ./frameworks/base/api/13.xml 13 -since ./frameworks/base/api/14.txt 14 -werror -hide 113 -overview frameworks/base/core/java/overview.html -hdf sdk.version 4.0 -hdf sdk.rel.id 1 -hdf sdk.preview 0 -stubs out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src -api out/target/common/obj/PACKAGING/public_api.txt -nodocs

    Now, it's strange to see the newly created intermediate file "out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src/java/io/PrintStream.java" becomes correct.
    After that, I continue to "make -j2", and see the build survived and continued.

Similar Threads

  1. Problem with Java 64-bit on my laptop
    By Unqualified in forum New To Java
    Replies: 1
    Last Post: 05-07-2011, 11:17 PM
  2. Replies: 0
    Last Post: 08-11-2010, 08:19 AM
  3. Laptop Help
    By Lil_Aziz1 in forum Forum Lobby
    Replies: 9
    Last Post: 08-08-2010, 05:04 PM
  4. Replies: 3
    Last Post: 03-04-2009, 06:03 AM
  5. Replies: 1
    Last Post: 03-03-2009, 05:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •