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.

Bug 269785 - StringIndexOutOfBoundsException: String index out of range: 2
Summary: StringIndexOutOfBoundsException: String index out of range: 2
Status: NEW
Alias: None
Product: ide
Classification: Unclassified
Component: Code (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: issues@ide
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-09 18:48 UTC by Bernd_L
Modified: 2017-05-19 09:58 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 221329


Attachments
stacktrace (4.28 KB, text/plain)
2017-02-09 18:48 UTC, Bernd_L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bernd_L 2017-02-09 18:48:39 UTC
Build: NetBeans IDE 8.1 (Build 201510222201)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.66-b18, Java(TM) SE Runtime Environment, 1.8.0_66-b18
OS: Windows 10

User Comments:
GUEST: Copy as rtf Plugin keeps breaking

Bernd_L: When having the Norway Today theme selected, and trying to RTF-Copy something with a backward Slash in it, this bug appears.
This Bug also sets the selected theme to Netbeans. Very annoying.

 Without NwToday, it just won't copy the Text.

GUEST: copy as rtf

GUEST: Trying to copy as RTF this source code:

package Huffman;

import java.util.ArrayList;
import GestioneIO.*;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.util.Collections;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.PriorityQueue;


public class Huffman {
    private NodoAlberoBinario root;
    private ArrayList<Carattere> frequenza;
    private Hashtable<Character, String> dizionario;
    private LeggiFile leggiFile;
    private ScriviFileBinario scriviFileBinario;
    private int dimensione = 0;
    private int dimensioneOutput;
    private String fileDizionario;
    
    public Huffman(String fileInput, String fileOutput, String fileDizionario) throws IOException{
        this.root = null;
        this.frequenza = new ArrayList<Carattere>();
        this.dizionario = new Hashtable<Character, String>();
        this.leggiFile = new LeggiFile(fileInput);
        this.scriviFi

GUEST: tried to copy 253 Lines of code (HTML, JS) to clipboard in RTF with RTF-Plugin

GUEST: RTF Copy/Paste Plugin - exception when copying JS

GUEST: I copied the Text as RTF (with a plugin). Now my theme changed from Norway Today to the Standard theme. I could change it back, though.




Stacktrace: 
java.lang.StringIndexOutOfBoundsException: String index out of range: 2
   at java.lang.String.charAt(String.java:658)
   at org.netbeans.modules.rtfcopypaste.converters.RtfConverter.tokenToRtf(RtfConverter.java:84)
   at org.netbeans.modules.rtfcopypaste.converters.RtfConverter.createContentRtf(RtfConverter.java:138)
   at org.netbeans.modules.rtfcopypaste.converters.RtfConverter.buildRtfFromTokens(RtfConverter.java:131)
   at org.netbeans.modules.rtfcopypaste.converters.RtfConverter.convertContentToRtf(RtfConverter.java:27)
   at org.netbeans.modules.rtfcopypaste.converters.SwapProfileRtfConverter.convertContentToRtf(SwapProfileRtfConverter.java:23)
Comment 1 Bernd_L 2017-02-09 18:48:42 UTC
Created attachment 163605 [details]
stacktrace
Comment 2 Exceptions Reporter 2017-05-19 09:58:20 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=221329