United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7126832 com.sun.tools.javac.api.ClientCodeWrapper$WrappedJavaFileManager cannot be cast
JDK-7126832 : com.sun.tools.javac.api.ClientCodeWrapper$WrappedJavaFileManager cannot be cast

Details
Type:
Bug
Submit Date:
2012-01-03
Status:
Closed
Updated Date:
2012-08-15
Project Name:
JDK
Resolved Date:
2012-02-24
Component:
tools
OS:
windows_7
Sub-Component:
javah
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:

Related Reports
Backport:
Duplicate:
Relates:
Relates:

Sub Tasks

Description
FULL PRODUCT VERSION :


A DESCRIPTION OF THE PROBLEM :
An exception has occurred in the compiler (1.7.0_02). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
java.lang.ClassCastException: com.sun.tools.javac.api.ClientCodeWrapper$WrappedJavaFileManager cannot be cast to com.sun.tools.javac.file.JavacFileManager
	at com.sun.tools.javac.main.Main.compile(Main.java:413)
	at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:132)
	at com.sun.tools.javah.JavahTask.run(JavahTask.java:513)
	at com.sun.tools.javah.JavahTask.run(JavahTask.java:335)
	at com.sun.tools.javah.Main.main(Main.java:46)


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Just starting off with JNI.  Occurs when javah is run as an external tool in eclipse.


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
package com.redwoodsys.jvolcano.proto;

public class EngineFpgaJni {
	public native void set8(int offset, int value);
	public native int get8(int offset);
	public native void set16(int offset, int value);
	public native int get16(int offset);
	public native void set32(int offset, int value);
	public native int get32(int offset);
}

---------- END SOURCE ----------

                                    

Comments
SUGGESTED FIX

Preserve the names found on the javah command line as classnames into the javac processing so javac doesn't think they are source file names.
                                     
2012-01-24
EVALUATION

Refactoring occurred in JDK 7 to allow javah to use more of the functionality in javac.  This caused code in javac to think that xxx.java on the command line is a source code file (as it is for javac) instead of a classname (as it is for javah).
                                     
2012-01-24



Hardware and Software, Engineered to Work Together