Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnjum Fatima2017-05-12 13:39:18 -0400
committerAnjum Fatima2017-05-12 15:32:25 -0400
commit2cb31783a97c1232a5ad44ddd7fc7c416dd1fd71 (patch)
tree908b309d5a7acdc1d5f7c636eb5e70879652f974
parent471290b335d93548114a8f31d1ca25e41dc1b38e (diff)
downloadrt.equinox.framework-I20170515-0910.tar.gz
rt.equinox.framework-I20170515-0910.tar.xz
rt.equinox.framework-I20170515-0910.zip
Bug 516592 - LogReaderService.getLog() is reverse order of javadoc I20170516-0800I20170515-2000I20170515-0910I20170515-0800I20170514-2000I20170514-1120
Changed storeEntry() to store the history in a way that it removes the old entries when it is full. Updated testLogHistory1() to account the change done in implementation Change-Id: I3455a0cf23368c19c20d52659491b21a581c3a04 Signed-off-by: Anjum Fatima <anjum.eclipse@gmail.com>
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/equinox/log/test/LogReaderServiceTest.java8
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogReaderServiceFactory.java4
2 files changed, 6 insertions, 6 deletions
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/equinox/log/test/LogReaderServiceTest.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/equinox/log/test/LogReaderServiceTest.java
index cfe80cd6a..04d90910e 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/equinox/log/test/LogReaderServiceTest.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/equinox/log/test/LogReaderServiceTest.java
@@ -167,15 +167,15 @@ public class LogReaderServiceTest extends AbstractBundleTests {
for (int i = 0; i < 9; i++) {
testLog.log(LogService.LOG_WARNING, String.valueOf(i));
}
- assertEquals("Wrong number of logs.", 9, countLogEntries(testReader.getLog(), 0));
+ assertEquals("Wrong number of logs.", 9, countLogEntries(testReader.getLog(), 8));
// log 9 more things
for (int i = 9; i < 18; i++) {
testLog.log(LogService.LOG_WARNING, String.valueOf(i));
}
- // should only be the last 10 logs (8 - 17)
- assertEquals("Wrong number of logs.", 10, countLogEntries(testReader.getLog(), 8));
+ // should only be the last 10 logs (17-8)
+ assertEquals("Wrong number of logs.", 10, countLogEntries(testReader.getLog(), 17));
} finally {
try {
equinox.stop();
@@ -215,7 +215,7 @@ public class LogReaderServiceTest extends AbstractBundleTests {
while (logEntries.hasMoreElements()) {
LogEntry entry = (LogEntry) logEntries.nextElement();
assertEquals("Wrong log message.", String.valueOf(startingMessage), entry.getMessage());
- startingMessage++;
+ startingMessage--;
count++;
}
return count;
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogReaderServiceFactory.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogReaderServiceFactory.java
index 2813efc2d..e018dd084 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogReaderServiceFactory.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogReaderServiceFactory.java
@@ -227,9 +227,9 @@ public class ExtendedLogReaderServiceFactory implements ServiceFactory<ExtendedL
if (history != null) {
synchronized (history) {
if (history.size() == maxHistory) {
- history.removeFirst();
+ history.removeLast();
}
- history.addLast(logEntry);
+ history.addFirst(logEntry);
}
}
}

Back to the top