diff --git a/java/execution/openapi/src/com/intellij/execution/filters/ExceptionExFilterFactory.java b/java/execution/openapi/src/com/intellij/execution/filters/ExceptionExFilterFactory.java index 722fb066ac1b..651bb76c445d 100644 --- a/java/execution/openapi/src/com/intellij/execution/filters/ExceptionExFilterFactory.java +++ b/java/execution/openapi/src/com/intellij/execution/filters/ExceptionExFilterFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 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. @@ -62,10 +62,10 @@ public class ExceptionExFilterFactory implements ExceptionFilterFactory { } @Override - public void applyHeavyFilter(final Document copiedFragment, + public void applyHeavyFilter(@NotNull final Document copiedFragment, final int startOffset, int startLineNumber, - final Consumer consumer) { + @NotNull final Consumer consumer) { Map> visited = new THashMap>(); final Trinity emptyInfo = Trinity.create(null, null, null); @@ -110,6 +110,7 @@ public class ExceptionExFilterFactory implements ExceptionFilterFactory { int off = startOffset + lineStartOffset; final Color color = UIUtil.getInactiveTextColor(); consumer.consume(new AdditionalHighlight(off + info.first.getStartOffset(), off + info.second.getEndOffset()) { + @NotNull @Override public TextAttributes getTextAttributes(@Nullable TextAttributes source) { return new TextAttributes(null, null, color, EffectType.BOLD_DOTTED_LINE, Font.PLAIN); @@ -118,6 +119,7 @@ public class ExceptionExFilterFactory implements ExceptionFilterFactory { } } + @NotNull @Override public String getUpdateMessage() { return "Highlighting try blocks..."; diff --git a/java/idea-ui/src/com/intellij/ide/util/projectWizard/ProjectJdkForModuleStep.java b/java/idea-ui/src/com/intellij/ide/util/projectWizard/ProjectJdkForModuleStep.java index 533ca0d30619..42f47c9d2344 100644 --- a/java/idea-ui/src/com/intellij/ide/util/projectWizard/ProjectJdkForModuleStep.java +++ b/java/idea-ui/src/com/intellij/ide/util/projectWizard/ProjectJdkForModuleStep.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 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. @@ -32,6 +32,7 @@ import com.intellij.openapi.ui.Messages; import com.intellij.openapi.ui.MultiLineLabelUI; import com.intellij.util.Consumer; import com.intellij.util.ui.UIUtil; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.swing.*; @@ -47,7 +48,7 @@ import java.awt.event.ActionListener; */ public class ProjectJdkForModuleStep extends ModuleWizardStep { private final JdkChooserPanel myJdkChooser; - private final JPanel myPanel; + @NotNull private final JPanel myPanel; private final WizardContext myContext; private final SdkType myType; private boolean myInitialized = false; diff --git a/java/idea-ui/src/com/intellij/openapi/projectRoots/ui/SdkEditor.java b/java/idea-ui/src/com/intellij/openapi/projectRoots/ui/SdkEditor.java index ce4a91952281..17a52d249a70 100644 --- a/java/idea-ui/src/com/intellij/openapi/projectRoots/ui/SdkEditor.java +++ b/java/idea-ui/src/com/intellij/openapi/projectRoots/ui/SdkEditor.java @@ -172,7 +172,7 @@ public class SdkEditor implements Configurable, Place.Navigator { }); } - protected boolean showTabForType(OrderRootType type) { + protected boolean showTabForType(@NotNull OrderRootType type) { return ((SdkType) mySdk.getSdkType()).isRootTypeApplicable(type); } diff --git a/java/java-impl/src/com/intellij/openapi/projectRoots/impl/JavaSdkImpl.java b/java/java-impl/src/com/intellij/openapi/projectRoots/impl/JavaSdkImpl.java index 2ac0a1c83bd3..8a5d7631cb94 100644 --- a/java/java-impl/src/com/intellij/openapi/projectRoots/impl/JavaSdkImpl.java +++ b/java/java-impl/src/com/intellij/openapi/projectRoots/impl/JavaSdkImpl.java @@ -100,6 +100,7 @@ public class JavaSdkImpl extends JavaSdk { }); } + @NotNull @Override public String getPresentableName() { return ProjectBundle.message("sdk.java.name"); @@ -116,6 +117,7 @@ public class JavaSdkImpl extends JavaSdk { return "reference.project.structure.sdk.java"; } + @NotNull @Override public Icon getIconForAddAction() { return AllIcons.General.AddJdk; @@ -141,7 +143,7 @@ public class JavaSdkImpl extends JavaSdk { } @Override - public AdditionalDataConfigurable createAdditionalDataConfigurable(SdkModel sdkModel, SdkModificator sdkModificator) { + public AdditionalDataConfigurable createAdditionalDataConfigurable(@NotNull SdkModel sdkModel, @NotNull SdkModificator sdkModificator) { return null; } @@ -280,6 +282,7 @@ public class JavaSdkImpl extends JavaSdk { } } + @NotNull @Override public FileChooserDescriptor getHomeChooserDescriptor() { final FileChooserDescriptor baseDescriptor = super.getHomeChooserDescriptor(); @@ -299,8 +302,9 @@ public class JavaSdkImpl extends JavaSdk { return descriptor; } + @NotNull @Override - public String adjustSelectedSdkHome(String homePath) { + public String adjustSelectedSdkHome(@NotNull String homePath) { if (SystemInfo.isMac) { File home = new File(homePath, "/Home"); if (home.exists()) return home.getPath(); @@ -621,7 +625,7 @@ public class JavaSdkImpl extends JavaSdk { } @Override - public boolean isRootTypeApplicable(OrderRootType type) { + public boolean isRootTypeApplicable(@NotNull OrderRootType type) { return type == OrderRootType.CLASSES || type == OrderRootType.SOURCES || type == JavadocOrderRootType.getInstance() || diff --git a/java/java-impl/src/com/intellij/openapi/vcs/contentAnnotation/VcsContentAnnotationExceptionFilter.java b/java/java-impl/src/com/intellij/openapi/vcs/contentAnnotation/VcsContentAnnotationExceptionFilter.java index 83e237aa2eff..cb75f56902b0 100644 --- a/java/java-impl/src/com/intellij/openapi/vcs/contentAnnotation/VcsContentAnnotationExceptionFilter.java +++ b/java/java-impl/src/com/intellij/openapi/vcs/contentAnnotation/VcsContentAnnotationExceptionFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 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. @@ -71,6 +71,7 @@ public class VcsContentAnnotationExceptionFilter implements Filter, FilterMixin super(start, end); } + @NotNull @Override public TextAttributes getTextAttributes(@Nullable TextAttributes source) { EditorColorsScheme globalScheme = EditorColorsManager.getInstance().getGlobalScheme(); @@ -93,10 +94,10 @@ public class VcsContentAnnotationExceptionFilter implements Filter, FilterMixin } @Override - public void applyHeavyFilter(final Document copiedFragment, + public void applyHeavyFilter(@NotNull final Document copiedFragment, int startOffset, int startLineNumber, - Consumer consumer) { + @NotNull Consumer consumer) { VcsContentAnnotation vcsContentAnnotation = VcsContentAnnotationImpl.getInstance(myProject); final LocalChangesCorrector localChangesCorrector = new LocalChangesCorrector(myProject); Trinity previousLineResult = null; @@ -168,6 +169,7 @@ public class VcsContentAnnotationExceptionFilter implements Filter, FilterMixin } } + @NotNull @Override public String getUpdateMessage() { return "Checking recent changes..."; diff --git a/platform/lang-api/src/com/intellij/execution/filters/FilterMixin.java b/platform/lang-api/src/com/intellij/execution/filters/FilterMixin.java index 059c6f65879f..da8fe5377d9e 100644 --- a/platform/lang-api/src/com/intellij/execution/filters/FilterMixin.java +++ b/platform/lang-api/src/com/intellij/execution/filters/FilterMixin.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 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. @@ -18,6 +18,7 @@ package com.intellij.execution.filters; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.markup.TextAttributes; import com.intellij.util.Consumer; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /** @@ -28,15 +29,16 @@ import org.jetbrains.annotations.Nullable; */ public interface FilterMixin { boolean shouldRunHeavy(); - void applyHeavyFilter(Document copiedFragment, int startOffset, int startLineNumber, Consumer consumer); + void applyHeavyFilter(@NotNull Document copiedFragment, int startOffset, int startLineNumber, @NotNull Consumer consumer); + @NotNull String getUpdateMessage(); abstract class AdditionalHighlight { private final int myStart; private final int myEnd; - public AdditionalHighlight(int start, int end) { + protected AdditionalHighlight(int start, int end) { myStart = start; myEnd = end; } @@ -49,6 +51,7 @@ public interface FilterMixin { return myEnd; } + @NotNull public abstract TextAttributes getTextAttributes(@Nullable final TextAttributes source); } } diff --git a/platform/lang-api/src/com/intellij/openapi/projectRoots/SdkType.java b/platform/lang-api/src/com/intellij/openapi/projectRoots/SdkType.java index 0411e16894ca..47d5fa15f89d 100644 --- a/platform/lang-api/src/com/intellij/openapi/projectRoots/SdkType.java +++ b/platform/lang-api/src/com/intellij/openapi/projectRoots/SdkType.java @@ -71,7 +71,8 @@ public abstract class SdkType implements SdkTypeId { * @param homePath the path selected in the file chooser. * @return the path to be used as the SDK home. */ - public String adjustSelectedSdkHome(String homePath) { + @NotNull + public String adjustSelectedSdkHome(@NotNull String homePath) { return homePath; } @@ -92,7 +93,7 @@ public abstract class SdkType implements SdkTypeId { public void setupSdkPaths(@NotNull Sdk sdk) {} - public boolean setupSdkPaths(final Sdk sdk, final SdkModel sdkModel) { + public boolean setupSdkPaths(@NotNull Sdk sdk, @NotNull SdkModel sdkModel) { setupSdkPaths(sdk); return true; } @@ -101,7 +102,7 @@ public abstract class SdkType implements SdkTypeId { * @return Configurable object for the sdk's additional data or null if not applicable */ @Nullable - public abstract AdditionalDataConfigurable createAdditionalDataConfigurable(SdkModel sdkModel, SdkModificator sdkModificator); + public abstract AdditionalDataConfigurable createAdditionalDataConfigurable(@NotNull SdkModel sdkModel, @NotNull SdkModificator sdkModificator); @Nullable public SdkAdditionalData loadAdditionalData(Element additional) { @@ -120,6 +121,7 @@ public abstract class SdkType implements SdkTypeId { return myName; } + @NotNull public abstract String getPresentableName(); public Icon getIcon() { @@ -131,6 +133,7 @@ public abstract class SdkType implements SdkTypeId { return "preferences.jdks"; } + @NotNull public Icon getIconForAddAction() { return IconUtil.getAddIcon(); } @@ -157,6 +160,7 @@ public abstract class SdkType implements SdkTypeId { return getName(); } + @NotNull public FileChooserDescriptor getHomeChooserDescriptor() { final FileChooserDescriptor descriptor = new FileChooserDescriptor(false, true, false, false, false, false) { @Override @@ -181,6 +185,7 @@ public abstract class SdkType implements SdkTypeId { } + @NotNull public String getHomeFieldLabel() { return ProjectBundle.message("sdk.configure.type.home.path", getPresentableName()); } @@ -190,6 +195,7 @@ public abstract class SdkType implements SdkTypeId { return null; } + @NotNull public static SdkType[] getAllTypes() { List allTypes = new ArrayList(); Collections.addAll(allTypes, ApplicationManager.getApplication().getComponents(SdkType.class)); @@ -197,7 +203,8 @@ public abstract class SdkType implements SdkTypeId { return allTypes.toArray(new SdkType[allTypes.size()]); } - public static T findInstance(final Class sdkTypeClass) { + @NotNull + public static T findInstance(@NotNull Class sdkTypeClass) { for (SdkType sdkType : Extensions.getExtensions(EP_NAME)) { if (sdkTypeClass.equals(sdkType.getClass())) { //noinspection unchecked @@ -208,7 +215,7 @@ public abstract class SdkType implements SdkTypeId { return null; } - public boolean isRootTypeApplicable(final OrderRootType type) { + public boolean isRootTypeApplicable(@NotNull OrderRootType type) { return true; } @@ -232,7 +239,7 @@ public abstract class SdkType implements SdkTypeId { * @param sdkCreatedCallback the callback to which the created SDK is passed. * @since 12.0 */ - public void showCustomCreateUI(SdkModel sdkModel, JComponent parentComponent, Consumer sdkCreatedCallback) { + public void showCustomCreateUI(@NotNull SdkModel sdkModel, @NotNull JComponent parentComponent, @NotNull Consumer sdkCreatedCallback) { } /** @@ -248,7 +255,7 @@ public abstract class SdkType implements SdkTypeId { return homeDir != null && homeDir.isValid(); } - public String sdkPath(VirtualFile homePath) { + public String sdkPath(@NotNull VirtualFile homePath) { return homePath.getPath(); } } diff --git a/platform/lang-api/src/com/intellij/openapi/projectRoots/SimpleJavaSdkType.java b/platform/lang-api/src/com/intellij/openapi/projectRoots/SimpleJavaSdkType.java index 9db9794a9b9f..dac1d63ce4dd 100644 --- a/platform/lang-api/src/com/intellij/openapi/projectRoots/SimpleJavaSdkType.java +++ b/platform/lang-api/src/com/intellij/openapi/projectRoots/SimpleJavaSdkType.java @@ -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. @@ -45,13 +45,14 @@ public class SimpleJavaSdkType extends SdkType implements JavaSdkType { return jdk; } + @NotNull @Override public String getPresentableName() { return ProjectBundle.message("sdk.java.name"); } @Override - public AdditionalDataConfigurable createAdditionalDataConfigurable(SdkModel sdkModel, SdkModificator sdkModificator) { + public AdditionalDataConfigurable createAdditionalDataConfigurable(@NotNull SdkModel sdkModel, @NotNull SdkModificator sdkModificator) { return null; } diff --git a/platform/lang-api/src/com/intellij/openapi/projectRoots/impl/UnknownSdkType.java b/platform/lang-api/src/com/intellij/openapi/projectRoots/impl/UnknownSdkType.java index 2b06e87d833d..2dc8266bf5f2 100644 --- a/platform/lang-api/src/com/intellij/openapi/projectRoots/impl/UnknownSdkType.java +++ b/platform/lang-api/src/com/intellij/openapi/projectRoots/impl/UnknownSdkType.java @@ -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. @@ -71,7 +71,7 @@ public class UnknownSdkType extends SdkType{ } @Override - public AdditionalDataConfigurable createAdditionalDataConfigurable(SdkModel sdkModel, SdkModificator sdkModificator) { + public AdditionalDataConfigurable createAdditionalDataConfigurable(@NotNull SdkModel sdkModel, @NotNull SdkModificator sdkModificator) { return null; } @@ -91,6 +91,7 @@ public class UnknownSdkType extends SdkType{ public void saveAdditionalData(@NotNull SdkAdditionalData additionalData, @NotNull Element additional) { } + @NotNull @Override public String getPresentableName() { return ProjectBundle.message("sdk.unknown.name"); diff --git a/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/DependentSdkType.java b/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/DependentSdkType.java index 926813fac514..0dd06d060f0e 100644 --- a/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/DependentSdkType.java +++ b/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/DependentSdkType.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 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,6 +24,7 @@ import com.intellij.openapi.util.Ref; import com.intellij.util.Consumer; import com.intellij.util.containers.ContainerUtil; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import javax.swing.*; import java.util.Arrays; @@ -60,7 +61,7 @@ public abstract class DependentSdkType extends SdkType { } @Override - public void showCustomCreateUI(final SdkModel sdkModel, JComponent parentComponent, final Consumer sdkCreatedCallback) { + public void showCustomCreateUI(@NotNull final SdkModel sdkModel, @NotNull JComponent parentComponent, @NotNull final Consumer sdkCreatedCallback) { if (!checkDependency(sdkModel)) { if (Messages.showOkCancelDialog(parentComponent, getUnsatisfiedDependencyMessage(), "Cannot Create SDK", Messages.getWarningIcon()) != Messages.OK) { return; diff --git a/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/SdkConfigurationUtil.java b/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/SdkConfigurationUtil.java index a83adffa083a..f78d871a7280 100644 --- a/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/SdkConfigurationUtil.java +++ b/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/SdkConfigurationUtil.java @@ -135,8 +135,10 @@ public class SdkConfigurationUtil { } @Nullable - public static Sdk setupSdk(final Sdk[] allSdks, - final VirtualFile homeDir, final SdkType sdkType, final boolean silent, + public static Sdk setupSdk(@NotNull Sdk[] allSdks, + @NotNull VirtualFile homeDir, + final SdkType sdkType, + final boolean silent, @Nullable final SdkAdditionalData additionalData, @Nullable final String customSdkSuggestedName) { final List sdksList = Arrays.asList(allSdks); diff --git a/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/projectRoot/ProjectSdksModel.java b/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/projectRoot/ProjectSdksModel.java index bc464fa20f29..350ed36a7220 100644 --- a/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/projectRoot/ProjectSdksModel.java +++ b/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/projectRoot/ProjectSdksModel.java @@ -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. @@ -37,7 +37,9 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.swing.*; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; /** * @author anna @@ -238,13 +240,13 @@ public class ProjectSdksModel implements SdkModel { } } - public void createAddActions(DefaultActionGroup group, final JComponent parent, final Consumer updateTree) { + public void createAddActions(@NotNull DefaultActionGroup group, @NotNull JComponent parent, @NotNull Consumer updateTree) { createAddActions(group, parent, updateTree, null); } - public void createAddActions(DefaultActionGroup group, - final JComponent parent, - final Consumer updateTree, + public void createAddActions(@NotNull DefaultActionGroup group, + @NotNull final JComponent parent, + @NotNull final Consumer updateTree, @Nullable Condition filter) { final SdkType[] types = SdkType.getAllTypes(); for (final SdkType type : types) { @@ -259,7 +261,7 @@ public class ProjectSdksModel implements SdkModel { } } - public void doAdd(JComponent parent, final SdkType type, final Consumer callback) { + public void doAdd(@NotNull JComponent parent, @NotNull final SdkType type, @NotNull final Consumer callback) { myModified = true; if (type.supportsCustomCreateUI()) { type.showCustomCreateUI(this, parent, new Consumer() { diff --git a/platform/util/src/com/intellij/util/xmlb/XmlSerializer.java b/platform/util/src/com/intellij/util/xmlb/XmlSerializer.java index e13c122d9aa3..4d45fed53452 100644 --- a/platform/util/src/com/intellij/util/xmlb/XmlSerializer.java +++ b/platform/util/src/com/intellij/util/xmlb/XmlSerializer.java @@ -63,7 +63,7 @@ public class XmlSerializer { @Nullable @SuppressWarnings({"unchecked"}) - public static T deserialize(Element element, Class aClass) throws XmlSerializationException { + public static T deserialize(@NotNull Element element, @NotNull Class aClass) throws XmlSerializationException { try { return (T)XmlSerializerImpl.getBinding(aClass).deserialize(null, element); } diff --git a/plugins/devkit/src/projectRoots/IdeaJdk.java b/plugins/devkit/src/projectRoots/IdeaJdk.java index b4b268ca339c..1fc41ca634ea 100644 --- a/plugins/devkit/src/projectRoots/IdeaJdk.java +++ b/plugins/devkit/src/projectRoots/IdeaJdk.java @@ -80,6 +80,7 @@ public class IdeaJdk extends JavaDependentSdkType implements JavaSdkType { return "reference.project.structure.sdk.idea"; } + @NotNull public Icon getIconForAddAction() { return ADD_SDK; } @@ -88,8 +89,9 @@ public class IdeaJdk extends JavaDependentSdkType implements JavaSdkType { return PathManager.getHomePath().replace(File.separatorChar, '/'); } + @NotNull @Override - public String adjustSelectedSdkHome(String homePath) { + public String adjustSelectedSdkHome(@NotNull String homePath) { if (SystemInfo.isMac) { File home = new File(homePath, "Contents"); if (home.exists()) return home.getPath(); @@ -209,7 +211,7 @@ public class IdeaJdk extends JavaDependentSdkType implements JavaSdkType { } - public boolean setupSdkPaths(final Sdk sdk, SdkModel sdkModel) { + public boolean setupSdkPaths(@NotNull final Sdk sdk, @NotNull SdkModel sdkModel) { final Sandbox additionalData = (Sandbox)sdk.getSdkAdditionalData(); if (additionalData != null) { additionalData.cleanupWatchedRoots(); @@ -418,7 +420,7 @@ public class IdeaJdk extends JavaDependentSdkType implements JavaSdkType { return wasSmthAdded; } - public AdditionalDataConfigurable createAdditionalDataConfigurable(final SdkModel sdkModel, SdkModificator sdkModificator) { + public AdditionalDataConfigurable createAdditionalDataConfigurable(@NotNull final SdkModel sdkModel, @NotNull SdkModificator sdkModificator) { return new IdeaJdkConfigurable(sdkModel, sdkModificator); } @@ -465,6 +467,7 @@ public class IdeaJdk extends JavaDependentSdkType implements JavaSdkType { return sandbox; } + @NotNull public String getPresentableName() { return DevKitBundle.message("sdk.title"); } @@ -481,7 +484,7 @@ public class IdeaJdk extends JavaDependentSdkType implements JavaSdkType { } @Override - public boolean isRootTypeApplicable(OrderRootType type) { + public boolean isRootTypeApplicable(@NotNull OrderRootType type) { return type == OrderRootType.CLASSES || type == OrderRootType.SOURCES || type == JavadocOrderRootType.getInstance() || diff --git a/python/src/com/jetbrains/python/sdk/PythonSdkType.java b/python/src/com/jetbrains/python/sdk/PythonSdkType.java index 1126170d92bb..3cf06f947ad1 100644 --- a/python/src/com/jetbrains/python/sdk/PythonSdkType.java +++ b/python/src/com/jetbrains/python/sdk/PythonSdkType.java @@ -135,6 +135,7 @@ public class PythonSdkType extends SdkType { return "reference.project.structure.sdk.python"; } + @NotNull public Icon getIconForAddAction() { return PythonFileType.INSTANCE.getIcon(); } @@ -264,6 +265,7 @@ public class PythonSdkType extends SdkType { return isRemote(findSdkByPath(sdkPath)); } + @NotNull @Override public FileChooserDescriptor getHomeChooserDescriptor() { final boolean isWindows = SystemInfo.isWindows; @@ -302,7 +304,7 @@ public class PythonSdkType extends SdkType { return true; } - public void showCustomCreateUI(SdkModel sdkModel, final JComponent parentComponent, final Consumer sdkCreatedCallback) { + public void showCustomCreateUI(@NotNull SdkModel sdkModel, @NotNull final JComponent parentComponent, @NotNull final Consumer sdkCreatedCallback) { Project project = CommonDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext(parentComponent)); final PointerInfo pointerInfo = MouseInfo.getPointerInfo(); if (pointerInfo == null) return; @@ -456,7 +458,7 @@ public class PythonSdkType extends SdkType { } @Nullable - public AdditionalDataConfigurable createAdditionalDataConfigurable(final SdkModel sdkModel, final SdkModificator sdkModificator) { + public AdditionalDataConfigurable createAdditionalDataConfigurable(@NotNull final SdkModel sdkModel, @NotNull final SdkModificator sdkModificator) { return null; } @@ -482,13 +484,14 @@ public class PythonSdkType extends SdkType { return path.contains(SKELETON_DIR_NAME); } + @NotNull @NonNls public String getPresentableName() { return "Python SDK"; } @Override - public String sdkPath(VirtualFile homePath) { + public String sdkPath(@NotNull VirtualFile homePath) { String path = super.sdkPath(homePath); PythonSdkFlavor flavor = PythonSdkFlavor.getFlavor(path); if (flavor != null) { @@ -520,7 +523,7 @@ public class PythonSdkType extends SdkType { } @Override - public boolean setupSdkPaths(Sdk sdk, SdkModel sdkModel) { + public boolean setupSdkPaths(@NotNull Sdk sdk, @NotNull SdkModel sdkModel) { return true; // run setupSdkPaths only once (from PythonSdkDetailsStep). Skip this from showCustomCreateUI } @@ -934,7 +937,7 @@ public class PythonSdkType extends SdkType { return LanguageLevel.getDefault(); } - public boolean isRootTypeApplicable(final OrderRootType type) { + public boolean isRootTypeApplicable(@NotNull final OrderRootType type) { return type == OrderRootType.CLASSES; }