File: 00bsh-jedit

package info (click to toggle)
jedit 5.5.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 14,724 kB
  • sloc: java: 103,377; xml: 96,521; makefile: 43; sh: 42; cpp: 6; python: 6
file content (2410 lines) | stat: -rw-r--r-- 73,334 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
Description: jEdit uses a modified bsh version. This patch to document
 differences between Debian bsh and jEdit bsh.
Author: Gabriele Giacone <1o5g4r8o@gmail.com>

--- a/bsh/src/bsh/BlockNameSpace.java
+++ b/bsh/src/bsh/BlockNameSpace.java
@@ -31,7 +31,7 @@
  *                                                                           *
  *****************************************************************************/
 
-package	bsh;
+package org.gjt.sp.jedit.bsh;
 
 /**
     A specialized namespace	for Blocks (e.g. the body of a "for" statement).
--- a/bsh/src/bsh/BSHAllocationExpression.java
+++ b/bsh/src/bsh/BSHAllocationExpression.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.lang.reflect.Array;
 import java.lang.reflect.InvocationTargetException;
--- a/bsh/src/bsh/BSHAmbiguousName.java
+++ b/bsh/src/bsh/BSHAmbiguousName.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 class BSHAmbiguousName extends SimpleNode
 {
--- a/bsh/src/bsh/BSHArguments.java
+++ b/bsh/src/bsh/BSHArguments.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 class BSHArguments extends SimpleNode
 {
--- a/bsh/src/bsh/BSHArrayDimensions.java
+++ b/bsh/src/bsh/BSHArrayDimensions.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.lang.reflect.Array;
 
--- a/bsh/src/bsh/BSHArrayInitializer.java
+++ b/bsh/src/bsh/BSHArrayInitializer.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.lang.reflect.Array;
 
--- a/bsh/src/bsh/BSHAssignment.java
+++ b/bsh/src/bsh/BSHAssignment.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 class BSHAssignment extends SimpleNode implements ParserConstants
 {
--- a/bsh/src/bsh/BSHBinaryExpression.java
+++ b/bsh/src/bsh/BSHBinaryExpression.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 /**
 	Implement binary expressions...
@@ -74,7 +74,7 @@
 				i.e. (5 instanceof bsh.Primitive) will be true
 			*/
 			if ( lhs instanceof Primitive )
-				if ( rhs == bsh.Primitive.class )
+				if ( rhs == org.gjt.sp.jedit.bsh.Primitive.class )
 					return new Primitive(true);
 				else
 					return new Primitive(false);
