Bug 229277 - IllegalArgumentException: Illegal replacement
IllegalArgumentException: Illegal replacement
Status: NEW
Product: platform
Classification: Unclassified
Component: -- Other --
7.3
All All
: P3 (vote)
: TBD
Assigned To: issues@platform
issues@platform
EXCEPTIONS_REPORT
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-02 13:31 UTC by hindermath
Modified: 2013-12-27 12:09 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
stacktrace (2.77 KB, text/plain)
2013-05-02 13:31 UTC, hindermath
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hindermath 2013-05-02 13:31:55 UTC
Build: NetBeans IDE 7.3 (Build 201302132200)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.7-b01, Java(TM) SE Runtime Environment, 1.7.0_15-b03
OS: Mac OS X

User Comments:
GUEST: Attempt to save all files and build.

hindermath: Want to rename the project name.




Stacktrace: 
java.lang.IllegalArgumentException: Illegal replacement
   at java.nio.charset.CharsetEncoder.replaceWith(CharsetEncoder.java:285)
   at org.netbeans.api.queries.FileEncodingQuery$ProxyCharset$ProxyEncoder.encodeHead(FileEncodingQuery.java:397)
   at org.netbeans.api.queries.FileEncodingQuery$ProxyCharset$ProxyEncoder.encodeLoop(FileEncodingQuery.java:368)
   at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:561)
   at sun.nio.cs.StreamEncoder.flushLeftoverChar(StreamEncoder.java:242)
   at sun.nio.cs.StreamEncoder.implClose(StreamEncoder.java:301)
Comment 1 hindermath 2013-05-02 13:31:56 UTC
Created attachment 134039 [details]
stacktrace
Comment 2 Milos Kleint 2013-05-09 09:09:39 UTC
adding tzezula and sdedic on CC, I'm fairly clueless what the error means. You seem to have participated in the affected code in FileEncodingQuery.ProxyEncoder
thanks for any hints.
Comment 3 Tomas Zezula 2013-05-09 09:32:06 UTC
The problem seems to be that the delagate encoder does not support  given replacement.
In the time the replaceWith([B)V was called the delegate was not yet known, the replacement was stored for future when the delegate will be known. When the delegate was found the ProxyEncoder tries to set the replacement but it fails as the delegate does not support given replacement. The issue belongs to Platform/other (queries).

There are two possibilities how this may happen:
1st) The caller of the replaceWith([B)V does not checked isLegalReplacement([B)Z.
2nd) The isLegalReplacement([B)Z ended with different CharsetEncoder.

It may be probably safe to ignore the replacement in some cases, I will need to check if this is the case.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo