mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
add NotNull
This commit is contained in:
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
* 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.
|
||||
@@ -45,7 +45,7 @@ public abstract class BuildArtifactsBeforeRunTaskBase<Self extends BuildArtifact
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readExternal(Element element) {
|
||||
public void readExternal(@NotNull Element element) {
|
||||
super.readExternal(element);
|
||||
final List<Element> children = element.getChildren(myElementName);
|
||||
final ArtifactPointerManager pointerManager = ArtifactPointerManager.getInstance(myProject);
|
||||
@@ -62,7 +62,7 @@ public abstract class BuildArtifactsBeforeRunTaskBase<Self extends BuildArtifact
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeExternal(Element element) {
|
||||
public void writeExternal(@NotNull Element element) {
|
||||
super.writeExternal(element);
|
||||
for (ArtifactPointer pointer : myArtifactPointers) {
|
||||
element.addContent(new Element(myElementName).setAttribute(NAME_ATTRIBUTE, pointer.getArtifactName()));
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* 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.
|
||||
@@ -44,7 +44,7 @@ public class ExternalSystemBeforeRunTask extends BeforeRunTask<ExternalSystemBef
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeExternal(Element element) {
|
||||
public void writeExternal(@NotNull Element element) {
|
||||
super.writeExternal(element);
|
||||
|
||||
element.setAttribute("tasks", StringUtil.join(myTaskExecutionSettings.getTaskNames(), " "));
|
||||
@@ -58,7 +58,7 @@ public class ExternalSystemBeforeRunTask extends BeforeRunTask<ExternalSystemBef
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readExternal(Element element) {
|
||||
public void readExternal(@NotNull Element element) {
|
||||
super.readExternal(element);
|
||||
myTaskExecutionSettings.setTaskNames(StringUtil.split(StringUtil.notNullize(element.getAttributeValue("tasks")), " "));
|
||||
myTaskExecutionSettings.setExternalProjectPath(element.getAttributeValue("externalProjectPath"));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* 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.
|
||||
@@ -46,18 +46,16 @@ public abstract class BeforeRunTask<T extends BeforeRunTask> implements Cloneabl
|
||||
myIsEnabled = isEnabled;
|
||||
}
|
||||
|
||||
public void writeExternal(Element element) {
|
||||
public void writeExternal(@NotNull Element element) {
|
||||
element.setAttribute("enabled", String.valueOf(myIsEnabled));
|
||||
}
|
||||
|
||||
public void readExternal(Element element) {
|
||||
public void readExternal(@NotNull Element element) {
|
||||
String attribValue = element.getAttributeValue("enabled");
|
||||
if (attribValue == null) {
|
||||
attribValue = element.getAttributeValue("value"); // maintain compatibility with old format
|
||||
}
|
||||
if (attribValue == null)
|
||||
attribValue = "true";
|
||||
myIsEnabled = Boolean.valueOf(attribValue).booleanValue();
|
||||
myIsEnabled = attribValue == null || Boolean.parseBoolean(attribValue);
|
||||
}
|
||||
|
||||
//Task may aggregate several items or targets to do (e.g. BuildArtifactsBeforeRunTask)
|
||||
|
||||
+2
-2
@@ -291,7 +291,7 @@ extends BeforeRunTaskProvider<RunConfigurationBeforeRunProvider.RunConfigurableB
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeExternal(Element element) {
|
||||
public void writeExternal(@NotNull Element element) {
|
||||
super.writeExternal(element);
|
||||
if (myConfigurationName != null && myConfigurationType != null) {
|
||||
element.setAttribute("run_configuration_name", myConfigurationName);
|
||||
@@ -304,7 +304,7 @@ extends BeforeRunTaskProvider<RunConfigurationBeforeRunProvider.RunConfigurableB
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readExternal(Element element) {
|
||||
public void readExternal(@NotNull Element element) {
|
||||
super.readExternal(element);
|
||||
|
||||
myConfigurationName = element.getAttributeValue("run_configuration_name");
|
||||
|
||||
+2
-2
@@ -84,12 +84,12 @@ public class UnknownBeforeRunTaskProvider extends BeforeRunTaskProvider<UnknownB
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readExternal(Element element) {
|
||||
public void readExternal(@NotNull Element element) {
|
||||
myConfig = element;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeExternal(Element element) {
|
||||
public void writeExternal(@NotNull Element element) {
|
||||
if (myConfig != null) {
|
||||
element.removeContent();
|
||||
final List attributes = myConfig.getAttributes();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* 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.
|
||||
@@ -51,7 +51,7 @@ public abstract class AbstractToolBeforeRunTask<ToolBeforeRunTask extends Abstra
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeExternal(Element element) {
|
||||
public void writeExternal(@NotNull Element element) {
|
||||
super.writeExternal(element);
|
||||
if (myToolActionId != null) {
|
||||
element.setAttribute(ACTION_ID_ATTRIBUTE, myToolActionId);
|
||||
@@ -59,7 +59,7 @@ public abstract class AbstractToolBeforeRunTask<ToolBeforeRunTask extends Abstra
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readExternal(Element element) {
|
||||
public void readExternal(@NotNull Element element) {
|
||||
super.readExternal(element);
|
||||
myToolActionId = element.getAttributeValue(ACTION_ID_ATTRIBUTE);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* 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.
|
||||
@@ -21,6 +21,7 @@ import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.jdom.Element;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author Eugene Zhuravlev
|
||||
@@ -50,7 +51,7 @@ public class AntBeforeRunTask extends BeforeRunTask<AntBeforeRunTask>{
|
||||
myTargetName = targetName;
|
||||
}
|
||||
|
||||
public void writeExternal(Element element) {
|
||||
public void writeExternal(@NotNull Element element) {
|
||||
super.writeExternal(element);
|
||||
if (myAntFileUrl != null && myTargetName != null) {
|
||||
element.setAttribute("antfile", myAntFileUrl);
|
||||
@@ -58,7 +59,7 @@ public class AntBeforeRunTask extends BeforeRunTask<AntBeforeRunTask>{
|
||||
}
|
||||
}
|
||||
|
||||
public void readExternal(Element element) {
|
||||
public void readExternal(@NotNull Element element) {
|
||||
super.readExternal(element);
|
||||
final String url = element.getAttributeValue("antfile");
|
||||
final String targetName = element.getAttributeValue("target");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* 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.
|
||||
@@ -18,6 +18,7 @@ package org.jetbrains.idea.maven.tasks;
|
||||
import com.intellij.execution.BeforeRunTask;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import org.jdom.Element;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.idea.maven.project.MavenProject;
|
||||
|
||||
public class MavenBeforeRunTask extends BeforeRunTask<MavenBeforeRunTask> {
|
||||
@@ -50,14 +51,14 @@ public class MavenBeforeRunTask extends BeforeRunTask<MavenBeforeRunTask> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeExternal(Element element) {
|
||||
public void writeExternal(@NotNull Element element) {
|
||||
super.writeExternal(element);
|
||||
if (myProjectPath != null) element.setAttribute("file", myProjectPath);
|
||||
if (myGoal != null) element.setAttribute("goal", myGoal);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readExternal(Element element) {
|
||||
public void readExternal(@NotNull Element element) {
|
||||
super.readExternal(element);
|
||||
myProjectPath = element.getAttributeValue("file");
|
||||
myGoal = element.getAttributeValue("goal");
|
||||
|
||||
Reference in New Issue
Block a user