Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2012-03-05 19:24:26 -0500
committerJeff Johnston2012-03-07 12:15:30 -0500
commitb7ade457f392ab2e90ec363495ec0a10a3d93b7d (patch)
tree99ddf00b3f4aae384de602239d9db69a32666772 /changelog
parent1eb866ac073b2eb6e22df4edcf3436a60d0c8456 (diff)
downloadorg.eclipse.linuxtools-b7ade457f392ab2e90ec363495ec0a10a3d93b7d.tar.gz
org.eclipse.linuxtools-b7ade457f392ab2e90ec363495ec0a10a3d93b7d.tar.xz
org.eclipse.linuxtools-b7ade457f392ab2e90ec363495ec0a10a3d93b7d.zip
Fix numerous FindBugs errors.
Diffstat (limited to 'changelog')
-rw-r--r--changelog/org.eclipse.linuxtools.changelog.core/ChangeLog9
-rw-r--r--changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/changelog/core/actions/PatchFile.java8
-rw-r--r--changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/changelog/core/actions/PatchRangeElement.java5
-rw-r--r--changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/changelog/core/actions/PrepareChangeLogAction.java4
-rw-r--r--changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/changelog/core/actions/PrepareCommitAction.java4
5 files changed, 28 insertions, 2 deletions
diff --git a/changelog/org.eclipse.linuxtools.changelog.core/ChangeLog b/changelog/org.eclipse.linuxtools.changelog.core/ChangeLog
index 925e308b8d..072729f54a 100644
--- a/changelog/org.eclipse.linuxtools.changelog.core/ChangeLog
+++ b/changelog/org.eclipse.linuxtools.changelog.core/ChangeLog
@@ -1,3 +1,12 @@
+2012-03-05 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/changelog/core/actions/PatchFile.java (hashCode): New Method to fix
+ FindBugs error.
+ * src/org/eclipse/linuxtools/changelog/core/actions/PatchRangeElement.java (hashCode): Ditto.
+ * src/org/eclipse/linuxtools/changelog/core/actions/PrepareChangeLogAction.java (getChangedLines): Remove
+ potential NPE discovered by FindBugs.
+ * src/org/eclipse/linuxtools/changelog/core/actions/PrepareCommitAction.java (loadClipboard): Ditto.
+
2012-02-08 Jeff Johnston <jjohnstn@redhat.com>
Resolves #366854.
diff --git a/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/changelog/core/actions/PatchFile.java b/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/changelog/core/actions/PatchFile.java
index 2620b4f394..9fb512e490 100644
--- a/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/changelog/core/actions/PatchFile.java
+++ b/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/changelog/core/actions/PatchFile.java
@@ -109,4 +109,12 @@ public class PatchFile {
return false;
return true;
}
+
+ @Override
+ public int hashCode() {
+ int hash = resource.hashCode();
+ for(int i=0; i<this.countRanges();i++)
+ hash += pranges.get(i).hashCode();
+ return hash;
+ }
} \ No newline at end of file
diff --git a/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/changelog/core/actions/PatchRangeElement.java b/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/changelog/core/actions/PatchRangeElement.java
index 04d211e565..04c039bbb5 100644
--- a/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/changelog/core/actions/PatchRangeElement.java
+++ b/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/changelog/core/actions/PatchRangeElement.java
@@ -41,4 +41,9 @@ public class PatchRangeElement {
else
return this == o;
}
+
+ @Override
+ public int hashCode() {
+ return ffromLine + ftoLine + (flocalChange ? 47 : 83);
+ }
} \ No newline at end of file
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 5486b0b004..5c644626fa 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
@@ -237,8 +237,10 @@ public class PrepareChangeLogAction extends ChangeLogAction {
ancestorStorage = ancestorState.getStorage(monitor);
p.setStorage(ancestorStorage);
}
- else
+ else {
ancestorStorage = null;
+ return;
+ }
try {
// We compare using a standard differencer to get ranges
diff --git a/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/changelog/core/actions/PrepareCommitAction.java b/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/changelog/core/actions/PrepareCommitAction.java
index fda7649cb0..9462bdcb13 100644
--- a/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/changelog/core/actions/PrepareCommitAction.java
+++ b/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/changelog/core/actions/PrepareCommitAction.java
@@ -184,8 +184,10 @@ public class PrepareCommitAction extends ChangeLogAction {
IStorage ancestorStorage;
if (ancestorState != null)
ancestorStorage = ancestorState.getStorage(monitor);
- else
+ else {
ancestorStorage = null;
+ return;
+ }
try {
LineComparator left = new LineComparator(ancestorStorage.getContents(), osEncoding);

Back to the top