Skip to content

Commit 2f42fa0

Browse files
committed
felix.log: Clean up.
1 parent 4ed9280 commit 2f42fa0

14 files changed

Lines changed: 32 additions & 27 deletions

log/src/main/java/org/apache/felix/log/Activator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ private static boolean getStoreDebug(final BundleContext context)
116116
String storeDebugPropValue = context.getProperty(STORE_DEBUG_PROPERTY);
117117
if (storeDebugPropValue != null)
118118
{
119-
storeDebug = Boolean.valueOf(storeDebugPropValue).booleanValue();
119+
storeDebug = Boolean.parseBoolean(storeDebugPropValue);
120120
}
121121

122122
return storeDebug;

log/src/main/java/org/apache/felix/log/ConfigurationListenerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class ConfigurationListenerImpl {
5252
final Log m_log;
5353
final LoggerAdminImpl m_loggerAdmin;
5454

55-
public ConfigurationListenerImpl(final BundleContext context, final Log log, final LoggerAdminImpl loggerAdmin) throws Exception {
55+
ConfigurationListenerImpl(final BundleContext context, final Log log, final LoggerAdminImpl loggerAdmin) throws Exception {
5656
m_context = context;
5757
m_log = log;
5858
m_loggerAdmin = loggerAdmin;

log/src/main/java/org/apache/felix/log/FormatterLoggerImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@
2626

2727
public class FormatterLoggerImpl extends LoggerImpl implements FormatterLogger {
2828

29-
public FormatterLoggerImpl(
29+
FormatterLoggerImpl(
3030
final String name, final Bundle bundle, final Log log, final LoggerAdminImpl loggerAdmin) {
3131

3232
super(name, bundle, log, loggerAdmin);
3333
}
3434

35+
@Override
3536
String format(String format, LogParameters logParameters) {
3637
StringBuilder sb = new StringBuilder();
3738

log/src/main/java/org/apache/felix/log/Log.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ synchronized Enumeration<LogEntry> getEntries()
206206
"FrameworkEvent STARTED",
207207
"FrameworkEvent ERROR",
208208
"FrameworkEvent PACKAGES REFRESHED",
209-
"FrameworkEvent STARTLEVEL CHANGED",
209+
"FrameworkEvent STARTLEVEL CHANGED",
210210
"FrameworkEvent WARNING",
211211
"FrameworkEvent INFO"
212212
};

log/src/main/java/org/apache/felix/log/LogEntryImpl.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ final class LogEntryImpl implements LogEntry
143143
* @return the bundle that created this LogEntry object;<code>null</code> if no
144144
* bundle is associated with this LogEntry object
145145
*/
146+
@Override
146147
public Bundle getBundle()
147148
{
148149
return m_bundle;
@@ -155,6 +156,7 @@ public Bundle getBundle()
155156
* this LogEntry object; <code>null</code> if no {@link ServiceReference} object
156157
* was provided
157158
*/
159+
@Override
158160
public ServiceReference<?> getServiceReference()
159161
{
160162
return m_serviceReference;
@@ -171,6 +173,7 @@ public ServiceReference<?> getServiceReference()
171173
* @see org.osgi.service.LogService#LOG_INFO
172174
* @see org.osgi.service.LogService#LOG_DEBUG
173175
*/
176+
@Override
174177
public int getLevel()
175178
{
176179
if (m_legacyLevel != m_level.ordinal()) {
@@ -184,6 +187,7 @@ public int getLevel()
184187
* Returns the human readable message associated with this LogEntry object.
185188
* @return a string containing the message associated with this LogEntry object
186189
*/
190+
@Override
187191
public String getMessage()
188192
{
189193
return m_message;
@@ -202,6 +206,7 @@ public String getMessage()
202206
* @return throwable object of the exception associated with this LogEntry;
203207
* <code>null</code> if no exception is associated with this LogEntry object
204208
*/
209+
@Override
205210
public Throwable getException()
206211
{
207212
return m_exception;
@@ -213,6 +218,7 @@ public Throwable getException()
213218
* @return the system time in milliseconds when this LogEntry object was created
214219
* @see System#currentTimeMillis()
215220
*/
221+
@Override
216222
public long getTime()
217223
{
218224
return m_time;

log/src/main/java/org/apache/felix/log/LogListenerThread.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ void shutdown()
106106
* The main method of the thread: waits for new messages to be receieved
107107
* and then delivers them to any registered log listeners.
108108
*/
109+
@Override
109110
public void run()
110111
{
111112
while (!isInterrupted())
@@ -138,10 +139,10 @@ public void run()
138139
{
139140
// Take a snapshot of all current listeners and deliver all
140141
// pending messages to them...
141-
List<LogListener> listeners = new ArrayList<>();
142+
List<LogListener> listeners;
142143
synchronized (m_listeners)
143144
{
144-
listeners.addAll(m_listeners);
145+
listeners = new ArrayList<>(m_listeners);
145146
}
146147

147148
Iterator<LogEntry> entriesIt = entriesToDeliver.iterator();

log/src/main/java/org/apache/felix/log/LogNodeEnumeration.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ final class LogNodeEnumeration implements Enumeration<LogEntry>
4848
* Determines whether there are any more elements to return.
4949
* @return <code>true</code> if there are more elements; <code>false</code> otherwise
5050
*/
51+
@Override
5152
public boolean hasMoreElements()
5253
{
5354
return m_next != null;
@@ -57,6 +58,7 @@ public boolean hasMoreElements()
5758
* Returns the current element and moves onto the next element.
5859
* @return the current element
5960
*/
61+
@Override
6062
public LogEntry nextElement()
6163
{
6264
LogEntry result = null;

log/src/main/java/org/apache/felix/log/LogReaderServiceFactory.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ final class LogReaderServiceFactory implements ServiceFactory<LogReaderService>
4747
* @param registration the service registration
4848
* @return the log reader service implementation for the specified bundle
4949
*/
50+
@Override
5051
public LogReaderService getService(final Bundle bundle,
5152
final ServiceRegistration<LogReaderService> registration)
5253
{
@@ -60,6 +61,7 @@ public LogReaderService getService(final Bundle bundle,
6061
* @param registration the service registration
6162
* @param service the service to release
6263
*/
64+
@Override
6365
public void ungetService(final Bundle bundle,
6466
final ServiceRegistration<LogReaderService> registration,
6567
final LogReaderService service)

log/src/main/java/org/apache/felix/log/LogServiceFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ final class LogServiceFactory implements ServiceFactory<LogService>
3434

3535
/**
3636
* Create a new instance.
37-
* @param log the log to associate the service implementations with.,
37+
* @param loggerAdminImpl
3838
*/
3939
LogServiceFactory(final LoggerAdminImpl loggerAdminImpl)
4040
{

log/src/main/java/org/apache/felix/log/LogServiceImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ final class LogServiceImpl implements LogService
4444

4545
/**
4646
* Create a new instance.
47-
* @param log the log implementation
4847
* @param bundle the bundle associated with this implementation
49-
* @param serviceReference
48+
* @param loggerAdminImpl
5049
*/
5150
LogServiceImpl(final Bundle bundle, final LoggerAdminImpl loggerAdminImpl)
5251
{

0 commit comments

Comments
 (0)