public void onChange(JApiCompatibility change, JApiSemanticVersionLevel semanticVersionLevel) { switch(semanticVersionLevel) { case MAJOR: if (changeType.ordinal() > SemanticVersion.ChangeType.MAJOR.ordinal()) { warn("Incompatibility detected: Requires semantic version level " + semanticVersionLevel + ": " + change); } break; case MINOR: if (changeType.ordinal() > SemanticVersion.ChangeType.MINOR.ordinal()) { warn("Incompatibility detected: Requires semantic version level " + semanticVersionLevel + ": " + change); } break; case PATCH: if (changeType.ordinal() > SemanticVersion.ChangeType.PATCH.ordinal()) { warn("Incompatibility detected: Requires semantic version level " + semanticVersionLevel + ": " + change); } break; default: // Ignore } } });
public void onChange(JApiCompatibility change, JApiSemanticVersionLevel semanticVersionLevel) { switch(semanticVersionLevel) { case MAJOR: if (changeType.ordinal() > SemanticVersion.ChangeType.MAJOR.ordinal()) { warn("Incompatibility detected: Requires semantic version level " + semanticVersionLevel + ": " + change); } break; case MINOR: if (changeType.ordinal() > SemanticVersion.ChangeType.MINOR.ordinal()) { warn("Incompatibility detected: Requires semantic version level " + semanticVersionLevel + ": " + change); } break; case PATCH: if (changeType.ordinal() > SemanticVersion.ChangeType.PATCH.ordinal()) { warn("Incompatibility detected: Requires semantic version level " + semanticVersionLevel + ": " + change); } break; default: // Ignore } } });
private boolean breakBuildIfCausedByExclusion(JApiMethod jApiMethod) { if (!breakBuildIfCausedByExclusion) { JApiReturnType returnType = jApiMethod.getReturnType(); String oldType = returnType.getOldReturnType(); try { Optional<CtClass> ctClassOptional = jarArchiveComparator.loadClass(JarArchiveComparator.ArchiveType.OLD, oldType); if (ctClassOptional.isPresent()) { if (classExcluded(ctClassOptional.get())) { return false; } } } catch (Exception e) { warn("Failed to load class " + oldType + ": " + e.getMessage(), e); } String newType = returnType.getNewReturnType(); try { Optional<CtClass> ctClassOptional = jarArchiveComparator.loadClass(JarArchiveComparator.ArchiveType.NEW, newType); if (ctClassOptional.isPresent()) { if (classExcluded(ctClassOptional.get())) { return false; } } } catch (Exception e) { warn("Failed to load class " + newType + ": " + e.getMessage(), e); } } return true; }
private boolean breakBuildIfCausedByExclusion(JApiMethod jApiMethod) { if (!breakBuildIfCausedByExclusion) { JApiReturnType returnType = jApiMethod.getReturnType(); String oldType = returnType.getOldReturnType(); try { Optional<CtClass> ctClassOptional = jarArchiveComparator.loadClass(JarArchiveComparator.ArchiveType.OLD, oldType); if (ctClassOptional.isPresent()) { if (classExcluded(ctClassOptional.get())) { return false; } } } catch (Exception e) { warn("Failed to load class " + oldType + ": " + e.getMessage(), e); } String newType = returnType.getNewReturnType(); try { Optional<CtClass> ctClassOptional = jarArchiveComparator.loadClass(JarArchiveComparator.ArchiveType.NEW, newType); if (ctClassOptional.isPresent()) { if (classExcluded(ctClassOptional.get())) { return false; } } } catch (Exception e) { warn("Failed to load class " + newType + ": " + e.getMessage(), e); } } return true; }