File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
src/main/java/com/acme/reflection Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 1212 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
1313 <sonar .host.url>https://sonarcloud.io</sonar .host.url>
1414 <sonar .organization>pixee</sonar .organization>
15- </properties >
15+ <versions .java-security-toolkit>1.2.1</versions .java-security-toolkit>
16+ </properties >
1617
1718 <dependencyManagement >
1819 <dependencies >
3132 <dependency >
3233 <groupId >io.github.pixee</groupId >
3334 <artifactId >java-security-toolkit</artifactId >
34- <version >1.2.0 </version >
35+ <version >${versions.java-security-toolkit} </version >
3536 </dependency >
3637 </dependencies >
3738 </dependencyManagement >
Original file line number Diff line number Diff line change 11package com .acme .reflection ;
22
3+ import io .github .pixee .security .Reflection ;
34import jakarta .ws .rs .GET ;
45import jakarta .ws .rs .Path ;
56import jakarta .ws .rs .QueryParam ;
@@ -22,7 +23,7 @@ public String hello(@QueryParam("translator") final String translationStrategy)
2223 private static TranslatorStrategy loadTranslatorByName (final String translationStrategy ) {
2324 final Class <?> translatorClazz ;
2425 try {
25- translatorClazz = Class . forName ("com.acme." + translationStrategy );
26+ translatorClazz = Reflection . loadAndVerify ("com.acme." + translationStrategy );
2627 } catch (ClassNotFoundException e ) {
2728 throw new IllegalArgumentException ("Invalid translator: " + translationStrategy , e );
2829 }
You can’t perform that action at this time.
0 commit comments