< prev index next >

test/hotspot/jtreg/vmTestbase/nsk/jdi/Accessible/modifiers/modifiers001.java

Print this page

171             ReferenceType refType = debugee.classByName(className);
172             if (refType == null) {
173                 logHandler.complain("##> isPublic001: Could NOT FIND class: " + className);
174                 class_not_found_errors++;
175                 continue;
176             }
177             Class class_obj;
178             try {
179                 class_obj = Class.forName(className);
180             }
181             catch (ClassNotFoundException e) {
182                 logHandler.complain
183                     ("##> modifiers001: Class.forName("+className+") - "+e.toString());
184                 class_not_found_exceptions++;
185                 continue;
186             }
187             int expected_modifiers = class_obj.getModifiers();
188             String s_type = classes_for_check[i][2];
189             String s_modifiers = classes_for_check[i][1];
190             int got_modifiers = refType.modifiers();
191             // Class.getModifiers() will never return ACC_SUPER
192             // but Accessible.modifers() can, so ignore this bit
193             got_modifiers &= ~0x20; // 0x20 == ACC_SUPER
194             logHandler.display("");
195             if ( got_modifiers != expected_modifiers ) {
196                 logHandler.complain("##> modifiers001: UNEXPECTED modifiers() method result ("
197                                     + "0x" + Integer.toHexString(got_modifiers) + ") for " + s_type + ": " + className
198                                     + "(" +  s_modifiers + ")");
199                 logHandler.complain("##>               expected modifiers() method result = "
200                                     + "0x" + Integer.toHexString(expected_modifiers));
201                 modifiers_method_errors++;
202             }
203             else {
204                 print_log_on_verbose("--> modifiers001:  expected modifiers() method result ("
205                                     + "0x" + Integer.toHexString(got_modifiers) + ") for " + s_type + ": " + className
206                                     + "(" +  s_modifiers + ")");
207             }
208         }
209         logHandler.display
210             ("--> modifiers001: checking debugee's classes completed!");
211         logHandler.display
212             ("--> modifiers001: number of checked classes = " + all_classes_count);
213         if ( class_not_found_errors > 0 ) {

171             ReferenceType refType = debugee.classByName(className);
172             if (refType == null) {
173                 logHandler.complain("##> isPublic001: Could NOT FIND class: " + className);
174                 class_not_found_errors++;
175                 continue;
176             }
177             Class class_obj;
178             try {
179                 class_obj = Class.forName(className);
180             }
181             catch (ClassNotFoundException e) {
182                 logHandler.complain
183                     ("##> modifiers001: Class.forName("+className+") - "+e.toString());
184                 class_not_found_exceptions++;
185                 continue;
186             }
187             int expected_modifiers = class_obj.getModifiers();
188             String s_type = classes_for_check[i][2];
189             String s_modifiers = classes_for_check[i][1];
190             int got_modifiers = refType.modifiers();



191             logHandler.display("");
192             if ( got_modifiers != expected_modifiers ) {
193                 logHandler.complain("##> modifiers001: UNEXPECTED modifiers() method result ("
194                                     + "0x" + Integer.toHexString(got_modifiers) + ") for " + s_type + ": " + className
195                                     + "(" +  s_modifiers + ")");
196                 logHandler.complain("##>               expected modifiers() method result = "
197                                     + "0x" + Integer.toHexString(expected_modifiers));
198                 modifiers_method_errors++;
199             }
200             else {
201                 print_log_on_verbose("--> modifiers001:  expected modifiers() method result ("
202                                     + "0x" + Integer.toHexString(got_modifiers) + ") for " + s_type + ": " + className
203                                     + "(" +  s_modifiers + ")");
204             }
205         }
206         logHandler.display
207             ("--> modifiers001: checking debugee's classes completed!");
208         logHandler.display
209             ("--> modifiers001: number of checked classes = " + all_classes_count);
210         if ( class_not_found_errors > 0 ) {
< prev index next >