@Override public void reportMissingClass(ClassDescriptor classDescriptor) { Global.getAnalysisCache().getErrorLogger().reportMissingClass(classDescriptor); }
@Override public void reportMissingClass(ClassNotFoundException ex) { Global.getAnalysisCache().getErrorLogger().reportMissingClass(ex); }
@Override public boolean matches(Type t) { if (!(t instanceof ReferenceType)) { return false; } IAnalysisCache analysisCache = Global.getAnalysisCache(); Subtypes2 subtypes2 = analysisCache.getDatabase(Subtypes2.class); try { return subtypes2.isSubtype((ReferenceType) t, supertype); } catch (ClassNotFoundException e) { analysisCache.getErrorLogger().reportMissingClass(e); return false; } }
/** * Look up an Obligation by type. This returns the first Obligation that is * a supertype of the type given (meaning that the given type could be an * instance of the returned Obligation). * * @param classDescriptor * a ClassDescriptor naming a class type * @return an Obligation that is a supertype of the given type, or null if * there is no such Obligation */ public @CheckForNull Obligation getObligationByType(ClassDescriptor classDescriptor) { try { return getObligationByType(BCELUtil.getObjectTypeInstance(classDescriptor.toDottedClassName())); } catch (ClassNotFoundException e) { Global.getAnalysisCache().getErrorLogger().reportMissingClass(e); return null; } }
/** * Determine whether class named by given ClassDescriptor is an Obligation * type. * * @param classDescriptor * a class * @return true if the class is an Obligation type, false otherwise */ public boolean isObligationType(ClassDescriptor classDescriptor) { try { return getObligationByType(BCELUtil.getObjectTypeInstance(classDescriptor.toDottedClassName())) != null; } catch (ClassNotFoundException e) { Global.getAnalysisCache().getErrorLogger().reportMissingClass(e); return false; } }
/** * Get array of Obligation types corresponding to the parameters of the * given method. * * @param xmethod * a method * @return array of Obligation types for each of the method's parameters; a * null element means the corresponding parameter is not an * Obligation type */ public Obligation[] getParameterObligationTypes(XMethod xmethod) { Type[] paramTypes = Type.getArgumentTypes(xmethod.getSignature()); Obligation[] result = new Obligation[paramTypes.length]; for (int i = 0; i < paramTypes.length; i++) { if (!(paramTypes[i] instanceof ObjectType)) { continue; } try { result[i] = getObligationByType((ObjectType) paramTypes[i]); } catch (ClassNotFoundException e) { Global.getAnalysisCache().getErrorLogger().reportMissingClass(e); } } return result; }
errorLogger.reportMissingClass(e); throw new MissingClassException(e);
logRecoverableException(classDescriptor, detector, e); } catch (MissingClassException e) { Global.getAnalysisCache().getErrorLogger().reportMissingClass(e.getClassDescriptor()); } catch (CheckedAnalysisException e) { logRecoverableException(classDescriptor, detector, e);
@Override public void reportMissingClass(ClassNotFoundException ex) { Global.getAnalysisCache().getErrorLogger().reportMissingClass(ex); }
@Override public void reportMissingClass(ClassDescriptor classDescriptor) { Global.getAnalysisCache().getErrorLogger().reportMissingClass(classDescriptor); }
@Override public boolean matches(Type t) { if (!(t instanceof ReferenceType)) { return false; } IAnalysisCache analysisCache = Global.getAnalysisCache(); Subtypes2 subtypes2 = analysisCache.getDatabase(Subtypes2.class); try { return subtypes2.isSubtype((ReferenceType) t, supertype); } catch (ClassNotFoundException e) { analysisCache.getErrorLogger().reportMissingClass(e); return false; } }
/** * Look up an Obligation by type. This returns the first Obligation that is * a supertype of the type given (meaning that the given type could be an * instance of the returned Obligation). * * @param classDescriptor * a ClassDescriptor naming a class type * @return an Obligation that is a supertype of the given type, or null if * there is no such Obligation */ public @CheckForNull Obligation getObligationByType(ClassDescriptor classDescriptor) { try { return getObligationByType(BCELUtil.getObjectTypeInstance(classDescriptor.toDottedClassName())); } catch (ClassNotFoundException e) { Global.getAnalysisCache().getErrorLogger().reportMissingClass(e); return null; } }
/** * Determine whether class named by given ClassDescriptor is an Obligation * type. * * @param classDescriptor * a class * @return true if the class is an Obligation type, false otherwise */ public boolean isObligationType(ClassDescriptor classDescriptor) { try { return getObligationByType(BCELUtil.getObjectTypeInstance(classDescriptor.toDottedClassName())) != null; } catch (ClassNotFoundException e) { Global.getAnalysisCache().getErrorLogger().reportMissingClass(e); return false; } }
/** * Get array of Obligation types corresponding to the parameters of the * given method. * * @param xmethod * a method * @return array of Obligation types for each of the method's parameters; a * null element means the corresponding parameter is not an * Obligation type */ public Obligation[] getParameterObligationTypes(XMethod xmethod) { Type[] paramTypes = Type.getArgumentTypes(xmethod.getSignature()); Obligation[] result = new Obligation[paramTypes.length]; for (int i = 0; i < paramTypes.length; i++) { if (!(paramTypes[i] instanceof ObjectType)) { continue; } try { result[i] = getObligationByType((ObjectType) paramTypes[i]); } catch (ClassNotFoundException e) { Global.getAnalysisCache().getErrorLogger().reportMissingClass(e); } } return result; }
errorLogger.reportMissingClass(e); throw new MissingClassException(e);
logRecoverableException(classDescriptor, detector, e); } catch (MissingClassException e) { Global.getAnalysisCache().getErrorLogger().reportMissingClass(e.getClassDescriptor()); } catch (CheckedAnalysisException e) { logRecoverableException(classDescriptor, detector, e);