Java get binary file data
4 stars based on
JDK - java getbinaryfile may throw CompilerError when looking for classes with spaces in their name. An error has occurred in the compiler; please file a java getbinaryfile report http: NItem4Impl I can provide the source files if needed.
I talked to Vella and he couldn't either, so so far it appears to be another problem that java getbinaryfile occurs when a Java VM is exec'd by the Harness. Vella is working on getting a java getbinaryfile reproducible test case.
Vella reproduced the problem, or at least java getbinaryfile very similar to the problem a CompilerError from "mangleInnerType"by writing a test Java program that "exec"s the rmic command, to simulate what the test harness does. As it turns out, the Java getbinaryfile is caused by passing all of the arguments to rmic as "one argument", so to java getbinaryfile, which can be simulated by putting them in quotes on the command line.
If you do not include spaces at either end, inside the java getbinaryfile, however, rmic will complain that it cannot find the class with the name of that entire quotation, which makes sense. If there is a space at either end, java getbinaryfile CompilerError will be produced; presumably, this is the behavior the harness is running into.
If all the arguments to rmic are correctly passed as individual arguments, then there is java getbinaryfile problem; the rmic works fine. In fact, the same behavior can be experienced without Vella's exec test; you just need to simulate the same argument weirdness on the command line.
The following output demonstrates the different possibilities: But there is no such class found, of course. But this CompilerError that happen in Type. OK, now I see what is going on here Up until very recently java getbinaryfile the JDK1.
For example, rmic "a b" was equivalent to rmic a b and apparently, the test harness was taking advantage of this. So, the harness in invoking rmic with arguments all strung together in one argument, and in the first case, since java getbinaryfile argument starts with a "-", it is considered an option, and it is flagged as an illegal option.
In the second and third cases, since it doesn't start with a "-", it is interpreted as a class name, and it can't find the class name, so it fails. Trying to look for the file, mangleInnerType needs to get called because class files are stored with mangled names. There are no inner java getbinaryfile involved here. But as mentioned above, mangleInnerType throws the CompilerError if, when it's done doing ". Therefore, the following cases do not throw CompilerErrors: I'm inclined to think that the bug fix for was correct; the tools should be consistent, and if java getbinaryfile do need to use arguments with spaces, it should be supported if you want to supply a directory name with a space in it to the "-d" option, for example.
The "real" problem is that the CompilerError can get thrown; the failure shouldn't be this ungraceful. Java getbinaryfile could be fixed in rmic, but I'm inclined to request that it get fixed in the compiler instead. But what about the harness?
It should be fixed to not pass arguments to rmic that way. The question is is that practical for our QA team right now? I'll leave this bug open until this is resolved. And I'll file a compiler bug about this problem.