Skip to content

Commit 16a1896

Browse files
committed
checkstyle fixes
1 parent e87f145 commit 16a1896

File tree

4 files changed

+62
-9
lines changed

4 files changed

+62
-9
lines changed

src/main/java/com/arpnetworking/akka/ActorBuilder.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/**
2+
* Copyright 2016 InscopeMetrics, Inc
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package com.arpnetworking.akka;
217

318
import akka.actor.Props;

src/main/java/com/arpnetworking/akka/NonJoiningClusterJoiner.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2016 Inscope Metrics
2+
* Copyright 2016 Inscope Metrics, Inc
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -60,9 +60,17 @@ public void onReceive(final Object message) throws Exception {
6060
unhandled(message);
6161
}
6262

63-
private static Logger LOGGER = LoggerFactory.getLogger(NonJoiningClusterJoiner.class);
63+
private static final Logger LOGGER = LoggerFactory.getLogger(NonJoiningClusterJoiner.class);
6464

65+
/**
66+
* Implementation of the {@link com.arpnetworking.commons.builder.Builder} pattern for a {@link NonJoiningClusterJoiner}.
67+
*
68+
* @author Brandon Arp (brandon dot arp at inscopemetrics dot com)
69+
*/
6570
public static class Builder extends ActorBuilder<Builder> {
71+
/**
72+
* Public constructor.
73+
*/
6674
public Builder() {
6775
super(NonJoiningClusterJoiner::props);
6876
}

src/main/java/com/arpnetworking/configuration/jackson/akka/ActorBuilderDeserializer.java

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
1+
/**
2+
* Copyright 2016 InscopeMetrics, Inc
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package com.arpnetworking.configuration.jackson.akka;
217

318
import akka.actor.Props;
419
import com.arpnetworking.commons.builder.Builder;
520
import com.fasterxml.jackson.core.JsonParser;
6-
import com.fasterxml.jackson.core.JsonProcessingException;
721
import com.fasterxml.jackson.core.TreeNode;
822
import com.fasterxml.jackson.databind.DeserializationContext;
923
import com.fasterxml.jackson.databind.JsonDeserializer;
@@ -14,7 +28,8 @@
1428
import java.io.IOException;
1529

1630
/**
17-
* Deserializer that will create an ActorBuilder for the given actor, then create the Actor from Guice
31+
* Deserializer that will create an ActorBuilder for the given actor, then create a Props from Guice.
32+
*
1833
* @author Brandon Arp (brandon dot arp at inscopemetrics dot com)
1934
*/
2035
public class ActorBuilderDeserializer extends JsonDeserializer<Props> {
@@ -28,15 +43,15 @@ public ActorBuilderDeserializer(final ObjectMapper mapper) {
2843
}
2944

3045
@Override
31-
public Props deserialize(final JsonParser p, final DeserializationContext ctxt) throws IOException, JsonProcessingException {
46+
public Props deserialize(final JsonParser p, final DeserializationContext ctxt) throws IOException {
3247
final TreeNode treeNode = p.readValueAsTree();
3348
final String type = ((TextNode) treeNode.get("type")).textValue();
3449
try {
3550
final Class<?> clazz = Class.forName(type);
3651
final Class<? extends Builder<? extends Props>> builder = getBuilderForClass(clazz);
3752
final Builder<? extends Props> value = _mapper.readValue(treeNode.toString(), builder);
3853
return value.build();
39-
} catch (ClassNotFoundException e) {
54+
} catch (final ClassNotFoundException e) {
4055
throw new JsonMappingException(p, String.format("Unable to find class %s referenced by Props type", type));
4156
}
4257
}

src/test/java/com/arpnetworking/clusteraggregator/configuration/ActorBuilderTest.java

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/**
2+
* Copyright 2016 InscopeMetrics, Inc
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package com.arpnetworking.clusteraggregator.configuration;
217

318
import akka.actor.Props;
@@ -29,9 +44,9 @@ public void testPolyDeserialize() throws IOException {
2944
module.addDeserializer(Props.class, new ActorBuilderDeserializer(mapper));
3045
mapper.registerModule(module);
3146

32-
@Language("JSON") final String data = "{\n" +
33-
" \"type\": \"com.arpnetworking.akka.NonJoiningClusterJoiner\"\n" +
34-
"}";
47+
@Language("JSON") final String data = "{\n"
48+
+ " \"type\": \"com.arpnetworking.akka.NonJoiningClusterJoiner\"\n"
49+
+ "}";
3550
final Props props = mapper.readValue(data, Props.class);
3651
}
3752
}

0 commit comments

Comments
 (0)