mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup
This commit is contained in:
+1
-1
@@ -68,7 +68,7 @@ import java.util.List;
|
||||
*/
|
||||
public class AppEngineUploader {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.appengine.actions.AppEngineUploader");
|
||||
private Project myProject;
|
||||
private final Project myProject;
|
||||
private final Artifact myArtifact;
|
||||
private final AppEngineFacet myAppEngineFacet;
|
||||
private final AppEngineSdk mySdk;
|
||||
|
||||
+2
-3
@@ -6,7 +6,6 @@ import com.intellij.appengine.util.AppEngineUtil;
|
||||
import com.intellij.facet.ProjectFacetManager;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.DataKeys;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.packaging.artifacts.Artifact;
|
||||
@@ -19,12 +18,12 @@ import java.util.List;
|
||||
public class UploadApplicationAction extends AnAction {
|
||||
@Override
|
||||
public void update(AnActionEvent e) {
|
||||
final Project project = e.getData(DataKeys.PROJECT);
|
||||
final Project project = e.getProject();
|
||||
e.getPresentation().setVisible(project != null && !ProjectFacetManager.getInstance(project).getFacets(AppEngineFacet.ID).isEmpty());
|
||||
}
|
||||
|
||||
public void actionPerformed(AnActionEvent e) {
|
||||
final Project project = e.getData(DataKeys.PROJECT);
|
||||
final Project project = e.getProject();
|
||||
if (project != null) {
|
||||
final List<Artifact> artifacts = AppEngineUtil.collectWebArtifacts(project, true);
|
||||
if (artifacts.isEmpty()) {
|
||||
|
||||
+2
-2
@@ -203,10 +203,10 @@ public class AppEngineSupportProvider extends FacetBasedFrameworkSupportProvider
|
||||
|
||||
private class AppEngineSupportConfigurable extends FrameworkSupportConfigurableBase implements FrameworkSupportModelListener {
|
||||
private JPanel myMainPanel;
|
||||
private AppEngineSdkEditor mySdkEditor;
|
||||
private final AppEngineSdkEditor mySdkEditor;
|
||||
private JComboBox myPersistenceApiComboBox;
|
||||
private JPanel mySdkPanel;
|
||||
private HyperlinkLabel myErrorLabel;
|
||||
private final HyperlinkLabel myErrorLabel;
|
||||
private JPanel myErrorPanel;
|
||||
|
||||
private AppEngineSupportConfigurable(FrameworkSupportModel model) {
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ public abstract class AppEngineSdkManager {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public abstract AppEngineSdk findSdk(String sdkPath);
|
||||
public abstract AppEngineSdk findSdk(@NotNull String sdkPath);
|
||||
|
||||
@NotNull
|
||||
public abstract List<? extends AppEngineSdk> getValidSdks();
|
||||
|
||||
+5
-4
@@ -12,6 +12,7 @@ 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.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileManager;
|
||||
import gnu.trove.THashMap;
|
||||
@@ -30,7 +31,7 @@ public class AppEngineSdkImpl implements AppEngineSdk {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.appengine.sdk.impl.AppEngineSdkImpl");
|
||||
private Map<String, Set<String>> myClassesWhiteList;
|
||||
private Map<String, Set<String>> myMethodsBlackList;
|
||||
private String myHomePath;
|
||||
private final String myHomePath;
|
||||
|
||||
public AppEngineSdkImpl(String homePath) {
|
||||
myHomePath = homePath;
|
||||
@@ -145,10 +146,10 @@ public class AppEngineSdkImpl implements AppEngineSdk {
|
||||
final AppEngineServerIntegration integration = AppEngineServerIntegration.getInstance();
|
||||
|
||||
final List<ApplicationServer> servers = serversManager.getApplicationServers(integration);
|
||||
File sdkHomeFile = new File(FileUtil.toSystemDependentName(myHomePath));
|
||||
File sdkHomeFile = new File(myHomePath);
|
||||
for (ApplicationServer server : servers) {
|
||||
final String path = ((AppEngineServerData)server.getPersistentData()).getSdkPath();
|
||||
if (sdkHomeFile.equals(new File(FileUtil.toSystemDependentName(path)))) {
|
||||
if (FileUtil.filesEqual(sdkHomeFile, new File(path))) {
|
||||
return server;
|
||||
}
|
||||
}
|
||||
@@ -181,7 +182,7 @@ public class AppEngineSdkImpl implements AppEngineSdk {
|
||||
}
|
||||
}
|
||||
}
|
||||
return VfsUtil.toVirtualFileArray(roots);
|
||||
return VfsUtilCore.toVirtualFileArray(roots);
|
||||
}
|
||||
|
||||
public String getLibUserDirectoryPath() {
|
||||
|
||||
+2
-2
@@ -18,11 +18,11 @@ import java.util.Map;
|
||||
* @author nik
|
||||
*/
|
||||
public class AppEngineSdkManagerImpl extends AppEngineSdkManager {
|
||||
private Map<String, AppEngineSdkImpl> myPath2Sdk = new THashMap<String, AppEngineSdkImpl>();
|
||||
private final Map<String, AppEngineSdkImpl> myPath2Sdk = new THashMap<String, AppEngineSdkImpl>();
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public AppEngineSdk findSdk(String sdkPath) {
|
||||
public AppEngineSdk findSdk(@NotNull String sdkPath) {
|
||||
sdkPath = StringUtil.trimEnd(sdkPath, "/");
|
||||
if (!myPath2Sdk.containsKey(sdkPath)) {
|
||||
myPath2Sdk.put(sdkPath, new AppEngineSdkImpl(sdkPath));
|
||||
|
||||
+1
-3
@@ -5,7 +5,6 @@ import com.intellij.appengine.sdk.AppEngineSdkManager;
|
||||
import com.intellij.javaee.appServerIntegrations.ApplicationServerPersistentData;
|
||||
import com.intellij.openapi.util.InvalidDataException;
|
||||
import com.intellij.openapi.util.WriteExternalException;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import org.jdom.Element;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -34,8 +33,7 @@ public class AppEngineServerData implements ApplicationServerPersistentData {
|
||||
}
|
||||
|
||||
public void readExternal(Element element) throws InvalidDataException {
|
||||
//todo[nik] remove toSystemIndependentName call later. It is needed only to fix incorrect config files
|
||||
mySdkPath = FileUtil.toSystemIndependentName(element.getChildTextTrim("sdk-path"));
|
||||
mySdkPath = element.getChildTextTrim("sdk-path");
|
||||
}
|
||||
|
||||
public void writeExternal(Element element) throws WriteExternalException {
|
||||
|
||||
Reference in New Issue
Block a user