From d255f003f52f9365afedb08587b008ac95e33435 Mon Sep 17 00:00:00 2001 From: Dmitry Trofimov Date: Mon, 16 Jun 2014 17:18:26 +0200 Subject: [PATCH] Avoid NotNull assertion in credential testing --- .../remote/VagrantCredentialsException.java | 32 +++++++++++++++++++ .../PythonRemoteInterpreterManager.java | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 platform/platform-impl/src/com/intellij/remote/VagrantCredentialsException.java diff --git a/platform/platform-impl/src/com/intellij/remote/VagrantCredentialsException.java b/platform/platform-impl/src/com/intellij/remote/VagrantCredentialsException.java new file mode 100644 index 000000000000..dca64eda2e02 --- /dev/null +++ b/platform/platform-impl/src/com/intellij/remote/VagrantCredentialsException.java @@ -0,0 +1,32 @@ +/* + * Copyright 2000-2014 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.remote; + +/** + * @author traff + */ +public class VagrantCredentialsException extends RuntimeException { + private String myVagrantFolder; + + public VagrantCredentialsException(String message, String vagrantFolder) { + super(message); + myVagrantFolder = vagrantFolder; + } + + public String getVagrantFolder() { + return myVagrantFolder; + } +} diff --git a/python/src/com/jetbrains/python/remote/PythonRemoteInterpreterManager.java b/python/src/com/jetbrains/python/remote/PythonRemoteInterpreterManager.java index b904b554570b..f4eb0ed5a4b2 100644 --- a/python/src/com/jetbrains/python/remote/PythonRemoteInterpreterManager.java +++ b/python/src/com/jetbrains/python/remote/PythonRemoteInterpreterManager.java @@ -145,7 +145,7 @@ public abstract class PythonRemoteInterpreterManager { public abstract SdkAdditionalData loadRemoteSdkData(Sdk sdk, Element additional); - public abstract boolean testConnection(RemoteCredentials credentials); + public abstract boolean testConnection(@NotNull RemoteCredentials credentials); public abstract PyConsoleProcessHandler createConsoleProcessHandler(Process process, PyRemoteSdkCredentials data,