Skip to content

Commit d47f794

Browse files
committed
Added de.thetaphi.forbiddenapis plugin to ArC.
1 parent 8049314 commit d47f794

File tree

7 files changed

+38
-8
lines changed

7 files changed

+38
-8
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@defaultMessage Don't use Maven classes. They won't be available when using Gradle.
2+
org.apache.maven.**
3+
org.codehaus.plexus.**
4+
5+
@defaultMessage Never use Type#toString() as it's almost always the wrong thing to do. Usually org.jboss.jandex.DotName#toString() is what is needed
6+
org.jboss.jandex.Type#toString()
7+
8+
org.apache.commons.io.** @ Don't use commons-io dependency

independent-projects/arc/processor/pom.xml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,27 @@
6363
</dependency>
6464

6565
</dependencies>
66-
66+
<build>
67+
<plugins>
68+
<plugin>
69+
<groupId>de.thetaphi</groupId>
70+
<artifactId>forbiddenapis</artifactId>
71+
<executions>
72+
<execution>
73+
<id>verify-forbidden-apis</id>
74+
<configuration>
75+
<signaturesFiles>
76+
<signaturesFile>./banned-signatures.txt</signaturesFile>
77+
</signaturesFiles>
78+
<ignoreSignaturesOfMissingClasses>true</ignoreSignaturesOfMissingClasses>
79+
</configuration>
80+
<phase>compile</phase>
81+
<goals>
82+
<goal>check</goal>
83+
</goals>
84+
</execution>
85+
</executions>
86+
</plugin>
87+
</plugins>
88+
</build>
6789
</project>

independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/ComponentsProviderGenerator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ void addComponentInternal(BeanInfo removedBean) {
567567
CatchBlockCreator catchBlock = tryBlock.addCatch(Throwable.class);
568568
catchBlock.invokeStaticInterfaceMethod(
569569
MethodDescriptors.COMPONENTS_PROVIDER_UNABLE_TO_LOAD_REMOVED_BEAN_TYPE,
570-
catchBlock.load(type.toString()), catchBlock.getCaughtException());
570+
catchBlock.load(type.name().toString()), catchBlock.getCaughtException());
571571
AssignableResultHandle typeHandle = tryBlock.createVariable(Object.class);
572572
try {
573573
Types.getTypeHandle(typeHandle, tryBlock, type, tccl, typeCache);
@@ -655,12 +655,12 @@ public void initialize(MethodCreator method) {
655655

656656
@Override
657657
public ResultHandle get(org.jboss.jandex.Type type, BytecodeCreator bytecode) {
658-
return bytecode.invokeInterfaceMethod(MethodDescriptors.MAP_GET, mapHandle, bytecode.load(type.toString()));
658+
return bytecode.invokeInterfaceMethod(MethodDescriptors.MAP_GET, mapHandle, bytecode.load(type.name().toString()));
659659
}
660660

661661
@Override
662662
public void put(org.jboss.jandex.Type type, ResultHandle value, BytecodeCreator bytecode) {
663-
bytecode.invokeInterfaceMethod(MethodDescriptors.MAP_PUT, mapHandle, bytecode.load(type.toString()), value);
663+
bytecode.invokeInterfaceMethod(MethodDescriptors.MAP_PUT, mapHandle, bytecode.load(type.name().toString()), value);
664664
}
665665

666666
}

independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/InvokerGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ CandidateMethod resolve() {
797797
}
798798

799799
if (matching.isEmpty()) {
800-
String expectedType = this.expectedType.toString();
800+
String expectedType = this.expectedType.name().toString();
801801
String expectation = "";
802802
if (transformer.isInputTransformer()) {
803803
expectation = "\n"

independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/ObserverGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void precomputeGeneratedName(ObserverInfo observer) {
117117
if (observer.getId() != null) {
118118
sigBuilder.append(observer.getId());
119119
}
120-
sigBuilder.append(observer.getObservedType().toString()).append(observer.getQualifiers().toString())
120+
sigBuilder.append(observer.getObservedType().name().toString()).append(observer.getQualifiers().toString())
121121
.append(observer.isAsync()).append(observer.getPriority()).append(observer.getTransactionPhase());
122122
} else {
123123
sigBuilder.append(observer.getObserverMethod().name())

independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/SubclassGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ private void processDecorator(DecoratorInfo decorator, BeanInfo bean, Type provi
714714
MethodCreator forward = delegateSubclass.getMethodCreator(methodDescriptor);
715715
// Exceptions
716716
for (Type exception : method.exceptions()) {
717-
forward.addException(exception.toString());
717+
forward.addException(exception.name().toString());
718718
}
719719

720720
ResultHandle ret = null;

independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/bcextensions/TypeImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,6 @@ public Collection<AnnotationInfo> annotations() {
109109

110110
@Override
111111
public String toString() {
112-
return jandexType.toString();
112+
return jandexType.name().toString();
113113
}
114114
}

0 commit comments

Comments
 (0)