This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
NetBeans IDE 7.2 (Build 201207171143) Java: 1.7.0_05; Java HotSpot(TM) 64-Bit Server VM 23.1-b03 Windows 7 versão 6.1 em execução em amd64; Cp1252; pt_BR (nb) Exeception raised when save button is clicked (document with LATIN character): java.lang.IllegalStateException: Current state = FLUSHED, new state = CODING_END at java.nio.charset.CharsetEncoder.throwIllegalStateException(CharsetEncoder.java:968) at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:554) at org.netbeans.api.queries.FileEncodingQuery$ProxyCharset$ProxyEncoder.implFlush(FileEncodingQuery.java:432) at java.nio.charset.CharsetEncoder.flush(CharsetEncoder.java:650) at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:786) at java.nio.charset.CharsetEncoder.canEncode(CharsetEncoder.java:892) at java.nio.charset.CharsetEncoder.canEncode(CharsetEncoder.java:961) at org.netbeans.modules.xml.text.TextEditorSupport.saveDocument(TextEditorSupport.java:398) at org.netbeans.modules.xml.text.TextEditorSupport$Env.save(TextEditorSupport.java:646) at org.openide.actions.SaveAction.performAction(SaveAction.java:132) at org.openide.actions.SaveAction.performAction(SaveAction.java:102) at org.openide.actions.SaveAction$Delegate.actionPerformed(SaveAction.java:249) at org.openide.awt.ContextAction$Performer.actionPerformed(ContextAction.java:231) at org.openide.awt.ContextManager.actionPerformed(ContextManager.java:247) at org.openide.awt.ContextAction.actionPerformed(ContextAction.java:109) at org.openide.util.actions.ActionInvoker$1.run(ActionInvoker.java:93) at org.openide.util.actions.ActionInvoker$ActionRunnable.actionPerformed(ActionInvoker.java:162) at org.netbeans.core.ModuleActions.invokeAction(ModuleActions.java:109) at org.netbeans.modules.openide.actions.ActionsBridgeImpl.invokeAction(ActionsBridgeImpl.java:60) at org.openide.util.actions.ActionInvoker$ActionRunnable.doRun(ActionInvoker.java:153) at org.openide.util.actions.ActionInvoker$2.run(ActionInvoker.java:110) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1452) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2032)
Could you please attach the file, or a portion of it, which I could use to raise the error ? Thanks.
Created attachment 125302 [details] Error reproduction You have to put a latin character in body before try to save. (like ç, á, ã)
It worked before the last update.
sdedic, you're able to reproduce the problem?
Yes, thanks for the detailed report.
This defect can actually affect not only XMLs and is in the generic infrastructure. If triggered, the user may loose data (unsaved file).
Created attachment 126003 [details] Proposed fix The proxy encoder did not properly handle OVERFLOW condition during encodeHead
Tomasi, could you please review the fix (as one of the original authors) ?
there was a defect in FEQ delegating encoder in that during flush(), the delegate encoder was flushed although it did not encode all contents of the buffer because of output buffer's overflow.
Changeset: 4dbab72bb677 Author: Svata Dedic <sdedic@netbeans.org> Date: 2012-10-17 17:57 Message: Fixed behaviour on output buffer boundary/overflow
Integrated into 'main-golden', will be available in build *201210180002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/4dbab72bb677 User: Svata Dedic <sdedic@netbeans.org> Log: Issue #219447 - Error saving XML with LATIN character: fixed Fixed behaviour on output buffer boundary/overflow
The fix seems good to me.
*** Bug 220710 has been marked as a duplicate of this bug. ***
*** Bug 219267 has been marked as a duplicate of this bug. ***
*** Bug 226895 has been marked as a duplicate of this bug. ***