private static String formatMethodNotFoundErrorMessage(Class<?> serviceIntf, String serviceMethodName, Class<?>[] parameterTypes) { StringBuffer sb = new StringBuffer(); sb.append("Could not locate requested method '"); sb.append(serviceMethodName); sb.append("("); for (int i = 0; i < parameterTypes.length; ++i) { if (i > 0) { sb.append(", "); } sb.append(printTypeName(parameterTypes[i])); } sb.append(")'"); sb.append(" in interface '"); sb.append(printTypeName(serviceIntf)); sb.append("'"); return sb.toString(); }
private static String formatIllegalAccessErrorMessage(Object target, Method serviceMethod) { StringBuffer sb = new StringBuffer(); sb.append("Blocked attempt to access inaccessible method '"); sb.append(getSourceRepresentation(serviceMethod)); sb.append("'"); if (target != null) { sb.append(" on target '"); sb.append(printTypeName(target.getClass())); sb.append("'"); } sb.append("; this is either misconfiguration or a hack attempt"); return sb.toString(); }
private static String formatIllegalArgumentErrorMessage(Object target, Method serviceMethod, Object[] args) { StringBuffer sb = new StringBuffer(); sb.append("Blocked attempt to invoke method '"); sb.append(getSourceRepresentation(serviceMethod)); sb.append("'"); if (target != null) { sb.append(" on target '"); sb.append(printTypeName(target.getClass())); sb.append("'"); } sb.append(" with invalid arguments"); if (args != null && args.length > 0) { sb.append(Arrays.asList(args)); } return sb.toString(); }
return printTypeName(componentType) + "[]";
public static String encodeResponseForSuccess(Method serviceMethod, Object object, SerializationPolicy serializationPolicy, int flags) throws SerializationException { if (serviceMethod == null) { throw new NullPointerException("serviceMethod cannot be null"); } if (serializationPolicy == null) { throw new NullPointerException("serializationPolicy"); } Class<?> methodReturnType = serviceMethod.getReturnType(); if (methodReturnType != void.class && object != null) { Class<?> actualReturnType; if (methodReturnType.isPrimitive()) { actualReturnType = getPrimitiveClassFromWrapper(object.getClass()); } else { actualReturnType = object.getClass(); } if (actualReturnType == null || !methodReturnType.isAssignableFrom(actualReturnType)) { throw new IllegalArgumentException("Type '" + printTypeName(object.getClass()) + "' does not match the return type in the method's signature: '" + getSourceRepresentation(serviceMethod) + "'"); } } return encodeResponse(methodReturnType, object, false, flags, serializationPolicy); }
+ serviceIntfName + "', which is not implemented by '" + printTypeName(type) + "'; this is either misconfiguration or a hack attempt"); + printTypeName(serviceIntf) + "', which doesn't extend RemoteService; this is either " + "misconfiguration or a hack attempt");
private static String formatIllegalAccessErrorMessage(Object target, Method serviceMethod) { StringBuffer sb = new StringBuffer(); sb.append("Blocked attempt to access inaccessible method '"); sb.append(getSourceRepresentation(serviceMethod)); sb.append("'"); if (target != null) { sb.append(" on target '"); sb.append(printTypeName(target.getClass())); sb.append("'"); } sb.append("; this is either misconfiguration or a hack attempt"); return sb.toString(); }
private static String formatMethodNotFoundErrorMessage(Class<?> serviceIntf, String serviceMethodName, Class<?>[] parameterTypes) { StringBuffer sb = new StringBuffer(); sb.append("Could not locate requested method '"); sb.append(serviceMethodName); sb.append("("); for (int i = 0; i < parameterTypes.length; ++i) { if (i > 0) { sb.append(", "); } sb.append(printTypeName(parameterTypes[i])); } sb.append(")'"); sb.append(" in interface '"); sb.append(printTypeName(serviceIntf)); sb.append("'"); return sb.toString(); }
private static String formatIllegalAccessErrorMessage(Object target, Method serviceMethod) { StringBuffer sb = new StringBuffer(); sb.append("Blocked attempt to access inaccessible method '"); sb.append(getSourceRepresentation(serviceMethod)); sb.append("'"); if (target != null) { sb.append(" on target '"); sb.append(printTypeName(target.getClass())); sb.append("'"); } sb.append("; this is either misconfiguration or a hack attempt"); return sb.toString(); }
private static String formatMethodNotFoundErrorMessage(Class<?> serviceIntf, String serviceMethodName, Class<?>[] parameterTypes) { StringBuffer sb = new StringBuffer(); sb.append("Could not locate requested method '"); sb.append(serviceMethodName); sb.append("("); for (int i = 0; i < parameterTypes.length; ++i) { if (i > 0) { sb.append(", "); } sb.append(printTypeName(parameterTypes[i])); } sb.append(")'"); sb.append(" in interface '"); sb.append(printTypeName(serviceIntf)); sb.append("'"); return sb.toString(); }
private static String formatIllegalArgumentErrorMessage(Object target, Method serviceMethod, Object[] args) { StringBuffer sb = new StringBuffer(); sb.append("Blocked attempt to invoke method '"); sb.append(getSourceRepresentation(serviceMethod)); sb.append("'"); if (target != null) { sb.append(" on target '"); sb.append(printTypeName(target.getClass())); sb.append("'"); } sb.append(" with invalid arguments"); if (args != null && args.length > 0) { sb.append(Arrays.asList(args)); } return sb.toString(); }
private static String formatIllegalArgumentErrorMessage(Object target, Method serviceMethod, Object[] args) { StringBuffer sb = new StringBuffer(); sb.append("Blocked attempt to invoke method '"); sb.append(getSourceRepresentation(serviceMethod)); sb.append("'"); if (target != null) { sb.append(" on target '"); sb.append(printTypeName(target.getClass())); sb.append("'"); } sb.append(" with invalid arguments"); if (args != null && args.length > 0) { sb.append(Arrays.asList(args)); } return sb.toString(); }
return printTypeName(componentType) + "[]";
return printTypeName(componentType) + "[]";
public static String encodeResponseForSuccess(Method serviceMethod, Object object, SerializationPolicy serializationPolicy, int flags) throws SerializationException { if (serviceMethod == null) { throw new NullPointerException("serviceMethod cannot be null"); } if (serializationPolicy == null) { throw new NullPointerException("serializationPolicy"); } Class<?> methodReturnType = serviceMethod.getReturnType(); if (methodReturnType != void.class && object != null) { Class<?> actualReturnType; if (methodReturnType.isPrimitive()) { actualReturnType = getPrimitiveClassFromWrapper(object.getClass()); } else { actualReturnType = object.getClass(); } if (actualReturnType == null || !methodReturnType.isAssignableFrom(actualReturnType)) { throw new IllegalArgumentException("Type '" + printTypeName(object.getClass()) + "' does not match the return type in the method's signature: '" + getSourceRepresentation(serviceMethod) + "'"); } } return encodeResponse(methodReturnType, object, false, flags, serializationPolicy); }
public static String encodeResponseForSuccess(Method serviceMethod, Object object, SerializationPolicy serializationPolicy, int flags) throws SerializationException { if (serviceMethod == null) { throw new NullPointerException("serviceMethod cannot be null"); } if (serializationPolicy == null) { throw new NullPointerException("serializationPolicy"); } Class<?> methodReturnType = serviceMethod.getReturnType(); if (methodReturnType != void.class && object != null) { Class<?> actualReturnType; if (methodReturnType.isPrimitive()) { actualReturnType = getPrimitiveClassFromWrapper(object.getClass()); } else { actualReturnType = object.getClass(); } if (actualReturnType == null || !methodReturnType.isAssignableFrom(actualReturnType)) { throw new IllegalArgumentException("Type '" + printTypeName(object.getClass()) + "' does not match the return type in the method's signature: '" + getSourceRepresentation(serviceMethod) + "'"); } } return encodeResponse(methodReturnType, object, false, flags, serializationPolicy); }
+ serviceIntfName + "', which is not implemented by '" + printTypeName(type) + "'; this is either misconfiguration or a hack attempt"); + printTypeName(serviceIntf) + "', which doesn't extend RemoteService; this is either " + "misconfiguration or a hack attempt");
+ serviceIntfName + "', which is not implemented by '" + printTypeName(type) + "'; this is either misconfiguration or a hack attempt"); + printTypeName(serviceIntf) + "', which doesn't extend RemoteService; this is either " + "misconfiguration or a hack attempt");