Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Overholt2011-02-28 04:01:29 +0000
committerAndrew Overholt2011-02-28 04:01:32 +0000
commit31d0b58083e3e684cebeb3a4a6ad67cd72e5ce28 (patch)
tree4e3e7234d3b548c541b0c1cfd0047bf1b37b8882
parent8743f059e9e8f9d0577f2bdea63732aefb975e5a (diff)
parent937232e91ad83e0ee57c6a3f17a6ff2c3f2799f2 (diff)
downloadorg.eclipse.linuxtools-31d0b58083e3e684cebeb3a4a6ad67cd72e5ce28.tar.gz
org.eclipse.linuxtools-31d0b58083e3e684cebeb3a4a6ad67cd72e5ce28.tar.xz
org.eclipse.linuxtools-31d0b58083e3e684cebeb3a4a6ad67cd72e5ce28.zip
Merge changelog 0.6.2
-rw-r--r--changelog/org.eclipse.linuxtools.changelog.core/ChangeLog6
-rw-r--r--changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/changelog/core/actions/PrepareChangeLogAction.java12
-rw-r--r--changelog/org.eclipse.linuxtools.changelog.javaparser/ChangeLog6
-rw-r--r--changelog/org.eclipse.linuxtools.changelog.javaparser/src/org/eclipse/linuxtools/changelog/parsers/java/JavaParser.java9
4 files changed, 27 insertions, 6 deletions
diff --git a/changelog/org.eclipse.linuxtools.changelog.core/ChangeLog b/changelog/org.eclipse.linuxtools.changelog.core/ChangeLog
index dc6b6468d7..44119ba995 100644
--- a/changelog/org.eclipse.linuxtools.changelog.core/ChangeLog
+++ b/changelog/org.eclipse.linuxtools.changelog.core/ChangeLog
@@ -1,3 +1,9 @@
+2010-10-18 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/changelog/core/actions/PrepareChangeLogAction.java (guessFunctionNames): Add
+ proper check for out-of-range by using the appropriate document according to whether change is local or
+ remote.
+
2010-06-08 Jeff Johnston <jjohnstn@redhat.com>
Resolves #315976
diff --git a/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/changelog/core/actions/PrepareChangeLogAction.java b/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/changelog/core/actions/PrepareChangeLogAction.java
index 008091cc18..d13199b0f5 100644
--- a/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/changelog/core/actions/PrepareChangeLogAction.java
+++ b/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/changelog/core/actions/PrepareChangeLogAction.java
@@ -553,18 +553,20 @@ public class PrepareChangeLogAction extends ChangeLogAction {
for (int j = tpre.ffromLine; j <= tpre.ftoLine; j++) {
- if ((j < 0) || (j > doc.getNumberOfLines() - 1))
- continue; // ignore out of bound lines
-
String functionGuess = "";
// add func that determines type of file.
// right now it assumes it's java file.
- if (tpre.isLocalChange())
+ if (tpre.isLocalChange()) {
+ if ((j < 0) || (j > doc.getNumberOfLines() - 1))
+ continue; // ignore out of bound lines
functionGuess = parseCurrentFunctionAtOffset(
editorName, fei, doc.getLineOffset(j));
- else
+ } else {
+ if ((j < 0) || (j > olddoc.getNumberOfLines() - 1))
+ continue; // ignore out of bound lines
functionGuess = parseCurrentFunctionAtOffset(
editorName, sei, olddoc.getLineOffset(j));
+ }
// putting it in hashmap will eliminate duplicate
// guesses. We use a list to keep track of ordering which
diff --git a/changelog/org.eclipse.linuxtools.changelog.javaparser/ChangeLog b/changelog/org.eclipse.linuxtools.changelog.javaparser/ChangeLog
index a98fc76e68..2a51f56da9 100644
--- a/changelog/org.eclipse.linuxtools.changelog.javaparser/ChangeLog
+++ b/changelog/org.eclipse.linuxtools.changelog.javaparser/ChangeLog
@@ -1,3 +1,9 @@
+2010-10-18 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/changelog/parsers/java/JavaParser.java (parseCurrentFunction):
+ Add support for StorageEditorInput so method removal or renames will show the methods that
+ no longer exist in the current source.
+
2010-02-26 Jeff Johnston <jjohnstn@redhat.com>
* src/org/eclipse/linuxtools/changelog/parsers/java/JavaParser.java (parseCurrentFunction): Add
diff --git a/changelog/org.eclipse.linuxtools.changelog.javaparser/src/org/eclipse/linuxtools/changelog/parsers/java/JavaParser.java b/changelog/org.eclipse.linuxtools.changelog.javaparser/src/org/eclipse/linuxtools/changelog/parsers/java/JavaParser.java
index bb08b33424..50dc762d87 100644
--- a/changelog/org.eclipse.linuxtools.changelog.javaparser/src/org/eclipse/linuxtools/changelog/parsers/java/JavaParser.java
+++ b/changelog/org.eclipse.linuxtools.changelog.javaparser/src/org/eclipse/linuxtools/changelog/parsers/java/JavaParser.java
@@ -15,6 +15,7 @@ package org.eclipse.linuxtools.changelog.parsers.java;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.internal.ui.javaeditor.ICompilationUnitDocumentProvider;
import org.eclipse.jdt.ui.IWorkingCopyManager;
import org.eclipse.jdt.ui.JavaUI;
import org.eclipse.jface.text.ITextSelection;
@@ -29,6 +30,7 @@ import org.eclipse.ui.texteditor.AbstractDecoratedTextEditor;
/**
* @author pmuldoon (Phil Muldoon)
*/
+@SuppressWarnings("restriction")
public class JavaParser implements IParserChangeLogContrib {
/**
@@ -44,8 +46,13 @@ public class JavaParser implements IParserChangeLogContrib {
IWorkingCopyManager manager = JavaUI.getWorkingCopyManager();
manager.connect(input);
+ // We do the following which uses an internal interface because the
+ // WorkingCopyManager won't find a working copy for a StorageEditorInput.
+ // The document provider is actually an ICompilationUnitDocumentProvider and
+ // it handles such requests which occur when a method is deleted or renamed.
+ ICompilationUnitDocumentProvider x = (ICompilationUnitDocumentProvider)JavaUI.getDocumentProvider();
// Retrieve the Java Element in question.
- ICompilationUnit workingCopy = manager.getWorkingCopy(input);
+ ICompilationUnit workingCopy = x.getWorkingCopy(input);
if (workingCopy == null)
return "";

Back to the top