APWTCL Arnulf's Preferred Web Tcl

Check-in [cd21760ebb]
Login

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

Overview
Comment:fixes and removed debugging stuff.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:cd21760ebbd22113bd856b18d53370a1b085f371
User & Date: arnulf 2014-02-08 20:01:23
Context
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
15:41
commented out debug stuff check-in: 2c65d2f052 user: arnulf tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

  /* ==================== ApwtclClassLoader ================================== */
  public ApwtclClassLoader(Interp interp, String path) {
    oid++;
    id = oid;

    this.path = path;
System.out.println("ApwtclClassLoader!"+path+"!");
  }

  /* ==================== mySelf ================================== */
  public String mySelf() {
    String str = "ApwtclClassLoader!"+id+"!";
    return str;
  } 







|







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

  /* ==================== ApwtclClassLoader ================================== */
  public ApwtclClassLoader(Interp interp, String path) {
    oid++;
    id = oid;

    this.path = path;
//System.out.println("ApwtclClassLoader!"+path+"!");
  }

  /* ==================== mySelf ================================== */
  public String mySelf() {
    String str = "ApwtclClassLoader!"+id+"!";
    return str;
  } 

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

356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
...
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
      BufferedInputStream bis = new BufferedInputStream(is);
      dis = new DataInputStream(bis);
		
      byte[] buffer = new byte[1024];
      while( (bytesRead = dis.read(buffer)) != -1){ 
        strFileContents.append(new String(buffer, 0, bytesRead));               
      }
	System.out.println("LEN: "+strFileContents.length());
	//System.out.println("BUF: "+strFileContents.toString()+"!");
	//System.out.println("BUF: done");
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    } finally {
................................................................................
	        }
	        i += 1;
	    }
	}
  
  /* ==================== source ===================================== */
  public int source(Interp interp, String url, boolean is_asset) {
System.out.println("Source: "+url+" "+is_asset);	  
    String response_text;
    ApwtclObj script;
  //  Method read_file = null;
  //  Method read_fcn = null;
  //  Method read = null;
    int result = ERROR;
  //  ApwtclObj my_obj_ptr;







<







 







|







356
357
358
359
360
361
362

363
364
365
366
367
368
369
...
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
      BufferedInputStream bis = new BufferedInputStream(is);
      dis = new DataInputStream(bis);
		
      byte[] buffer = new byte[1024];
      while( (bytesRead = dis.read(buffer)) != -1){ 
        strFileContents.append(new String(buffer, 0, bytesRead));               
      }

	//System.out.println("BUF: "+strFileContents.toString()+"!");
	//System.out.println("BUF: done");
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    } finally {
................................................................................
	        }
	        i += 1;
	    }
	}
  
  /* ==================== source ===================================== */
  public int source(Interp interp, String url, boolean is_asset) {
//System.out.println("Source: "+url+" "+is_asset);	  
    String response_text;
    ApwtclObj script;
  //  Method read_file = null;
  //  Method read_fcn = null;
  //  Method read = null;
    int result = ERROR;
  //  ApwtclObj my_obj_ptr;

Changes to src/org/apwtcl/lang/cmd/PackageCommand.java.

76
77
78
79
80
81
82

83
84
85
86
87
88
89
    interp.setResultString("package forget not yet implemented");
    return ERROR;
  }

  /* ==================== packageIfneededCmd ===================================== */
  public int packageIfneededCmd(Interp interp, ArrayList<ApwtclObj> args) {
//print("package ifneeded called");

    if (args.size() != 3 && args.size() != 4) {
      interp.wrongNumArgs(1, args, "package version ?script?");
      return ERROR;
    }
    ApwtclObj package_name = args.get(1);
    ApwtclObj package_version = args.get(2);
    ApwtclObj script = null;







>







76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
    interp.setResultString("package forget not yet implemented");
    return ERROR;
  }

  /* ==================== packageIfneededCmd ===================================== */
  public int packageIfneededCmd(Interp interp, ArrayList<ApwtclObj> args) {
//print("package ifneeded called");
//ShowArgs(0, "packageIfneededCmd", args);
    if (args.size() != 3 && args.size() != 4) {
      interp.wrongNumArgs(1, args, "package version ?script?");
      return ERROR;
    }
    ApwtclObj package_name = args.get(1);
    ApwtclObj package_version = args.get(2);
    ApwtclObj script = null;

Changes to src/org/apwtcl/lang/cmd/SourceCommand.java.

25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

  /* ==================== SourceCommand ================================== */
  public SourceCommand() {
  }

  /* ==================== sourceCmd ================================== */
  public int sourceCmd(Interp interp, ArrayList<ApwtclObj> args) {
//print("source called!"+args+"!");
    ApwtclObj script_obj_ptr;
    ApwtclObj prev_script_obj;
    int ret_code;

    if (args.size() != 2) {
      interp.wrongNumArgs(1, args, "filename");
      return ERROR;
    }
    script_obj_ptr = args.get(1);
    script_obj_ptr.incrRefCount("I_PKG_CORECMD_4");
    prev_script_obj = interp.current_script_obj;

    interp.current_script_obj = script_obj_ptr;
    ret_code = source(interp, script_obj_ptr.getString(), true);
    interp.current_script_obj = prev_script_obj;
    script_obj_ptr.decrRefCount("D_PKG_CORE_CMD_5");
    return ret_code;
  }

}







|













|






25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

  /* ==================== SourceCommand ================================== */
  public SourceCommand() {
  }

  /* ==================== sourceCmd ================================== */
  public int sourceCmd(Interp interp, ArrayList<ApwtclObj> args) {
print("source called!"+args+"!");
    ApwtclObj script_obj_ptr;
    ApwtclObj prev_script_obj;
    int ret_code;

    if (args.size() != 2) {
      interp.wrongNumArgs(1, args, "filename");
      return ERROR;
    }
    script_obj_ptr = args.get(1);
    script_obj_ptr.incrRefCount("I_PKG_CORECMD_4");
    prev_script_obj = interp.current_script_obj;

    interp.current_script_obj = script_obj_ptr;
    ret_code = source(interp, script_obj_ptr.getString(), interp.is_asset);
    interp.current_script_obj = prev_script_obj;
    script_obj_ptr.decrRefCount("D_PKG_CORE_CMD_5");
    return ret_code;
  }

}