public static boolean hasExplainProblemResolution(IMarker marker) { int id = ApiProblemFactory.getProblemId(marker); if (id > -1) { if( id == ApiProblemFactory.createProblemId(IApiProblem.CATEGORY_COMPATIBILITY, IDelta.CLASS_ELEMENT_TYPE, IDelta.ADDED, IDelta.FIELD) || id == ApiProblemFactory.createProblemId(IApiProblem.CATEGORY_COMPATIBILITY, IDelta.INTERFACE_ELEMENT_TYPE, IDelta.ADDED, IDelta.FIELD) || id == ApiProblemFactory.createProblemId(IApiProblem.CATEGORY_COMPATIBILITY, IDelta.INTERFACE_ELEMENT_TYPE, IDelta.ADDED, IDelta.DEFAULT_METHOD)) { return true; } } return false; } }
/** * Creates a new fatal {@link IApiProblem} * * @param resourcepath the path to the resource this problem was found in * @param messageargs listing of arguments to pass in to the localized * message. The arguments are passed into the string in the order * they appear in the array. * @param kind the kind * @return a new {@link IApiProblem} for API usage */ public static IApiProblem newFatalProblem(String resourcepath, String[] messageargs, int kind) { int id = createProblemId(IApiProblem.CATEGORY_FATAL_PROBLEM, IElementDescriptor.RESOURCE, kind, IApiProblem.NO_FLAGS); return newApiProblem(resourcepath, null, messageargs, null, null, -1, -1, -1, id); }
/** * Creates a new API component resolution {@link IApiProblem} * * @param resourcepath the path to the resource this problem was found in * @param messageargs listing of arguments to pass in to the localized * message. The arguments are passed into the string in the order * they appear in the array. * @param argumentids the ids of arguments passed into the problem * @param arguments the arguments that correspond to the listing of ids * @param element the element kind * @param kind the kind * @return a new {@link IApiProblem} for API usage */ public static IApiProblem newApiComponentResolutionProblem(String resourcepath, String[] messageargs, String[] argumentids, Object[] arguments, int element, int kind) { int id = createProblemId(IApiProblem.CATEGORY_API_COMPONENT_RESOLUTION, element, kind, IApiProblem.NO_FLAGS); return newApiProblem(resourcepath, null, messageargs, argumentids, arguments, -1, -1, -1, id); }
/** * Creates a new API baseline {@link IApiProblem} * * @param resourcepath the path to the resource this problem was found in * The arguments are passed into the string in the order they * appear in the array. * @param argumentids the ids of arguments passed into the problem * @param arguments the arguments that correspond to the listing of ids * @param element the element kind * @param kind the kind * @return a new {@link IApiProblem} for API usage */ public static IApiProblem newApiBaselineProblem(String resourcepath, String[] argumentids, Object[] arguments, int element, int kind) { int id = createProblemId(IApiProblem.CATEGORY_API_BASELINE, element, kind, IApiProblem.NO_FLAGS); return newApiProblem(resourcepath, null, null, argumentids, arguments, -1, -1, -1, id); }
/** * Creates a new API usage {@link IApiProblem} * * @param resourcepath the path to the resource this problem was found in * @param typeName the type name this problem was found in * @param messageargs listing of arguments to pass in to the localized * message. The arguments are passed into the string in the order * they appear in the array. * @param argumentids the ids of arguments passed into the problem * @param arguments the arguments that correspond to the listing of ids * @param linenumber the number of the line the problem occurred on * @param charstart the start of a char selection range * @param charend the end of a char selection range * @param element the element kind * @param kind the kind * @return a new {@link IApiProblem} for API usage */ public static IApiProblem newApiUsageProblem(String resourcepath, String typeName, String[] messageargs, String[] argumentids, Object[] arguments, int linenumber, int charstart, int charend, int element, int kind) { int id = createProblemId(IApiProblem.CATEGORY_USAGE, element, kind, IApiProblem.NO_FLAGS); return newApiProblem(resourcepath, typeName, messageargs, argumentids, arguments, linenumber, charstart, charend, id); }
/** * Creates a new since tag {@link IApiProblem} * * @param resourcepath the path to the resource this problem was found in * @param typeName the type name this problem was found in * @param messageargs listing of arguments to pass in to the localized * message. The arguments are passed into the string in the order * they appear in the array. * @param argumentids the ids of arguments passed into the problem * @param arguments the arguments that correspond to the listing of ids * @param linenumber the number of the line the problem occurred on * @param charstart the start of a char selection range * @param charend the end of a char selection range * @param element the element kind * @param kind the kind * @return a new {@link IApiProblem} for since tags */ public static IApiProblem newApiSinceTagProblem(String resourcepath, String typeName, String[] messageargs, String[] argumentids, Object[] arguments, int linenumber, int charstart, int charend, int element, int kind) { int id = createProblemId(IApiProblem.CATEGORY_SINCETAGS, element, kind, IApiProblem.NO_FLAGS); return newApiProblem(resourcepath, typeName, messageargs, argumentids, arguments, linenumber, charstart, charend, id); }
/** * Creates a new version number {@link IApiProblem} * * @param resourcepath the path to the resource this problem was found in * @param typeName the type name this problem was found in * @param messageargs listing of arguments to pass in to the localized * message. The arguments are passed into the string in the order * they appear in the array. * @param argumentids the ids of arguments passed into the problem * @param arguments the arguments that correspond to the listing of ids * @param linenumber the number of the line the problem occurred on * @param charstart the start of a char selection range * @param charend the end of a char selection range * @param element the element kind * @param kind the kind * @return a new {@link IApiProblem} for version numbers */ public static IApiProblem newApiVersionNumberProblem(String resourcepath, String typeName, String[] messageargs, String[] argumentids, Object[] arguments, int linenumber, int charstart, int charend, int element, int kind) { int id = createProblemId(IApiProblem.CATEGORY_VERSION, element, kind, IApiProblem.NO_FLAGS); return newApiProblem(resourcepath, typeName, messageargs, argumentids, arguments, linenumber, charstart, charend, id); }
/** * Creates a new API usage {@link IApiProblem} * * @param resourcepath the path to the resource this problem was found in * @param typeName the type name this problem was found in * @param messageargs listing of arguments to pass in to the localized * message. The arguments are passed into the string in the order * they appear in the array. * @param argumentids the ids of arguments passed into the problem * @param arguments the arguments that correspond to the listing of ids * @param linenumber the number of the line the problem occurred on * @param charstart the start of a char selection range * @param charend the end of a char selection range * @param element the element kind * @param kind the kind * @param flags the flags * @return a new {@link IApiProblem} for API usage */ public static IApiProblem newApiUsageProblem(String resourcepath, String typeName, String[] messageargs, String[] argumentids, Object[] arguments, int linenumber, int charstart, int charend, int element, int kind, int flags) { int id = createProblemId(IApiProblem.CATEGORY_USAGE, element, kind, flags); return newApiProblem(resourcepath, typeName, messageargs, argumentids, arguments, linenumber, charstart, charend, id); }
/** * Creates a new API Use Scan breakage {@link IApiProblem} * * @param resourcePath path of the resource associated with the problem * @param typeName the type name this problem was found in * @param messageargs listing of arguments to pass in to the localized * message. The arguments are passed into the string in the order * they appear in the array. * @param argumentids the ids of arguments passed into the problem * @param arguments the arguments that correspond to the listing of ids * @param linenumber the number of the line the problem occurred on * @param charstart the start of a char selection range * @param charend the end of a char selection range * @param element the element kind * @param kind the kind * @param flags flags the reason for problem. <code>0</code> if the type * could not be resolved. <code>1</code> if member could not be * located in the type. * @return a new {@link IApiProblem} for API Use Scan breakage */ public static IApiProblem newApiUseScanProblem(String resourcePath, String typeName, String[] messageargs, String[] argumentids, Object[] arguments, int linenumber, int charstart, int charend, int element, int kind, int flags) { int id = createProblemId(IApiProblem.CATEGORY_API_USE_SCAN_PROBLEM, element, kind, flags); return newApiProblem(resourcePath, typeName, messageargs, argumentids, arguments, linenumber, charstart, charend, id); }
/** * Creates a new {@link IApiProblem} * * @param resourcepath the path to the resource this problem was found in * @param typeName the type name this problem was found in * @param messageargs listing of arguments to pass in to the localized * message. The arguments are passed into the string in the order * they appear in the array. * @param argumentids the ids of arguments passed into the problem * @param arguments the arguments that correspond to the listing of ids * @param linenumber the number of the line the problem occurred on * @param charstart the start of a char selection range * @param charend the end of a char selection range * @param category the category of the problem. See {@link IApiProblem} for * categories * @param element the id of the backing element for this problem See * {@link IElementDescriptor}, {@link IDelta} and * {@link IJavaElement} for kinds * @param kind the kind of the problem * @param flags any additional flags for the kind * @return a new {@link IApiProblem} */ public static IApiProblem newApiProblem(String resourcepath, String typeName, String[] messageargs, String[] argumentids, Object[] arguments, int linenumber, int charstart, int charend, int category, int element, int kind, int flags) { return newApiProblem(resourcepath, typeName, messageargs, argumentids, arguments, linenumber, charstart, charend, createProblemId(category, element, kind, flags)); }
int problemId = ApiProblemFactory.createProblemId(IApiProblem.CATEGORY_API_USE_SCAN_PROBLEM, elementType, kind, flag); String problemKey = referenceTypeName + problemId; IApiProblem similarProblem = problems.get(problemKey);