Codebase list findbugs / ae8b2526-32e9-4b37-8f72-25923ca1a232/main src / patches / obsolete / bcel-30-April-2003.patch
ae8b2526-32e9-4b37-8f72-25923ca1a232/main

Tree @ae8b2526-32e9-4b37-8f72-25923ca1a232/main (Download .tar.gz)

bcel-30-April-2003.patch @ae8b2526-32e9-4b37-8f72-25923ca1a232/mainraw · history · blame

   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
? HelloWorld.class
? java
? docs/api
Index: examples/TransitiveHull.java
===================================================================
RCS file: /home/cvspublic/jakarta-bcel/examples/TransitiveHull.java,v
retrieving revision 1.2
diff -u -r1.2 TransitiveHull.java
--- examples/TransitiveHull.java	10 Nov 2002 18:30:05 -0000	1.2
+++ examples/TransitiveHull.java	30 Apr 2003 17:53:51 -0000
@@ -24,6 +24,12 @@
  * @author  <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
  */
 public class TransitiveHull extends org.apache.bcel.classfile.EmptyVisitor {
+  private static class LookupFailure extends RuntimeException {
+    public LookupFailure(String msg) {
+      super(msg);
+    }
+  }
+
   private JavaClass    _class;
   private ClassQueue   _queue;
   private ClassSet     _set;
@@ -86,10 +92,14 @@
       return;
     }
     
-    JavaClass clazz = Repository.lookupClass(class_name);
+    try {
+      JavaClass clazz = Repository.lookupClass(class_name);
     
-    if(clazz != null && _set.add(clazz)) {
-      _queue.enqueue(clazz);
+      if(_set.add(clazz)) {
+        _queue.enqueue(clazz);
+      }
+    } catch (ClassNotFoundException e) {
+      throw new LookupFailure("Missing class: " + e.toString());
     }
   }
 
Index: src/java/org/apache/bcel/Repository.java
===================================================================
RCS file: /home/cvspublic/jakarta-bcel/src/java/org/apache/bcel/Repository.java,v
retrieving revision 1.11
diff -u -r1.11 Repository.java
--- src/java/org/apache/bcel/Repository.java	11 Oct 2002 20:34:47 -0000	1.11
+++ src/java/org/apache/bcel/Repository.java	30 Apr 2003 17:53:51 -0000
@@ -88,33 +88,32 @@
   /** Lookup class somewhere found on your CLASSPATH, or whereever the
    * repository instance looks for it.
    *
-   * @return class object for given fully qualified class name, or null
-   * if the class could not be found or parsed correctly
+   * @return class object for given fully qualified class name
+   * @throws ClassNotFoundException if the class could not be found or
+   * parsed correctly
    */
