Skip to content

Commit 88a7778

Browse files
authored
[Polish] Code level polish (no logic change) (#166)
1 parent c8840b0 commit 88a7778

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/SnifferConfigInitializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public static boolean isInitCompleted() {
191191
* <p>
192192
* such as: Property key of `agent.service_name` should be `skywalking.agent.service_name`
193193
*/
194-
private static void overrideConfigBySystemProp() throws IllegalAccessException {
194+
private static void overrideConfigBySystemProp() {
195195
Properties systemProperties = System.getProperties();
196196
for (final Map.Entry<Object, Object> prop : systemProperties.entrySet()) {
197197
String key = prop.getKey().toString();

apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/logging/core/JsonLogger.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public JsonLogger(String targetClass, Gson gson) {
7171
@Override
7272
protected String format(LogLevel level, String message, Throwable e) {
7373
LogEvent logEvent = new LogEvent(level, message, e, this.targetClass);
74-
Map<String, String> log = new HashMap<>();
74+
Map<String, String> log = new HashMap<>(this.converters.size());
7575
for (Converter converter : this.converters) {
7676
log.put(converter.getKey(), converter.convert(logEvent));
7777
}

apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/interceptor/enhance/ClassEnhancePluginDefine.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public abstract class ClassEnhancePluginDefine extends AbstractClassEnhancePlugi
6363
* @param newClassBuilder byte-buddy's builder to manipulate class bytecode.
6464
* @return new byte-buddy's builder for further manipulation.
6565
*/
66+
@Override
6667
protected DynamicType.Builder<?> enhanceInstance(TypeDescription typeDescription,
6768
DynamicType.Builder<?> newClassBuilder, ClassLoader classLoader,
6869
EnhanceContext context) throws PluginException {
@@ -174,6 +175,7 @@ protected DynamicType.Builder<?> enhanceInstance(TypeDescription typeDescription
174175
* @param newClassBuilder byte-buddy's builder to manipulate class bytecode.
175176
* @return new byte-buddy's builder for further manipulation.
176177
*/
178+
@Override
177179
protected DynamicType.Builder<?> enhanceClass(TypeDescription typeDescription, DynamicType.Builder<?> newClassBuilder,
178180
ClassLoader classLoader) throws PluginException {
179181
StaticMethodsInterceptPoint[] staticMethodsInterceptPoints = getStaticMethodsInterceptPoints();

apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/interceptor/enhance/v2/ClassEnhancePluginDefineV2.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
*/
5757
public abstract class ClassEnhancePluginDefineV2 extends AbstractClassEnhancePluginDefine {
5858

59+
@Override
5960
protected DynamicType.Builder<?> enhanceClass(TypeDescription typeDescription,
6061
DynamicType.Builder<?> newClassBuilder,
6162
ClassLoader classLoader) throws PluginException {
@@ -105,6 +106,7 @@ protected DynamicType.Builder<?> enhanceClass(TypeDescription typeDescription,
105106
return newClassBuilder;
106107
}
107108

109+
@Override
108110
protected DynamicType.Builder<?> enhanceInstance(TypeDescription typeDescription,
109111
DynamicType.Builder<?> newClassBuilder, ClassLoader classLoader,
110112
EnhanceContext context) throws PluginException {

0 commit comments

Comments
 (0)