[Polish] Code level polish (no logic change) (#166)

This commit is contained in:
Oliver 2022-06-13 10:02:08 +08:00 committed by GitHub
parent c8840b010c
commit 88a7778637
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 2 deletions

View File

@ -191,7 +191,7 @@ public class SnifferConfigInitializer {
* <p>
* such as: Property key of `agent.service_name` should be `skywalking.agent.service_name`
*/
private static void overrideConfigBySystemProp() throws IllegalAccessException {
private static void overrideConfigBySystemProp() {
Properties systemProperties = System.getProperties();
for (final Map.Entry<Object, Object> prop : systemProperties.entrySet()) {
String key = prop.getKey().toString();

View File

@ -71,7 +71,7 @@ public class JsonLogger extends AbstractLogger {
@Override
protected String format(LogLevel level, String message, Throwable e) {
LogEvent logEvent = new LogEvent(level, message, e, this.targetClass);
Map<String, String> log = new HashMap<>();
Map<String, String> log = new HashMap<>(this.converters.size());
for (Converter converter : this.converters) {
log.put(converter.getKey(), converter.convert(logEvent));
}

View File

@ -63,6 +63,7 @@ public abstract class ClassEnhancePluginDefine extends AbstractClassEnhancePlugi
* @param newClassBuilder byte-buddy's builder to manipulate class bytecode.
* @return new byte-buddy's builder for further manipulation.
*/
@Override
protected DynamicType.Builder<?> enhanceInstance(TypeDescription typeDescription,
DynamicType.Builder<?> newClassBuilder, ClassLoader classLoader,
EnhanceContext context) throws PluginException {
@ -174,6 +175,7 @@ public abstract class ClassEnhancePluginDefine extends AbstractClassEnhancePlugi
* @param newClassBuilder byte-buddy's builder to manipulate class bytecode.
* @return new byte-buddy's builder for further manipulation.
*/
@Override
protected DynamicType.Builder<?> enhanceClass(TypeDescription typeDescription, DynamicType.Builder<?> newClassBuilder,
ClassLoader classLoader) throws PluginException {
StaticMethodsInterceptPoint[] staticMethodsInterceptPoints = getStaticMethodsInterceptPoints();

View File

@ -56,6 +56,7 @@ import static net.bytebuddy.matcher.ElementMatchers.not;
*/
public abstract class ClassEnhancePluginDefineV2 extends AbstractClassEnhancePluginDefine {
@Override
protected DynamicType.Builder<?> enhanceClass(TypeDescription typeDescription,
DynamicType.Builder<?> newClassBuilder,
ClassLoader classLoader) throws PluginException {
@ -105,6 +106,7 @@ public abstract class ClassEnhancePluginDefineV2 extends AbstractClassEnhancePlu
return newClassBuilder;
}
@Override
protected DynamicType.Builder<?> enhanceInstance(TypeDescription typeDescription,
DynamicType.Builder<?> newClassBuilder, ClassLoader classLoader,
EnhanceContext context) throws PluginException {