-  public static JavaClass lookupClass(String class_name) {
-    try {
-      JavaClass clazz = _repository.findClass(class_name);
+  public static JavaClass lookupClass(String class_name)
+    throws ClassNotFoundException {
 
-      if(clazz == null) {
-	return _repository.loadClass(class_name);
-      } else {
-	return clazz;
-      }
-    } catch(ClassNotFoundException ex) { return null; }
+    return _repository.loadClass(class_name);
   }
 
   /**
-   * Try to find class source via getResourceAsStream().
+   * Try to find class source using the internal repository instance.
    * @see Class
    * @return JavaClass object for given runtime class
+   * @throws ClassNotFoundException if the class could not be found or
+   * parsed correctly
    */
-  public static JavaClass lookupClass(Class clazz) {
-    try {
-      return _repository.loadClass(clazz);
-    } catch(ClassNotFoundException ex) { return null; }
+  public static JavaClass lookupClass(Class clazz)
+    throws ClassNotFoundException {
+    return _repository.loadClass(clazz);
   }
 
-  /** @return class file object for given Java class.
+  /**
+   * @return class file object for given Java class by looking on the
+   *  system class path; returns null if the class file can't be
+   *  found
    */
   public static ClassPath.ClassFile lookupClassFile(String class_name) {
     try {
@@ -156,92 +155,124 @@
   /**
    * @return list of super classes of clazz in ascending order, i.e.,
    * Object is always the last element
+   * @throws ClassNotFoundException if any of the superclasses can't be found
    */
-  public static JavaClass[] getSuperClasses(JavaClass clazz) {
+  public static JavaClass[] getSuperClasses(JavaClass clazz)
+    throws ClassNotFoundException {
     return clazz.getSuperClasses();
   }
 
   /**
    * @return list of super classes of clazz in ascending order, i.e.,
-   * Object is always the last element. return "null", if class
-   * cannot be found.
+   * Object is always the last element.
+   * @throws ClassNotFoundException if the named class or any of its
+   *  superclasses can't be found
    */
-  public static JavaClass[] getSuperClasses(String class_name) {
+  public static JavaClass[] getSuperClasses(String class_name)
+    throws ClassNotFoundException {
     JavaClass jc = lookupClass(class_name);
-    return (jc == null? null : getSuperClasses(jc));
+    return getSuperClasses(jc);
   }
 
   /**
    * @return all interfaces implemented by class and its super
    * classes and the interfaces that those interfaces extend, and so on.
    * (Some people call this a transitive hull).
+   * @throws ClassNotFoundException if any of the class's
+   *  superclasses or superinterfaces can't be found
    */
-  public static JavaClass[] getInterfaces(JavaClass clazz) {
+  public static JavaClass[] getInterfaces(JavaClass clazz)
+    throws ClassNotFoundException {
     return clazz.getAllInterfaces();
   }
 
   /**
    * @return all interfaces implemented by class and its super
    * classes and the interfaces that extend those interfaces, and so on
+   * @throws ClassNotFoundException if the named class can't be found,
+   *   or if any of its superclasses or superinterfaces can't be found
    */
-  public static JavaClass[] getInterfaces(String class_name) {
+  public static JavaClass[] getInterfaces(String class_name)
+    throws ClassNotFoundException {
     return getInterfaces(lookupClass(class_name));
   }
 
   /**
    * Equivalent to runtime "instanceof" operator.
    * @return true, if clazz is an instance of super_class
+   * @throws ClassNotFoundException if any superclasses or superinterfaces
+   *   of clazz can't be found
    */
-  public static boolean instanceOf(JavaClass clazz, JavaClass super_class) {
+  public static boolean instanceOf(JavaClass clazz, JavaClass super_class)
+    throws ClassNotFoundException {
     return clazz.instanceOf(super_class);
   }
 
   /**
    * @return true, if clazz is an instance of super_class
+   * @throws ClassNotFoundException if either clazz or super_class
+   *   can't be found
    */
-  public static boolean instanceOf(String clazz, String super_class) {
+  public static boolean instanceOf(String clazz, String super_class)
+    throws ClassNotFoundException {
     return instanceOf(lookupClass(clazz), lookupClass(super_class));
   }
 
   /**
    * @return true, if clazz is an instance of super_class
+   * @throws ClassNotFoundException if super_class can't be found
    */
-  public static boolean instanceOf(JavaClass clazz, String super_class) {
+  public static boolean instanceOf(JavaClass clazz, String super_class)
+    throws ClassNotFoundException {
     return instanceOf(clazz, lookupClass(super_class));
   }
 
   /**
    * @return true, if clazz is an instance of super_class
+   * @throws ClassNotFoundException if clazz can't be found
    */
-  public static boolean instanceOf(String clazz, JavaClass super_class) {
+  public static boolean instanceOf(String clazz, JavaClass super_class)
+    throws ClassNotFoundException {
     return instanceOf(lookupClass(clazz), super_class);
   }
 
   /**
    * @return true, if clazz is an implementation of interface inter
+   * @throws ClassNotFoundException if any superclasses or superinterfaces
+   *   of clazz can't be found
    */
-  public static boolean implementationOf(JavaClass clazz, JavaClass inter) {
+  public static boolean implementationOf(JavaClass clazz, JavaClass inter)
+    throws ClassNotFoundException {
     return clazz.implementationOf(inter);
   }
 
   /**
    * @return true, if clazz is an implementation of interface inter
+   * @throws ClassNotFoundException if clazz, inter, or any superclasses
+   *   or superinterfaces of clazz can't be found
    */
-  public static boolean implementationOf(String clazz, String inter) {
+  public static boolean implementationOf(String clazz, String inter)
+    throws ClassNotFoundException {
     return implementationOf(lookupClass(clazz), lookupClass(inter));
   }
 
   /**
    * @return true, if clazz is an implementation of interface inter
+   * @throws ClassNotFoundException if inter or any superclasses
+   *   or superinterfaces of clazz can't be found
    */
-  public static boolean implementationOf(JavaClass clazz, String inter) {
+  public static boolean implementationOf(JavaClass clazz, String inter)
+    throws ClassNotFoundException {
     return implementationOf(clazz, lookupClass(inter));
   }
 
   /**
    * @return true, if clazz is an implementation of interface inter
+   * @throws ClassNotFoundException if clazz or any superclasses or
+   *   superinterfaces of clazz can't be found
    */
-  public static boolean implementationOf(String clazz, JavaClass inter) {
+  public static boolean implementationOf(String clazz, JavaClass inter)
+    throws ClassNotFoundException {
     return implementationOf(lookupClass(clazz), inter);
   }
 }
Index: src/java/org/apache/bcel/classfile/JavaClass.java
===================================================================
RCS file: /home/cvspublic/jakarta-bcel/src/java/org/apache/bcel/classfile/JavaClass.java,v
retrieving revision 1.13
diff -u -r1.13 JavaClass.java
--- src/java/org/apache/bcel/classfile/JavaClass.java	11 Jul 2002 19:39:04 -0000	1.13
+++ src/java/org/apache/bcel/classfile/JavaClass.java	30 Apr 2003 17:53:51 -0000
@@ -685,9 +685,13 @@
 
   /** Equivalent to runtime "instanceof" operator.
    *
-   * @return true if this JavaClass is derived from teh super class
+   * @return true if this JavaClass is derived from the super class
+   * @throws ClassNotFoundException if superclasses or superinterfaces
+   *   of this object can't be found
    */
-  public final boolean instanceOf(JavaClass super_class) {
+  public final boolean instanceOf(JavaClass super_class)
+    throws ClassNotFoundException {
+
     if(this.equals(super_class))
       return true;
 
@@ -707,9 +711,13 @@
   }
 
   /**
-   * @return true, if clazz is an implementation of interface inter
+   * @return true, if this class is an implementation of interface inter
+   * @throws ClassNotFoundException if superclasses or superinterfaces
+   *   of this class can't be found
    */
-  public boolean implementationOf(JavaClass inter) {
+  public boolean implementationOf(JavaClass inter)
+    throws ClassNotFoundException {
+
     if(!inter.isInterface()) {
       throw new IllegalArgumentException(inter.getClassName() + " is no interface");
     }
@@ -732,25 +740,22 @@
   /**
    * @return the superclass for this JavaClass object, or null if this
    * is java.lang.Object
+   * @throws ClassNotFoundException if the superclass can't be found
    */
-  public JavaClass getSuperClass() {
+  public JavaClass getSuperClass() throws ClassNotFoundException {
     if("java.lang.Object".equals(getClassName())) {
       return null;
     }
 
-    try {
-      return repository.loadClass(getSuperclassName());
-    } catch(ClassNotFoundException e) {
-      System.err.println(e);
-      return null;
-    }
+    return repository.loadClass(getSuperclassName());
   }
 
   /**
    * @return list of super classes of this class in ascending order, i.e.,
    * java.lang.Object is always the last element
+   * @throws ClassNotFoundException if any of the superclasses can't be found
    */
-  public JavaClass[] getSuperClasses() {
+  public JavaClass[] getSuperClasses() throws ClassNotFoundException {
     JavaClass   clazz = this;
     ClassVector vec   = new ClassVector();
 
@@ -766,17 +771,12 @@
   /**
    * Get interfaces directly implemented by this JavaClass.
    */
-  public JavaClass[] getInterfaces() {
+  public JavaClass[] getInterfaces() throws ClassNotFoundException {
     String[]    interfaces = getInterfaceNames();
     JavaClass[] classes    = new JavaClass[interfaces.length];
 
-    try {
-      for(int i = 0; i < interfaces.length; i++) {
-	classes[i] = repository.loadClass(interfaces[i]);
-      }
-    } catch(ClassNotFoundException e) {
-      System.err.println(e);
-      return null;
+    for(int i = 0; i < interfaces.length; i++) {
+      classes[i] = repository.loadClass(interfaces[i]);
     }
 
     return classes;
@@ -785,7 +785,7 @@
   /**
    * Get all interfaces implemented by this JavaClass (transitively).
    */
-  public JavaClass[] getAllInterfaces() {
+  public JavaClass[] getAllInterfaces() throws ClassNotFoundException {
     ClassQueue  queue = new ClassQueue();
     ClassVector vec   = new ClassVector();
     
Index: src/java/org/apache/bcel/classfile/Signature.java
===================================================================
RCS file: /home/cvspublic/jakarta-bcel/src/java/org/apache/bcel/classfile/Signature.java,v
retrieving revision 1.3
diff -u -r1.3 Signature.java
--- src/java/org/apache/bcel/classfile/Signature.java	11 Mar 2002 16:16:35 -0000	1.3
+++ src/java/org/apache/bcel/classfile/Signature.java	30 Apr 2003 17:53:51 -0000
@@ -111,7 +111,7 @@
    * @param v Visitor object
    */
    public void accept(Visitor v) {
-     System.err.println("Visiting non-standard Signature object");
+     //System.err.println("Visiting non-standard Signature object");
      v.visitSignature(this);
    }
    
Index: src/java/org/apache/bcel/generic/ObjectType.java
===================================================================
RCS file: /home/cvspublic/jakarta-bcel/src/java/org/apache/bcel/generic/ObjectType.java,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 ObjectType.java
--- src/java/org/apache/bcel/generic/ObjectType.java	29 Oct 2001 20:00:25 -0000	1.1.1.1
+++ src/java/org/apache/bcel/generic/ObjectType.java	30 Apr 2003 17:53:51 -0000
@@ -93,12 +93,13 @@
    * If "this" doesn't reference a class, it references an interface
    * or a non-existant entity.
    */
-  public boolean referencesClass(){
-    JavaClass jc = Repository.lookupClass(class_name);
-    if (jc == null)
-      return false;
-    else
+  public boolean referencesClass() {
+    try {
+      JavaClass jc = Repository.lookupClass(class_name);
       return jc.isClass();
+    } catch (ClassNotFoundException e) {
+      return false;
+    }
   }
   
   /**
@@ -106,14 +107,22 @@
    * or a non-existant entity.
    */
   public boolean referencesInterface(){
-    JavaClass jc = Repository.lookupClass(class_name);
-    if (jc == null)
-      return false;
-    else
+    try {
+      JavaClass jc = Repository.lookupClass(class_name);
       return !jc.isClass();
+    } catch (ClassNotFoundException e) {
+      return false;
+    }
   }
 
-  public boolean subclassOf(ObjectType superclass){
+  /**
+   * Return true if this type is a subclass of given ObjectType.
+   * @throws ClassNotFoundException if any of this class's superclasses
+   *  can't be found
+   */
+  public boolean subclassOf(ObjectType superclass)
+    throws ClassNotFoundException {
+
     if (this.referencesInterface() || superclass.referencesInterface())
       return false;
 
@@ -122,8 +131,10 @@
 
   /**
    * Java Virtual Machine Specification edition 2, § 5.4.4 Access Control
+   * @throws ClassNotFoundException if the class referenced by this type
+   *   can't be found
    */
-  public boolean accessibleTo(ObjectType accessor) {
+  public boolean accessibleTo(ObjectType accessor) throws ClassNotFoundException {
     JavaClass jc = Repository.lookupClass(class_name);
 
     if(jc.isPublic()) {
Index: src/java/org/apache/bcel/generic/ReferenceType.java
===================================================================
RCS file: /home/cvspublic/jakarta-bcel/src/java/org/apache/bcel/generic/ReferenceType.java,v
retrieving revision 1.5
diff -u -r1.5 ReferenceType.java
--- src/java/org/apache/bcel/generic/ReferenceType.java	7 Aug 2002 18:01:32 -0000	1.5
+++ src/java/org/apache/bcel/generic/ReferenceType.java	30 Apr 2003 17:53:51 -0000
@@ -82,8 +82,11 @@
    * However, because e.g. CHECKCAST doesn't throw a
    * ClassCastException when casting a null reference to any Object,
    * true is returned in this case.
+   *
+   * @throws ClassNotFoundException if any classes or interfaces required
+   *  to determine assignment compatibility can't be found
    */
-  public boolean isCastableTo(Type t) {
+  public boolean isCastableTo(Type t) throws ClassNotFoundException {
     if (this.equals(Type.NULL))
       return true;		// If this is ever changed in isAssignmentCompatible()
 
@@ -97,8 +100,12 @@
    * Return true iff this is assignment compatible with another type t
    * as defined in the JVM specification; see the AASTORE definition
    * there.
+   * @throws ClassNotFoundException if any classes or interfaces required
+   *  to determine assignment compatibility can't be found
    */
-  public boolean isAssignmentCompatibleWith(Type t) {
+  public boolean isAssignmentCompatibleWith(Type t)
+    throws ClassNotFoundException {
+
     if (!(t instanceof ReferenceType))
       return false;
 
@@ -210,8 +217,13 @@
    * If "this" or t is a ReferenceType referencing an interface, then Type.OBJECT is returned.
    * If not all of the two classes' superclasses cannot be found, "null" is returned.
    * See the JVM specification edition 2, "§4.9.2 The Bytecode Verifier".
+   *
+   * @throws ClassNotFoundException on failure to find superclasses of this
+   *  type, or the type passed as a parameter
    */
-  public ReferenceType getFirstCommonSuperclass(ReferenceType t) {
+  public ReferenceType getFirstCommonSuperclass(ReferenceType t)
+    throws ClassNotFoundException {
+
     if (this.equals(Type.NULL)) return t;
     if (t.equals(Type.NULL)) return this;
     if (this.equals(t)) return this;
@@ -294,8 +306,12 @@
    *
    * @deprecated use getFirstCommonSuperclass(ReferenceType t) which has
    *             slightly changed semantics.
+   * @throws ClassNotFoundException on failure to find superclasses of this
+   *  type, or the type passed as a parameter
    */
-  public ReferenceType firstCommonSuperclass(ReferenceType t) {
+  public ReferenceType firstCommonSuperclass(ReferenceType t)
+    throws ClassNotFoundException {
+
     if (this.equals(Type.NULL)) return t;
     if (t.equals(Type.NULL)) return this;
     if (this.equals(t)) return this;
Index: src/java/org/apache/bcel/util/SyntheticRepository.java
===================================================================
RCS file: /home/cvspublic/jakarta-bcel/src/java/org/apache/bcel/util/SyntheticRepository.java,v
retrieving revision 1.6
diff -u -r1.6 SyntheticRepository.java
--- src/java/org/apache/bcel/util/SyntheticRepository.java	10 Nov 2002 18:30:05 -0000	1.6
+++ src/java/org/apache/bcel/util/SyntheticRepository.java	30 Apr 2003 17:53:51 -0000
@@ -138,6 +138,10 @@
   public JavaClass loadClass(String className) 
     throws ClassNotFoundException
   {
+    JavaClass alreadyLoaded = findClass(className);
+    if (alreadyLoaded != null)
+      return alreadyLoaded;
+
     if(className == null || className.equals("")) {
       throw new IllegalArgumentException("Invalid class name " + className);
     }
@@ -159,6 +163,11 @@
    */
   public JavaClass loadClass(Class clazz) throws ClassNotFoundException {
     String className = clazz.getName();
+
+    JavaClass alreadyLoaded = findClass(className);
+    if (alreadyLoaded != null)
+      return alreadyLoaded;
+
     String name      = className;
     int    i         = name.lastIndexOf('.');
 
Index: src/java/org/apache/bcel/verifier/TransitiveHull.java
===================================================================
RCS file: /home/cvspublic/jakarta-bcel/src/java/org/apache/bcel/verifier/TransitiveHull.java,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 TransitiveHull.java
--- src/java/org/apache/bcel/verifier/TransitiveHull.java	29 Oct 2001 20:00:31 -0000	1.1.1.1
+++ src/java/org/apache/bcel/verifier/TransitiveHull.java	30 Apr 2003 17:53:51 -0000
@@ -77,7 +77,7 @@
 	}
 	
 	/* Implementing VerifierFactoryObserver. */
-	public void update(String classname){
+	public void update(String classname) {
 
 		System.gc(); // avoid swapping if possible.
 
@@ -99,15 +99,19 @@
 			System.out.println("Pass 2:\n"+vr);
 
 		if (vr == VerificationResult.VR_OK){
-			JavaClass jc = Repository.lookupClass(v.getClassName());
-			for (int i=0; i<jc.getMethods().length; i++){
-				vr = v.doPass3a(i);
-				if (vr != VerificationResult.VR_OK) //System.exit(1);
-					System.out.println(v.getClassName()+", Pass 3a, method "+i+" ['"+jc.getMethods()[i]+"']:\n"+vr);
-
-				vr = v.doPass3b(i);
-				if (vr != VerificationResult.VR_OK) //System.exit(1);
-					System.out.println(v.getClassName()+", Pass 3b, method "+i+" ['"+jc.getMethods()[i]+"']:\n"+vr);
+			try {
+				JavaClass jc = Repository.lookupClass(v.getClassName());
+				for (int i=0; i<jc.getMethods().length; i++){
+					vr = v.doPass3a(i);
+					if (vr != VerificationResult.VR_OK) //System.exit(1);
+						System.out.println(v.getClassName()+", Pass 3a, method "+i+" ['"+jc.getMethods()[i]+"']:\n"+vr);
+	
+					vr = v.doPass3b(i);
+					if (vr != VerificationResult.VR_OK) //System.exit(1);
+						System.out.println(v.getClassName()+", Pass 3b, method "+i+" ['"+jc.getMethods()[i]+"']:\n"+vr);
+				}
+			} catch (ClassNotFoundException e) {
+				System.err.println("Could not find class " + v.getClassName() + " in Repository");
 			}
 		}
 
Index: src/java/org/apache/bcel/verifier/Verifier.java
===================================================================
RCS file: /home/cvspublic/jakarta-bcel/src/java/org/apache/bcel/verifier/Verifier.java,v
retrieving revision 1.7
diff -u -r1.7 Verifier.java
--- src/java/org/apache/bcel/verifier/Verifier.java	13 Oct 2002 21:56:16 -0000	1.7
+++ src/java/org/apache/bcel/verifier/Verifier.java	30 Apr 2003 17:53:51 -0000
@@ -172,7 +172,7 @@
 	 * This returns all the (warning) messages collected during verification.
 	 * A prefix shows from which verifying pass a message originates.
 	 */
-	public String[] getMessages(){
+	public String[] getMessages() throws ClassNotFoundException {
 		ArrayList messages = new ArrayList();
 
 		if (p1v != null){
@@ -237,7 +237,7 @@
 	public static void main(String [] args){
 		System.out.println("JustIce by Enver Haase, (C) 2001-2002.\n<http://bcel.sourceforge.net>\n<http://jakarta.apache.org/bcel>\n");
 	  for(int k=0; k < args.length; k++) {
-
+		try {
 			if (args[k].endsWith(".class")){
 				int dotclasspos = args[k].lastIndexOf(".class");
 				if (dotclasspos != -1) args[k] = args[k].substring(0,dotclasspos);
@@ -278,9 +278,12 @@
 			System.out.println("\n");
 
 			// avoid swapping.
-	  	v.flush();
-	  	org.apache.bcel.Repository.clearCache();
-		System.gc();
+	  		v.flush();
+	  		org.apache.bcel.Repository.clearCache();
+			System.gc();
+		} catch (ClassNotFoundException e) {
+			e.printStackTrace();
+		}
 	  }
 	}
 }
Index: src/java/org/apache/bcel/verifier/VerifierAppFrame.java
===================================================================
RCS file: /home/cvspublic/jakarta-bcel/src/java/org/apache/bcel/verifier/VerifierAppFrame.java,v
retrieving revision 1.3
diff -u -r1.3 VerifierAppFrame.java
--- src/java/org/apache/bcel/verifier/VerifierAppFrame.java	13 Jun 2002 09:32:50 -0000	1.3
+++ src/java/org/apache/bcel/verifier/VerifierAppFrame.java	30 Apr 2003 17:53:51 -0000
@@ -242,11 +242,16 @@
   synchronized void classNamesJList_valueChanged(ListSelectionEvent e) {
     if (e.getValueIsAdjusting()) return;
     current_class = classNamesJList.getSelectedValue().toString();
-    verify();
+    try {
+      verify();
+    } catch (ClassNotFoundException ex) {
+      // FIXME: report the error using the GUI
+      ex.printStackTrace();
+    }
     classNamesJList.setSelectedValue(current_class, true);
   }
 
-  private void verify(){
+  private void verify() throws ClassNotFoundException {
     setTitle("PLEASE WAIT");
 
     Verifier v = VerifierFactory.getVerifier(current_class);
@@ -345,7 +350,14 @@
           all3aok = false;
           rejected = true;
         }
-        all3amsg += "Method '"+Repository.lookupClass(v.getClassName()).getMethods()[i]+"': "+vr.getMessage().replace('\n',' ')+"\n\n";
+        JavaClass jc = null;
+	try {
+          jc = Repository.lookupClass(v.getClassName());
+        } catch (ClassNotFoundException ex) {
+          // FIXME: handle the error
+          ex.printStackTrace();
+        }
+        all3amsg += "Method '"+jc.getMethods()[i]+"': "+vr.getMessage().replace('\n',' ')+"\n\n";
       }
     }
     pass3aTextPane.setText(all3amsg);
@@ -370,7 +382,14 @@
           all3bok = false;
           rejected = true;
         }
-        all3bmsg += "Method '"+Repository.lookupClass(v.getClassName()).getMethods()[i]+"': "+vr.getMessage().replace('\n',' ')+"\n\n";
+        JavaClass jc = null;
+	try {
+          jc = Repository.lookupClass(v.getClassName());
+        } catch (ClassNotFoundException ex) {
+          // FIXME: handle the error
+          ex.printStackTrace();
+        }
+        all3bmsg += "Method '"+jc.getMethods()[i]+"': "+vr.getMessage().replace('\n',' ')+"\n\n";
       }
     }
     pass3bTextPane.setText(all3bmsg);
Index: src/java/org/apache/bcel/verifier/VerifyDialog.java
===================================================================
RCS file: /home/cvspublic/jakarta-bcel/src/java/org/apache/bcel/verifier/VerifyDialog.java,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 VerifyDialog.java
--- src/java/org/apache/bcel/verifier/VerifyDialog.java	29 Oct 2001 20:00:33 -0000	1.1.1.1
+++ src/java/org/apache/bcel/verifier/VerifyDialog.java	30 Apr 2003 17:53:51 -0000
@@ -539,7 +539,13 @@
 	Verifier v = VerifierFactory.getVerifier(class_name);
 	VerificationResult vr = v.doPass2();
 	if (vr.getStatus() == VerificationResult.VERIFIED_OK){
-		JavaClass jc = Repository.lookupClass(class_name);
+		JavaClass jc = null;
+		try {
+			jc = Repository.lookupClass(class_name);
+		} catch (ClassNotFoundException ex) {
+			// FIXME: report the error
+			ex.printStackTrace();
+		}
 		int nr = jc.getMethods().length;
 		for (int i=0; i<nr; i++) {
 			vr = v.doPass3b(i);
Index: src/java/org/apache/bcel/verifier/statics/Pass1Verifier.java
===================================================================
RCS file: /home/cvspublic/jakarta-bcel/src/java/org/apache/bcel/verifier/statics/Pass1Verifier.java,v
retrieving revision 1.2
diff -u -r1.2 Pass1Verifier.java
--- src/java/org/apache/bcel/verifier/statics/Pass1Verifier.java	13 Jun 2002 09:32:50 -0000	1.2
+++ src/java/org/apache/bcel/verifier/statics/Pass1Verifier.java	30 Apr 2003 17:53:51 -0000
@@ -85,7 +85,14 @@
 	/** Used to load in and return the myOwner-matching JavaClass object when needed. Avoids loading in a class file when it's not really needed! */
 	private JavaClass getJavaClass(){
 		if (jc == null){
-			jc = Repository.lookupClass(myOwner.getClassName());
+			try {
+				jc = Repository.lookupClass(myOwner.getClassName());
+			} catch (ClassNotFoundException e) {
+				// FIXME: currently, Pass1Verifier treats jc == null as a special
+				// case, so we don't need to do anything here.  A better solution
+				// would be to simply throw the ClassNotFoundException
+				// out of this method.
+			}
 		}
 		return jc;
 	}
Index: src/java/org/apache/bcel/verifier/statics/Pass2Verifier.java
===================================================================
RCS file: /home/cvspublic/jakarta-bcel/src/java/org/apache/bcel/verifier/statics/Pass2Verifier.java,v
retrieving revision 1.2
diff -u -r1.2 Pass2Verifier.java
--- src/java/org/apache/bcel/verifier/statics/Pass2Verifier.java	13 Jun 2002 09:32:50 -0000	1.2
+++ src/java/org/apache/bcel/verifier/statics/Pass2Verifier.java	30 Apr 2003 17:53:51 -0000
@@ -139,6 +139,7 @@
 	 * @see org.apache.bcel.verifier.statics.Pass3aVerifier
 	 */
 	public VerificationResult do_verify(){
+	    try {
 		VerificationResult vr1 = myOwner.doPass1();
 		if (vr1.equals(VerificationResult.VR_OK)){
 			
@@ -160,6 +161,11 @@
 		}
 		else
 			return VerificationResult.VR_NOTYET;
+
+	    } catch (ClassNotFoundException e) {
+		// FIXME: this might not be the best way to handle missing classes.
+		throw new AssertionViolatedException("Missing class: " + e.toString());
+	    }
 	}
 
 	/**
@@ -176,6 +182,7 @@
 	 * @throws ClassConstraintException otherwise.
 	 */
 	private void every_class_has_an_accessible_superclass(){
+	    try {
 		HashSet hs = new HashSet(); // save class names to detect circular inheritance
 		JavaClass jc = Repository.lookupClass(myOwner.getClassName());
 		int supidx = -1;
@@ -206,6 +213,11 @@
 				}
 			}
 		}
+
+	    } catch (ClassNotFoundException e) {
+		// FIXME: this might not be the best way to handle missing classes.
+		throw new AssertionViolatedException("Missing class: " + e.toString());
+	    }
 	}
 
 	/**
@@ -220,6 +232,7 @@
 	 * @see #every_class_has_an_accessible_superclass()
 	 */
 	private void final_methods_are_not_overridden(){
+	    try {
 		HashMap hashmap = new HashMap();
 		JavaClass jc = Repository.lookupClass(myOwner.getClassName());
 		
@@ -251,6 +264,11 @@
 			jc = Repository.lookupClass(jc.getSuperclassName());	// Well, for OBJECT this returns OBJECT so it works (could return anything but must not throw an Exception).
 		}
 
+	    } catch (ClassNotFoundException e) {
+		// FIXME: this might not be the best way to handle missing classes.
+		throw new AssertionViolatedException("Missing class: " + e.toString());
+	    }
+
 	}
 
 	/**
@@ -260,11 +278,17 @@
 	 * @throws ClassConstraintException otherwise.
 	 */
 	private void constant_pool_entries_satisfy_static_constraints(){
+	    try {
 		// Most of the consistency is handled internally by BCEL; here
 		// we only have to verify if the indices of the constants point
 		// to constants of the appropriate type and such.
 		JavaClass jc = Repository.lookupClass(myOwner.getClassName());
 		new CPESSC_Visitor(jc); // constructor implicitely traverses jc
+
+	    } catch (ClassNotFoundException e) {
+		// FIXME: this might not be the best way to handle missing classes.
+		throw new AssertionViolatedException("Missing class: " + e.toString());
+	    }
 	}
 
 	/**
@@ -799,6 +823,7 @@
 		// method_info-structure-ATTRIBUTES (vmspec2 4.6, 4.7) //
 		/////////////////////////////////////////////////////////
 		public void visitCode(Code obj){//vmspec2 4.7.3
+		    try {
 			// No code attribute allowed for native or abstract methods: see visitMethod(Method).
 			// Code array constraints are checked in Pass3 (3a and 3b).
 
@@ -945,9 +970,16 @@
 					}
 				}// if atts[a] instanceof LocalVariableTable END
 			}// for all attributes atts[a] END
+
+		    } catch (ClassNotFoundException e) {
+			// FIXME: this might not be the best way to handle missing classes.
+			throw new AssertionViolatedException("Missing class: " + e.toString());
+		    }
+
 		}// visitCode(Code) END
 
 		public void visitExceptionTable(ExceptionTable obj){//vmspec2 4.7.4
+		    try {
 			// incorrectly named, it's the Exceptions attribute (vmspec2 4.7.4)
 			checkIndex(obj, obj.getNameIndex(), CONST_Utf8);
 
@@ -992,6 +1024,11 @@
 					if (e != t) throw new ClassConstraintException("Exceptions attribute '"+tostring(obj)+"' references '"+cname+"' as an Exception but it is not a subclass of '"+t.getClassName()+"'.");
 				}
 			}
+
+		    } catch (ClassNotFoundException e) {
+			// FIXME: this might not be the best way to handle missing classes.
+			throw new AssertionViolatedException("Missing class: " + e.toString());
+		    }
 		}
 		// SYNTHETIC: see above
 		// DEPRECATED: see above
@@ -1073,9 +1110,15 @@
 	 * @see #constant_pool_entries_satisfy_static_constraints()
 	 */
 	private void field_and_method_refs_are_valid(){
+	    try {
 		JavaClass jc = Repository.lookupClass(myOwner.getClassName());
 		DescendingVisitor v = new DescendingVisitor(jc, new FAMRAV_Visitor(jc));
 		v.visit();
+
+	    } catch (ClassNotFoundException e) {
+		// FIXME: this might not be the best way to handle missing classes.
+		throw new AssertionViolatedException("Missing class: " + e.toString());
+	    }
 	}
 
 	/**
Index: src/java/org/apache/bcel/verifier/statics/Pass3aVerifier.java
===================================================================
RCS file: /home/cvspublic/jakarta-bcel/src/java/org/apache/bcel/verifier/statics/Pass3aVerifier.java,v
retrieving revision 1.3
diff -u -r1.3 Pass3aVerifier.java
--- src/java/org/apache/bcel/verifier/statics/Pass3aVerifier.java	13 Jun 2002 09:32:50 -0000	1.3
+++ src/java/org/apache/bcel/verifier/statics/Pass3aVerifier.java	30 Apr 2003 17:53:51 -0000
@@ -112,6 +112,7 @@
 	 * @throws InvalidMethodException if the method to verify does not exist.
 	 */
 	public VerificationResult do_verify(){
+	    try {
 		if (myOwner.doPass2().equals(VerificationResult.VR_OK)){
 			// Okay, class file was loaded correctly by Pass 1
 			// and satisfies static constraints of Pass 2.
@@ -167,6 +168,10 @@
 		else{ //did not pass Pass 2.
 			return VerificationResult.VR_NOTYET;
 		}
+	    } catch (ClassNotFoundException e) {
+		// FIXME: maybe not the best way to handle this
+		throw new AssertionViolatedException("Missing class: " + e.toString());
+	    }
 	}
 
 	/**
@@ -330,6 +335,7 @@
 	 * @throws StaticCodeConstraintException if the verification fails.
 	 */
 	private void pass3StaticInstructionOperandsChecks(){
+	    try {
 		// When building up the InstructionList, BCEL has already done all those checks
 		// mentioned in The Java Virtual Machine Specification, Second Edition, as
 		// "static constraints on the operands of instructions in the code array".
@@ -366,6 +372,10 @@
 			ih = ih.getNext();
 		}
 
+	    } catch (ClassNotFoundException e) {
+		// FIXME: maybe not the best way to handle this
+		throw new AssertionViolatedException("Missing class: " + e.toString());
+	    }
 	}
 	
 	/** A small utility method returning if a given int i is in the given int[] ints. */
@@ -399,7 +409,12 @@
 		 * by the surrounding Pass3aVerifier instance.
 		 */
 		private int max_locals(){
+		   try {
 			return Repository.lookupClass(myOwner.getClassName()).getMethods()[method_no].getCode().getMaxLocals();
+		    } catch (ClassNotFoundException e) {
+			// FIXME: maybe not the best way to handle this
+			throw new AssertionViolatedException("Missing class: " + e.toString());
+		    }
 		}
 
 		/**
@@ -476,6 +491,7 @@
 		/** Checks if the constraints of operands of the said instruction(s) are satisfied. */
  		//getfield, putfield, getstatic, putstatic
  		public void visitFieldInstruction(FieldInstruction o){
+		   try {
 			indexValid(o, o.getIndex());
 			Constant c = cpg.getConstant(o.getIndex());
 			if (! (c instanceof ConstantFieldref)){
@@ -511,6 +527,10 @@
 				}
 				/* TODO: Check for access modifiers here. */
 			}
+		    } catch (ClassNotFoundException e) {
+			// FIXME: maybe not the best way to handle this
+			throw new AssertionViolatedException("Missing class: " + e.toString());
+		    }
 		}	
 
 		/** Checks if the constraints of operands of the said instruction(s) are satisfied. */
@@ -869,6 +889,7 @@
 
 		/** Checks if the constraints of operands of the said instruction(s) are satisfied. */
 		public void visitPUTSTATIC(PUTSTATIC o){
+		    try {
 			String field_name = o.getFieldName(cpg);
 			JavaClass jc = Repository.lookupClass(o.getClassType(cpg).getClassName());
 			Field[] fields = jc.getFields();
@@ -899,10 +920,15 @@
 			if ((!(jc.isClass())) && (!(meth_name.equals(Constants.STATIC_INITIALIZER_NAME)))){
 				constraintViolated(o, "Interface field '"+f+"' must be set in a '"+Constants.STATIC_INITIALIZER_NAME+"' method.");
 			}
+		    } catch (ClassNotFoundException e) {
+			// FIXME: maybe not the best way to handle this
+			throw new AssertionViolatedException("Missing class: " + e.toString());
+		    }
 		}
 
 		/** Checks if the constraints of operands of the said instruction(s) are satisfied. */
 		public void visitGETSTATIC(GETSTATIC o){
+		    try {
 			String field_name = o.getFieldName(cpg);
 			JavaClass jc = Repository.lookupClass(o.getClassType(cpg).getClassName());
 			Field[] fields = jc.getFields();
@@ -920,6 +946,10 @@
 			if (! (f.isStatic())){
 				constraintViolated(o, "Referenced field '"+f+"' is not static which it should be.");
 			}
+		    } catch (ClassNotFoundException e) {
+			// FIXME: maybe not the best way to handle this
+			throw new AssertionViolatedException("Missing class: " + e.toString());
+		    }
 		}
 
 		/* Checks if the constraints of operands of the said instruction(s) are satisfied. */
@@ -934,6 +964,7 @@
 
 		/** Checks if the constraints of operands of the said instruction(s) are satisfied. */
 		public void visitINVOKEINTERFACE(INVOKEINTERFACE o){
+		    try {
 			// INVOKEINTERFACE is a LoadClass; the Class where the referenced method is declared in,
 			// is therefore resolved/verified.
 			// INVOKEINTERFACE is an InvokeInstruction, the argument and return types are resolved/verified,
@@ -956,10 +987,15 @@
 			if (jc.isClass()){
 				constraintViolated(o, "Referenced class '"+jc.getClassName()+"' is a class, but not an interface as expected.");
 			}
+		    } catch (ClassNotFoundException e) {
+			// FIXME: maybe not the best way to handle this
+			throw new AssertionViolatedException("Missing class: " + e.toString());
+		    }
 		}
 
 		/** Checks if the constraints of operands of the said instruction(s) are satisfied. */
 		public void visitINVOKESPECIAL(INVOKESPECIAL o){
+		    try {
 			// INVOKESPECIAL is a LoadClass; the Class where the referenced method is declared in,
 			// is therefore resolved/verified.
 			// INVOKESPECIAL is an InvokeInstruction, the argument and return types are resolved/verified,
@@ -1013,11 +1049,16 @@
 				}
 			}
 			
+		    } catch (ClassNotFoundException e) {
+			// FIXME: maybe not the best way to handle this
+			throw new AssertionViolatedException("Missing class: " + e.toString());
+		    }
 			
 		}
 		
 		/** Checks if the constraints of operands of the said instruction(s) are satisfied. */
 		public void visitINVOKESTATIC(INVOKESTATIC o){
+		    try {
 			// INVOKESTATIC is a LoadClass; the Class where the referenced method is declared in,
 			// is therefore resolved/verified.
 			// INVOKESTATIC is an InvokeInstruction, the argument and return types are resolved/verified,
@@ -1042,11 +1083,16 @@
 				constraintViolated(o, "Referenced method '"+o.getMethodName(cpg)+"' has ACC_STATIC unset.");
 			}
 		
+		    } catch (ClassNotFoundException e) {
+			// FIXME: maybe not the best way to handle this
+			throw new AssertionViolatedException("Missing class: " + e.toString());
+		    }
 		}
 
 
 		/** Checks if the constraints of operands of the said instruction(s) are satisfied. */
 		public void visitINVOKEVIRTUAL(INVOKEVIRTUAL o){
+		    try {
 			// INVOKEVIRTUAL is a LoadClass; the Class where the referenced method is declared in,
 			// is therefore resolved/verified.
 			// INVOKEVIRTUAL is an InvokeInstruction, the argument and return types are resolved/verified,
@@ -1070,6 +1116,10 @@
 				constraintViolated(o, "Referenced class '"+jc.getClassName()+"' is an interface, but not a class as expected.");
 			}
 					
+		    } catch (ClassNotFoundException e) {
+			// FIXME: maybe not the best way to handle this
+			throw new AssertionViolatedException("Missing class: " + e.toString());
+		    }
 		}
 
 		
Index: src/java/org/apache/bcel/verifier/structurals/InstConstraintVisitor.java
===================================================================
RCS file: /home/cvspublic/jakarta-bcel/src/java/org/apache/bcel/verifier/structurals/InstConstraintVisitor.java,v
retrieving revision 1.5
diff -u -r1.5 InstConstraintVisitor.java
--- src/java/org/apache/bcel/verifier/structurals/InstConstraintVisitor.java	12 Feb 2003 10:15:29 -0000	1.5
+++ src/java/org/apache/bcel/verifier/structurals/InstConstraintVisitor.java	30 Apr 2003 17:53:51 -0000
@@ -473,6 +473,7 @@
 	 * Ensures the specific preconditions of the said instruction.
 	 */
 	public void visitAASTORE(AASTORE o){
+	    try {
 		Type arrayref = stack().peek(2);
 		Type index    = stack().peek(1);
 		Type value    = stack().peek(0);
@@ -493,6 +494,10 @@
 				constraintViolated(o, "The type of 'value' ('"+value+"') is not assignment compatible to the components of the array 'arrayref' refers to. ('"+((ArrayType) arrayref).getElementType()+"')");
 			}
 		}
+	    } catch (ClassNotFoundException e) {
+		// FIXME: maybe not the best way to handle this
+		throw new AssertionViolatedException("Missing class: " + e.toString());
+	    }
 	}
 
 	/**
@@ -563,6 +568,7 @@
 	 * Ensures the specific preconditions of the said instruction.
 	 */
 	public void visitATHROW(ATHROW o){
+	    try {
 		// It's stated that 'objectref' must be of a ReferenceType --- but since Throwable is
 		// not derived from an ArrayType, it follows that 'objectref' must be of an ObjectType or Type.NULL.
 		if (! ((stack().peek() instanceof ObjectType) || (stack().peek().equals(Type.NULL))) ){
@@ -577,6 +583,10 @@
 		if ( (! (exc.subclassOf(throwable)) ) && (! (exc.equals(throwable))) ){
 			constraintViolated(o, "The 'objectref' is not of class Throwable or of a subclass of Throwable, but of '"+stack().peek()+"'.");
 		}
+	    } catch (ClassNotFoundException e) {
+		// FIXME: maybe not the best way to handle this
+		throw new AssertionViolatedException("Missing class: " + e.toString());
+	    }
 	}
 
 	/**
@@ -1167,6 +1177,7 @@
 	 * Ensures the specific preconditions of the said instruction.
 	 */
 	public void visitGETFIELD(GETFIELD o){
+	    try {
 		Type objectref = stack().peek();
 		if (! ( (objectref instanceof ObjectType) || (objectref == Type.NULL) ) ){
 			constraintViolated(o, "Stack top should be an object reference that's not an array reference, but is '"+objectref+"'.");
@@ -1215,6 +1226,11 @@
 		if (f.isStatic()){
 			constraintViolated(o, "Referenced field '"+f+"' is static which it shouldn't be.");
 		}
+
+	    } catch (ClassNotFoundException e) {
+		// FIXME: maybe not the best way to handle this
+		throw new AssertionViolatedException("Missing class: " + e.toString());
+	    }
 	}
 
 	/**
@@ -1716,6 +1732,7 @@
 	 * Ensures the specific preconditions of the said instruction.
 	 */
 	public void visitINVOKESPECIAL(INVOKESPECIAL o){
+	    try {
 		// Don't init an object twice.
 		if ( (o.getMethodName(cpg).equals(Constants.CONSTRUCTOR_NAME)) && (!(stack().peek(o.getArgumentTypes(cpg).length) instanceof UninitializedObjectType)) ){
 			constraintViolated(o, "Possibly initializing object twice. A valid instruction sequence must not have an uninitialized object on the operand stack or in a local variable during a backwards branch, or in a local variable in code protected by an exception handler. Please see The Java Virtual Machine Specification, Second Edition, 4.9.4 (pages 147 and 148) for details.");
@@ -1796,12 +1813,17 @@
 			constraintViolated(o, "The 'objref' item '"+objref+"' does not implement '"+theClass+"' as expected.");
 		}	
 		
+	    } catch (ClassNotFoundException e) {
+		// FIXME: maybe not the best way to handle this
+		throw new AssertionViolatedException("Missing class: " + e.toString());
+	    }
 	}
 
 	/**
 	 * Ensures the specific preconditions of the said instruction.
 	 */
 	public void visitINVOKESTATIC(INVOKESTATIC o){
+	    try {
 		// Method is not native, otherwise pass 3 would not happen.
 		
 		Type t = o.getType(cpg);
@@ -1841,12 +1863,17 @@
 				}
 			}
 		}
+	    } catch (ClassNotFoundException e) {
+		// FIXME: maybe not the best way to handle this
+		throw new AssertionViolatedException("Missing class: " + e.toString());
+	    }
 	}
 
 	/**
 	 * Ensures the specific preconditions of the said instruction.
 	 */
 	public void visitINVOKEVIRTUAL(INVOKEVIRTUAL o){
+	    try {
 		// the o.getClassType(cpg) type has passed pass 2; see visitLoadClass(o).
 
 		Type t = o.getType(cpg);
@@ -1912,6 +1939,10 @@
 		if ( ! Repository.instanceOf(objref_classname, theClass) ){
 			constraintViolated(o, "The 'objref' item '"+objref+"' does not implement '"+theClass+"' as expected.");
 		}	
+	    } catch (ClassNotFoundException e) {
+		// FIXME: maybe not the best way to handle this
+		throw new AssertionViolatedException("Missing class: " + e.toString());
+	    }
 	}
 
 	/**
@@ -2427,6 +2458,7 @@
 	 * Ensures the specific preconditions of the said instruction.
 	 */
 	public void visitPUTFIELD(PUTFIELD o){
+	    try {
 
 		Type objectref = stack().peek(1);
 		if (! ( (objectref instanceof ObjectType) || (objectref == Type.NULL) ) ){
@@ -2504,12 +2536,18 @@
 		if (f.isStatic()){
 			constraintViolated(o, "Referenced field '"+f+"' is static which it shouldn't be.");
 		}
+
+	    } catch (ClassNotFoundException e) {
+		// FIXME: maybe not the best way to handle this
+		throw new AssertionViolatedException("Missing class: " + e.toString());
+	    }
 	}
 
 	/**
 	 * Ensures the specific preconditions of the said instruction.
 	 */
 	public void visitPUTSTATIC(PUTSTATIC o){
+	    try {
 		String field_name = o.getFieldName(cpg);
 		JavaClass jc = Repository.lookupClass(o.getClassType(cpg).getClassName());
 		Field[] fields = jc.getFields();
@@ -2555,6 +2593,11 @@
 		}
 		// TODO: Interface fields may be assigned to only once. (Hard to implement in
 		//       JustIce's execution model). This may only happen in <clinit>, see Pass 3a.
+
+	    } catch (ClassNotFoundException e) {
+		// FIXME: maybe not the best way to handle this
+		throw new AssertionViolatedException("Missing class: " + e.toString());
+	    }
 	}
 
 	/**
Index: src/java/org/apache/bcel/verifier/structurals/LocalVariables.java
===================================================================
RCS file: /home/cvspublic/jakarta-bcel/src/java/org/apache/bcel/verifier/structurals/LocalVariables.java,v
retrieving revision 1.2
diff -u -r1.2 LocalVariables.java
--- src/java/org/apache/bcel/verifier/structurals/LocalVariables.java	2 Aug 2002 11:57:51 -0000	1.2
+++ src/java/org/apache/bcel/verifier/structurals/LocalVariables.java	30 Apr 2003 17:53:51 -0000
@@ -162,6 +162,7 @@
 	 * @see #merge(LocalVariables)
 	 */
 	private void merge(LocalVariables lv, int i){
+	    try {
 		
 		// We won't accept an unitialized object if we know it was initialized;
 		// compare vmspec2, 4.9.4, last paragraph.
@@ -202,6 +203,10 @@
 				locals[i] = Type.UNKNOWN;
 			}
 		}
+	    } catch (ClassNotFoundException e) {
+		// FIXME: maybe not the best way to handle this
+		throw new AssertionViolatedException("Missing class: " + e.toString());
+	    }
 	}
 
 	/**
Index: src/java/org/apache/bcel/verifier/structurals/OperandStack.java
===================================================================
RCS file: /home/cvspublic/jakarta-bcel/src/java/org/apache/bcel/verifier/structurals/OperandStack.java,v
retrieving revision 1.2
diff -u -r1.2 OperandStack.java
--- src/java/org/apache/bcel/verifier/structurals/OperandStack.java	2 Aug 2002 11:57:51 -0000	1.2
+++ src/java/org/apache/bcel/verifier/structurals/OperandStack.java	30 Apr 2003 17:53:51 -0000
@@ -228,6 +228,7 @@
 	 * for details.
 	 */
 	public void merge(OperandStack s){
+	    try {
 		if ( (slotsUsed() != s.slotsUsed()) || (size() != s.size()) )
 			throw new StructuralCodeConstraintException("Cannot merge stacks of different size:\nOperandStack A:\n"+this+"\nOperandStack B:\n"+s);
 		
@@ -258,6 +259,10 @@
 				}
 			}
 		}
+	    } catch (ClassNotFoundException e) {
+		// FIXME: maybe not the best way to handle this
+		throw new AssertionViolatedException("Missing class: " + e.toString());
+	    }
 	}
 
 	/**
Index: src/java/org/apache/bcel/verifier/structurals/Pass3bVerifier.java
===================================================================
RCS file: /home/cvspublic/jakarta-bcel/src/java/org/apache/bcel/verifier/structurals/Pass3bVerifier.java,v
retrieving revision 1.3
diff -u -r1.3 Pass3bVerifier.java
--- src/java/org/apache/bcel/verifier/structurals/Pass3bVerifier.java	4 Jul 2002 21:44:42 -0000	1.3
+++ src/java/org/apache/bcel/verifier/structurals/Pass3bVerifier.java	30 Apr 2003 17:53:51 -0000
@@ -292,7 +292,13 @@
 
 		// Pass 3a ran before, so it's safe to assume the JavaClass object is
 		// in the BCEL repository.
-		JavaClass jc = Repository.lookupClass(myOwner.getClassName());
+		JavaClass jc;
+		try {
+			jc = Repository.lookupClass(myOwner.getClassName());
+		} catch (ClassNotFoundException e) {
+			// FIXME: maybe not the best way to handle this
+			throw new AssertionViolatedException("Missing class: " + e.toString());
+		}
 
 		ConstantPoolGen constantPoolGen = new ConstantPoolGen(jc.getConstantPool());
 		// Init Visitors