Skip to content

Instantly share code, notes, and snippets.

@Riduidel
Forked from anonymous/gist:419888
Created May 31, 2010 14:45
Show Gist options
  • Save Riduidel/419889 to your computer and use it in GitHub Desktop.
Save Riduidel/419889 to your computer and use it in GitHub Desktop.
private void removeJavaFXMethods(Set<Method> methods) {
try {
// Never load twice a Java class, it's really an heavy code fragment, requiring class path and file parsing, and so on
Class fxObject = Class.forName("com.sun.javafx.runtime.FXObject");
if (fxObject.isAssignableFrom(moduleClass)) {
Iterator<Method> iterator = methods.iterator();
while (iterator.hasNext()) {
Method m = iterator.next();
if (m.getDeclaringClass().equals(fxObject))
// Will only work if input set allows remove operation, which seems in no way guaranteed to me. It would be better to re-create set with correct methods
iterator.remove();
}
}
} catch (ClassNotFoundException cnfe) {
// this code surely isn't JavaFX code
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment