From 817f0332d83916cb5cf4f444e7534a829298a235 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Wed, 22 Feb 2023 21:48:34 +0100 Subject: [PATCH] Migrate user of TypeDescription.OBJECT Use TypeDescription.ForLoadedType.of() instead. Also shorten references to TypeDescription.ForLoadedType, as we already have it imported. Change-Id: I2e5531b8e0199d341ee943792369bafb7ab64dc3 Signed-off-by: Robert Varga --- .../dom/codec/impl/CodecDataObjectGenerator.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/CodecDataObjectGenerator.java b/binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/CodecDataObjectGenerator.java index 9d00f9adc4..c26eea37db 100644 --- a/binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/CodecDataObjectGenerator.java +++ b/binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/CodecDataObjectGenerator.java @@ -170,7 +170,7 @@ abstract class CodecDataObjectGenerator> implements for (Method method : properties.keySet()) { LOG.trace("Generating for fixed method {}", method); final String methodName = method.getName(); - final TypeDescription retType = TypeDescription.ForLoadedType.of(method.getReturnType()); + final TypeDescription retType = ForLoadedType.of(method.getReturnType()); tmp = tmp.defineMethod(methodName, retType, PUB_FINAL).intercept( new SupplierGetterMethodImplementation(methodName, retType)); } @@ -205,7 +205,7 @@ abstract class CodecDataObjectGenerator> implements for (Method method : simpleProperties.keySet()) { LOG.trace("Generating for simple method {}", method); final String methodName = method.getName(); - final TypeDescription retType = TypeDescription.ForLoadedType.of(method.getReturnType()); + final TypeDescription retType = ForLoadedType.of(method.getReturnType()); tmp = tmp.defineMethod(methodName, retType, PUB_FINAL).intercept( new SimpleGetterMethodImplementation(methodName, retType)); } @@ -214,7 +214,7 @@ abstract class CodecDataObjectGenerator> implements final Method method = info.getterMethod(); LOG.trace("Generating for structured method {}", method); final String methodName = method.getName(); - final TypeDescription retType = TypeDescription.ForLoadedType.of(method.getReturnType()); + final TypeDescription retType = ForLoadedType.of(method.getReturnType()); tmp = tmp.defineMethod(methodName, retType, PUB_FINAL).intercept( new StructuredGetterMethodImplementation(methodName, retType, entry.getKey())); @@ -290,7 +290,7 @@ abstract class CodecDataObjectGenerator> implements if (keyMethod != null) { LOG.trace("Generating for key {}", keyMethod); final String methodName = keyMethod.getName(); - final TypeDescription retType = TypeDescription.ForLoadedType.of(keyMethod.getReturnType()); + final TypeDescription retType = ForLoadedType.of(keyMethod.getReturnType()); builder = builder.defineMethod(methodName, retType, PUB_FINAL).intercept( new KeyMethodImplementation(methodName, retType)); } @@ -351,7 +351,7 @@ abstract class CodecDataObjectGenerator> implements private abstract static class AbstractCachedMethodImplementation extends AbstractMethodImplementation { private static final Generic BB_HANDLE = TypeDefinition.Sort.describe(VarHandle.class); private static final Generic BB_OBJECT = TypeDefinition.Sort.describe(Object.class); - private static final StackManipulation OBJECT_CLASS = ClassConstant.of(TypeDescription.OBJECT); + private static final StackManipulation OBJECT_CLASS = ClassConstant.of(ForLoadedType.of(Object.class)); private static final StackManipulation LOOKUP = invokeMethod(MethodHandles.class, "lookup"); private static final StackManipulation FIND_VAR_HANDLE = invokeMethod(Lookup.class, "findVarHandle", Class.class, String.class, Class.class); -- 2.36.6