File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
java/org/apache/lucene/internal/vectorization
test/org/apache/lucene/internal/vectorization Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,11 @@ public static VectorizationProvider getInstance() {
9696 Holder .INSTANCE , "call to getInstance() from subclass of VectorizationProvider" );
9797 }
9898
99+ /** Returns the name of the {@code VectorizationProvider}'s implementation that's being used. */
100+ public static String getImplementationName () {
101+ return Objects .requireNonNull (Holder .INSTANCE ).getName ();
102+ }
103+
99104 VectorizationProvider () {
100105 // no instance/subclass except from this package
101106 }
@@ -224,6 +229,10 @@ private static void ensureCaller() {
224229 }
225230 }
226231
232+ public String getName () {
233+ return this .getClass ().getSimpleName ();
234+ }
235+
227236 /** This static holder class prevents classloading deadlock. */
228237 private static final class Holder {
229238 private Holder () {}
Original file line number Diff line number Diff line change @@ -24,6 +24,10 @@ public void testCallerOfGetter() {
2424 expectThrows (UnsupportedOperationException .class , TestVectorizationProvider ::illegalCaller );
2525 }
2626
27+ public void testGetProviderName () {
28+ assertEquals ("DefaultVectorizationProvider" , VectorizationProvider .getImplementationName ());
29+ }
30+
2731 private static void illegalCaller () {
2832 VectorizationProvider .getInstance ();
2933 }
You can’t perform that action at this time.
0 commit comments