Source:
<code>private static Object decodeArg(Component instance, Method method, Class<?> type, int index, JsonValue argValue) { assert argValue != null; if (type.isPrimitive() && argValue.getType() == JsonType.NULL) { String msg = String.format( "Null values are not allowed for primitive types but " + "a 'null' value was received for parameter %d " + "which refers to primitive type '%s' " + "in the method '%s' defined in the class '%s'", index, type.getName(), method.getName(), method.getDeclaringClass().getName()); throw new IllegalArgumentException(msg); } else if (type.isArray()) { return decodeArray(method, type, index, argValue); } else { Class<?> convertedType = ReflectTools.convertPrimitiveType(type); if (instance != null) { Optional<UI> ui = instance.getUI(); assert ui .isPresent() : "Rpc handler may not be called for a component that is not attached"; VaadinContext context = ui.get().getSession().getService() .getContext(); <START> DeprecatedPolymerPublishedEventHandler handler = context <END> .getAttribute(Lookup.class) .lookup(DeprecatedPolymerPublishedEventHandler.class); if (handler != null) { if (handler.isTemplateModelValue(instance, argValue, convertedType)) { return handler.getTemplateItem(instance, (JsonObject) argValue, method.getGenericParameterTypes()[index]); } } } Optional<RpcDecoder> decoder = getDecoder(argValue, convertedType); if (decoder.isPresent()) { try { return decoder.get().decode(argValue, convertedType); } catch (RpcDecodeException exception) { throw new IllegalArgumentException(exception); } } String msg = String.format("Class '%s' has the method '%s' " + "whose parameter %d refers to unsupported type '%s'", method.getDeclaringClass().getName(), method.getName(), index, type.getName()); throw new IllegalArgumentException(msg); } }</code><technical_language>![MINOR](<LINK_2> 'Severity: MINOR') Remove this of "DeprecatedPolymerPublishedEventHandler"; is deprecated. [![rule](<LINK_1>](<LINK_0></technical_language>

Target:
private static Object decodeArg(Component instance, Method method, Class<?> type, int index, JsonValue argValue) { assert argValue != null; if (type.isPrimitive() && argValue.getType() == JsonType.NULL) { String msg = String.format( "Null values are not allowed for primitive types but " + "a 'null' value was received for parameter %d " + "which refers to primitive type '%s' " + "in the method '%s' defined in the class '%s'", index, type.getName(), method.getName(), method.getDeclaringClass().getName()); throw new IllegalArgumentException(msg); } else if (type.isArray()) { return decodeArray(method, type, index, argValue); } else { Class<?> convertedType = ReflectTools.convertPrimitiveType(type); if (instance != null) { Optional<UI> ui = instance.getUI(); if (!ui.isPresent()) { throw new IllegalStateException( "Rpc handler may not be called for a detached component"); } VaadinContext context = ui.get().getSession().getService() .getContext(); DeprecatedPolymerPublishedEventHandler handler = context .getAttribute(Lookup.class) .lookup(DeprecatedPolymerPublishedEventHandler.class); if (handler != null && handler.isTemplateModelValue(instance, argValue, convertedType)) { return handler.getTemplateItem(instance, (JsonObject) argValue, method.getGenericParameterTypes()[index]); } } Optional<RpcDecoder> decoder = getDecoder(argValue, convertedType); if (decoder.isPresent()) { try { return decoder.get().decode(argValue, convertedType); } catch (RpcDecodeException exception) { throw new IllegalArgumentException(exception); } } String msg = String.format("Class '%s' has the method '%s' " + "whose parameter %d refers to unsupported type '%s'", method.getDeclaringClass().getName(), method.getName(), index, type.getName()); throw new IllegalArgumentException(msg); } }