Im using this Code Part (in the class StatsController):

```
String spl_name = lne.substring(0, idx_firstnumber);
SpecialList spl = new SpecialList(spl_name);

```

Declarations (was desired):

```
String lne = "";
int idx_firstnumber = 0;

```

The variable "lne" has 127 characters. If I continue to debug, just one step, are the correct characters in the variable "spl\_name". With the next step I create a special list (normal list with special functions).

**EDIT: The variable "idx\_firstnumber" is 31.**

The code for the constructor is as follows:

```
//Klasse
public class SpecialList {

    //Variablen
    private ArrayList<SpecialListItem> _list = new ArrayList<SpecialListItem>();
    private String _name = "";

    //Konstruktor
    SpecialList(String name){
        _name = name;
    }

.. non relevant code

```

Image of the values in debugger and while debugging: 
<http://dancger.pf-control.de/images>

So, if I continue with F5, the program crashes with the error message "Source not found". In the debug windows is now that:

```
owns: Object  ?id=2235?
ClassNotFoundException?Throwable?.<init>?String, Throwable? line: 286
ClassNotFoundException?Exception?.<init>?String, Throwable? line: not available
ClassNotFoundException?ReflectiveOperationException?.<init>?String, Throwable? line: not available
ClassNotFoundException.<init>?String? line: not available
URLClassLoader$1.run?? line: not available
URLClassLoader$1.run?? line: not available
AccessController.doPrivileged?PrivilegedExceptionAction<T>, AccessControlContext? line: not available [native method]
Launcher$ExtClassLoader?URLClassLoader?.findClass?String? line: not available
Launcher$ExtClassLoader?ClassLoader?.loadClass?String, boolean? line: not available
Launcher$AppClassLoader?ClassLoader?.loadClass?String, boolean? line: not available
Launcher$AppClassLoader.loadClass?String, boolean? line: not available
Launcher$AppClassLoader?ClassLoader?.loadClass?String? line: not available
StatsController.readdatafromfile?String? line: 108
Frm_Main.btn_show_clicked?? line: 209 
Frm_Main.access$1?Frm_Main? line: 186 
Frm_Main$3.actionPerformed?ActionEvent? line: 139
JButton?AbstractButton?.fireActionPerformed?ActionEvent? line: not available
AbstractButton$Handler.actionPerformed?ActionEvent? line: not available
DefaultButtonModel.fireActionPerformed?ActionEvent? line: not available
DefaultButtonModel.setPressed?boolean? line: not available
BasicButtonListener.mouseReleased?MouseEvent? line: not available
Some more..

```

If i run the programm normal (no debugging), follow errormessage appears:

```
Exception in thread "AWT-EventQueue-0" java.lang.StringIndexOutOfBoundsException: String index out of range: 31
    at java.lang.String.substring(Unknown Source)
    at business.StatsController.readdatafromfile(StatsController.java:107)
    at gui.Frm_Main.btn_show_clicked(Frm_Main.java:209)
    at gui.Frm_Main.access$1(Frm_Main.java:186)
    at gui.Frm_Main$3.actionPerformed(Frm_Main.java:139)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$000(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)

```

And my question:
Why the program crashed or will crashing?

It's a normal class with a constructor which demands a string. And the string is filled!

Does anyone have an idea?

**EDIT 2: I've rebuild the full project. New Computer, new eclipse, new classes. Same Problem.**

**EDIT 3: The Problem is the variable `idx_firstnumber`. If I take 31 (Value of `idx_firstnumber`), it works. But if the program must work with these variable, it crashes.**

Because of Edit 3, the full Code of this method. I think the problem is there:

```
public boolean readdatafromfile(String pth){

        //Textinhalt holen
        String[] input = fc.GetFileContentAsLines(pth);

        //Inhalt prüfen
        if (input.length == 0){
            return false;
        }

        //Aktuelle Daten löschen
        datalist.clear();

        //Aktuellen Pfad ändern
        currentpath = pth;

        //Variablen
        int idx_firstnumber = 0;
        int idx_lastnumber = 0;
        boolean bl_readpolicies = false;

        //Auslesen
        for (int idx = 0; idx < input.length;idx++){

            //Zeile bestimmen
            String lne = input[idx];

            //Index oder Daten lesen
            if (!bl_readpolicies){

                //Index LastNumber lesen
                if (lne.trim().contains("AVG")){
                    idx_lastnumber = lne.substring(0, lne.indexOf("AVG")).length();
                }

                //Index FirstNumber lesen
                if (lne.trim().startsWith("01")){ //contains
                    idx_firstnumber = lne.substring(0,lne.indexOf("01")).length();
                }

                //Anfangspunkt suchen
                if (lne.startsWith("----------")){
                    bl_readpolicies = true;
                }

            } else {

                //Abbrechen wenn keine Daten mehr kommen
                if (lne == ""){
                    break;
                }

                /*if (idx_firstnumber >= lne.length()) {
                    throw new IllegalStateException("Index " + idx_firstnumber + " out of range " + lne.length() + " [" + lne + "]");
                }*/

                //Neue SpezialListe erstellen
                String spl_name = lne.substring(0, 31);//idx_firstnumber);
                //String x = lne.
                SpecialList spl = new SpecialList(spl_name);

                //Alle Einträge auslesen
                for(int idx2 = idx_firstnumber; idx2 <= idx_lastnumber; idx+=3){

                    //Auslesen der ANzahl Stunden
                    String anzstd_string;
                    try {
                        anzstd_string = lne.substring(idx2, 2);
                    } catch (Exception e) {
                        break;
                    }

                    //Prüfen ob numerisch
                    try {

                        //Parsen
                        int anzstd = Integer.parseInt(anzstd_string);

                        //Überschritten / Standard
                        if (anzstd > 48){
                            spl.add(new SpecialListItem(anzstd,enm_valuetyp.limitexceeded));
                        } else {
                            spl.add(new SpecialListItem(anzstd,enm_valuetyp.standard));
                        }
                    } catch (Exception e) {
                        switch (anzstd_string){
                            case "-":
                                spl.add(new SpecialListItem(0,enm_valuetyp.error));
                                break;
                            case "":
                                spl.add(new SpecialListItem(0, enm_valuetyp.blank));
                                break;
                            case "*":
                                spl.add(new SpecialListItem(0,enm_valuetyp.unfinished));
                                break;
                            default:
                                System.out.println("Fail AnzStd: " + anzstd_string);
                                break;
                        }
                    }

                }

                //Daten einer Reihe hinzufügen
                datalist.add(spl);

            }

        }

        //Erfolgreiche Rückgabe
        return true;

}

```

Edit 4: Well, i think i've got the problem. If i use 50x the char "a" for the variable `lne` it works. But what for a char is not allowed?!?

This is the value (between start and end without ":") from the string `lne`:

> 
> start:\_VXC\_POLICY\_ai\_b0\_cbw\_vs\_01 2 1 2 2 - - - - 1 1 1 1 1 1 1 1 :end
> 
> 
> 

Thanks in advance, greez Dancger :)