Skip to content

Commit

Permalink
Merge pull request #699 from amitjoy/refactoring
Browse files Browse the repository at this point in the history
Refactoring
  • Loading branch information
amitjoy authored Nov 30, 2023
2 parents 03d4939 + 7b36ad2 commit c80fe05
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public void logged(final XLogEntryDTO logEvent) {

@Override
public void addOSGiEventListener(final EventListener eventListener) {
checkNotNull(eventListener, "'logEntryListener' cannot be null");
checkNotNull(eventListener, "'eventListener' cannot be null");
if (eventListeners.contains(eventListener)) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ void init(final Configuration configuration) {
if (configuration.location() == null) {
return;
}
// using gson as a field variable in a component seems very luring but it leads to classloader leaks
final var gson = new Gson();
try {
final var reader = new JsonReader(new FileReader(configuration.location()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@ public class ConfigHelper<T> {
/**
* Create a Config Helper for simple configurations.
*
* @param type
* the type of the configuration interface
* @param cm
* the Configuration Admin service
* @param type the type of the configuration interface
* @param cm the Configuration Admin service
*/
@SuppressWarnings("unchecked")
public ConfigHelper(final Class<T> type, final ConfigurationAdmin cm) {
Expand Down Expand Up @@ -104,10 +102,8 @@ public T d() {
* The last invocation on the proxy is remembered and used in the set method
* to get the name and return type of the property.
*
* @param older
* ignored
* @param newer
* the value to set
* @param older ignored
* @param newer the value to set
* @return this
*/
public <X> ConfigHelper<T> set(final X older, final X newer) {
Expand Down Expand Up @@ -140,8 +136,7 @@ public Map<String, Object> getProperties() {
/**
* Read a configuration
*
* @param pid
* a non-null PID
* @param pid a non-null PID
* @return the properties read or empty if did not exist
*/
public Map<String, Object> read(final String pid) {
Expand Down

0 comments on commit c80fe05

Please sign in to comment.