@Override
    public void visitOuterClass(final String owner, final String name, final String desc) {
      myOuterClassName.set(owner);

      if (name != null) {
        myLocalClassFlag.set(true);
      }
    }
Exemplo n.º 2
0
 public static void clear() {
   pluginManagers.set(null);
   pluginManagersInCreation.set(null);
   configs.set(null);
   flatConfigs.set(null);
   if (servletContexts != null) {
     servletContexts.set(null);
   }
   applicationDiscoveryStrategies.clear();
   applicationSingleton = null;
 }
    @Override
    public void visit(int version, int a, String n, String sig, String s, String[] i) {
      myTakeIntoAccount = notPrivate(a);

      myAccess = a;
      myName = myContext.get(n);
      mySignature = sig;
      mySuperClass = s;
      myInterfaces = i;

      myClassNameHolder.set(n);

      if (mySuperClass != null) {
        final int superclassName = myContext.get(mySuperClass);
        myUsages.add(UsageRepr.createClassUsage(myContext, superclassName));
        myUsages.add(UsageRepr.createClassExtendsUsage(myContext, superclassName));
      }

      if (myInterfaces != null) {
        for (String it : myInterfaces) {
          final int interfaceName = myContext.get(it);
          myUsages.add(UsageRepr.createClassUsage(myContext, interfaceName));
          myUsages.add(UsageRepr.createClassExtendsUsage(myContext, interfaceName));
        }
      }

      processSignature(sig);
    }
Exemplo n.º 4
0
 public static void main(String[] args) {
   Holder<Apple> Apple = new Holder<Apple>(new Apple());
   Apple d = Apple.get();
   Apple.set(d);
   Holder<? extends Fruit> fruit = Apple;
   Fruit p = fruit.get();
   d = (Apple) fruit.get();
   try {
     Orange c = (Orange) fruit.get();
   } catch (Exception e) {
     System.out.println(e);
   }
   System.out.println(fruit.equals(d));
 }
Exemplo n.º 5
0
 public static void main(String[] args) {
   Holder<Character> charHolder = new Holder<Character>();
   Holder<Byte> byteHolder = new Holder<Byte>();
   Holder<Short> shortHolder = new Holder<Short>();
   Holder<Integer> intHolder = new Holder<Integer>();
   Holder<Long> longHolder = new Holder<Long>();
   Holder<Float> floatHolder = new Holder<Float>();
   Holder<Double> doubleHolder = new Holder<Double>();
   // Autoboxing and autounboxing work:
   charHolder.set('a');
   print(charHolder.get() + ", ");
   println(charHolder.get().getClass());
   char c = charHolder.get();
   println("char c = charHolder.get() = " + c);
   byte b = 1;
   byteHolder.set(b);
   print(byteHolder.get() + ", ");
   println(byteHolder.get().getClass());
   byte bb = byteHolder.get();
   println("byte bb = byteHolder.get() = " + bb);
   short s = 1;
   shortHolder.set(s);
   print(shortHolder.get() + ", ");
   println(shortHolder.get().getClass());
   short ss = shortHolder.get();
   println("short ss = shortHolder.get() = " + ss);
   intHolder.set(1);
   print(intHolder.get() + ". ");
   println(intHolder.get().getClass());
   int i = intHolder.get();
   println("int i = intHolder.get() = " + i);
   long l = 2;
   longHolder.set(l);
   print(longHolder.get() + ", ");
   println(longHolder.get().getClass());
   long ll = longHolder.get();
   println("long ll = longHolder.get() = " + ll);
   float f = 1f;
   floatHolder.set(f);
   print(floatHolder.get() + ", ");
   println(floatHolder.get().getClass());
   float ff = floatHolder.get();
   println("float ff = floatHolder.get() = " + ff);
   double d = 1.1;
   doubleHolder.set(d);
   print(doubleHolder.get() + ", ");
   println(doubleHolder.get().getClass());
   double dd = doubleHolder.get();
   println("double dd = doubleHolder.get() = " + dd);
 }
Exemplo n.º 6
0
  public static void main(String[] args) {
    Holder<Apple> apple = new Holder<Apple>(new Apple());

    Apple a = apple.get();
    apple.set(a);
  }
Exemplo n.º 7
0
 public static void setServletContext(final Object servletContext) {
   servletContexts.set(servletContext);
 }
Exemplo n.º 8
0
 public static void setPluginManager(GrailsPluginManager pluginManager) {
   if (pluginManager != null) {
     pluginManagersInCreation.set(false);
   }
   pluginManagers.set(pluginManager);
 }
Exemplo n.º 9
0
 public static void setPluginManagerInCreation(boolean inCreation) {
   pluginManagersInCreation.set(inCreation);
 }
Exemplo n.º 10
0
  public static void setConfig(Config config) {
    configs.set(config);

    // reset flat config
    flatConfigs.set(config == null ? null : config.flatten());
  }
 {
   myLocalClassFlag.set(false);
 }