mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup — default method, nullability
This commit is contained in:
+3
-12
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -29,7 +29,6 @@ import com.intellij.execution.testframework.sm.runner.SMTestProxy;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.options.SettingsEditor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.InvalidDataException;
|
||||
@@ -54,16 +53,6 @@ import java.util.List;
|
||||
public class TestDiscoveryExtension extends RunConfigurationExtension {
|
||||
private static final Logger LOG = Logger.getInstance("#" + TestDiscoveryExtension.class.getName());
|
||||
|
||||
@Nullable
|
||||
public SettingsEditor createEditor(@NotNull RunConfigurationBase configuration) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getEditorTitle() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getSerializationId() {
|
||||
@@ -117,6 +106,7 @@ public class TestDiscoveryExtension extends RunConfigurationExtension {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateJavaParameters(RunConfigurationBase configuration, JavaParameters params, RunnerSettings runnerSettings) {
|
||||
if (runnerSettings != null || !isApplicableFor(configuration)) {
|
||||
return;
|
||||
@@ -147,6 +137,7 @@ public class TestDiscoveryExtension extends RunConfigurationExtension {
|
||||
throw new WriteExternalException();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isApplicableFor(@NotNull final RunConfigurationBase configuration) {
|
||||
return configuration instanceof JavaTestConfigurationBase && Registry.is("testDiscovery.enabled");
|
||||
}
|
||||
|
||||
+9
-7
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -22,7 +22,6 @@ import com.intellij.execution.configurations.RunConfigurationBase;
|
||||
import com.intellij.execution.configurations.RunnerSettings;
|
||||
import com.intellij.execution.process.ProcessHandler;
|
||||
import com.intellij.openapi.options.SettingsEditor;
|
||||
import com.intellij.openapi.util.InvalidDataException;
|
||||
import com.intellij.openapi.util.WriteExternalException;
|
||||
import org.jdom.Element;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -51,8 +50,8 @@ public abstract class RunConfigurationExtensionBase<T extends RunConfigurationBa
|
||||
* @param runConfiguration the run configuration being deserialized.
|
||||
* @param element the element with persisted settings.
|
||||
*/
|
||||
protected abstract void readExternal(@NotNull final T runConfiguration,
|
||||
@NotNull final Element element) throws InvalidDataException;
|
||||
protected void readExternal(@NotNull final T runConfiguration, @NotNull final Element element) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the settings of this extension to the run configuration XML element.
|
||||
@@ -73,7 +72,9 @@ public abstract class RunConfigurationExtensionBase<T extends RunConfigurationBa
|
||||
* @return the editor component, or null if this extension doesn't provide any UI for editing the settings.
|
||||
*/
|
||||
@Nullable
|
||||
protected abstract <P extends T> SettingsEditor<P> createEditor(@NotNull final P configuration);
|
||||
protected <P extends T> SettingsEditor<P> createEditor(@NotNull final P configuration) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the title of the tab in which the settings editor is displayed.
|
||||
@@ -81,7 +82,9 @@ public abstract class RunConfigurationExtensionBase<T extends RunConfigurationBa
|
||||
* @return the editor tab title, or null if this extension doesn't provide any UI for editing the settings.
|
||||
*/
|
||||
@Nullable
|
||||
protected abstract String getEditorTitle();
|
||||
protected String getEditorTitle() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param configuration Run configuration
|
||||
@@ -93,7 +96,6 @@ public abstract class RunConfigurationExtensionBase<T extends RunConfigurationBa
|
||||
/**
|
||||
*
|
||||
* @param applicableConfiguration Applicable run configuration
|
||||
* @param runnerSettings
|
||||
* @return True if extension is turned on in configuration extension settings.
|
||||
* E.g. RCov is turned on for given run configuration.
|
||||
*/
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2000-2016 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.execution.util;
|
||||
|
||||
import com.intellij.execution.CantRunException;
|
||||
@@ -5,13 +20,11 @@ import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
import com.intellij.openapi.fileEditor.impl.LoadTextUtil;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.CharsetToolkit;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.PathUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
+1
-22
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -20,12 +20,8 @@ import com.intellij.execution.ExecutionException;
|
||||
import com.intellij.execution.RunConfigurationExtension;
|
||||
import com.intellij.execution.configurations.*;
|
||||
import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil;
|
||||
import com.intellij.openapi.options.SettingsEditor;
|
||||
import com.intellij.openapi.util.InvalidDataException;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import org.jdom.Element;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jps.model.serialization.PathMacroUtil;
|
||||
import org.jetbrains.plugins.gradle.util.GradleConstants;
|
||||
|
||||
@@ -55,23 +51,6 @@ public class ProgramRunConfigurationExtension extends RunConfigurationExtension
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readExternal(@NotNull RunConfigurationBase runConfiguration, @NotNull Element element)
|
||||
throws InvalidDataException {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
protected <P extends RunConfigurationBase> SettingsEditor<P> createEditor(@NotNull P configuration) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
protected String getEditorTitle() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isApplicableFor(@NotNull RunConfigurationBase configuration) {
|
||||
if (configuration instanceof ModuleBasedConfiguration && configuration instanceof CommonProgramRunConfigurationParameters) {
|
||||
|
||||
+4
-12
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -34,7 +34,6 @@ import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.components.BaseComponent;
|
||||
import com.intellij.openapi.components.ProjectComponent;
|
||||
import com.intellij.openapi.extensions.AreaInstance;
|
||||
import com.intellij.openapi.options.SettingsEditor;
|
||||
import com.intellij.openapi.util.InvalidDataException;
|
||||
import com.intellij.openapi.util.WriteExternalException;
|
||||
import com.intellij.pom.Navigatable;
|
||||
@@ -96,10 +95,12 @@ public class SnapShooterConfigurationExtension extends RunConfigurationExtension
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isApplicableFor(@NotNull RunConfigurationBase configuration) {
|
||||
return configuration instanceof ApplicationConfiguration;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void attachToProcess(@NotNull final RunConfigurationBase configuration, @NotNull final ProcessHandler handler, RunnerSettings runnerSettings) {
|
||||
SnapShooterConfigurationSettings settings = configuration.getUserData(SnapShooterConfigurationSettings.SNAP_SHOOTER_KEY);
|
||||
if (settings != null) {
|
||||
@@ -107,6 +108,7 @@ public class SnapShooterConfigurationExtension extends RunConfigurationExtension
|
||||
if (runnable != null) {
|
||||
settings.setNotifyRunnable(null);
|
||||
handler.addProcessListener(new ProcessAdapter() {
|
||||
@Override
|
||||
public void startNotified(final ProcessEvent event) {
|
||||
runnable.run();
|
||||
}
|
||||
@@ -115,16 +117,6 @@ public class SnapShooterConfigurationExtension extends RunConfigurationExtension
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SettingsEditor createEditor(@NotNull RunConfigurationBase configuration) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEditorTitle() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getSerializationId() {
|
||||
|
||||
Reference in New Issue
Block a user