Microsoft SDK for Java

J5001-J5020

J5001 J5002 J5003
J5004 J5005 J5006
J5007 J5008 J5009
J5010 J5011 J5012
J5013 J5014 J5015
J5016 J5017 J5018
J5019 J5020  

J5001 - Local variable 'identifier' is initialized but never used

The compiler detected an initialized variable that was never referenced in any class code. This message occurs at warning level 3 or greater.

The following sample illustrates this warning.

public class Simple {
   
   public int method1() {
   
      int i = 1;
      return 1;
      // warning: 'i' is never used
   }
}

J5002 - Compiler option 'identifier' is not supported

The compiler that detected an unsupported command line option was specified. Check your compiler switch settings, and then try compiling again.

J5003 - Ignoring unknown compiler option 'identifier'

The compiler detected an unknown option specified on the jvc command line. This warning most likely occurs when a typographical error exists. For example, specifying /W4 on the command line will cause this warning because the warning level option must use a lowercase 'w'.

J5004 - Missing argument for compiler option 'identifier'

The compiler detected a valid command line option, but the required argument was not specified. Check your compiler switch settings and try compiling again.

J5005 - Package 'identifier' was already implicitly imported

The compiler detected an import statement for a package that was already implicitly imported, such as java.lang. This message occurs at warning level 1 or greater.

J5006 - 'private protected' not supported, using 'protected'

The compiler detected use of the modifier combination private protected. This combination is now obsolete and has been replaced by protected. This message occurs at warning level 1 or greater.

J5007 - Not used

This error message is currently not used.

J5008 - Not used

This error message is currently not used.

J5009 - Not used

This error message is currently not used.

J5010 - Not used

This error message is currently not used.

J5011 - Not used

This error message is currently not used.

J5012 - Not used

This error message is currently not used.

J5013 - Not used

This error message is currently not used.

J5014 - 'identifier' has been deprecated by the author of 'identifier'

The method or class referenced has been marked as deprecated. Deprecated methods or classes are marked by the creator of the source code as outdated and subject to removal. To keep code stable, avoid calling functions that have been flagged as deprecated.

J5015 - The parameter 'identifier' in an @com.parameters declaration does not match the corresponding argument 'identifier'

A COM interface parameter declaration does not match the method that implements the interface. This error could indicate inconsistent data types or mismatched parameter locations.

The following sample illustrates this warning.

/** @com.interface(iid=31415926-5358-9793-2384-612345678901, dual) */
interface ExampleInterface 
{
/** 
@com.method(dispid=306)
@com.parameters([type=BOOLEAN] when, on) 
*/
public String Method1(boolean on, int when); //Error, on and when
                                             // have changed order. 
}

J5016 - This 'instanceof' operator will always be true

The compiler determined that the specified instanceof expression will always evaluate to true. This could occur when instanceof is used to determine if a subclass instance is a member of a base class or an implemented interface. Although it is not an error to use the operator in this way, it is not useful because the expression will always evaluate to true.

The following sample illustrates this warning.

interface I {}
class X {}
class Y extends X implements I {}
public class Simple{
   void f()
   {
      Y y = new Y();
      X x = new X();
      Object o;
      // These statements result in J5016 warnings.
      if (y instanceof X){
         // y is of type Y, which extends X, so this is always true
      }
      if (y instanceof I){
         // type Y implements I, so this is always true.
      }
      if (x instanceof Object){
         // everything is of type Object
      }
   }
}

J5017 – Not used

This error message is currently not used.

J5018 – Class, interface, or package name contains characters not in the ASCII character set

The compiler detected a character that is not in the ASCII character set used for a class, interface, or package name. Some computer systems may not support this character. To ensure that your class, interface, or package name can be interpreted by virtual machines (VM) on other computer systems, change the invalid character to a valid character from the ASCII character set and compile again.

J5019 – Public member of COM-exposed class or interface contains characters not in the ASCII character set

The compiler detected a character that is not in the ASCII character set used for a method or field that is accessible to other languages via COM. Other languages may not support this character. To ensure that your member name can be accessed from other languages, change the character to a valid character from the ASCII character set and compile again.

J5020 - Directive @'identifier' ignored -- extensions are turned off

The Microsoft compiler for Java (jvc.exe) now disables Microsoft language extensions by default. This warning occurs when a program that uses the @com, @dll, or @security directives is compiled without enabling Microsoft language extensions. To compile code that uses Microsoft extensions, use the /x- option with jvc.

If you receive this warning, the .class file generated may not function properly. You should recompile using the /x- option. Failure to do so may result in the following error message when running your application:

Caught exception: java.lang.UnsatisfiedLinkError:Simple.MessageBox
Possible causes: If you are trying to use J/Direct (@dll.import),
check your compiler version (for JVC, requires 4336 or greater).
If you are trying to use RNI, there are new requirements: see 
documentation. Probably wrong version of Java compiler.

Compiling with the /x- option generates a message warning that the use of Microsoft extensions results in compiled code that will run only on Windows systems with the Microsoft virtual machine installed and may not run on other virtual machines. You can disable this message by using the /nomessage option with jvc. For example:

jvc /x- /nomessage Test.java

© 1999 Microsoft Corporation. All rights reserved. Terms of use.