APWTCL Arnulf's Preferred Web Tcl

Check-in [feccf5df40]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:fixes for java null pointer exceptions.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:feccf5df402c67a326c980a82fd779f87e8c6ffc
User & Date: arnulf 2014-02-09 21:29:04
Context
2014-02-12
21:15
added some temporary fields to interp. Will be replaced by Tcl commands later. check-in: 3f603ae819 user: arnulf tags: trunk
2014-02-09
21:29
fixes for java null pointer exceptions. check-in: feccf5df40 user: arnulf tags: trunk
2014-02-08
20:01
fixes and removed debugging stuff. check-in: cd21760ebb user: arnulf tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/org/apwtcl/lang/Parse.java.

1216
1217
1218
1219
1220
1221
1222
1223
1224



1225

1226
1227
1228
  /* ==================== feedChar ===================================== */
  private void feedChar() {
//print("FC!"+parse_info.index+"!"+parse_info.len+"!");
    parse_info.index++;
    parse_info.len--;
    if (parse_info.len < 0) {
//      throw new PanicException("End of file reached");
print("PANIC! End of file reached");
    }



    parse_info.cur = parse_info.text.charAt(parse_info.index);

  }

}







|

>
>
>
|
>



1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
  /* ==================== feedChar ===================================== */
  private void feedChar() {
//print("FC!"+parse_info.index+"!"+parse_info.len+"!");
    parse_info.index++;
    parse_info.len--;
    if (parse_info.len < 0) {
//      throw new PanicException("End of file reached");
print("PANIC! End of file reached for: "+parse_info.text+"!");
    }
    if (parse_info.text.isEmpty()) {
    	
    } else {
      parse_info.cur = parse_info.text.charAt(parse_info.index);
    }
  }

}

Changes to src/org/apwtcl/lang/objtype/ObjTypeBase.java.

46
47
48
49
50
51
52
53


54
55
56
57
58
59
60
..
68
69
70
71
72
73
74


75
76
77
78
79
80
81
...
103
104
105
106
107
108
109
110
    case OBJ_TYPE_INT:
      return true;
    case OBJ_TYPE_LIST:
      return true;
    case OBJ_TYPE_DICT:
      return true;
    case OBJ_TYPE_DOUBLE:
        return true;


    }
    return false;
  }

  /* ==================== callUpdateString ===================================== */
  public int callUpdateString(int obj_type, ApwtclObj obj_ptr) {
    switch (obj_type) {
................................................................................
      return OK;
    case OBJ_TYPE_DICT:
        interp.dict_obj_type.updateString(obj_ptr);
        return OK;
    case OBJ_TYPE_DOUBLE:
        interp.double_obj_type.updateString(obj_ptr);
        return OK;


    }
print("callUpdateString missing case for obj_type!"+getObjTypeString(obj_type)+"!");
    return OK;
  }

  /* ==================== haveDupInternalRep ===================================== */
  public boolean haveDupInternalRep(int obj_type) {
................................................................................
        return OK;
    }
print("callUpdateString missing case for obj_type!"+getObjTypeString(obj_type)+"!");
    return OK;
  }

}








|
>
>







 







>
>







 







<
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
..
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
...
107
108
109
110
111
112
113

    case OBJ_TYPE_INT:
      return true;
    case OBJ_TYPE_LIST:
      return true;
    case OBJ_TYPE_DICT:
      return true;
    case OBJ_TYPE_DOUBLE:
      return true;
    case OBJ_TYPE_SCRIPT:
      return true;
    }
    return false;
  }

  /* ==================== callUpdateString ===================================== */
  public int callUpdateString(int obj_type, ApwtclObj obj_ptr) {
    switch (obj_type) {
................................................................................
      return OK;
    case OBJ_TYPE_DICT:
        interp.dict_obj_type.updateString(obj_ptr);
        return OK;
    case OBJ_TYPE_DOUBLE:
        interp.double_obj_type.updateString(obj_ptr);
        return OK;
    case OBJ_TYPE_SCRIPT: 
      return OK;
    }
print("callUpdateString missing case for obj_type!"+getObjTypeString(obj_type)+"!");
    return OK;
  }

  /* ==================== haveDupInternalRep ===================================== */
  public boolean haveDupInternalRep(int obj_type) {
................................................................................
        return OK;
    }
print("callUpdateString missing case for obj_type!"+getObjTypeString(obj_type)+"!");
    return OK;
  }

}

Changes to src/org/apwtcl/lang/objtype/ScriptObjType.java.

162
163
164
165
166
167
168



169
170
171
172
173
174
175
  }

  /* ==================== getScript ================================== */
  public Script getScript(ApwtclObj obj_ptr) {
    int script_flags = 0;
    if (obj_ptr.obj_type == OBJ_TYPE_SCRIPT) {
      Script script = obj_ptr.scriptValue_GetScript();



      script_flags = script.script_object.subst_flags;
    }
    if ((obj_ptr.obj_type == 0) || (obj_ptr.obj_type != OBJ_TYPE_SCRIPT) || (script_flags != 0)) {
      if (setFromAny(obj_ptr, 0) != OK) {
        return null;
      }
    }







>
>
>







162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
  }

  /* ==================== getScript ================================== */
  public Script getScript(ApwtclObj obj_ptr) {
    int script_flags = 0;
    if (obj_ptr.obj_type == OBJ_TYPE_SCRIPT) {
      Script script = obj_ptr.scriptValue_GetScript();
      if (script == null) {
        return null;
      }
      script_flags = script.script_object.subst_flags;
    }
    if ((obj_ptr.obj_type == 0) || (obj_ptr.obj_type != OBJ_TYPE_SCRIPT) || (script_flags != 0)) {
      if (setFromAny(obj_ptr, 0) != OK) {
        return null;
      }
    }