Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2012-02-08 16:49:49 -0500
committerJeff Johnston2012-02-08 18:14:53 -0500
commitf948d22940fb7a00652c0841d6e155bebcba02c4 (patch)
treec82eacbebd0c85358bba90fcbf0793fe6524f756 /changelog
parentfa676dcc7e12f3f7c2717cdcb2265961ecf6b3d1 (diff)
downloadorg.eclipse.linuxtools-f948d22940fb7a00652c0841d6e155bebcba02c4.tar.gz
org.eclipse.linuxtools-f948d22940fb7a00652c0841d6e155bebcba02c4.tar.xz
org.eclipse.linuxtools-f948d22940fb7a00652c0841d6e155bebcba02c4.zip
Fix bug #366854.
Diffstat (limited to 'changelog')
-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/formatters/GNUFormat.java22
2 files changed, 20 insertions, 8 deletions
diff --git a/changelog/org.eclipse.linuxtools.changelog.core/ChangeLog b/changelog/org.eclipse.linuxtools.changelog.core/ChangeLog
index a9d4e510b0..925e308b8d 100644
--- a/changelog/org.eclipse.linuxtools.changelog.core/ChangeLog
+++ b/changelog/org.eclipse.linuxtools.changelog.core/ChangeLog
@@ -1,3 +1,9 @@
+2012-02-08 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #366854.
+ * src/org/eclipse/linuxtools/changelog/core/formatters/GNUFormat.java (mergeChangelog): Fix code to reset force
+ new entry even if this is the first entry in a ChangeLog.
+
2011-08-31 Jeff Johnston <jjohnstn@redhat.com>
Bug #347703
diff --git a/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/changelog/core/formatters/GNUFormat.java b/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/changelog/core/formatters/GNUFormat.java
index 64cd027691..309d5c4545 100644
--- a/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/changelog/core/formatters/GNUFormat.java
+++ b/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/changelog/core/formatters/GNUFormat.java
@@ -57,26 +57,32 @@ public class GNUFormat implements IFormatterChangeLogContrib {
IDocument changelog_doc = getDocument(changelog);
String function = formatFunction(functionGuess);
boolean multipleEntrySuccess = false;
+ boolean forceNewEntry = false;
String functionSpacer = " "; // $NON-NLS-1$
if (function.equals(": ")) // $NON-NLS-1$
functionSpacer = ""; // $NON-NLS-1$
+
+ /* Fix Bz #366854. Make sure that forceNewEntry is used only
+ * once and then cleared even when the ChangeLog is empty to start with.
+ */
+ if(changelog instanceof ChangeLogEditor) {
+ ChangeLogEditor editor = (ChangeLogEditor)changelog;
+ forceNewEntry = editor.isForceNewLogEntry();
+ editor.setForceNewLogEntry(false);
+ }
+
if (changelog_doc.getLength() > 0) {
int offset_start = findChangeLogEntry(changelog_doc, dateLine);
int offset_end = dateLine.length();
boolean foundFunction = false;
- boolean forceNewEntry = false;
//if the prepare change action determines it requires a new entry, we force
//a new entry by changing the offset_start and change the corresponding field
//of the editor back to false to prevent subsequent function change log being
//written to a new entry again.
- if(changelog instanceof ChangeLogEditor) {
- ChangeLogEditor editor = (ChangeLogEditor)changelog;
- forceNewEntry = editor.isForceNewLogEntry();
- editor.setForceNewLogEntry(false);
- if (forceNewEntry)
- offset_start = -1;
- }
+ if (forceNewEntry)
+ offset_start = -1;
+
if (offset_start != -1) {
int nextChangeEntry = findChangeLogPattern(changelog_doc,
offset_start + dateLine.length());

Back to the top