Skip to content

Commit

Permalink
Move constants from feature to phase
Browse files Browse the repository at this point in the history
  • Loading branch information
jormundur00 committed Dec 23, 2024
1 parent 5f5a1ea commit e64ea05
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@
*/
@AutomaticallyRegisteredFeature
public final class AnalyzeMethodsRequiringMetadataUsageFeature implements InternalFeature {
public static final String METHODTYPE_REFLECTION = "reflection";
public static final String METHODTYPE_RESOURCE = "resource";
public static final String METHODTYPE_SERIALIZATION = "serialization";
public static final String METHODTYPE_PROXY = "proxy";
private final Set<String> jarPaths;
private final Map<String, Map<String, Map<String, List<String>>>> callsByJar;
private final Set<FoldEntry> foldEntries = ConcurrentHashMap.newKeySet();
Expand Down Expand Up @@ -101,8 +97,8 @@ public void dumpReportForJar(String jarPath) {
var builder = writer.objectBuilder()) {
for (Map.Entry<String, Map<String, List<String>>> callEntry : calls.entrySet()) {
try (JsonBuilder.ObjectBuilder methodsByTypeBuilder = builder.append(callEntry.getKey()).object()) {
Map<String, List<String>> nestedMap = callEntry.getValue();
for (Map.Entry<String, List<String>> entry : nestedMap.entrySet()) {
Map<String, List<String>> methodsByType = callEntry.getValue();
for (Map.Entry<String, List<String>> entry : methodsByType.entrySet()) {
try (JsonBuilder.ArrayBuilder array = methodsByTypeBuilder.append(entry.getKey()).array()) {
for (String call : entry.getValue()) {
array.append(call);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@
import java.util.Set;
import java.util.random.RandomGeneratorFactory;

import static com.oracle.svm.hosted.AnalyzeMethodsRequiringMetadataUsageFeature.METHODTYPE_PROXY;
import static com.oracle.svm.hosted.AnalyzeMethodsRequiringMetadataUsageFeature.METHODTYPE_REFLECTION;
import static com.oracle.svm.hosted.AnalyzeMethodsRequiringMetadataUsageFeature.METHODTYPE_RESOURCE;
import static com.oracle.svm.hosted.AnalyzeMethodsRequiringMetadataUsageFeature.METHODTYPE_SERIALIZATION;

/**
* This phase detects usages of any calls that might require metadata in reached parts of the
* project, given the JAR files in which to search, and outputs and serializes them to the
Expand All @@ -76,6 +71,11 @@
*/

public class AnalyzeMethodsRequiringMetadataUsagePhase extends BasePhase<CoreProviders> {
public static final String METHODTYPE_REFLECTION = "reflection";
public static final String METHODTYPE_RESOURCE = "resource";
public static final String METHODTYPE_SERIALIZATION = "serialization";
public static final String METHODTYPE_PROXY = "proxy";

private static final Map<String, Set<String>> reflectMethodNames = new HashMap<>();
private static final Map<String, Set<String>> resourceMethodNames = new HashMap<>();
private static final Map<String, Set<String>> serializationMethodNames = new HashMap<>();
Expand Down

0 comments on commit e64ea05

Please sign in to comment.