Skip to content

Commit 3d82206

Browse files
ahornacetarzanek
authored andcommitted
Remove redundant changeRequests field from HistoryEntry
1 parent 9c8ced1 commit 3d82206

File tree

3 files changed

+5
-63
lines changed

3 files changed

+5
-63
lines changed

src/org/opensolaris/opengrok/history/HistoryEntry.java

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,14 @@
1818
*/
1919

2020
/*
21-
* Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
21+
* Copyright (c) 2006, 2018 Oracle and/or its affiliates. All rights reserved.
2222
*/
2323
/*
2424
* Copyright 2006 Trond Norbye. All rights reserved.
2525
*/
2626
package org.opensolaris.opengrok.history;
2727

28-
import java.util.ArrayList;
2928
import java.util.Date;
30-
import java.util.List;
3129
import java.util.SortedSet;
3230
import java.util.TreeSet;
3331
import java.util.logging.Level;
@@ -53,13 +51,11 @@ public class HistoryEntry {
5351

5452
private boolean active;
5553
private SortedSet<String> files;
56-
private List<String> changeRequests;
5754

5855
/** Creates a new instance of HistoryEntry */
5956
public HistoryEntry() {
6057
message = new StringBuffer();
61-
files = new TreeSet<String>();
62-
changeRequests = new ArrayList<String>();
58+
files = new TreeSet<>();
6359
}
6460

6561
/**
@@ -74,7 +70,6 @@ public HistoryEntry(HistoryEntry that) {
7470
this.message = that.message;
7571
this.active = that.active;
7672
this.files = that.files;
77-
this.changeRequests = that.changeRequests;
7873
}
7974

8075
public HistoryEntry(String revision, Date date, String author,
@@ -85,8 +80,7 @@ public HistoryEntry(String revision, Date date, String author,
8580
this.tags = tags;
8681
this.message = new StringBuffer(message);
8782
this.active = active;
88-
this.files = new TreeSet<String>();
89-
this.changeRequests = new ArrayList<String>();
83+
this.files = new TreeSet<>();
9084
}
9185

9286
public String getLine() {
@@ -109,12 +103,6 @@ public void dump() {
109103
separator = ">";
110104
}
111105
separator = "=";
112-
for (String cr : changeRequests) {
113-
LOGGER.log(Level.FINE, "HistoryEntry : changeRequests {0} {1}",
114-
new Object[]{separator, cr});
115-
separator = ">";
116-
}
117-
separator = "=";
118106
for (String file : files) {
119107
LOGGER.log(Level.FINE, "HistoryEntry : files {0} {1}",
120108
new Object[]{separator, file});
@@ -197,20 +185,6 @@ public String toString() {
197185
return getLine();
198186
}
199187

200-
public void addChangeRequest(String changeRequest) {
201-
if (!changeRequests.contains(changeRequest)) {
202-
changeRequests.add(changeRequest);
203-
}
204-
}
205-
206-
public List<String> getChangeRequests() {
207-
return changeRequests;
208-
}
209-
210-
public void setChangeRequests(List<String> changeRequests) {
211-
this.changeRequests = changeRequests;
212-
}
213-
214188
/**
215189
* Remove list of files and tags.
216190
*/

src/org/opensolaris/opengrok/history/RazorHistoryParser.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
/*
21-
* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
21+
* Copyright (c) 2008, 2018 Oracle and/or its affiliates. All rights reserved.
2222
*/
2323
/* Portions Copyright 2008 Peter Bray */
2424
package org.opensolaris.opengrok.history;
@@ -124,9 +124,6 @@ protected History parseContents(BufferedReader contents) throws IOException {
124124
parseDebug("Setting Message : '" + details + "'");
125125
entry.setMessage(details);
126126
lastWasTitle = true;
127-
} else if ("ISSUE".equals(infoType)) {
128-
parseDebug("Adding CR : '" + details + "'");
129-
entry.addChangeRequest(details);
130127
} else {
131128
parseDebug("Ignoring Info Type Line '" + line + "'");
132129
}

test/org/opensolaris/opengrok/history/HistoryEntryTest.java

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,12 @@
1818
*/
1919

2020
/*
21-
* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
21+
* Copyright (c) 2008, 2018 Oracle and/or its affiliates. All rights reserved.
2222
*/
23-
2423
package org.opensolaris.opengrok.history;
2524

26-
import java.util.ArrayList;
2725
import java.util.Collections;
2826
import java.util.Date;
29-
import java.util.List;
3027
import java.util.TreeSet;
3128
import org.junit.After;
3229
import org.junit.AfterClass;
@@ -86,8 +83,6 @@ public void dump() {
8683
instance.setActive(false);
8784
instance.addFile("testFile1.txt");
8885
instance.addFile("testFile2.txt");
89-
instance.addChangeRequest("CR1");
90-
instance.addChangeRequest("CR2");
9186
instance.dump();
9287
}
9388

@@ -246,30 +241,6 @@ public void testToString() {
246241
assertTrue(instance.toString().contains(historyAuthor));
247242
}
248243

249-
/**
250-
* Test of addChangeRequest method, of class HistoryEntry.
251-
*/
252-
@Test
253-
public void addGetChangeRequest() {
254-
String changeRequest = "Change Request";
255-
assertEquals(0, instance.getChangeRequests().size());
256-
instance.addChangeRequest(changeRequest);
257-
assertEquals(1, instance.getChangeRequests().size());
258-
assertTrue(instance.getChangeRequests().contains(changeRequest));
259-
}
260-
261-
/**
262-
* Test of setChangeRequests method, of class HistoryEntry.
263-
*/
264-
@Test
265-
public void setChangeRequests() {
266-
List<String> changeRequests = new ArrayList<String>();
267-
changeRequests.add("CR1");
268-
changeRequests.add("CR2");
269-
instance.setChangeRequests(changeRequests);
270-
assertEquals(2, instance.getChangeRequests().size());
271-
}
272-
273244
/**
274245
* Test of strip method, of class HistoryEntry.
275246
*/

0 commit comments

Comments
 (0)