Skip to content

Commit

Permalink
[#noissue] Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
emeroad committed Jun 28, 2022
1 parent 14cbfb4 commit 6c6b594
Show file tree
Hide file tree
Showing 13 changed files with 11 additions and 204 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
package com.navercorp.pinpoint.bootstrap.plugin.test;

import java.util.Arrays;
import java.util.StringJoiner;

import com.navercorp.pinpoint.common.trace.AnnotationKey;
import com.navercorp.pinpoint.common.util.StringJoiner;

/**
* @author Jongho Moon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.Objects;
import java.util.StringJoiner;

public class StringJoinUtils {
private StringJoinUtils() {
Expand All @@ -22,11 +23,11 @@ public static <T> String join(final Collection<String> collection, final String
if (size == 1) {
return getFirstElement(collection);
}

final int bufferSize = StringJoiner.getBufferSize(collection, delimiter);
final StringBuilder buffer = new StringBuilder(bufferSize);
StringJoiner.build(buffer, collection, delimiter);
return buffer.toString();
StringJoiner joiner = new StringJoiner(delimiter);
for (String str : collection) {
joiner.add(str);
}
return joiner.toString();
}

private static String getFirstElement(Collection<String> collection) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.apache.logging.log4j.LogManager;

import java.util.Arrays;
import java.util.StringJoiner;

/**
* @author Woonduk Kang(emeroad)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.navercorp.pinpoint.grpc.client;

import com.navercorp.pinpoint.common.util.StringJoiner;
import com.navercorp.pinpoint.grpc.Header;
import io.grpc.CallOptions;
import io.grpc.Channel;
Expand All @@ -29,6 +28,7 @@
import java.util.Collection;
import java.util.Objects;
import java.util.Set;
import java.util.StringJoiner;

public class SupportCommandCodeClientInterceptor implements ClientInterceptor {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

import com.google.inject.Inject;
import com.google.inject.Provider;
import com.navercorp.pinpoint.common.util.JvmUtils;
import com.navercorp.pinpoint.common.util.JvmVersion;
import com.navercorp.pinpoint.profiler.monitor.metric.buffer.BufferMetric;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
Expand All @@ -41,13 +39,6 @@ public BufferMetricProvider() {

@Override
public BufferMetric get() {

final JvmVersion jvmVersion = JvmUtils.getVersion();
if (!jvmVersion.onOrAfter(JvmVersion.JAVA_7)) {
logger.debug("Unsupported JVM version. {}", jvmVersion);
return BufferMetric.UNSUPPORTED_BUFFER_METRIC;
}

BufferMetric bufferMetric = createBufferMetric(BUFFER_METRIC);
logger.info("loaded : {}", bufferMetric);
return bufferMetric;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import com.navercorp.pinpoint.test.plugin.util.ArrayUtils;
import com.navercorp.pinpoint.test.plugin.util.CodeSourceUtils;
import com.navercorp.pinpoint.test.plugin.util.StringUtils;
import com.navercorp.pinpoint.test.plugin.util.TLSOption;
import com.navercorp.pinpoint.test.plugin.util.TestLogger;
import com.navercorp.pinpoint.test.plugin.util.TestPluginVersion;

Expand Down Expand Up @@ -67,7 +66,6 @@ public abstract class AbstractPinpointPluginTestSuite extends Suite {

public AbstractPinpointPluginTestSuite(Class<?> testClass) throws InitializationError {
super(testClass, Collections.<Runner>emptyList());
TLSOption.applyTLSv12();

PinpointAgent agent = testClass.getAnnotation(PinpointAgent.class);
this.agentJar = resolveAgentPath(agent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,42 +16,16 @@

package com.navercorp.pinpoint.test.plugin;

import com.navercorp.pinpoint.test.plugin.util.JDKUtils;

/**
* @author Woonduk Kang(emeroad)
*/
public final class MavenCentral {
public static final String MAVEN_CENTRAL_SECURE = "https://repo.maven.apache.org/maven2";

/*
* for jdk 6, 7
* Central 501 HTTPS Required
* https://support.sonatype.com/hc/en-us/articles/360041287334
* Discontinued support for TLSv1.1 and below
* https://central.sonatype.org/articles/2018/May/04/discontinued-support-for-tlsv11-and-below/
* */
public static final String MAVEN_CENTRAL_INSECURE = "http://insecure.repo1.maven.org/maven2/";

public static final String INSECURE_ENABLE = "pinpoint.plugin.maven.insecure.enable";

private MavenCentral() {
}

public static String getAddress() {
if (enableMavenInsecure()) {
if (JDKUtils.isJdk8Plus()) {
return MAVEN_CENTRAL_SECURE;
} else {
return MAVEN_CENTRAL_INSECURE;
}
}
return MAVEN_CENTRAL_SECURE;

}

private static boolean enableMavenInsecure() {
String mavenInsecureEnable = System.getProperty(INSECURE_ENABLE, Boolean.FALSE.toString());
return mavenInsecureEnable.equals(Boolean.TRUE.toString());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@
import com.navercorp.pinpoint.test.plugin.ProcessManager;
import com.navercorp.pinpoint.test.plugin.util.CollectionUtils;
import com.navercorp.pinpoint.test.plugin.util.CommandLineOption;
import com.navercorp.pinpoint.test.plugin.util.JDKUtils;
import com.navercorp.pinpoint.test.plugin.util.StringJoiner;
import com.navercorp.pinpoint.test.plugin.util.StringUtils;
import com.navercorp.pinpoint.test.plugin.util.TLSOption;
import com.navercorp.pinpoint.test.plugin.util.TestLogger;
import org.eclipse.aether.artifact.Artifact;
import org.tinylog.TaggedLogger;
Expand All @@ -39,6 +36,7 @@
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.StringJoiner;
import java.util.Timer;
import java.util.TimerTask;

Expand All @@ -58,7 +56,6 @@ public class SharedProcessManager implements ProcessManager {

public SharedProcessManager(PluginTestContext context) {
this.context = Objects.requireNonNull(context, "context");
TLSOption.applyTLSv12();
}

@Override
Expand Down Expand Up @@ -152,12 +149,6 @@ private List<String> buildCommand() {

option.addOption("-Xmx1024m");
final List<String> jvmArguments = context.getJvmArguments();
if (!JDKUtils.isJdk8Plus()) {
// -XX:MaxPermSize for jdk 7
if (!hasMaxPermSize(jvmArguments)) {
option.addOption("-XX:MaxPermSize=512m");
}
}

option.addOptions(jvmArguments);

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.navercorp.pinpoint.test.plugin.util;

import java.util.Collection;
import java.util.StringJoiner;

public final class StringUtils {
private StringUtils() {
Expand Down

This file was deleted.

0 comments on commit 6c6b594

Please sign in to comment.