remove deprecated methods getExternalInfo/isLocal — the only external usage is qaplug (we in contact to publish fixed version)

This commit is contained in:
Vladimir Krivosheev
2015-09-29 17:06:18 +02:00
parent f8cdf9eaa1
commit d9f45ce084
11 changed files with 20 additions and 93 deletions
@@ -22,8 +22,6 @@ import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.InvalidDataException;
import com.intellij.openapi.util.WriteExternalException;
import com.intellij.packageDependencies.DependencyValidationManager;
import com.intellij.psi.search.scope.packageSet.NamedScopesHolder;
import com.intellij.util.ArrayUtil;
@@ -104,12 +102,7 @@ public abstract class DefaultProjectProfileManager extends ProjectProfileManager
final Profile projectProfile = myProfiles.get(profile);
if (projectProfile != null) {
Element profileElement = new Element(PROFILE);
try {
projectProfile.writeExternal(profileElement);
}
catch (WriteExternalException e) {
LOG.error(e);
}
projectProfile.writeExternal(profileElement);
boolean hasSmthToSave = sortedProfiles.length > 1 || isCustomProfileUsed();
if (!hasSmthToSave) {
for (Element child : profileElement.getChildren()) {
@@ -141,16 +134,12 @@ public abstract class DefaultProjectProfileManager extends ProjectProfileManager
for (Element o : state.getChildren(PROFILE)) {
Profile profile = myApplicationProfileManager.createProfile();
profile.setProfileManager(this);
try {
profile.readExternal(o);
}
catch (InvalidDataException e) {
LOG.error(e);
}
profile.readExternal(o);
profile.setProjectLevel(true);
if (profileKeys.contains(profile.getName())) {
updateProfile(profile);
} else {
}
else {
myProfiles.put(profile.getName(), profile);
}
}
@@ -252,10 +241,6 @@ public abstract class DefaultProjectProfileManager extends ProjectProfileManager
});
}
public void removeProfilesListener(@NotNull ProfileChangeAdapter profilesListener) {
myProfilesListener.remove(profilesListener);
}
public static class ProfileStateSplitter extends MainConfigurationStateSplitter {
@NotNull
@Override
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,14 +16,14 @@
package com.intellij.profile;
import com.intellij.openapi.options.Scheme;
import com.intellij.openapi.util.JDOMExternalizable;
import org.jdom.Element;
import org.jetbrains.annotations.NotNull;
/**
* User: anna
* Date: 20-Nov-2005
*/
public interface Profile extends JDOMExternalizable, Comparable, Scheme {
public interface Profile extends Comparable, Scheme {
void copyFrom(@NotNull Profile profile);
void setLocal(boolean isLocal);
@@ -48,4 +48,8 @@ public interface Profile extends JDOMExternalizable, Comparable, Scheme {
@NotNull
ProfileManager getProfileManager();
void readExternal(Element element);
void writeExternal(Element element);
}
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.codeInspection.ex;
import com.intellij.codeHighlighting.HighlightDisplayLevel;
@@ -27,7 +26,6 @@ import com.intellij.lang.annotation.HighlightSeverity;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.options.ExternalInfo;
import com.intellij.openapi.options.ExternalizableScheme;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.project.Project;
@@ -253,7 +251,7 @@ public class InspectionProfileImpl extends ProfileEx implements ModifiableModel,
}
@Override
public void readExternal(@NotNull Element element) throws InvalidDataException {
public void readExternal(@NotNull Element element) {
super.readExternal(element);
final String version = element.getAttributeValue(VERSION_TAG);
@@ -868,12 +866,6 @@ public class InspectionProfileImpl extends ProfileEx implements ModifiableModel,
}
}
@Override
@Nullable
public ExternalInfo getExternalInfo() {
return null;
}
@NotNull
public List<ScopeToolState> getAllTools(Project project) {
initInspectionTools(project);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,10 +15,7 @@
*/
package com.intellij.profile;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.InvalidDataException;
import com.intellij.openapi.util.WriteExternalException;
import com.intellij.util.xmlb.SmartSerializer;
import com.intellij.util.xmlb.annotations.OptionTag;
import com.intellij.util.xmlb.annotations.Transient;
@@ -30,8 +27,6 @@ import org.jetbrains.annotations.NotNull;
* Date: 01-Dec-2005
*/
public abstract class ProfileEx implements Profile {
private static final Logger LOG = Logger.getInstance(ProfileEx.class);
public static final String SCOPE = "scope";
public static final String NAME = "name";
@@ -68,17 +63,9 @@ public abstract class ProfileEx implements Profile {
@Override
public void copyFrom(@NotNull Profile profile) {
try {
Element config = new Element("config");
profile.writeExternal(config);
readExternal(config);
}
catch (WriteExternalException e) {
LOG.error(e);
}
catch (InvalidDataException e) {
LOG.error(e);
}
Element config = new Element("config");
profile.writeExternal(config);
readExternal(config);
}
@Override
@@ -121,7 +108,7 @@ public abstract class ProfileEx implements Profile {
}
@Override
public void readExternal(Element element) throws InvalidDataException {
public void readExternal(Element element) {
mySerializer.readExternal(this, element);
}
@@ -130,7 +117,7 @@ public abstract class ProfileEx implements Profile {
}
@Override
public void writeExternal(Element element) throws WriteExternalException {
public void writeExternal(Element element) {
serializeInto(element, true);
}
@@ -375,9 +375,6 @@ data class TestScheme(@field:Attribute private var name: String = "", @field:Att
override @Transient fun setName(newName: String) {
name = newName
}
@Suppress("DEPRECATED_SYMBOL_WITH_MESSAGE")
override fun getExternalInfo() = null
}
open class TestSchemesProcessor : BaseSchemeProcessor<TestScheme>() {
@@ -16,13 +16,7 @@
package com.intellij.openapi.options;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public interface ExternalizableScheme extends Scheme {
@SuppressWarnings({"unused", "deprecation"})
@Nullable
@Deprecated
ExternalInfo getExternalInfo();
void setName(@NotNull String newName);
}
@@ -16,17 +16,10 @@
package com.intellij.openapi.options;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public abstract class ExternalizableSchemeAdapter implements ExternalizableScheme {
protected String myName;
@Override
@Nullable
public final ExternalInfo getExternalInfo() {
return null;
}
@Override
@NotNull
public final String getName() {
@@ -19,7 +19,6 @@ import com.intellij.openapi.editor.colors.ColorKey;
import com.intellij.openapi.editor.colors.EditorColorsScheme;
import com.intellij.openapi.editor.colors.TextAttributesKey;
import com.intellij.openapi.editor.markup.TextAttributes;
import com.intellij.openapi.options.ExternalInfo;
import com.intellij.openapi.options.ExternalizableScheme;
import com.intellij.openapi.util.Comparing;
import org.jetbrains.annotations.Nullable;
@@ -83,10 +82,4 @@ public class EditorColorsSchemeImpl extends AbstractColorsScheme implements Exte
newScheme.setName(getName());
return newScheme;
}
@Override
@Nullable
public ExternalInfo getExternalInfo() {
return null;
}
}
@@ -360,9 +360,6 @@ public abstract class InspectionToolsConfigurable extends BaseConfigurable
}
JDOMUtil.writeDocument(new Document(element), filePath, SystemProperties.getLineSeparator());
}
catch (WriteExternalException e1) {
LOG.error(e1);
}
catch (IOException e1) {
LOG.error(e1);
}
@@ -22,7 +22,6 @@ import com.intellij.lang.Commenter;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.fileTypes.*;
import com.intellij.openapi.fileTypes.ex.ExternalizableFileType;
import com.intellij.openapi.options.ExternalInfo;
import com.intellij.openapi.options.ExternalizableScheme;
import com.intellij.openapi.options.SettingsEditor;
import com.intellij.openapi.util.*;
@@ -415,10 +414,4 @@ public class AbstractFileType extends UserFileType<AbstractFileType> implements
public void setCommenter(final Commenter commenter) {
myCommenter = commenter;
}
@Override
@Nullable
public ExternalInfo getExternalInfo() {
return null;
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,7 +24,6 @@ package com.intellij.openapi.vcs.changes.shelf;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.diff.impl.patch.FilePatch;
import com.intellij.openapi.options.ExternalInfo;
import com.intellij.openapi.options.ExternalizableScheme;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.DefaultJDOMExternalizer;
@@ -36,7 +35,6 @@ import com.intellij.openapi.vcs.FileStatus;
import org.jdom.Element;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.util.ArrayList;
@@ -90,7 +88,7 @@ public class ShelvedChangeList implements JDOMExternalizable, ExternalizableSche
DATE = new Date(Long.parseLong(element.getAttributeValue(ATTRIBUTE_DATE)));
myRecycled = Boolean.parseBoolean(element.getAttributeValue(ATTRIBUTE_RECYCLED_CHANGELIST));
//noinspection unchecked
final List<Element> children = (List<Element>)element.getChildren(ELEMENT_BINARY);
final List<Element> children = element.getChildren(ELEMENT_BINARY);
myBinaryFiles = new ArrayList<ShelvedBinaryFile>(children.size());
for (Element child : children) {
ShelvedBinaryFile binaryFile = new ShelvedBinaryFile();
@@ -161,12 +159,6 @@ public class ShelvedChangeList implements JDOMExternalizable, ExternalizableSche
return mySchemeName;
}
@Nullable
@Override
public ExternalInfo getExternalInfo() {
return null;
}
@Override
public void setName(@NotNull String newName) {
mySchemeName = newName;