private void createCanonicalMethods() {
   if (!hasAnnotation(annotatedClass, EQUALS_HASHCODE_ANNOT)) {
     createHashCode(annotatedClass, false, false, true, null, null);
     createEquals(annotatedClass, false, true, true, null, null);
   }
   if (!hasAnnotation(annotatedClass, TOSTRING_ANNOT)) {
     if (ownerField == null) createToString(annotatedClass, false, false, null, null, false);
     else
       createToString(
           annotatedClass,
           false,
           false,
           Collections.singletonList(ownerField.getName()),
           null,
           false);
   }
 }
Exemplo n.º 2
0
 /**
  * @param name is the full name of the class
  * @param modifiers the modifiers,
  * @param superClass the base class name - use "java.lang.Object" if no direct base class
  * @param interfaces the interfaces for this class
  * @param mixins the mixins for this class
  * @see org.objectweb.asm.Opcodes
  */
 public ClassNode(
     String name,
     int modifiers,
     ClassNode superClass,
     ClassNode[] interfaces,
     MixinNode[] mixins) {
   this.name = name;
   this.modifiers = modifiers;
   this.superClass = superClass;
   this.interfaces = interfaces;
   this.mixins = mixins;
   isPrimaryNode = true;
   if (superClass != null) {
     usesGenerics = superClass.isUsingGenerics();
   }
   if (!usesGenerics && interfaces != null) {
     for (ClassNode anInterface : interfaces) {
       usesGenerics = usesGenerics || anInterface.isUsingGenerics();
       if (usesGenerics) break;
     }
   }
   this.methods = new MapOfLists();
   this.methodsList = Collections.emptyList();
 }
Exemplo n.º 3
0
 public List<MethodNode> getNotNull(Object key) {
   List<MethodNode> ret = get(key);
   if (ret == null) ret = Collections.emptyList();
   return ret;
 }
Exemplo n.º 4
0
 /** @return iterator of inner classes defined inside this one */
 public Iterator<InnerClassNode> getInnerClasses() {
   return (innerClasses == null ? Collections.<InnerClassNode>emptyList() : innerClasses)
       .iterator();
 }