Merge branch 'master' of git@git.labs.intellij.net:idea/community

This commit is contained in:
Kirill Kalishev
2009-12-04 15:48:07 +03:00
11 changed files with 35 additions and 19 deletions
@@ -112,6 +112,7 @@ public class TranslatingCompilerFilesMonitor implements ApplicationComponent {
public TIntObjectHashMap<Pair<Integer, Integer>> createValue(Integer key) {
TIntObjectHashMap<Pair<Integer, Integer>> map = null;
try {
ensureOutputStorageInitialized();
map = myOutputRootsStorage.get(key);
}
catch (IOException e) {
@@ -385,6 +386,14 @@ public class TranslatingCompilerFilesMonitor implements ApplicationComponent {
myOutputsToDelete.clear();
FileUtil.delete(file);
}
ensureOutputStorageInitialized();
}
private void ensureOutputStorageInitialized() {
if (myOutputRootsStorage != null) {
return;
}
final File rootsFile = new File(CompilerPaths.getCompilerSystemDirectory(), OUTPUT_ROOTS_FILENAME);
try {
initOutputRootsFile(rootsFile);
@@ -307,7 +307,12 @@ public class JavacCompiler extends ExternalCompiler {
StringTokenizer optionsTokenizer = new StringTokenizer(options, " ", false);
while (optionsTokenizer.hasMoreTokens()) {
final String token = optionsTokenizer.nextToken();
additionalOptions.add("-A"+token);
if (token.startsWith("-A")) {
additionalOptions.add(token.substring("-A".length()));
}
else {
additionalOptions.add("-A" + token);
}
}
}
}
@@ -263,7 +263,7 @@ public class AnnotationProcessorsConfigurable implements Configurable{
public String getColumnName(int column) {
switch (column) {
case ProcessorTableRow.NAME_COLUMN: return "Processor FQ Name";
case ProcessorTableRow.OPTIONS_COLUMN : return "Processor Run Options";
case ProcessorTableRow.OPTIONS_COLUMN : return "Processor Run Options (space-separated \"key=value\" pairs)";
}
return super.getColumnName(column);
}
@@ -799,6 +799,8 @@ public class LibraryTableEditor implements Disposable, LibraryEditorListener {
super(parent, true);
setTitle(myLibraryTableProvider.getLibraryTablePresentation().getLibraryTableEditorTitle());
init();
Disposer.register(getDisposable(), LibraryTableEditor.this);
}
@SuppressWarnings({"RefusedBequest"})
@@ -838,11 +840,6 @@ public class LibraryTableEditor implements Disposable, LibraryEditorListener {
}
commitChanges();
super.doOKAction();
ApplicationManager.getApplication().invokeLater(new Runnable(){
public void run() {
Disposer.dispose(LibraryTableEditor.this);
}
});
}
protected JComponent createNorthPanel() {
@@ -24,7 +24,6 @@ import com.intellij.codeInsight.daemon.HighlightDisplayKey;
import com.intellij.codeInsight.intention.IntentionAction;
import com.intellij.codeInspection.InspectionProfileEntry;
import com.intellij.codeInspection.InspectionsBundle;
import com.intellij.codeInspection.LocalInspectionTool;
import com.intellij.codeInspection.ex.*;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.module.Module;
@@ -45,7 +44,7 @@ public class RunInspectionIntention implements IntentionAction {
private final String myShortName;
private final String myDisplayName;
public RunInspectionIntention(final LocalInspectionTool tool) {
public RunInspectionIntention(final InspectionProfileEntry tool) {
myShortName = tool.getShortName();
myDisplayName = tool.getDisplayName();
}
@@ -100,7 +100,7 @@ public class InspectionsOptionsToolbarAction extends AnAction {
result.add(new DisableInspectionAction(key));
final RunInspectionIntention runInspectionIntention = new RunInspectionIntention(key);
final RunInspectionIntention runInspectionIntention = new RunInspectionIntention(tool);
result.add(new AnAction(runInspectionIntention.getText()) {
public void actionPerformed(final AnActionEvent e) {
final RefEntity[] selectedElements = tree.getSelectedElements();
@@ -452,7 +452,8 @@ public final class UpdateChecker {
InputStream in = null;
OutputStream out = null;
String patchFileName = "jetbrains.patch.jar." + productCode;
String platform = System.getProperty("idea.platform.prefix", "idea");
String patchFileName = "jetbrains.patch.jar." + platform;
File patchFile = new File(FileUtil.getTempDirectory(), patchFileName);
try {
@@ -19,14 +19,11 @@
*/
package com.intellij.util.io;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.util.containers.SLRUCache;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.*;
import java.util.Locale;
import java.util.concurrent.atomic.AtomicInteger;
public class PersistentHashMapValueStorage {
@@ -60,8 +57,7 @@ public class PersistentHashMapValueStorage {
};
public PersistentHashMapValueStorage(String path) throws IOException {
myPath = SystemInfo.isFileSystemCaseSensitive? FileUtil.toSystemDependentName(path) : FileUtil.toSystemDependentName(path).toLowerCase(Locale.US);
myPath = path;
myFile = new File(path);
mySize = myFile.length();
@@ -69,7 +69,10 @@ public class EclipseClasspathWriter {
outputPath = getRelativePath(output.getUrl());
}
else if (output == null) {
outputPath = getRelativePath(myModel.getModuleExtension(CompilerModuleExtension.class).getCompilerOutputUrl());
final String url = myModel.getModuleExtension(CompilerModuleExtension.class).getCompilerOutputUrl();
if (url != null) {
outputPath = getRelativePath(url);
}
}
}
final Element orderEntry = addOrderEntry(EclipseXml.OUTPUT_KIND, outputPath, classpathElement, oldRoot);
@@ -101,7 +101,7 @@
<orderEntry type="module-library">
<library name="junit4">
<CLASSES>
<root url="jar://$APPLICATION_HOME_DIR$/community/lib/junit-4.6.jar!/" />
<root url="jar://$APPLICATION_HOME_DIR$/community/lib/junit-4.7.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
@@ -55,7 +55,13 @@ public class AnchorPathReferenceProvider implements PathReferenceProvider {
}
}
final int pos = elementText.indexOf('?', anchorOffset);
final String anchor = elementText.substring(anchorOffset + 1, pos == -1 ? range.getEndOffset() : pos);
final String anchor;
try {
anchor = elementText.substring(anchorOffset + 1, pos == -1 ? range.getEndOffset() : pos);
}
catch (StringIndexOutOfBoundsException e) {
throw new RuntimeException(elementText, e);
}
final AnchorReference anchorReference = new AnchorReference(anchor, fileReference, psiElement, anchorOffset + 1, soft);
references.add(anchorReference);
return false;