add NotNull to read/writeExternal

This commit is contained in:
Vladimir Krivosheev
2017-12-06 13:49:19 +01:00
parent fcbe4c6949
commit b7f68ecec1
12 changed files with 38 additions and 142 deletions
@@ -1,17 +1,5 @@
/*
* 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.
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package com.intellij.execution.jar;
@@ -65,7 +53,7 @@ public class JarApplicationConfiguration extends LocatableConfigurationBase impl
}
@Override
public void readExternal(Element element) throws InvalidDataException {
public void readExternal(@NotNull Element element) throws InvalidDataException {
super.readExternal(element);
JavaRunConfigurationExtensionManager.getInstance().readExternal(this, element);
XmlSerializer.deserializeInto(myBean, element);
@@ -92,7 +80,7 @@ public class JarApplicationConfiguration extends LocatableConfigurationBase impl
}
@Override
public void writeExternal(Element element) throws WriteExternalException {
public void writeExternal(@NotNull Element element) throws WriteExternalException {
super.writeExternal(element);
JavaRunConfigurationExtensionManager.getInstance().writeExternal(this, element);
XmlSerializer.serializeInto(myBean, element, SERIALIZATION_FILTERS);
@@ -1,4 +1,6 @@
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
/*
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package com.intellij.openapi.externalSystem.service.execution;
import com.intellij.build.*;
@@ -122,7 +124,7 @@ public class ExternalSystemRunConfiguration extends LocatableConfigurationBase i
}
@Override
public void readExternal(Element element) throws InvalidDataException {
public void readExternal(@NotNull Element element) throws InvalidDataException {
super.readExternal(element);
Element e = element.getChild(ExternalSystemTaskExecutionSettings.TAG_NAME);
if (e != null) {
@@ -132,7 +134,7 @@ public class ExternalSystemRunConfiguration extends LocatableConfigurationBase i
}
@Override
public void writeExternal(Element element) throws WriteExternalException {
public void writeExternal(@NotNull Element element) throws WriteExternalException {
super.writeExternal(element);
element.addContent(XmlSerializer.serialize(mySettings, new SerializationFilter() {
@Override
@@ -1,17 +1,5 @@
/*
* Copyright 2000-2017 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.
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package com.intellij.execution.configurations;
@@ -118,7 +106,7 @@ public class UnknownRunConfiguration implements RunConfiguration, WithoutOwnBefo
}
@Override
public void readExternal(final Element element) throws InvalidDataException {
public void readExternal(@NotNull final Element element) throws InvalidDataException {
myStoredElement = JDOMUtil.internElement(element);
}
@@ -1,17 +1,5 @@
/*
* Copyright 2000-2017 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.
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package com.intellij.execution.junit;
@@ -216,12 +204,12 @@ public abstract class RuntimeConfigurationProducer implements Comparable, Clonea
}
@Override
public void readExternal(Element element) throws InvalidDataException {
public void readExternal(@NotNull Element element) throws InvalidDataException {
myConfig.readExternal(element);
}
@Override
public void writeExternal(Element element) throws WriteExternalException {
public void writeExternal(@NotNull Element element) throws WriteExternalException {
myConfig.writeExternal(element);
}
@@ -1,4 +1,6 @@
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
/*
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package com.intellij.remoteServer.impl.configuration.deployment;
import com.intellij.configurationStore.ComponentSerializationUtil;
@@ -174,7 +176,7 @@ public class DeployToServerRunConfiguration<S extends ServerConfiguration, D ext
}
@Override
public void readExternal(Element element) throws InvalidDataException {
public void readExternal(@NotNull Element element) throws InvalidDataException {
super.readExternal(element);
ConfigurationState state = XmlSerializer.deserialize(element, ConfigurationState.class);
myServerName = null;
@@ -211,7 +213,7 @@ public class DeployToServerRunConfiguration<S extends ServerConfiguration, D ext
}
@Override
public void writeExternal(Element element) throws WriteExternalException {
public void writeExternal(@NotNull Element element) throws WriteExternalException {
ConfigurationState state = new ConfigurationState();
state.myServerName = myServerName;
if (myDeploymentSource != null) {
@@ -1,17 +1,5 @@
/*
* 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.
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package org.jetbrains.debugger;
@@ -109,7 +97,7 @@ public abstract class RemoteDebugConfiguration extends LocatableConfigurationBas
}
@Override
public void readExternal(Element element) throws InvalidDataException {
public void readExternal(@NotNull Element element) throws InvalidDataException {
super.readExternal(element);
XmlSerializer.deserializeInto(this, element);
@@ -119,7 +107,7 @@ public abstract class RemoteDebugConfiguration extends LocatableConfigurationBas
}
@Override
public void writeExternal(Element element) throws WriteExternalException {
public void writeExternal(@NotNull Element element) throws WriteExternalException {
super.writeExternal(element);
XmlSerializer.serializeInto(this, element, serializationFilter);
@@ -1,17 +1,5 @@
/*
* Copyright 2000-2017 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.
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package com.intellij.execution.testframework.sm.runner;
@@ -36,12 +24,12 @@ public class MockRuntimeConfiguration extends LocatableConfigurationBase impleme
}
@Override
public void readExternal(Element element) throws InvalidDataException {
public void readExternal(@NotNull Element element) throws InvalidDataException {
//Do nothing
}
@Override
public void writeExternal(Element element) throws WriteExternalException {
public void writeExternal(@NotNull Element element) throws WriteExternalException {
//Do nothing
}
@@ -1,17 +1,5 @@
/*
* Copyright 2000-2017 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.
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package com.intellij.execution.testframework.actions;
@@ -278,12 +266,12 @@ public class AbstractRerunFailedTestsAction extends AnAction implements AnAction
///////////////////////////////////Delegates
@Override
public void readExternal(final Element element) throws InvalidDataException {
public void readExternal(@NotNull final Element element) throws InvalidDataException {
myConfiguration.readExternal(element);
}
@Override
public void writeExternal(final Element element) throws WriteExternalException {
public void writeExternal(@NotNull final Element element) throws WriteExternalException {
myConfiguration.writeExternal(element);
}
@@ -1,17 +1,5 @@
/*
* Copyright 2000-2017 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.
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package com.intellij.lang.ant.config.execution;
@@ -93,13 +81,13 @@ public class AntRunConfiguration extends LocatableConfigurationBase implements R
}
@Override
public void readExternal(Element element) throws InvalidDataException {
public void readExternal(@NotNull Element element) throws InvalidDataException {
super.readExternal(element);
mySettings.readExternal(element);
}
@Override
public void writeExternal(Element element) throws WriteExternalException {
public void writeExternal(@NotNull Element element) throws WriteExternalException {
super.writeExternal(element);
mySettings.writeExternal(element);
}
@@ -1,17 +1,5 @@
/*
* 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.
* 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.
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package org.jetbrains.idea.devkit.run;
@@ -289,7 +277,7 @@ public class PluginRunConfiguration extends RunConfigurationBase implements Modu
}
@Override
public void readExternal(Element element) throws InvalidDataException {
public void readExternal(@NotNull Element element) throws InvalidDataException {
Element module = element.getChild(MODULE);
if (module != null) {
myModuleName = module.getAttributeValue(NAME);
@@ -308,7 +296,7 @@ public class PluginRunConfiguration extends RunConfigurationBase implements Modu
}
@Override
public void writeExternal(Element element) throws WriteExternalException {
public void writeExternal(@NotNull Element element) throws WriteExternalException {
Element moduleElement = new Element(MODULE);
moduleElement.setAttribute(NAME, ApplicationManager.getApplication().runReadAction(new Computable<String>() {
@Override
@@ -1,17 +1,5 @@
/*
* Copyright 2000-2017 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.
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package org.jetbrains.idea.maven.execution;
@@ -137,7 +125,7 @@ public class MavenRunConfiguration extends LocatableConfigurationBase implements
}
@Override
public void readExternal(Element element) throws InvalidDataException {
public void readExternal(@NotNull Element element) throws InvalidDataException {
super.readExternal(element);
Element mavenSettingsElement = element.getChild(MavenSettings.TAG);
@@ -152,7 +140,7 @@ public class MavenRunConfiguration extends LocatableConfigurationBase implements
}
@Override
public void writeExternal(Element element) throws WriteExternalException {
public void writeExternal(@NotNull Element element) throws WriteExternalException {
super.writeExternal(element);
element.addContent(XmlSerializer.serialize(mySettings));
}
@@ -218,7 +218,7 @@ public final class XsltRunConfiguration extends LocatableConfigurationBase imple
@Override
@SuppressWarnings({ "unchecked" })
public void readExternal(Element element) throws InvalidDataException {
public void readExternal(@NotNull Element element) throws InvalidDataException {
super.readExternal(element);
DefaultJDOMExternalizer.readExternal(this, element);
@@ -281,7 +281,7 @@ public final class XsltRunConfiguration extends LocatableConfigurationBase imple
}
@Override
public void writeExternal(Element element) throws WriteExternalException {
public void writeExternal(@NotNull Element element) throws WriteExternalException {
super.writeExternal(element);
DefaultJDOMExternalizer.writeExternal(this, element);