VirtualBox

Changeset 31095 in vbox


Ignore:
Timestamp:
Jul 26, 2010 8:31:46 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
64047
Message:

Java: few warnings shut up

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r31038 r31095  
    43754375  VBOX_SEP=:
    43764376endif
    4377 VBOX_JAVAC_OPTS = -source 1.5 -target 1.5
     4377VBOX_JAVAC_OPTS = -source 1.5 -target 1.5 -Xlint:unchecked
    43784378
    43794379#
  • trunk/src/VBox/Main/glue/glue-java.xsl

    r31070 r31095  
    23842384    }
    23852385
     2386    @SuppressWarnings( "unchecked")
    23862387    public static <T> T[] unwrap(Class<T> wrapperClass, List<T> thisPtrs) {
    23872388        if (thisPtrs==null)
     
    23922393    }
    23932394
     2395    @SuppressWarnings( "unchecked" )
    23942396    public static <T> T queryInterface(Object obj, String uuid, Class<T> iface)
    23952397    {
     
    24092411    }
    24102412
     2413    @SuppressWarnings("unchecked")
    24112414    public static <T1 extends IUnknown,T2> T2[] unwrap2(Class<T1> wrapperClass1, Class<T2> wrapperClass2, List<T1> thisPtrs) {
    24122415        if (thisPtrs==null || thisPtrs.size() == 0)  return null;
     
    32073210    }
    32083211
     3212    @SuppressWarnings("unchecked" )
    32093213    public static <T1 extends Enum <T1>, T2 extends Enum <T2>> List<T2> convertEnums(Class<T1> fromClass,
    32103214                                                                                     Class<T2> toClass,
     
    32163220            List<T2> ret = new ArrayList<T2>(values.size());
    32173221            for (T1 v : values) {
    3218                 // static method is called with null this
     3222                // static method is called with null this               
    32193223                ret.add((T2)fromValue.invoke(null, v.name()));
    32203224            }
  • trunk/src/libs/xpcom18a4/java/src/org/mozilla/xpcom/INIParser.java

    r29140 r31095  
    5757public class INIParser {
    5858
    59   private HashMap mSections;
     59  private HashMap<String, Properties> mSections;
    6060
    6161  /**
     
    6363   * given path. <code>aCharset</code> specifies the character encoding of
    6464   * the file.
    65    * 
     65   *
    6666   * @param aFilename path of INI file to parse
    6767   * @param aCharset character encoding of file
     
    7777   * Creates a new <code>INIParser</code> instance from the INI file at the
    7878   * given path, which is assumed to be in the <code>UTF-8</code> charset.
    79    * 
     79   *
    8080   * @param aFilename path of INI file to parse
    8181   * @throws FileNotFoundException if <code>aFilename</code> does not exist.
     
    8989   * Creates a new <code>INIParser</code> instance from the given file.
    9090   * <code>aCharset</code> specifies the character encoding of the file.
    91    * 
     91   *
    9292   * @param aFile INI file to parse
    9393   * @param aCharset character encoding of file
     
    103103   * Creates a new <code>INIParser</code> instance from the given file,
    104104   * which is assumed to be in the <code>UTF-8</code> charset.
    105    * 
     105   *
    106106   * @param aFile INI file to parse
    107107   * @throws FileNotFoundException if <code>aFile</code> does not exist.
     
    114114  /**
    115115   * Parses given INI file.
    116    * 
     116   *
    117117   * @param aFile INI file to parse
    118118   * @param aCharset character encoding of file
     
    126126    BufferedReader reader = new BufferedReader(inStream);
    127127
    128     mSections = new HashMap();
     128    mSections = new HashMap<String, Properties>();
    129129    String currSection = null;
    130130
     
    166166      }
    167167
    168       Properties props = (Properties) mSections.get(currSection);
     168      Properties props = mSections.get(currSection);
    169169      if (props == null) {
    170170        props = new Properties();
     
    179179  /**
    180180   * Returns an iterator over the section names available in the INI file.
    181    * 
     181   *
    182182   * @return an iterator over the section names
    183183   */
     
    189189   * Returns an iterator over the keys available within a section.
    190190   *
    191    * @param aSection section name whose keys are to be returned 
     191   * @param aSection section name whose keys are to be returned
    192192   * @return an iterator over section keys, or <code>null</code> if no
    193193   *          such section exists
     
    217217    }
    218218
    219     Properties props = (Properties) mSections.get(aSection);
     219    Properties props = mSections.get(aSection);
    220220    if (props == null) {
    221221      return null;
     
    233233   */
    234234  public String getString(String aSection, String aKey) {
    235     Properties props = (Properties) mSections.get(aSection);
     235    Properties props = mSections.get(aSection);
    236236    if (props == null) {
    237237      return null;
     
    242242
    243243}
    244 
  • trunk/src/libs/xpcom18a4/java/src/org/mozilla/xpcom/Mozilla.java

    r29216 r31095  
    217217    try {
    218218      URL[] urls = new URL[1];
    219       urls[0] = new File("/System/Library/Java/").toURL();
     219      urls[0] = new File("/System/Library/Java/").toURI().toURL();
    220220      ClassLoader loader = new URLClassLoader(urls);
    221       Class bundleClass = Class.forName("com.apple.cocoa.foundation.NSBundle",
    222                                         true, loader);
     221      Class<?> bundleClass = Class.forName("com.apple.cocoa.foundation.NSBundle",
     222                                           true, loader);
    223223
    224224      // Get the bundle for this app.  If this is not executing from
     
    638638    URL[] urls = new URL[1];
    639639    try {
    640       urls[0] = jar.toURL();
     640      urls[0] = jar.toURI().toURL();
    641641    } catch (MalformedURLException e) {
    642642      throw new XPCOMInitializationException(e);
     
    970970   */
    971971  public static nsISupports queryInterface(nsISupports aObject, String aIID) {
    972     ArrayList classes = new ArrayList();
     972    ArrayList<Class> classes = new ArrayList<Class>();
    973973    classes.add(aObject.getClass());
    974974
    975975    while (!classes.isEmpty()) {
    976       Class clazz = (Class) classes.remove(0);
     976      Class clazz = classes.remove(0);
    977977
    978978      // Skip over any class/interface in the "java.*" and "javax.*" domains.
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette