notnull, cleanup

This commit is contained in:
Alexey Kudravtsev
2013-07-04 11:13:50 +04:00
parent db26741e18
commit 69ed314a2f
4 changed files with 15 additions and 37 deletions
@@ -64,12 +64,12 @@ public abstract class DefaultProjectProfileManager extends ProjectProfileManager
private final List<ProfileChangeAdapter> myProfilesListener = ContainerUtil.createLockFreeCopyOnWriteList();
@NonNls private static final String PROJECT_DEFAULT_PROFILE_NAME = "Project Default";
public DefaultProjectProfileManager(@NotNull final Project project, final ApplicationProfileManager applicationProfileManager,
final DependencyValidationManager holder) {
public DefaultProjectProfileManager(@NotNull final Project project,
@NotNull ApplicationProfileManager applicationProfileManager,
@NotNull DependencyValidationManager holder) {
myProject = project;
myHolder = holder;
myApplicationProfileManager = applicationProfileManager;
LOG.assertTrue(myApplicationProfileManager != null);
}
@NotNull
@@ -32,7 +32,6 @@ import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
/**
@@ -53,10 +52,6 @@ public abstract class InspectionProfileManager extends ApplicationProfileManager
public InspectionProfileManager() {
}
@Override
@NotNull
public abstract Collection<Profile> getProfiles();
protected abstract void initProfiles();
public abstract Profile loadProfile(@NotNull String path) throws IOException, JDOMException;
@@ -67,13 +62,6 @@ public abstract class InspectionProfileManager extends ApplicationProfileManager
return "InspectionProfileManager";
}
@Override
public abstract void updateProfile(@NotNull Profile profile);
@Override
public abstract Profile createProfile();
@Override
public void addProfileChangeListener(@NotNull final ProfileChangeAdapter listener) {
myProfileChangeAdapters.add(listener);
@@ -103,16 +91,6 @@ public abstract class InspectionProfileManager extends ApplicationProfileManager
}
}
@Override
public abstract Profile getProfile(@NotNull final String name, boolean returnRootProfileIfNamedIsAbsent);
@Override
@NotNull
public abstract Profile getRootProfile();
@Override
public abstract void deleteProfile(final String profile);
@Nullable
public static File getProfileDirectory() {
String directoryPath = PathManager.getConfigPath() + File.separator + INSPECTION_DIR;
@@ -125,10 +103,6 @@ public abstract class InspectionProfileManager extends ApplicationProfileManager
return directory;
}
@Override
@NotNull
public abstract String[] getAvailableProfileNames();
@Override
public Profile getProfile(@NotNull final String name) {
return getProfile(name, true);
@@ -34,7 +34,9 @@ import org.jetbrains.annotations.NotNull;
* Date: 30-Nov-2005
*/
public abstract class InspectionProjectProfileManager extends DefaultProjectProfileManager implements ProjectComponent, PersistentStateComponent<Element> {
public InspectionProjectProfileManager(final Project project, InspectionProfileManager inspectionProfileManager, DependencyValidationManager holder) {
public InspectionProjectProfileManager(@NotNull Project project,
@NotNull InspectionProfileManager inspectionProfileManager,
@NotNull DependencyValidationManager holder) {
super(project, inspectionProfileManager, holder);
}
@@ -61,10 +61,10 @@ public class InspectionProjectProfileManagerImpl extends InspectionProjectProfil
private final NamedScopeManager myLocalScopesHolder;
private NamedScopesHolder.ScopeListener myScopeListener;
public InspectionProjectProfileManagerImpl(final Project project,
InspectionProfileManager inspectionProfileManager,
DependencyValidationManager holder,
NamedScopeManager localScopesHolder) {
public InspectionProjectProfileManagerImpl(@NotNull Project project,
@NotNull InspectionProfileManager inspectionProfileManager,
@NotNull DependencyValidationManager holder,
@NotNull NamedScopeManager localScopesHolder) {
super(project, inspectionProfileManager, holder);
myLocalScopesHolder = localScopesHolder;
mySeverityRegistrar = new SeverityRegistrar();
@@ -133,7 +133,9 @@ public class InspectionProjectProfileManagerImpl extends InspectionProjectProfil
@Override
public void projectOpened() {
StartupManager.getInstance(myProject).registerPostStartupActivity(new DumbAwareRunnable() {
StartupManager startupManager = StartupManager.getInstance(myProject);
if (startupManager == null) return; // upsource
startupManager.registerPostStartupActivity(new DumbAwareRunnable() {
@Override
public void run() {
final Set<Profile> profiles = new HashSet<Profile>();
@@ -170,8 +172,8 @@ public class InspectionProjectProfileManagerImpl extends InspectionProjectProfil
Disposer.register(myProject, new Disposable() {
@Override
public void dispose() {
myHolder.removeScopeListener(myScopeListener);
myLocalScopesHolder.removeScopeListener(myScopeListener);
myHolder.removeScopeListener(myScopeListener);
myLocalScopesHolder.removeScopeListener(myScopeListener);
}
});
}