mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Cleanup
This commit is contained in:
+4
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 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.
|
||||
@@ -39,6 +39,7 @@ import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.EmptyRunnable;
|
||||
import com.intellij.openapi.util.IconLoader;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import com.intellij.ui.DocumentAdapter;
|
||||
@@ -190,8 +191,9 @@ public class ProjectConfigurable extends ProjectStructureElementConfigurable<Pro
|
||||
|
||||
public void apply() throws ConfigurationException {
|
||||
final CompilerProjectExtension compilerProjectExtension = CompilerProjectExtension.getInstance(myProject);
|
||||
assert compilerProjectExtension != null : myProject;
|
||||
|
||||
if (myProjectName != null && myProjectName.getText().trim().length() == 0) {
|
||||
if (myProjectName != null && StringUtil.isEmptyOrSpaces(myProjectName.getText())) {
|
||||
throw new ConfigurationException("Please, specify project name!");
|
||||
}
|
||||
|
||||
|
||||
+11
-5
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 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.
|
||||
@@ -27,12 +27,14 @@ import com.intellij.openapi.vfs.pointers.VirtualFilePointerListener;
|
||||
import com.intellij.openapi.vfs.pointers.VirtualFilePointerManager;
|
||||
import com.intellij.util.PathUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.PrintStream;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
public class VirtualFilePointerImpl extends UserDataHolderBase implements VirtualFilePointer, Disposable {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.vfs.impl.VirtualFilePointerImpl");
|
||||
|
||||
private Pair<VirtualFile, String> myFileAndUrl; // must not be both null
|
||||
private final VirtualFileManager myVirtualFileManager;
|
||||
private final VirtualFilePointerListener myListener;
|
||||
@@ -44,7 +46,11 @@ public class VirtualFilePointerImpl extends UserDataHolderBase implements Virtua
|
||||
private static final Key<Throwable> KILL_TRACE = Key.create("KILL_TRACE");
|
||||
private static final boolean TRACE_CREATION = /*true || */LOG.isDebugEnabled();
|
||||
|
||||
VirtualFilePointerImpl(VirtualFile file, @NotNull String url, @NotNull VirtualFileManager virtualFileManager, VirtualFilePointerListener listener, @NotNull Disposable parentDisposable) {
|
||||
VirtualFilePointerImpl(VirtualFile file,
|
||||
@NotNull String url,
|
||||
@NotNull VirtualFileManager virtualFileManager,
|
||||
VirtualFilePointerListener listener,
|
||||
@NotNull Disposable parentDisposable) {
|
||||
myFileAndUrl = Pair.create(file, url);
|
||||
myVirtualFileManager = virtualFileManager;
|
||||
myListener = listener;
|
||||
@@ -84,8 +90,6 @@ public class VirtualFilePointerImpl extends UserDataHolderBase implements Virtua
|
||||
@Override
|
||||
@NotNull
|
||||
public String getUrl() {
|
||||
//checkDisposed(); no check here since Disposer might want to compute hashcode during dispose()
|
||||
|
||||
update();
|
||||
return getUrlNoUpdate();
|
||||
}
|
||||
@@ -132,6 +136,7 @@ public class VirtualFilePointerImpl extends UserDataHolderBase implements Virtua
|
||||
|
||||
@Override
|
||||
public void printStackTrace(PrintStream s) {
|
||||
//noinspection IOResourceOpenedButNotSafelyClosed
|
||||
printStackTrace(new PrintWriter(s));
|
||||
}
|
||||
|
||||
@@ -155,6 +160,7 @@ public class VirtualFilePointerImpl extends UserDataHolderBase implements Virtua
|
||||
return result != null && result.first != null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
Pair<VirtualFile, String> update() {
|
||||
if (disposed) return null;
|
||||
long lastUpdated = myLastUpdated;
|
||||
@@ -193,7 +199,7 @@ public class VirtualFilePointerImpl extends UserDataHolderBase implements Virtua
|
||||
@Override
|
||||
public void dispose() {
|
||||
if (disposed) {
|
||||
throw new MyException("Punching the dead horse.\nurl="+toString(), getUserData(CREATE_TRACE), getUserData(KILL_TRACE));
|
||||
throw new MyException("Punching the dead horse.\nURL=" + toString(), getUserData(CREATE_TRACE), getUserData(KILL_TRACE));
|
||||
}
|
||||
if (--useCount == 0) {
|
||||
if (TRACE_CREATION) {
|
||||
|
||||
+3
-1
@@ -171,10 +171,12 @@ public class VirtualDirectoryImpl extends VirtualFileSystemEntry {
|
||||
final VirtualFileSystemEntry child;
|
||||
final NewVirtualFileSystem fs = getFileSystem();
|
||||
if (PersistentFS.isDirectory(id)) {
|
||||
child = ALT_SYMLINK_HANDLING && PersistentFS.isSymLink(id) ? new SymlinkDirectory(name, this, fs, id) : new VirtualDirectoryImpl(name, this, fs, id);
|
||||
child = ALT_SYMLINK_HANDLING && PersistentFS.isSymLink(id) ? new SymlinkDirectory(name, this, fs, id)
|
||||
: new VirtualDirectoryImpl(name, this, fs, id);
|
||||
}
|
||||
else {
|
||||
child = new VirtualFileImpl(name, this, id);
|
||||
//noinspection TestOnlyProblems
|
||||
assertAccessInTests(child);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user