Skip to content

Commit

Permalink
added check for private modiefiers
Browse files Browse the repository at this point in the history
Signed-off-by: Nischal Sharma <[email protected]>
  • Loading branch information
NickSneo committed Apr 3, 2024
1 parent c47ba3d commit 141f2aa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ private Set<String> getDuplicateFunctionNames(List<AbiDefinition> functionDefini
private static MethodSpec buildGetDeploymentBinaryMethod() {
MethodSpec.Builder toReturn =
MethodSpec.methodBuilder("getDeploymentBinary")
.addModifiers(Modifier.PUBLIC, Modifier.STATIC)
.addModifiers(Modifier.PRIVATE, Modifier.STATIC)
.returns(ClassName.get(String.class));

CodeBlock codeBlock =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
package org.web3j.codegen.unit.gen;

import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
Expand Down Expand Up @@ -61,7 +62,7 @@ public static List<MethodSpec> generateMethodSpecsForEachTest(Class theContract)
.forEach(
method -> {
String uniqueName = getUniqueName(method, methodNameCountMap);
if (!uniqueName.startsWith("getDeploymentBinary")) {
if (!Modifier.isPrivate(method.getModifiers())) {
listOfMethodSpecs.add(
new MethodParser(method, theContract, uniqueName)
.getMethodSpec());
Expand All @@ -78,7 +79,7 @@ public static List<FunSpec> generateFunctionSpecsForEachTest(Class theContract)
.forEach(
method -> {
String uniqueName = getUniqueName(method, functionNameCountMap);
if (!uniqueName.startsWith("getDeploymentBinary")) {
if (!Modifier.isPrivate(method.getModifiers())) {
listOfFunSpecs.add(
new FunParser(method, theContract, uniqueName)
.getFunSpec());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public static void linkLibraries(List<Contract.LinkReference> references) {
librariesLinkedBinary = linkBinaryWithReferences(BINARY, references);
}

public static String getDeploymentBinary() {
private static String getDeploymentBinary() {
if (librariesLinkedBinary != null) {
return librariesLinkedBinary;
} else {
Expand Down

0 comments on commit 141f2aa

Please sign in to comment.