/** * {@inheritDoc} */ public Thread newThread(Runnable r) { Thread newThread = actualFactory.newThread(new RunnableWithLifeCycle(this, r)); if (newThread != null) { count.incrementAndGet(); } return newThread; }
/** * Method to check a subclass overrides all methods in its superclass or the interface it implements * * @param parent * @param subClass */ public static void check(Class parent, Class subClass) { boolean excludeSuper = parent.isAssignableFrom(subClass); Set<String> superMethods = methodsFor(parent, false); Set<String> subMethods = methodsFor(subClass, excludeSuper); List<String> missing = new ArrayList(); for (String method : superMethods) { if (!subMethods.contains(method)) { // This class should be overriding all methods on the super class missing.add(method); } } if (!missing.isEmpty()) { throw new RuntimeException(subClass.getName() + " is missing overrides (defined in " + parent.getName() + "):\n" + missing); } }
/** * {@inheritDoc} */ public Thread newThread(Runnable r) { Thread newThread = actualFactory.newThread(new RunnableWithLifeCycle(this, r)); if (newThread != null) { count.incrementAndGet(); } return newThread; }
/** * Method to check a subclass overrides all methods in its superclass or the interface it implements * * @param parent * @param subClass */ public static void check(Class parent, Class subClass) { boolean excludeSuper = parent.isAssignableFrom(subClass); Set<String> superMethods = methodsFor(parent, false); Set<String> subMethods = methodsFor(subClass, excludeSuper); List<String> missing = new ArrayList(); for (String method : superMethods) { if (!subMethods.contains(method)) { // This class should be overriding all methods on the super class missing.add(method); } } if (!missing.isEmpty()) { throw new RuntimeException(subClass.getName() + " is missing overrides (defined in " + parent.getName() + "):\n" + missing); } }
/** * {@inheritDoc} */ public Thread newThread(Runnable r) { Thread newThread = actualFactory.newThread(new RunnableWithLifeCycle(this, r)); if (newThread != null) { count.incrementAndGet(); } return newThread; }
/** * Method to check a subclass overrides all methods in its superclass or the interface it implements * * @param parent * @param subClass */ public static void check(Class parent, Class subClass) { boolean excludeSuper = parent.isAssignableFrom(subClass); Set<String> superMethods = methodsFor(parent, false); Set<String> subMethods = methodsFor(subClass, excludeSuper); List<String> missing = new ArrayList(); for (String method : superMethods) { if (!subMethods.contains(method)) { // This class should be overriding all methods on the super class missing.add(method); } } if (!missing.isEmpty()) { throw new RuntimeException(subClass.getName() + " is missing overrides (defined in " + parent.getName() + "):\n" + missing); } }
/** * {@inheritDoc} */ public Thread newThread(Runnable r) { Thread newThread = actualFactory.newThread(new RunnableWithLifeCycle(this, r)); if (newThread != null) { count.incrementAndGet(); } return newThread; }
/** * Method to check a subclass overrides all methods in its superclass or the interface it implements * * @param parent * @param subClass */ public static void check(Class parent, Class subClass) { boolean excludeSuper = parent.isAssignableFrom(subClass); Set<String> superMethods = methodsFor(parent, false); Set<String> subMethods = methodsFor(subClass, excludeSuper); List<String> missing = new ArrayList(); for (String method : superMethods) { if (!subMethods.contains(method)) { // This class should be overriding all methods on the super class missing.add(method); } } if (!missing.isEmpty()) { throw new RuntimeException(subClass.getName() + " is missing overrides (defined in " + parent.getName() + "):\n" + missing); } }