< prev index next >

src/java.base/share/classes/jdk/internal/org/objectweb/asm/util/CheckSignatureAdapter.java

Print this page
rev 52979 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: TBD


 348         if ("+-=".indexOf(wildcard) == -1) {
 349             throw new IllegalArgumentException();
 350         }
 351         return new CheckSignatureAdapter(
 352                 TYPE_SIGNATURE,
 353                 signatureVisitor == null ? null : signatureVisitor.visitTypeArgument(wildcard));
 354     }
 355 
 356     @Override
 357     public void visitEnd() {
 358         if (state != State.CLASS_TYPE) {
 359             throw new IllegalStateException();
 360         }
 361         state = State.END;
 362         if (signatureVisitor != null) {
 363             signatureVisitor.visitEnd();
 364         }
 365     }
 366 
 367     private void checkClassName(final String name, final String message) {
 368         if (name == null || name.length() == 0) {
 369             throw new IllegalArgumentException(INVALID + message + " (must not be null or empty)");
 370         }
 371         for (int i = 0; i < name.length(); ++i) {
 372             if (".;[<>:".indexOf(name.charAt(i)) != -1) {
 373                 throw new IllegalArgumentException(
 374                         INVALID + message + " (must not contain . ; [ < > or :): " + name);
 375             }
 376         }
 377     }
 378 
 379     private void checkIdentifier(final String name, final String message) {
 380         if (name == null || name.length() == 0) {
 381             throw new IllegalArgumentException(INVALID + message + " (must not be null or empty)");
 382         }
 383         for (int i = 0; i < name.length(); ++i) {
 384             if (".;[/<>:".indexOf(name.charAt(i)) != -1) {
 385                 throw new IllegalArgumentException(
 386                         INVALID + message + " (must not contain . ; [ / < > or :): " + name);
 387             }
 388         }
 389     }
 390 }


 348         if ("+-=".indexOf(wildcard) == -1) {
 349             throw new IllegalArgumentException();
 350         }
 351         return new CheckSignatureAdapter(
 352                 TYPE_SIGNATURE,
 353                 signatureVisitor == null ? null : signatureVisitor.visitTypeArgument(wildcard));
 354     }
 355 
 356     @Override
 357     public void visitEnd() {
 358         if (state != State.CLASS_TYPE) {
 359             throw new IllegalStateException();
 360         }
 361         state = State.END;
 362         if (signatureVisitor != null) {
 363             signatureVisitor.visitEnd();
 364         }
 365     }
 366 
 367     private void checkClassName(final String name, final String message) {
 368         if (name == null || name.isEmpty()) {
 369             throw new IllegalArgumentException(INVALID + message + " (must not be null or empty)");
 370         }
 371         for (int i = 0; i < name.length(); ++i) {
 372             if (".;[<>:".indexOf(name.charAt(i)) != -1) {
 373                 throw new IllegalArgumentException(
 374                         INVALID + message + " (must not contain . ; [ < > or :): " + name);
 375             }
 376         }
 377     }
 378 
 379     private void checkIdentifier(final String name, final String message) {
 380         if (name == null || name.isEmpty()) {
 381             throw new IllegalArgumentException(INVALID + message + " (must not be null or empty)");
 382         }
 383         for (int i = 0; i < name.length(); ++i) {
 384             if (".;[/<>:".indexOf(name.charAt(i)) != -1) {
 385                 throw new IllegalArgumentException(
 386                         INVALID + message + " (must not contain . ; [ / < > or :): " + name);
 387             }
 388         }
 389     }
 390 }
< prev index next >