--- a/bsh/src/bsh/BSHBlock.java
+++ b/bsh/src/bsh/BSHBlock.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 class BSHBlock extends SimpleNode
 {
--- a/bsh/src/bsh/BSHCastExpression.java
+++ b/bsh/src/bsh/BSHCastExpression.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 /**
 	Implement casts.
--- a/bsh/src/bsh/BSHClassDeclaration.java
+++ b/bsh/src/bsh/BSHClassDeclaration.java
@@ -31,7 +31,7 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 /**
 */
--- a/bsh/src/bsh/BshClassManager.java
+++ b/bsh/src/bsh/BshClassManager.java
@@ -31,7 +31,7 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.net.*;
 import java.util.*;
@@ -120,8 +120,8 @@
 		Create a new instance of the class manager.  
 		Class manager instnaces are now associated with the interpreter.
 
-		@see bsh.Interpreter.getClassManager()
-		@see bsh.Interpreter.setClassLoader( ClassLoader )
+        @see org.gjt.sp.jedit.bsh.Interpreter#getClassManager() getClassManager
+        @see org.gjt.sp.jedit.bsh.Interpreter#setClassLoader(ClassLoader) setClassLoader
 	*/
 	public static BshClassManager createClassManager( Interpreter interpreter ) 
 	{
@@ -130,12 +130,12 @@
 		// Do we have the necessary jdk1.2 packages and optional package?
 		if ( Capabilities.classExists("java.lang.ref.WeakReference") 
 			&& Capabilities.classExists("java.util.HashMap") 
-			&& Capabilities.classExists("bsh.classpath.ClassManagerImpl") 
+            && Capabilities.classExists("org.gjt.sp.jedit.bsh.classpath.ClassManagerImpl")
 		) 
 			try {
 				// Try to load the module
 				// don't refer to it directly here or we're dependent upon it
-				Class clas = Class.forName( "bsh.classpath.ClassManagerImpl" );
+                Class clas = Class.forName( "org.gjt.sp.jedit.bsh.classpath.ClassManagerImpl" );
 				manager = (BshClassManager)clas.newInstance();
 			} catch ( Exception e ) {
 				throw new InterpreterError("Error loading classmanager: "+e);
@@ -346,7 +346,6 @@
 
 	/**
 		Clear the caches in BshClassManager
-		@see public void #reset() for external usage
 	*/
 	protected void clearCaches() 
 	{
--- a/bsh/src/bsh/BshClass.scripted
+++ b/bsh/src/bsh/BshClass.scripted
@@ -31,7 +31,7 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 import java.util.List;
 import java.util.ArrayList;
 
--- a/bsh/src/bsh/BSHEnhancedForStatement.java
+++ b/bsh/src/bsh/BSHEnhancedForStatement.java
@@ -1,7 +1,6 @@
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 // Just testing...
-import java.util.*;
 
 /**
 	 Implementation of the enhanced for(:) statement.  
--- a/bsh/src/bsh/BSHFormalComment.java
+++ b/bsh/src/bsh/BSHFormalComment.java
@@ -1,6 +1,6 @@
 /* Generated By:JJTree: Do not edit this line. BSHFormalComment.java */
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 public class BSHFormalComment extends SimpleNode 
 {
--- a/bsh/src/bsh/BSHFormalParameter.java
+++ b/bsh/src/bsh/BSHFormalParameter.java
@@ -31,7 +31,7 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 /**
 	A formal parameter declaration.
--- a/bsh/src/bsh/BSHFormalParameters.java
+++ b/bsh/src/bsh/BSHFormalParameters.java
@@ -31,7 +31,7 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 class BSHFormalParameters extends SimpleNode
 {
--- a/bsh/src/bsh/BSHForStatement.java
+++ b/bsh/src/bsh/BSHForStatement.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 /**
 	Implementation of the for(;;) statement.
--- a/bsh/src/bsh/BSHIfStatement.java
+++ b/bsh/src/bsh/BSHIfStatement.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 class BSHIfStatement extends SimpleNode
 {
--- a/bsh/src/bsh/BSHImportDeclaration.java
+++ b/bsh/src/bsh/BSHImportDeclaration.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 class BSHImportDeclaration extends SimpleNode
 {
--- a/bsh/src/bsh/BshIterator.java
+++ b/bsh/src/bsh/BshIterator.java
@@ -31,12 +31,12 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 /**
 	An interface implemented by classes wrapping instances of iterators,
 	enumerations, collections, etc.
-	@see CollectionManager.getBshIterator(Object)
+    @see CollectionManager#getBshIterator(Object) getBshIterator
 */
 public interface BshIterator 
 {
--- a/bsh/src/bsh/bsh.jj
+++ b/bsh/src/bsh/bsh.jj
@@ -60,7 +60,7 @@
 }
 
 PARSER_BEGIN(Parser)
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.io.*;
 import java.util.Vector;
--- a/bsh/src/bsh/bsh.jjt
+++ b/bsh/src/bsh/bsh.jjt
@@ -63,7 +63,7 @@
 }
 
 PARSER_BEGIN(Parser)
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.io.*;
 import java.util.Vector;
--- a/bsh/src/bsh/BSHLiteral.java
+++ b/bsh/src/bsh/BSHLiteral.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 class BSHLiteral extends SimpleNode
 {
@@ -102,7 +102,7 @@
 
     void stringSetup(String str)
     {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder buffer = new StringBuilder();
         for(int i = 0; i < str.length(); i++)
         {
             char ch = str.charAt(i);
--- a/bsh/src/bsh/BSHMethodDeclaration.java
+++ b/bsh/src/bsh/BSHMethodDeclaration.java
@@ -31,7 +31,7 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 class BSHMethodDeclaration extends SimpleNode
 {
--- a/bsh/src/bsh/BSHMethodInvocation.java
+++ b/bsh/src/bsh/BSHMethodInvocation.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.lang.reflect.InvocationTargetException;
 
--- a/bsh/src/bsh/BshMethod.java
+++ b/bsh/src/bsh/BshMethod.java
@@ -31,7 +31,7 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.lang.reflect.Method;
 import java.lang.reflect.InvocationTargetException;
--- a/bsh/src/bsh/BSHPackageDeclaration.java
+++ b/bsh/src/bsh/BSHPackageDeclaration.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 public class BSHPackageDeclaration extends SimpleNode 
 {
--- a/bsh/src/bsh/BSHPrimaryExpression.java
+++ b/bsh/src/bsh/BSHPrimaryExpression.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 class BSHPrimaryExpression extends SimpleNode
 {
--- a/bsh/src/bsh/BSHPrimarySuffix.java
+++ b/bsh/src/bsh/BSHPrimarySuffix.java
@@ -32,9 +32,8 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
-import java.util.Hashtable;
 import java.lang.reflect.Array;
 import java.lang.reflect.InvocationTargetException;
 
--- a/bsh/src/bsh/BSHPrimitiveType.java
+++ b/bsh/src/bsh/BSHPrimitiveType.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 class BSHPrimitiveType extends SimpleNode
 {
--- a/bsh/src/bsh/BSHReturnStatement.java
+++ b/bsh/src/bsh/BSHReturnStatement.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 class BSHReturnStatement extends SimpleNode implements ParserConstants
 {
--- a/bsh/src/bsh/BSHReturnType.java
+++ b/bsh/src/bsh/BSHReturnType.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 class BSHReturnType extends SimpleNode
 {
--- a/bsh/src/bsh/BSHStatementExpressionList.java
+++ b/bsh/src/bsh/BSHStatementExpressionList.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 class BSHStatementExpressionList extends SimpleNode
 {
--- a/bsh/src/bsh/BSHSwitchLabel.java
+++ b/bsh/src/bsh/BSHSwitchLabel.java
@@ -31,7 +31,7 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 class BSHSwitchLabel extends SimpleNode {
 	boolean isDefault;
--- a/bsh/src/bsh/BSHSwitchStatement.java
+++ b/bsh/src/bsh/BSHSwitchStatement.java
@@ -31,7 +31,7 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 class BSHSwitchStatement 
 	extends SimpleNode 
--- a/bsh/src/bsh/BSHTernaryExpression.java
+++ b/bsh/src/bsh/BSHTernaryExpression.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 /**
 	This class needs logic to prevent the right hand side of boolean logical
--- a/bsh/src/bsh/BSHThrowStatement.java
+++ b/bsh/src/bsh/BSHThrowStatement.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 class BSHThrowStatement extends SimpleNode
 {
--- a/bsh/src/bsh/BSHTryStatement.java
+++ b/bsh/src/bsh/BSHTryStatement.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.util.Vector;
 
--- a/bsh/src/bsh/BSHTypedVariableDeclaration.java
+++ b/bsh/src/bsh/BSHTypedVariableDeclaration.java
@@ -31,7 +31,7 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 class BSHTypedVariableDeclaration extends SimpleNode
 {
--- a/bsh/src/bsh/BSHType.java
+++ b/bsh/src/bsh/BSHType.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.lang.reflect.Array;
 
--- a/bsh/src/bsh/BSHUnaryExpression.java
+++ b/bsh/src/bsh/BSHUnaryExpression.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 class BSHUnaryExpression extends SimpleNode implements ParserConstants
 {
--- a/bsh/src/bsh/BSHVariableDeclarator.java
+++ b/bsh/src/bsh/BSHVariableDeclarator.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 /**
 	name [ = initializer ]
--- a/bsh/src/bsh/BSHWhileStatement.java
+++ b/bsh/src/bsh/BSHWhileStatement.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 /**
 	This class handles both while(){} statements and do{}while() statements.
--- a/bsh/src/bsh/CallStack.java
+++ b/bsh/src/bsh/CallStack.java
@@ -31,7 +31,7 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.util.Vector;
 
@@ -61,7 +61,7 @@
 */
 public class CallStack 
 {
-	private Vector stack = new Vector(2);
+	private Vector<NameSpace> stack = new Vector<NameSpace>(2);
 
 	public CallStack() { }
 
@@ -128,7 +128,7 @@
 	}
 
 	public String toString() {
-		StringBuffer sb = new StringBuffer();
+		StringBuilder sb = new StringBuilder();
 		sb.append("CallStack:\n");
 		NameSpace [] nsa = toArray();
 		for(int i=0; i<nsa.length; i++)
@@ -141,9 +141,10 @@
 		Occasionally we need to freeze the callstack for error reporting
 		purposes, etc.
 	*/
+	@SuppressWarnings("unchecked")
 	public CallStack copy() {
 		CallStack cs = new CallStack();
-		cs.stack = (Vector)this.stack.clone();
+		cs.stack = (Vector<NameSpace>) stack.clone();
 		return cs;
 	}
 }
--- a/bsh/src/bsh/Capabilities.java
+++ b/bsh/src/bsh/Capabilities.java
@@ -31,7 +31,7 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.util.Hashtable;
 
@@ -67,7 +67,7 @@
 		Note that even if both are true it does not necessarily mean that we 
 		have runtime permission to access the fields... Java security has
 	 	a say in it.
-		@see bsh.ReflectManager
+		@see org.gjt.sp.jedit.bsh.ReflectManager
 	*/
 	public static boolean haveAccessibility() 
 	{
@@ -84,7 +84,7 @@
 		}
 
 		if ( !classExists( "java.lang.reflect.AccessibleObject" )
-			|| !classExists("bsh.reflect.ReflectManagerImpl")  
+			|| !classExists("org.gjt.sp.jedit.bsh.reflect.ReflectManagerImpl")  
 		)
 			throw new Unavailable( "Accessibility unavailable" );
 
--- a/bsh/src/bsh/ClassGeneratorImpl.java
+++ b/bsh/src/bsh/ClassGeneratorImpl.java
@@ -1,4 +1,4 @@
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.io.*;
 import java.util.*;
--- a/bsh/src/bsh/ClassGenerator.java
+++ b/bsh/src/bsh/ClassGenerator.java
@@ -1,6 +1,6 @@
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
-import bsh.Capabilities.Unavailable;
+import org.gjt.sp.jedit.bsh.Capabilities.Unavailable;
 import java.lang.reflect.InvocationTargetException;
 
 public abstract class ClassGenerator
@@ -13,7 +13,7 @@
 		if ( cg == null ) 
 		{
 			try {
-				Class clas = Class.forName( "bsh.ClassGeneratorImpl" );
+				Class clas = Class.forName( "org.gjt.sp.jedit.bsh.ClassGeneratorImpl" );
 				cg = (ClassGenerator)clas.newInstance();
 			} catch ( Exception e ) {
 				throw new Unavailable("ClassGenerator unavailable: "+e);
--- a/bsh/src/bsh/ClassGeneratorUtil.java
+++ b/bsh/src/bsh/ClassGeneratorUtil.java
@@ -31,10 +31,10 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
-import bsh.org.objectweb.asm.*;
-import bsh.org.objectweb.asm.Type;
+import org.gjt.sp.jedit.bsh.org.objectweb.asm.*;
+import org.gjt.sp.jedit.bsh.org.objectweb.asm.Type;
 
 import java.lang.reflect.*;
 import java.util.ArrayList;
@@ -192,11 +192,11 @@
 		{
 			// Generate the bsh instance 'This' reference holder field
 			generateField( 
-				BSHTHIS+className, "Lbsh/This;", ACC_PUBLIC, cw);
+				BSHTHIS+className, "Lorg/gjt/sp/jedit/bsh/This;", ACC_PUBLIC, cw);
 
 			// Generate the static bsh static reference holder field
 			generateField( 
-				BSHSTATIC+className, "Lbsh/This;", ACC_PUBLIC+ACC_STATIC, cw);
+				BSHSTATIC+className, "Lorg/gjt/sp/jedit/bsh/This;", ACC_PUBLIC+ACC_STATIC, cw);
 		}
 
 		// Generate the fields
@@ -329,7 +329,7 @@
 		if ( isStatic )
 		{
 			cv.visitFieldInsn( 
-				GETSTATIC, fqClassName, BSHSTATIC+className, "Lbsh/This;" );
+				GETSTATIC, fqClassName, BSHSTATIC+className, "Lorg/gjt/sp/jedit/bsh/This;" );
 		}else
 		{
 			// Push 'this'
@@ -337,7 +337,7 @@
 
 			// Get the instance field
 			cv.visitFieldInsn( 
-				GETFIELD, fqClassName, BSHTHIS+className, "Lbsh/This;" );
+				GETFIELD, fqClassName, BSHTHIS+className, "Lorg/gjt/sp/jedit/bsh/This;" );
 		}
 
 		// Push the name of the method as a constant
@@ -356,7 +356,7 @@
 
 		// Invoke the method This.invokeMethod( name, Class [] sig, boolean )
 		cv.visitMethodInsn(
-			INVOKEVIRTUAL, "bsh/This", "invokeMethod", 
+			INVOKEVIRTUAL, "org/gjt/sp/jedit/bsh/This", "invokeMethod",
 			Type.getMethodDescriptor( 
 				Type.getType(Object.class),
 				new Type [] { 
@@ -372,7 +372,7 @@
 
 		// Generate code to unwrap bsh Primitive types
 		cv.visitMethodInsn(
-		  INVOKESTATIC, "bsh/Primitive", "unwrap", 
+		  INVOKESTATIC, "org/gjt/sp/jedit/bsh/Primitive", "unwrap",
 		  "(Ljava/lang/Object;)Ljava/lang/Object;" );
 
 		// Generate code to return the value
@@ -420,7 +420,7 @@
 
 		// invoke the initInstance() method
 		cv.visitMethodInsn(
-			INVOKESTATIC, "bsh/ClassGeneratorUtil", "initInstance",
+			INVOKESTATIC, "org/gjt/sp/jedit/bsh/ClassGeneratorUtil", "initInstance",
 			"(Ljava/lang/Object;Ljava/lang/String;[Ljava/lang/Object;)V");
 
 		cv.visitInsn( RETURN );
@@ -461,7 +461,7 @@
 
 		// push class static This object
 		cv.visitFieldInsn( 
-			GETSTATIC, fqClassName, BSHSTATIC+className, "Lbsh/This;" );
+			GETSTATIC, fqClassName, BSHSTATIC+className, "Lorg/gjt/sp/jedit/bsh/This;" );
 
 		// push args
 		cv.visitVarInsn( ALOAD, argsVar );
@@ -471,9 +471,9 @@
 
 		// invoke the ClassGeneratorUtil getConstructorsArgs() method
 		cv.visitMethodInsn(
-			INVOKESTATIC, "bsh/ClassGeneratorUtil", "getConstructorArgs",
-			"(Ljava/lang/String;Lbsh/This;[Ljava/lang/Object;I)"
-			+"Lbsh/ClassGeneratorUtil$ConstructorArgs;"
+			INVOKESTATIC, "org/gjt/sp/jedit/bsh/ClassGeneratorUtil", "getConstructorArgs",
+			"(Ljava/lang/String;Lorg/gjt/sp/jedit/bsh/This;[Ljava/lang/Object;I)"
+			+"Lorg/gjt/sp/jedit/bsh/ClassGeneratorUtil$ConstructorArgs;"
 		);
 
 		// store ConstructorArgs in consArgsVar
@@ -484,7 +484,7 @@
 		// push ConstructorArgs 
 		cv.visitVarInsn( ALOAD, consArgsVar );
 		cv.visitFieldInsn( 
-			GETFIELD, "bsh/ClassGeneratorUtil$ConstructorArgs", "selector", "I" );
+			GETFIELD, "org/gjt/sp/jedit/bsh/ClassGeneratorUtil$ConstructorArgs", "selector", "I" );
 
 		// start switch
 		cv.visitTableSwitchInsn( 
@@ -552,7 +552,7 @@
 
 			// invoke the iterator method on the ConstructorArgs
 			cv.visitVarInsn( ALOAD, consArgsVar ); // push the ConstructorArgs
-			String className = "bsh/ClassGeneratorUtil$ConstructorArgs";
+			String className = "org/gjt/sp/jedit/bsh/ClassGeneratorUtil$ConstructorArgs";
 			String retType;
 			if ( method.equals("getObject") )
 				retType = OBJECT;
@@ -573,7 +573,7 @@
 	
 	static String getMethodDescriptor( String returnType, String [] paramTypes )
 	{
-		StringBuffer sb = new StringBuffer("(");
+		StringBuilder sb = new StringBuilder("(");
 		for(int i=0; i<paramTypes.length; i++)
 			sb.append(paramTypes[i]);
 		sb.append(")"+returnType);
@@ -716,7 +716,7 @@
                     opcode = ILOAD;
                 }
 
-				String type = "bsh/Primitive";
+				String type = "org/gjt/sp/jedit/bsh/Primitive";
 				cv.visitTypeInsn( NEW, type );
 				cv.visitInsn(DUP);
 				cv.visitVarInsn(opcode, localVarIndex);
--- a/bsh/src/bsh/ClassIdentifier.java
+++ b/bsh/src/bsh/ClassIdentifier.java
@@ -31,7 +31,7 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 public class ClassIdentifier 
 {
--- a/bsh/src/bsh/classpath/BshClassLoader.java
+++ b/bsh/src/bsh/classpath/BshClassLoader.java
@@ -31,12 +31,11 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh.classpath;
+package org.gjt.sp.jedit.bsh.classpath;
 
 import java.net.*;
-import java.util.*;
-import java.io.*;
-import bsh.BshClassManager;
+
+import org.gjt.sp.jedit.bsh.BshClassManager;
 
 /**
 	One of the things BshClassLoader does is to address a deficiency in
@@ -56,7 +55,7 @@
 	}
 
 	/**
-		@param bases URLs JARClassLoader seems to require absolute paths 
+        @param bcp URLs JARClassLoader seems to require absolute paths
 	*/
 	public BshClassLoader( BshClassManager classManager, BshClassPath bcp ) {
 		this( classManager, bcp.getPathComponents() );
@@ -64,7 +63,7 @@
 
 	/**
 		For use by children
-		@param bases URLs JARClassLoader seems to require absolute paths 
+        @param classManager URLs JARClassLoader seems to require absolute paths
 	*/
 	protected BshClassLoader( BshClassManager classManager ) { 
 		this( classManager, new URL [] { } );
@@ -100,7 +99,7 @@
 // We should refactor this somehow if it sticks around
 		if ( name.startsWith( ClassManagerImpl.BSH_PACKAGE ) )
 			try {
-				return bsh.Interpreter.class.getClassLoader().loadClass( name );
+                return org.gjt.sp.jedit.bsh.Interpreter.class.getClassLoader().loadClass( name );
 			} catch ( ClassNotFoundException e ) {}
 
 		/*
--- a/bsh/src/bsh/classpath/BshClassPath.java
+++ b/bsh/src/bsh/classpath/BshClassPath.java
@@ -31,18 +31,18 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh.classpath;
+package org.gjt.sp.jedit.bsh.classpath;
 
 import java.util.*;
 import java.util.zip.*;
 import java.io.*;
 import java.net.*;
 import java.io.File;
-import bsh.ConsoleInterface;
-import bsh.StringUtil;
-import bsh.ClassPathException;
+
+import org.gjt.sp.jedit.bsh.StringUtil;
+import org.gjt.sp.jedit.bsh.ClassPathException;
 import java.lang.ref.WeakReference;
-import bsh.NameSource;
+import org.gjt.sp.jedit.bsh.NameSource;
 
 /**
 	A BshClassPath encapsulates knowledge about a class path of URLs.
--- a/bsh/src/bsh/classpath/ClassManagerImpl.java
+++ b/bsh/src/bsh/classpath/ClassManagerImpl.java
@@ -31,20 +31,20 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh.classpath;
+package org.gjt.sp.jedit.bsh.classpath;
 
 import java.net.*;
 import java.util.*;
 import java.lang.ref.*;
 import java.io.IOException;
 import java.io.*;
-import bsh.classpath.BshClassPath.ClassSource;
-import bsh.classpath.BshClassPath.JarClassSource;
-import bsh.classpath.BshClassPath.GeneratedClassSource;
-import bsh.BshClassManager;
-import bsh.ClassPathException;
-import bsh.Interpreter;  // for debug()
-import bsh.UtilEvalError; 
+import org.gjt.sp.jedit.bsh.classpath.BshClassPath.ClassSource;
+import org.gjt.sp.jedit.bsh.classpath.BshClassPath.JarClassSource;
+import org.gjt.sp.jedit.bsh.classpath.BshClassPath.GeneratedClassSource;
+import org.gjt.sp.jedit.bsh.BshClassManager;
+import org.gjt.sp.jedit.bsh.ClassPathException;
+import org.gjt.sp.jedit.bsh.Interpreter;  // for debug()
+import org.gjt.sp.jedit.bsh.UtilEvalError;
 
 /**
 	<pre>
@@ -94,7 +94,7 @@
 */
 public class ClassManagerImpl extends BshClassManager
 {
-	static final String BSH_PACKAGE = "bsh";
+	static final String BSH_PACKAGE = "org.gjt.sp.jedit.bsh";
 	/**
 		The classpath of the base loader.  Initially and upon reset() this is
 		an empty instance of BshClassPath.  It grows as paths are added or is
@@ -531,7 +531,7 @@
 		try {
 			reloadClasses( new String [] { name } );
 		} catch ( ClassPathException e ) {
-			throw new bsh.InterpreterError("defineClass: "+e);
+			throw new org.gjt.sp.jedit.bsh.InterpreterError("defineClass: "+e);
 		}
 		return classForName( name );
 	}
--- a/bsh/src/bsh/classpath/ClassPathListener.java
+++ b/bsh/src/bsh/classpath/ClassPathListener.java
@@ -31,7 +31,7 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh.classpath;
+package org.gjt.sp.jedit.bsh.classpath;
 
 public interface ClassPathListener {
 	public void classPathChanged();
--- a/bsh/src/bsh/classpath/DiscreteFilesClassLoader.java
+++ b/bsh/src/bsh/classpath/DiscreteFilesClassLoader.java
@@ -31,16 +31,12 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh.classpath;
+package org.gjt.sp.jedit.bsh.classpath;
 
-import java.io.*;
-import java.io.File;
 import java.util.*;
-import java.awt.*;
-import bsh.BshClassManager;
-import bsh.classpath.BshClassPath.ClassSource;
-import bsh.classpath.BshClassPath.DirClassSource;
-import bsh.classpath.BshClassPath.GeneratedClassSource;
+
+import org.gjt.sp.jedit.bsh.BshClassManager;
+import org.gjt.sp.jedit.bsh.classpath.BshClassPath.ClassSource;
 
 /**
 	A classloader which can load one or more classes from specified sources.
--- a/bsh/src/bsh/ClassPathException.java
+++ b/bsh/src/bsh/ClassPathException.java
@@ -31,7 +31,7 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 public class ClassPathException extends UtilEvalError {
 	public ClassPathException( String msg ) { super(msg); }
--- a/bsh/src/bsh/collection/CollectionIterator.java
+++ b/bsh/src/bsh/collection/CollectionIterator.java
@@ -1,12 +1,9 @@
-package bsh.collection;
+package org.gjt.sp.jedit.bsh.collection;
 
 import java.util.Iterator;
 import java.util.Collection;
-import java.util.Enumeration;
 //import java.util.Map;
 
-import java.lang.reflect.Array;
-
 /**
  *	This is the implementation of:
  *	BshIterator - a dynamically loaded extension that supports the collections
@@ -15,14 +12,14 @@
  *	@author Daniel Leuck
  *	@author Pat Niemeyer
  */
-public class CollectionIterator implements bsh.BshIterator
+public class CollectionIterator implements org.gjt.sp.jedit.bsh.BshIterator
 {
 	private Iterator iterator;
 
 	/**
 	 * Construct a basic CollectionIterator
 	 *
-	 * @param The object over which we are iterating
+     * @param iterateOverMe The object over which we are iterating
 	 *
 	 * @throws java.lang.IllegalArgumentException If the argument is not a
 	 * supported (i.e. iterable) type.
--- a/bsh/src/bsh/collection/CollectionManagerImpl.java
+++ b/bsh/src/bsh/collection/CollectionManagerImpl.java
@@ -31,20 +31,19 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh.collection;
+package org.gjt.sp.jedit.bsh.collection;
 
 import java.util.Iterator;
 import java.util.Collection;
-import java.util.Enumeration;
 import java.util.Map;
-import java.lang.reflect.Array;
-import bsh.BshIterator;
+
+import org.gjt.sp.jedit.bsh.BshIterator;
 
 /**
 	Dynamically loaded extension supporting post 1.1 collections iterator.
  	@author Pat Niemeyer
  */
-public class CollectionManagerImpl extends bsh.CollectionManager
+public class CollectionManagerImpl extends org.gjt.sp.jedit.bsh.CollectionManager
 {
 	public BshIterator getBshIterator( Object obj ) 
 		throws IllegalArgumentException
@@ -52,7 +51,7 @@
 		if ( obj instanceof Collection || obj instanceof Iterator )
 			return new CollectionIterator( obj ); 
 		else
-			return new bsh.CollectionManager.BasicBshIterator( obj ); 
+			return new org.gjt.sp.jedit.bsh.CollectionManager.BasicBshIterator( obj );
 	}
 
 	public boolean isMap( Object obj ) 
--- a/bsh/src/bsh/CollectionManager.java
+++ b/bsh/src/bsh/CollectionManager.java
@@ -31,7 +31,7 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.util.Enumeration;
 import java.util.Vector;
@@ -44,8 +44,6 @@
 	Enumeration, Vector, String, StringBuffer and array.
 	The dynamically loaded CollectionManagerImpl supports additional types when
 	it is present.
-
-	@see BshIterable.java
 */
 public class CollectionManager
 {
@@ -58,7 +56,7 @@
 		{
 			Class clas;
 			try {
-				clas = Class.forName( "bsh.collection.CollectionManagerImpl" );
+                clas = Class.forName( "org.gjt.sp.jedit.bsh.collection.CollectionManagerImpl" );
 				manager = (CollectionManager)clas.newInstance();
 			} catch ( Exception e ) {
 				Interpreter.debug("unable to load CollectionManagerImpl: "+e);
@@ -119,7 +117,7 @@
 		/**
 		 * Construct a basic BasicBshIterator
 		 *
-		 * @param The object over which we are iterating
+         * @param iterateOverMe The object over which we are iterating
 		 *
 		 * @throws java.lang.IllegalArgumentException If the argument is not a
 		 * supported (i.e. iterable) type.
@@ -173,6 +171,10 @@
 				return createEnumeration(
 					iterateOverMe.toString().toCharArray());
 
+            if (iterateOverMe instanceof StringBuilder)
+                return createEnumeration(
+                    iterateOverMe.toString().toCharArray());
+
 			throw new IllegalArgumentException(
 				"Cannot enumerate object of type "+iterateOverMe.getClass());
 		}
--- a/bsh/src/bsh/CommandLineReader.java
+++ b/bsh/src/bsh/CommandLineReader.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.io.*;
 
--- a/bsh/src/bsh/commands/addClassPath.bsh
+++ b/bsh/src/bsh/commands/addClassPath.bsh
@@ -16,7 +16,7 @@
 bsh.help.addClassPath= "usage: addClassPath( string | URL )";
 
 import java.net.URL;
-import bsh.BshClassManager;
+import org.gjt.sp.jedit.bsh.BshClassManager;
 
 addClassPath( path ) {
 	URL url;
--- a/bsh/src/bsh/commands/bind.bsh
+++ b/bsh/src/bsh/commands/bind.bsh
@@ -1,10 +1,10 @@
 /**
 	Bind a bsh object into a particular namespace and interpreter
 */
-import bsh.This;
-import bsh.NameSpace;
+import org.gjt.sp.jedit.bsh.This;
+import org.gjt.sp.jedit.bsh.NameSpace;
 
-bind( bsh.This ths, bsh.NameSpace namespace ) {
+bind( org.gjt.sp.jedit.bsh.This ths, bsh.NameSpace namespace ) {
 	This.bind( ths, namespace, this.interpreter );
 }
 
--- a/bsh/src/bsh/commands/browseClass.bsh
+++ b/bsh/src/bsh/commands/browseClass.bsh
@@ -12,7 +12,7 @@
 
 	@method void browseClass( String | Object | Class )
 */
-import bsh.ClassIdentifier;
+import org.gjt.sp.jedit.bsh.ClassIdentifier;
 
 browseClass( Object o ) 
 {
--- a/bsh/src/bsh/commands/classBrowser.bsh
+++ b/bsh/src/bsh/commands/classBrowser.bsh
@@ -1,7 +1,7 @@
 /**
 	Open the class browser.
 */
-import bsh.util.ClassBrowser;
+import org.gjt.sp.jedit.bsh.util.ClassBrowser;
 
 classBrowser() 
 {
--- a/bsh/src/bsh/commands/desktop.bsh
+++ b/bsh/src/bsh/commands/desktop.bsh
@@ -10,11 +10,11 @@
  
 import javax.swing.*;
 import javax.swing.border.*;
-import bsh.util.JConsole;
-import bsh.util.Util;
-import bsh.Interpreter;
+import org.gjt.sp.jedit.bsh.util.JConsole;
+import org.gjt.sp.jedit.bsh.util.Util;
+import org.gjt.sp.jedit.bsh.Interpreter;
 import java.awt.Component;
-import bsh.Capabilities;
+import org.gjt.sp.jedit.bsh.Capabilities;
 
 desktop() 
 {
@@ -199,7 +199,7 @@
 
 	if ( Capabilities.canGenerateInterfaces() ) 
 	{
-		import bsh.classpath.BshClassPath;
+		import org.gjt.sp.jedit.bsh.classpath.BshClassPath;
 		classFeedbackListener = new BshClassPath.MappingFeedback() 
 		{
 			startClassMapping() { }
--- a/bsh/src/bsh/commands/dir.java
+++ b/bsh/src/bsh/commands/dir.java
@@ -5,12 +5,11 @@
 	
 	@method void dir( [ String dirname ] )
 */
-package bsh.commands;
+package org.gjt.sp.jedit.bsh.commands;
 
 import java.io.*;
-import bsh.*;
+import org.gjt.sp.jedit.bsh.*;
 import java.util.Date;
-import java.util.Vector;
 import java.util.GregorianCalendar;
 import java.util.Calendar;
 
@@ -59,7 +58,7 @@
 
 		for( int i=0; i< files.length; i++ ) {
 			File f = new File( dir + File.separator + files[i] );
-			StringBuffer sb = new StringBuffer();
+			StringBuilder sb = new StringBuilder();
 			sb.append( f.canRead() ? "r": "-" );
 			sb.append( f.canWrite() ? "w": "-" );
 			sb.append( "_" );
@@ -77,7 +76,7 @@
 
 			// hack to get fixed length 'length' field
 			int fieldlen = 8;
-			StringBuffer len = new StringBuffer();
+			StringBuilder len = new StringBuilder();
 			for(int j=0; j<fieldlen; j++)
 				len.append(" ");
 			len.insert(0, f.length());
--- a/bsh/src/bsh/commands/extend.bsh
+++ b/bsh/src/bsh/commands/extend.bsh
@@ -42,7 +42,7 @@
 	@method This extend( This object )
 */
 bsh.help.extend= "usage: extend( This parent )";
-extend( bsh.This parent ) 
+extend( org.gjt.sp.jedit.bsh.This parent ) 
 {
 	this.namespace.setParent( parent.namespace );
 	return this; 
--- a/bsh/src/bsh/commands/frame.bsh
+++ b/bsh/src/bsh/commands/frame.bsh
@@ -15,7 +15,7 @@
 bsh.help.frame = "usage: frame( Component component )";
  
 import java.awt.*;
-import bsh.Capabilities;
+import org.gjt.sp.jedit.bsh.Capabilities;
 
 frame( Component comp ) 
 {
--- a/bsh/src/bsh/commands/getClassPath.bsh
+++ b/bsh/src/bsh/commands/getClassPath.bsh
@@ -4,7 +4,7 @@
 */
 
 bsh.help.getClassPath= "usage: getClassPath()";
-import bsh.BshClassManager;
+import org.gjt.sp.jedit.bsh.BshClassManager;
 
 URL [] getClassPath() {
 	this.cp = this.caller.namespace.getClassManager().getClassPath();
--- a/bsh/src/bsh/commands/getResource.bsh
+++ b/bsh/src/bsh/commands/getResource.bsh
@@ -6,7 +6,7 @@
 
 bsh.help.getResource = "usage: getResource( String name )";
 
-import bsh.Interpreter;
+import org.gjt.sp.jedit.bsh.Interpreter;
 
 URL getResource( String path ) 
 {
--- a/bsh/src/bsh/commands/getSourceFileInfo.bsh
+++ b/bsh/src/bsh/commands/getSourceFileInfo.bsh
@@ -20,7 +20,7 @@
 
 bsh.help.getSourceFileInfo = "usage: getSourceFileInfo()";
 
-import bsh.Interpreter;
+import org.gjt.sp.jedit.bsh.Interpreter;
 
 getSourceFileInfo() {
 	return this.interpreter.getSourceFileInfo();
--- a/bsh/src/bsh/commands/javap.bsh
+++ b/bsh/src/bsh/commands/javap.bsh
@@ -21,7 +21,7 @@
 
 bsh.help.javap= "usage: javap( value )";
 
-import bsh.ClassIdentifier;
+import org.gjt.sp.jedit.bsh.ClassIdentifier;
 import java.lang.reflect.Modifier;
 
 javap( Object o ) 
--- a/bsh/src/bsh/commands/load.bsh
+++ b/bsh/src/bsh/commands/load.bsh
@@ -6,13 +6,13 @@
 
 setAccessibility(true);
 
-import bsh.BshClassManager;
+import org.gjt.sp.jedit.bsh.BshClassManager;
 import java.io.*;
 import java.lang.reflect.Proxy;
 
-import bsh.Capabilities;
+import org.gjt.sp.jedit.bsh.Capabilities;
 
-if ( Capabilities.classExists("bsh.ClassGeneratorImpl") )
+if ( Capabilities.classExists("org.gjt.sp.jedit.bsh.ClassGeneratorImpl") )
 {
 public class BshObjectInputStream extends ObjectInputStream
 {
@@ -81,7 +81,7 @@
 	oin.close();
 
 	// bind bsh objects into the caller's namespace
-	if ( obj instanceof bsh.This )
+	if ( obj instanceof org.gjt.sp.jedit.bsh.This )
 		bind( obj, this.caller.namespace );
 
 	return obj;
--- a/bsh/src/bsh/commands/makeWorkspace.bsh
+++ b/bsh/src/bsh/commands/makeWorkspace.bsh
@@ -9,11 +9,11 @@
  */
 
 import javax.swing.*;
-import bsh.Interpreter;
-import bsh.BshClassManager;
-import bsh.ClassPathException;
-import bsh.util.JConsole;
-import bsh.util.NameCompletionTable;
+import org.gjt.sp.jedit.bsh.Interpreter;
+import org.gjt.sp.jedit.bsh.BshClassManager;
+import org.gjt.sp.jedit.bsh.ClassPathException;
+import org.gjt.sp.jedit.bsh.util.JConsole;
+import org.gjt.sp.jedit.bsh.util.NameCompletionTable;
 
 makeWorkspace( String name ) 
 {
--- a/bsh/src/bsh/commands/printBanner.bsh
+++ b/bsh/src/bsh/commands/printBanner.bsh
@@ -6,9 +6,9 @@
 
 import javax.swing.ImageIcon;
 import java.awt.*;
-import bsh.Interpreter;
-import bsh.Capabilities;
-import bsh.util.JConsole;
+import org.gjt.sp.jedit.bsh.Interpreter;
+import org.gjt.sp.jedit.bsh.Capabilities;
+import org.gjt.sp.jedit.bsh.util.JConsole;
 
 /*
 	Note: any errors thrown in here will be caught by interpreter and
--- a/bsh/src/bsh/commands/print.bsh
+++ b/bsh/src/bsh/commands/print.bsh
@@ -13,9 +13,9 @@
 	instead of print().
 */
 bsh.help.print = "usage: print( value )";
-import bsh.CollectionManager;
-import bsh.StringUtil;
-import bsh.Primitive;
+import org.gjt.sp.jedit.bsh.CollectionManager;
+import org.gjt.sp.jedit.bsh.StringUtil;
+import org.gjt.sp.jedit.bsh.Primitive;
 
 void print( arg ) 
 {
--- a/bsh/src/bsh/commands/reloadClasses.bsh
+++ b/bsh/src/bsh/commands/reloadClasses.bsh
@@ -19,7 +19,7 @@
 bsh.help.reloadClasses= 
 	"usage: reloadClasses( String class | String package | String [] classes )";
 
-import bsh.ClassPathException;
+import org.gjt.sp.jedit.bsh.ClassPathException;
 
 void reloadClasses( item ) 
 {
--- a/bsh/src/bsh/commands/save.bsh
+++ b/bsh/src/bsh/commands/save.bsh
@@ -15,7 +15,7 @@
 
 	// Detach bsh objects from the caller's namespace during serialization
 	// NOTE: THIS IS NOT THREAD SAFE
-	if ( obj instanceof bsh.This ) {
+	if ( obj instanceof org.gjt.sp.jedit.bsh.This ) {
 		super.parent = obj.namespace.getParent();
 		obj.namespace.prune();
 	}
@@ -27,7 +27,7 @@
 
 	// Reattach bsh objects to the caller's namespace after serialization
 	// NOTE: THIS IS NOT THREAD SAFE
-	if ( obj instanceof bsh.This ) 
+	if ( obj instanceof org.gjt.sp.jedit.bsh.This ) 
 		obj.namespace.setParent( super.parent );
 }
 
--- a/bsh/src/bsh/commands/server.bsh
+++ b/bsh/src/bsh/commands/server.bsh
@@ -2,8 +2,8 @@
 	Create a remote BeanShell listener service attached to 
 	the current interpreter, listening on the specified port.
 */
-import bsh.util.Httpd;
-import bsh.util.Sessiond;
+import org.gjt.sp.jedit.bsh.util.Httpd;
+import org.gjt.sp.jedit.bsh.util.Sessiond;
 
 bsh.help.server = "usage: server(int port)";
 
--- a/bsh/src/bsh/commands/setAccessibility.bsh
+++ b/bsh/src/bsh/commands/setAccessibility.bsh
@@ -2,7 +2,7 @@
 	Setting accessibility on enables to private and other non-public
 	fields and method.
 */
-import bsh.Capabilities;
+import org.gjt.sp.jedit.bsh.Capabilities;
 
 setAccessibility( boolean b ) 
 {
--- a/bsh/src/bsh/commands/which.bsh
+++ b/bsh/src/bsh/commands/which.bsh
@@ -26,7 +26,7 @@
 
 bsh.help.which= "usage: which( classIdentifier | string | class )";
 
-import bsh.ClassIdentifier;
+import org.gjt.sp.jedit.bsh.ClassIdentifier;
 
 which( clas ) 
 {
--- a/bsh/src/bsh/commands/workspaceEditor.bsh
+++ b/bsh/src/bsh/commands/workspaceEditor.bsh
@@ -10,7 +10,7 @@
  */
  
 import java.awt.Insets;
-import bsh.Interpreter;
+import org.gjt.sp.jedit.bsh.Interpreter;
 
 workspaceEditor(Interpreter parent, String name ) 
 {
--- a/bsh/src/bsh/ConsoleInterface.java
+++ b/bsh/src/bsh/ConsoleInterface.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.io.*;
 
@@ -42,7 +42,6 @@
 
 	A simple console may ignore some of these or map them to trivial
 	implementations.  e.g. print() with color can be mapped to plain text.
-	@see bsh.util.GUIConsoleInterface
 */
 public interface ConsoleInterface {
 	public Reader getIn();
--- a/bsh/src/bsh/DelayedEvalBshMethod.java
+++ b/bsh/src/bsh/DelayedEvalBshMethod.java
@@ -31,7 +31,7 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 public class DelayedEvalBshMethod extends BshMethod
 {
--- a/bsh/src/bsh/EvalError.java
+++ b/bsh/src/bsh/EvalError.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 /**
 	EvalError indicates that we cannot continue evaluating the script
--- a/bsh/src/bsh/ExternalNameSpace.java
+++ b/bsh/src/bsh/ExternalNameSpace.java
@@ -1,4 +1,4 @@
-package	bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.util.*;
 
--- a/bsh/src/bsh/InterpreterError.java
+++ b/bsh/src/bsh/InterpreterError.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 /**
 	An internal error in the interpreter has occurred.
--- a/bsh/src/bsh/Interpreter.java
+++ b/bsh/src/bsh/Interpreter.java
@@ -31,9 +31,8 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
-import java.util.Vector;
 import java.io.*;
 import java.lang.reflect.Method;
 import java.lang.reflect.InvocationTargetException;
@@ -95,7 +94,7 @@
 {
 	/* --- Begin static members --- */
 
-	public static final String VERSION = "2.0b4";
+	public static final String VERSION = "2.0b4-jedit";
 	/*
 		Debug utils are static so that they are reachable by code that doesn't
 		necessarily have an interpreter reference (e.g. tracing in utils).
@@ -197,7 +196,7 @@
 		/* 
 			Create the root "bsh" system object if it doesn't exist.
 		*/
-		if ( ! ( getu("bsh") instanceof bsh.This ) )
+		if ( ! ( getu("bsh") instanceof org.gjt.sp.jedit.bsh.This ) )
 			initRootSystemObject();
 
 		if ( interactive )
@@ -1135,7 +1134,7 @@
 		sourcing and from what file a method was originally parsed.  One
 		file may call a method sourced from another file.  See SimpleNode
 		for origination file info.
-		@see bsh.SimpleNode#getSourceFile()
+		@see org.gjt.sp.jedit.bsh.SimpleNode#getSourceFile()
 	*/
 	public String getSourceFileInfo() { 
 		if ( sourceFileInfo != null )
--- a/bsh/src/bsh/JavaCharStream.java
+++ b/bsh/src/bsh/JavaCharStream.java
@@ -1,5 +1,5 @@
 /* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 3.0 */
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 /**
  * An implementation of interface CharStream, where the stream is assumed to
--- a/bsh/src/bsh/JJTParserState.java
+++ b/bsh/src/bsh/JJTParserState.java
@@ -1,6 +1,6 @@
 /* Generated By:JJTree: Do not edit this line. src/bsh/JJTParserState.java */
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 class JJTParserState {
   private java.util.Stack nodes;
--- a/bsh/src/bsh/JThis.java
+++ b/bsh/src/bsh/JThis.java
@@ -32,12 +32,10 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.awt.event.*;
-import javax.swing.*;
 import javax.swing.event.*;
-import java.io.*;
 import java.beans.*;
 
 /**
--- a/bsh/src/bsh/LHS.java
+++ b/bsh/src/bsh/LHS.java
@@ -32,10 +32,9 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.lang.reflect.Field;
-import java.util.Hashtable;
 
 /**
 	An LHS is a wrapper for an variable, field, or property.  It ordinarily 
--- a/bsh/src/bsh/Modifiers.java
+++ b/bsh/src/bsh/Modifiers.java
@@ -1,4 +1,4 @@
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.util.Hashtable;
 
--- a/bsh/src/bsh/Name.java
+++ b/bsh/src/bsh/Name.java
@@ -32,13 +32,10 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.lang.reflect.Array;
-import java.util.Hashtable;
-import java.io.*;
 import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
 
 /**
 	What's in a name?  I'll tell you...
--- a/bsh/src/bsh/NameSource.java
+++ b/bsh/src/bsh/NameSource.java
@@ -31,8 +31,7 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh;
-import java.util.*;
+package org.gjt.sp.jedit.bsh;
 
 /**
 	This interface supports name completion, which is used primarily for 
@@ -46,8 +45,6 @@
 	fasion.  However in general name competion is used for human interaction
 	and therefore does not require high performance.
 	<p>
-	@see bsh.util.NameCompletion
-	@see bsh.util.NameCompletionTable
 */
 public interface NameSource 
 {
--- a/bsh/src/bsh/NameSpace.java
+++ b/bsh/src/bsh/NameSpace.java
@@ -32,12 +32,11 @@
  *****************************************************************************/
 
 
-package	bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.util.*;
 
 import java.io.InputStream;
-import java.io.BufferedReader;
 import java.io.InputStreamReader;
 import java.io.IOException;
 
@@ -160,9 +159,10 @@
 	// Begin constructors
 
 	/**
-		@parent the parent namespace of this namespace.  Child namespaces
+        @param parent the parent namespace of this namespace.  Child namespaces
 		inherit all variables and methods of their parent and can (of course)
 		override / shadow them.
+        @param name a name
 	*/
     public NameSpace( NameSpace parent, String name ) 
 	{
@@ -246,7 +246,7 @@
 		Note: this method is primarily intended for use internally.  If you use
 		this method outside of the bsh package and wish to set variables with
 		primitive values you will have to wrap them using bsh.Primitive.
-		@see bsh.Primitive
+        @see org.gjt.sp.jedit.bsh.Primitive
 		<p>
 		Setting a new variable (which didn't exist before) or removing
 		a variable causes a namespace change.
@@ -285,7 +285,7 @@
 		Note: this method is primarily intended for use internally.  If you use
 		this method outside of the bsh package and wish to set variables with
 		primitive values you will have to wrap them using bsh.Primitive.
-		@see bsh.Primitive
+        @see org.gjt.sp.jedit.bsh.Primitive
 		<p>
 		Setting a new variable (which didn't exist before) or removing
 		a variable causes a namespace change.
@@ -302,9 +302,17 @@
 			variables =	new Hashtable();
 
 		// primitives should have been wrapped
-		if ( value == null )
-			throw new InterpreterError("null variable value");
+        // {{{ jEdit change
+        //if ( value == null )
+        //	throw new InterpreterError("null variable value");
+
+        if ( value == null ) {
+            // don't break jEdit core and plugins!
+            unsetVariable(name);
+            return;
+        }
 
+        // }}}
 		// Locate the variable definition if it exists.
 		Variable existing = getVariableImpl( name, recurse );
 
@@ -653,7 +661,7 @@
 		Note: this method is primarily intended for use internally.  If you use
 		this method outside of the bsh package and wish to set variables with
 		primitive values you will have to wrap them using bsh.Primitive.
-		@see bsh.Primitive
+        @see org.gjt.sp.jedit.bsh.Primitive
 
 		@param value If value is null, you'll get the default value for the type
 		@param modifiers may be null
@@ -735,16 +743,56 @@
 
 		Object m = methods.get(name);
 
-		if ( m == null )
+        //{{{ jEdit version: properly handle methods with same signature.
+        if (m == null)
+            methods.put(name, method);
+        else if (m instanceof BshMethod)
+        {
+            // is the new method overriding the old method?
+            if (Arrays.equals(((BshMethod)m).getParameterTypes(),
+                              method.getParameterTypes()))
+            {
 			methods.put(name, method);
+            }
 		else 
-		if ( m instanceof BshMethod ) {
+            {
 			Vector v = new Vector();
 			v.addElement( m );
 			v.addElement( method );
 			methods.put( name, v );
-		} else // Vector
-			((Vector)m).addElement( method );
+            }
+        }
+        else
+        {
+            Vector _methods = (Vector) m;
+            for (int i = 0; i < _methods.size(); i++)
+            {
+                // Check whether the new method overrides some old
+                // method in the list.
+                BshMethod _old_m = (BshMethod) _methods.get(i);
+                if (Arrays.equals(_old_m.getParameterTypes(),
+                                  method.getParameterTypes()))
+                {
+                    _methods.remove(i);
+                    break;
+                }
+            }
+            _methods.addElement( method );
+        }
+        //}}}
+
+        //{{{ Original BeanShell code
+        // if ( m == null )
+        // 	methods.put(name, method);
+        // else
+        // if ( m instanceof BshMethod ) {
+        // 	Vector v = new Vector();
+        // 	v.addElement( m );
+        // 	v.addElement( method );
+        // 	methods.put( name, v );
+        // } else // Vector
+        // 	((Vector)m).addElement( method );
+        //}}}
     }
 
 	/**
@@ -764,7 +812,7 @@
 		Note: this method is primarily intended for use internally.  If you use
 		this method outside of the bsh package you will have to be familiar
 		with BeanShell's use of the Primitive wrapper class.
-		@see bsh.Primitive
+        @see org.gjt.sp.jedit.bsh.Primitive
 		@return the BshMethod or null if not found
 		@param declaredOnly if true then only methods declared directly in this
 			namespace will be found and no inherited or imported methods will
@@ -906,6 +954,39 @@
 		@throws UtilEvalError if loadScriptedCommand throws UtilEvalError
 			i.e. on errors loading a script that was found
 	*/
+    // {{{ jEdit's getCommand
+    public Object getCommand(
+        String name, Class [] argTypes, Interpreter interpreter )
+        throws UtilEvalError
+    {
+        if (Interpreter.DEBUG) Interpreter.debug("getCommand: "+name);
+        BshClassManager bcm = interpreter.getClassManager();
+
+        InputStream in = getCommand( name );
+
+        if ( in != null )
+            return loadScriptedCommand(
+                in, name, argTypes, name, interpreter );
+
+        /* // Chop leading "/" and change "/" to "."
+        String className;
+        if ( path.equals("/") )
+            className = name;
+        else
+            className = path.substring(1).replace('/','.') +"."+name;
+
+        Class clas = bcm.classForName( className );
+        if ( clas != null )
+            return clas; */
+
+        if ( parent != null )
+            return parent.getCommand( name, argTypes, interpreter );
+        else
+            return null;
+    }
+
+
+    /*
 	public Object getCommand( 	
 		String name, Class [] argTypes, Interpreter interpreter ) 
 		throws UtilEvalError
@@ -952,8 +1033,8 @@
 			return parent.getCommand( name, argTypes, interpreter );
 		else
 			return null;
-	}
-
+    }   */
+    // }}}
 	protected BshMethod getImportedMethod( String name, Class [] sig ) 
 		throws UtilEvalError
 	{
@@ -1320,9 +1401,7 @@
 		required.  The method will appear as if called externally from Java.
 		<p>
 
-		@see bsh.This.invokeMethod( 
-			String methodName, Object [] args, Interpreter interpreter, 
-			CallStack callstack, SimpleNode callerInfo, boolean )
+        @see org.gjt.sp.jedit.bsh.This#invokeMethod(String methodName, Object [] args, Interpreter interpreter,	CallStack callstack, SimpleNode callerInfo, boolean ) invokeMethod
 	*/
 	public Object invokeMethod( 
 		String methodName, Object [] args, Interpreter interpreter ) 
@@ -1335,9 +1414,7 @@
 	/**
 		This method simply delegates to This.invokeMethod();
 		<p>
-		@see bsh.This.invokeMethod( 
-			String methodName, Object [] args, Interpreter interpreter, 
-			CallStack callstack, SimpleNode callerInfo )
+        @see org.gjt.sp.jedit.bsh.This#invokeMethod(String methodName, Object [] args, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo, boolean declaredOnly ) invokeMethod
 	*/
 	public Object invokeMethod( 
 		String methodName, Object [] args, Interpreter interpreter, 
@@ -1367,8 +1444,8 @@
 	/**
 		Import standard packages.  Currently:
 		<pre>
-			importClass("bsh.EvalError");
-			importClass("bsh.Interpreter");
+            importClass("org.gjt.sp.jedit.bsh.EvalError");
+            importClass("org.gjt.sp.jedit.bsh.Interpreter");
 			importPackage("javax.swing.event");
 			importPackage("javax.swing");
 			importPackage("java.awt.event");
@@ -1377,7 +1454,7 @@
 			importPackage("java.util");
 			importPackage("java.io");
 			importPackage("java.lang");
-			importCommands("/bsh/commands");
+            addCommandPath("/org/gjt/sp/jedit/bsh/commands",getClass());
 		</pre>
 	*/
     public void loadDefaultImports()
@@ -1387,8 +1464,8 @@
 			precedence rules...  so for max efficiency put the most common
 			ones later.
 		*/
-		importClass("bsh.EvalError");
-		importClass("bsh.Interpreter");
+        importClass("org.gjt.sp.jedit.bsh.EvalError");
+        importClass("org.gjt.sp.jedit.bsh.Interpreter");
 		importPackage("javax.swing.event");
 		importPackage("javax.swing");
 		importPackage("java.awt.event");
@@ -1397,7 +1474,7 @@
 		importPackage("java.util");
 		importPackage("java.io");
 		importPackage("java.lang");
-		importCommands("/bsh/commands");
+        addCommandPath("/org/gjt/sp/jedit/bsh/commands",getClass());
     }
 
 	/**
@@ -1546,5 +1623,82 @@
 		
 		return null;
 	}
+
+    // {{{ jEdit addition
+    public void setVariable(String name, Object value) throws UtilEvalError
+        {
+                setVariable(name,value,false);
+        }
+
+    /**
+        Adds a URL to the command path.
+    */
+    public void addCommandPath(String path, Class clas)
+    {
+        if(importedCommands == null)
+            importedCommands = new Vector();
+
+        if(!path.endsWith("/"))
+            path += '/';
+        importedCommands.addElement(new CommandPathEntry(path,clas));
+    }
+
+    /**
+        Remove a URLfrom the command path.
+    */
+    public void removeCommandPath(String path, Class clas)
+    {
+        if(importedCommands == null)
+            return;
+
+        for(int i = 0; i < importedCommands.size(); i++)
+        {
+            CommandPathEntry entry = (CommandPathEntry)importedCommands
+                .elementAt(i);
+            if(entry.path.equals(path) && entry.clas == clas)
+            {
+                importedCommands.removeElementAt(i);
+                return;
+            }
+        }
+    }
+
+    /**
+        Looks up a command.
+    */
+    public InputStream getCommand(String name)
+    {
+        if(importedCommands != null)
+        {
+            String extName = name + ".bsh";
+            for(int i = importedCommands.size() - 1; i >= 0; i--)
+            {
+                CommandPathEntry entry = (CommandPathEntry)importedCommands
+                    .elementAt(i);
+                InputStream in = entry.clas.getResourceAsStream(entry.path + extName);
+                if(in != null)
+                    return in;
+            }
+        }
+
+        if(parent == null)
+            return null;
+        else
+            return parent.getCommand(name);
+    }
+
+    static class CommandPathEntry
+    {
+        final String path;
+        final Class clas;
+
+        CommandPathEntry(String path, Class clas)
+        {
+            this.path = path;
+            this.clas = clas;
+        }
+    }
+
+    // }}}
 }
 
--- a/bsh/src/bsh/Node.java
+++ b/bsh/src/bsh/Node.java
@@ -34,7 +34,7 @@
 
 /* Generated By:JJTree: Do not edit this line. Node.java */
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 /*
 	All BSH nodes must implement this interface.  It provides basic
--- a/bsh/src/bsh/ParseException.java
+++ b/bsh/src/bsh/ParseException.java
@@ -29,7 +29,7 @@
 
 */
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 /**
  * This exception is thrown when parse errors are encountered.
@@ -219,7 +219,7 @@
    * string literal.
    */
   protected String add_escapes(String str) {
-      StringBuffer retval = new StringBuffer();
+      StringBuilder retval = new StringBuilder();
       char ch;
       for (int i = 0; i < str.length(); i++) {
         switch (str.charAt(i))
--- a/bsh/src/bsh/ParserConstants.java
+++ b/bsh/src/bsh/ParserConstants.java
@@ -1,5 +1,5 @@
 /* Generated By:JJTree&JavaCC: Do not edit this line. ParserConstants.java */
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 public interface ParserConstants {
 
--- a/bsh/src/bsh/Parser.java
+++ b/bsh/src/bsh/Parser.java
@@ -1,8 +1,7 @@
 /* Generated By:JJTree&JavaCC: Do not edit this line. Parser.java */
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.io.*;
-import java.util.Vector;
 
 /**
 	This is the BeanShell parser.  It is used internally by the Interpreter
@@ -960,10 +959,10 @@
     boolean jjtc000 = true;
     jjtree.openNodeScope(jjtn000);
     jjtreeOpenNodeScope(jjtn000);Token t;
-    StringBuffer s;
+    StringBuilder s;
     try {
       t = jj_consume_token(IDENTIFIER);
-        s = new StringBuffer(t.image);
+        s = new StringBuilder(t.image);
       label_5:
       while (true) {
         if (jj_2_7(2)) {
--- a/bsh/src/bsh/ParserTokenManager.java
+++ b/bsh/src/bsh/ParserTokenManager.java
@@ -1,7 +1,5 @@
 /* Generated By:JJTree&JavaCC: Do not edit this line. ParserTokenManager.java */
-package bsh;
-import java.io.*;
-import java.util.Vector;
+package org.gjt.sp.jedit.bsh;
 
 public class ParserTokenManager implements ParserConstants
 {
--- a/bsh/src/bsh/ParserTreeConstants.java
+++ b/bsh/src/bsh/ParserTreeConstants.java
@@ -1,6 +1,6 @@
 /* Generated By:JJTree: Do not edit this line. src/bsh\ParserTreeConstants.java */
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 public interface ParserTreeConstants
 {
--- a/bsh/src/bsh/Primitive.java
+++ b/bsh/src/bsh/Primitive.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.util.Hashtable;
 
--- a/bsh/src/bsh/reflect/ReflectManagerImpl.java
+++ b/bsh/src/bsh/reflect/ReflectManagerImpl.java
@@ -31,9 +31,9 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh.reflect;
+package org.gjt.sp.jedit.bsh.reflect;
 
-import bsh.ReflectManager;
+import org.gjt.sp.jedit.bsh.ReflectManager;
 import java.lang.reflect.AccessibleObject;
 
 /**
--- a/bsh/src/bsh/ReflectError.java
+++ b/bsh/src/bsh/ReflectError.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 class ReflectError extends Exception
 {
--- a/bsh/src/bsh/Reflect.java
+++ b/bsh/src/bsh/Reflect.java
@@ -31,7 +31,7 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.lang.reflect.*;
 import java.util.Vector;
@@ -846,7 +846,7 @@
         if ( !type.isArray() )
             return type.getName();
 
-        StringBuffer className = new StringBuffer();
+        StringBuilder className = new StringBuilder();
         try {
             className.append( getArrayBaseType(type).getName() +" ");
             for(int i = 0; i < getArrayDimensions(type); i++)
--- a/bsh/src/bsh/Reflect.last
+++ b/bsh/src/bsh/Reflect.last
@@ -31,7 +31,7 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.lang.reflect.*;
 import java.io.*;
--- a/bsh/src/bsh/ReflectManager.java
+++ b/bsh/src/bsh/ReflectManager.java
@@ -31,9 +31,9 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
-import bsh.Capabilities.Unavailable;
+import org.gjt.sp.jedit.bsh.Capabilities.Unavailable;
 
 /**
 	ReflectManager is a dynamically loaded extension that supports extended
@@ -57,7 +57,7 @@
 		{
 			Class clas;
 			try {
-				clas = Class.forName( "bsh.reflect.ReflectManagerImpl" );
+				clas = Class.forName( "org.gjt.sp.jedit.bsh.reflect.ReflectManagerImpl" );
 				rfm = (ReflectManager)clas.newInstance();
 			} catch ( Exception e ) {
 				throw new Unavailable("Reflect Manager unavailable: "+e);
--- a/bsh/src/bsh/Remote.java
+++ b/bsh/src/bsh/Remote.java
@@ -31,11 +31,11 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.io.*;
 import java.net.*;
-import java.text.*;
+
 /**
 	Remote executor class. Posts a script from the command line to a BshServlet
  	or embedded  interpreter using (respectively) HTTP or the bsh telnet
@@ -146,7 +146,7 @@
 	static String doHttp( String postURL, String text )
 	{
 		String returnValue = null;
-		StringBuffer sb = new StringBuffer();
+		StringBuilder sb = new StringBuilder();
 		sb.append( "bsh.client=Remote" );
 		sb.append( "&bsh.script=" );
 		sb.append( URLEncoder.encode( text ) );
@@ -204,7 +204,7 @@
 	static String getFile( String name )
 		throws FileNotFoundException, IOException
 	{
-		StringBuffer sb = new StringBuffer();
+		StringBuilder sb = new StringBuilder();
 		BufferedReader bin = new BufferedReader( new FileReader( name ) );
 		String line;
 		while ( (line=bin.readLine()) != null )
--- a/bsh/src/bsh/ReturnControl.java
+++ b/bsh/src/bsh/ReturnControl.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 /**
 	Represents a Return, Break, or Continue statement
--- a/bsh/src/bsh/SimpleNode.java
+++ b/bsh/src/bsh/SimpleNode.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 /*
 	Note: great care (and lots of typing) were taken to insure that the
 	namespace and interpreter references are passed on the stack and not 
@@ -206,7 +206,7 @@
 	*/
 	public String getText() 
 	{
-		StringBuffer text = new StringBuffer();
+		StringBuilder text = new StringBuilder();
 		Token t = firstToken;
 		while ( t!=null ) {
 			text.append(t.image);
--- a/bsh/src/bsh/StringUtil.java
+++ b/bsh/src/bsh/StringUtil.java
@@ -31,7 +31,7 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.util.*;
 
@@ -81,7 +81,7 @@
 
     public static String methodString(String name, Class[] types)
     {
-        StringBuffer sb = new StringBuffer(name + "(");
+    	StringBuilder sb = new StringBuilder(name + "(");
         if ( types.length > 0 )
 			sb.append(" ");
         for( int i=0; i<types.length; i++ )
--- a/bsh/src/bsh/TargetError.java
+++ b/bsh/src/bsh/TargetError.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.lang.reflect.InvocationTargetException;
 
--- a/bsh/src/bsh/This.java
+++ b/bsh/src/bsh/This.java
@@ -32,9 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
-
-import java.io.IOException;
+package org.gjt.sp.jedit.bsh;
 
 /**
 	'This' is the type of bsh scripted objects.
@@ -82,9 +80,9 @@
 		try {
 			Class c;
 			if ( Capabilities.canGenerateInterfaces() )
-				c = Class.forName( "bsh.XThis" );
+                c = Class.forName( "org.gjt.sp.jedit.bsh.XThis" );
 			else if ( Capabilities.haveSwing() )
-				c = Class.forName( "bsh.JThis" );
+                c = Class.forName( "org.gjt.sp.jedit.bsh.JThis" );
 			else
 				return new This( namespace, declaringInterpreter );
 
@@ -165,7 +163,7 @@
 		outside of bsh in native java code.
 		Note: you must still wrap/unwrap args/return values using 
 		Primitive/Primitive.unwrap() for use outside of BeanShell.
-		@see bsh.Primitive
+        @see org.gjt.sp.jedit.bsh.Primitive
 	*/
 	public Object invokeMethod( String name, Object [] args ) 
 		throws EvalError
@@ -197,15 +195,13 @@
 		have to script them directly.
 		<p>
 
-		@see bsh.This.invokeMethod( 
-			String methodName, Object [] args, Interpreter interpreter, 
-			CallStack callstack, SimpleNode callerInfo )
-		@param if callStack is null a new CallStack will be created and
+        @see org.gjt.sp.jedit.bsh.This#invokeMethod(String methodName, Object [] args, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo, boolean declaredOnly ) invokeMethod
+        @param callstack if callStack is null a new CallStack will be created and
 			initialized with this namespace.
 		@param declaredOnly if true then only methods declared directly in the
 			namespace will be visible - no inherited or imported methods will
 			be visible.
-		@see bsh.Primitive
+        @see org.gjt.sp.jedit.bsh.Primitive Primitive
 	*/
 	/*
 		invokeMethod() here is generally used by outside code to callback
--- a/bsh/src/bsh/Token.java
+++ b/bsh/src/bsh/Token.java
@@ -1,5 +1,5 @@
 /* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
-package bsh;
+package org.gjt.sp.jedit.bsh;
 /*
 	This file has been modified for BeanShell to make Token serializable.
 	If this file is regenerated please make this change.
--- a/bsh/src/bsh/TokenMgrError.java
+++ b/bsh/src/bsh/TokenMgrError.java
@@ -1,5 +1,5 @@
 /* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 3.0 */
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 public class TokenMgrError extends Error
 {
@@ -38,7 +38,7 @@
     * equivalents in the given string
     */
    protected static final String addEscapes(String str) {
-      StringBuffer retval = new StringBuffer();
+	  StringBuilder retval = new StringBuilder();
       char ch;
       for (int i = 0; i < str.length(); i++) {
         switch (str.charAt(i))
--- a/bsh/src/bsh/Types.java
+++ b/bsh/src/bsh/Types.java
@@ -31,7 +31,7 @@
  *                                                                           *
  *****************************************************************************/
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 /**
 	Static routines supporing type comparison and conversion in BeanShell.
@@ -366,7 +366,7 @@
 
 		@param operation is Types.CAST or Types.ASSIGNMENT
 
-		@see bsh.Primitive.getType()
+		@see org.gjt.sp.jedit.bsh.Primitive.getType()
 	*/
 	/*
 		Notes: This method is currently responsible for auto-boxing/unboxing
@@ -483,11 +483,11 @@
 		// Can we use the proxy mechanism to cast a bsh.This to 
 		// the correct interface?
 		if ( toType.isInterface() 
-			&& bsh.This.class.isAssignableFrom( fromType ) 
+			&& org.gjt.sp.jedit.bsh.This.class.isAssignableFrom( fromType )
 			&& Capabilities.canGenerateInterfaces() 
 		)
 			return checkOnly ? VALID_CAST : 
-				((bsh.This)fromValue).getInterface( toType );
+				((org.gjt.sp.jedit.bsh.This)fromValue).getInterface( toType );
 
 		// Both numeric wrapper types? 
 		// Try numeric style promotion wrapper cast
--- a/bsh/src/bsh/UtilEvalError.java
+++ b/bsh/src/bsh/UtilEvalError.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 /**
 	UtilEvalError is an error corresponding to an EvalError but thrown by a 
@@ -68,7 +68,6 @@
 	/**
 		Re-throw as an eval error, prefixing msg to the message and specifying
 		the node.  If a node already exists the addNode is ignored.
-		@see #setNode( bsh.SimpleNode )
 		<p>
 		@param msg may be null for no additional message.
 	*/
--- a/bsh/src/bsh/UtilTargetError.java
+++ b/bsh/src/bsh/UtilTargetError.java
@@ -32,7 +32,7 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 /**
 	UtilTargetError is an error corresponding to a TargetError but thrown by a 
--- a/bsh/src/bsh/Variable.java
+++ b/bsh/src/bsh/Variable.java
@@ -1,4 +1,4 @@
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 public class Variable implements java.io.Serializable 
 {
--- a/bsh/src/bsh/XThis.java
+++ b/bsh/src/bsh/XThis.java
@@ -32,11 +32,10 @@
  *****************************************************************************/
 
 
-package bsh;
+package org.gjt.sp.jedit.bsh;
 
 import java.lang.reflect.*;
 import java.lang.reflect.InvocationHandler;
-import java.io.*;
 import java.util.Hashtable;
 
 /**
@@ -54,8 +53,9 @@
 
 	XThis stands for "eXtended This" (I had to call it something).
 	
-	@see JThis	 See also JThis with explicit JFC support for compatability.
-	@see This	
+    @see org.gjt.sp.jedit.bsh.JThis	JThis
+    See also JThis with explicit JFC support for compatability.
+    @see org.gjt.sp.jedit.bsh.This This
 */
 public class XThis extends This 
 	{
@@ -182,7 +182,7 @@
 			{
 				Class [] ints = proxy.getClass().getInterfaces();
 				// XThis.this refers to the enclosing class instance
-				StringBuffer sb = new StringBuffer( 
+                StringBuilder sb = new StringBuilder(
 					XThis.this.toString() + "\nimplements:" );
 				for(int i=0; i<ints.length; i++)
 					sb.append( " "+ ints[i].getName()