Results 1 to 2 of 2

Thread: java 5 custom sequence mapping warnings

  1. #1
    xdm's Avatar
    xdm
    xdm is offline ZeroC Staff
    Name: Jose Gutierrez de la Concha
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Sep 2003
    Location
    La Coruņa, Spain
    Posts
    588

    java 5 custom sequence mapping warnings

    I get a javac warning when use java-5 Ice-3.2.0 and custom sequence mapping

    java version is Sun JDK 1.5.0.11

    Sample Slice
    Code:
    class ObjectMetadata{
                string objectId;
                string content;
                StringMap indexedKeys;
                StringMap storedKeys;
            };
            ["java:type:java.util.ArrayList"]sequence<ObjectMetadata>ObjectMetadataSeq;
    Compiler output
    Code:
    generate:
    [slice2java] slice2java  --output-dir /home/pepone/proyects/hydra-0.5.5/Services/java/SearchServer/generated -I/opt/Ice-3.2/slice -I/home/pepone/proyects/hydra-0.5.5/Services/slice /home/pepone/proyects/hydra-0.5.5/Services/slice/SearchServer/SearchServer.ice
    
    compile:
        [javac] Compiling 63 source files to /home/pepone/proyects/hydra-0.5.5/Services/java/SearchServer/classes
        [javac] Note: /home/pepone/proyects/hydra-0.5.5/Services/java/SearchServer/generated/Oz/ObjectMetadataSeqHelper.java uses unchecked or unsafe operations.
        [javac] Note: Recompile with -Xlint:unchecked for details.
    Is this code safe envent with the warnings or must i use other slice2java options to avoid this warnings?


    For use the java-2 mapping is needed to add the --meta java:java2 when compile slice files?

    Thanks

  2. #2
    mes's Avatar
    mes
    mes is online now ZeroC Staff
    Name: Mark Spruiell
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Feb 2003
    Location
    California
    Posts
    1,444
    Is this code safe envent with the warnings or must i use other slice2java options to avoid this warnings?
    The generated code is still safe to use. The Java compiler emits a warning because your metadata uses an untyped container (java.util.ArrayList). You could eliminate this warning by using java.util.ArrayList<ObjectMetadata> instead. Of course, if you are trying to remain compatible with both Java2 and Java5, then you should leave the metadata as it is and simply ignore the warning when compiling with Java5.
    For use the java-2 mapping is needed to add the --meta java:java2 when compile slice files?
    Yes, in Ice 3.2.0 the default mapping uses Java5 types; if you want to generate code that is compatible with Java2, you have to specify that metadata.

    Take care,
    - Mark

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. sequence to set mapping
    By peter in forum Help Center
    Replies: 6
    Last Post: 10-25-2011, 03:51 PM
  2. C# byte sequence mapping
    By kwaclaw in forum Comments
    Replies: 1
    Last Post: 11-28-2010, 03:27 PM
  3. Slice mapping for java.lang.Object
    By sattursa in forum Help Center
    Replies: 5
    Last Post: 06-02-2008, 04:15 PM
  4. Why is the Java mapping for consts the way it is?
    By mefoster in forum Help Center
    Replies: 1
    Last Post: 04-17-2007, 12:28 PM
  5. Replies: 4
    Last Post: 08-23-2006, 09:33 PM

Posting Permissions

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