/** * Renames the given class within this project. Used internally by * {@link BCClass} instances when their name is modified. * * @throws IllegalStateException if a class with the new name already exists */ void renameClass(String oldName, String newName, BCClass bc) { if (oldName.equals(newName)) return; BCClass cached = (BCClass) checkCache(newName); if (cached != null) throw new IllegalStateException("A class with name " + newName + " already exists in this project"); removeFromCache(oldName, bc); cache(newName, bc); }
/** * Renames the given class within this project. Used internally by * {@link BCClass} instances when their name is modified. * * @throws IllegalStateException if a class with the new name already exists */ void renameClass(String oldName, String newName, BCClass bc) { if (oldName.equals(newName)) return; BCClass cached = (BCClass) checkCache(newName); if (cached != null) throw new IllegalStateException("A class with name " + newName + " already exists in this project"); removeFromCache(oldName, bc); cache(newName, bc); }
/** * Remove a class from this project. After removal, the result of any * further operations on the class is undefined. * * @return true if the class belonged to this project, false otherwise */ public boolean removeClass(BCClass type) { if (type == null) return false; if (!removeFromCache(type.getName(), type)) return false; type.invalidate(); return true; }
/** * Remove a class from this project. After removal, the result of any * further operations on the class is undefined. * * @return true if the class belonged to this project, false otherwise */ public boolean removeClass(BCClass type) { if (type == null) return false; if (!removeFromCache(type.getName(), type)) return false; type.invalidate(); return true; }