Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 06-07-2007
xdm's Avatar
xdm xdm is online now
ZeroC Staff
 
Name: José Gutíerrez de la Concha Martínez
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Sep 2003
Location: La Coruña, Spain
Posts: 292
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
Reply With Quote
  #2 (permalink)  
Old 06-07-2007
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 971
Quote:
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.
Quote:
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
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Why is the Java mapping for consts the way it is? mefoster Help Center 1 04-17-2007 01:28 PM
supressing warnings in ice generated c# code Lothar Kraner Help Center 3 03-20-2007 10:09 AM
Another solution about package mapping in Java rc_hz Comments 4 08-23-2006 10:33 PM
PHP5 Strict warnings Sander Bug Reports 1 01-26-2006 08:01 PM
Questions about sanity-check of sequence sizes during sequence unmarshaling rc_hz Help Center 4 06-22-2005 10:33 PM


All times are GMT -4. The time now is 11:51 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.