Package org.apache.aries.proxy

Examples of org.apache.aries.proxy.FinalModifierException


  private static void scanForFinalModifiers(Class<?> clazz) throws FinalModifierException
  {
    LOGGER.debug(Constants.LOG_ENTRY, "scanForFinalModifiers", new Object[] { clazz });

    if (isFinal(clazz.getModifiers())) {
      throw new FinalModifierException(clazz);
    }

    List<String> finalMethods = new ArrayList<String>();

    // we don't want to check for final methods on java.* or javax.* Class
    // also, clazz can never be null here (we will always hit
    // java.lang.Object first)
    while (!clazz.getName().startsWith("java.") && !clazz.getName().startsWith("javax.")) {
      for (Method m : clazz.getDeclaredMethods()) {
        if (isFinal(m.getModifiers())) {
          finalMethods.add(m.toGenericString());
        }
      }
      clazz = clazz.getSuperclass();
    }

    if (!finalMethods.isEmpty()) {

      String methodList = finalMethods.toString();
      methodList = methodList.substring(1, methodList.length() - 1);
      throw new FinalModifierException(clazz, methodList);
    }

    LOGGER.debug(Constants.LOG_EXIT, "scanForFinalModifiers");

  }
View Full Code Here

TOP

Related Classes of org.apache.aries.proxy.FinalModifierException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.