public boolean equals (Object other) { if (other instanceof Profile) { Profile op = (Profile) other; return this.name == null ? op.name == null : this.name.equals(op.name) && this.version == null ? op.version == null : this.version.equals (op.version); } else return false; }
public boolean equals (Object other) { if (other instanceof Specification) { Specification os = (Specification) other; boolean re = this.name == null ? os.name == null : this.name.equals(os.name) && this.version == null ? os.version == null : this.version.equals (os.version); if (!re || this.profiles == null) return re; if (os.profiles == null || this.profiles.length != os.profiles.length) return false; for (int i=0; i<os.profiles.length; i++) re &= this.profiles[i].equals(os.profiles[i]); return re; } else return false; }
private static boolean compatibleProfile (Profile platformProfile, Profile query) { String name = query.getName(); SpecificationVersion version = query.getVersion(); return ((name == null || name.equals (platformProfile.getName())) && (version == null || version.equals (platformProfile.getVersion()))); }
private static SpecificationVersion getDefaultSourceLevel () { if (defaultSourceLevel != null) { return defaultSourceLevel; } else { JavaPlatform defaultPlatform = JavaPlatformManager.getDefault().getDefaultPlatform(); SpecificationVersion v = defaultPlatform.getSpecification().getVersion(); if (v.equals(new SpecificationVersion("1.6")) || v.equals(new SpecificationVersion("1.7"))) { // #89131: these levels are not actually distinct from 1.5. - xxx not true, but may be acceptable to have 1.5 as default return new SpecificationVersion("1.5"); } else { return v; } } }
private static boolean compatible (Specification platformSpec, Specification query) { String name = query.getName(); SpecificationVersion version = query.getVersion(); return ((name == null || name.equalsIgnoreCase (platformSpec.getName())) && (version == null || version.equals (platformSpec.getVersion())) && compatibleProfiles (platformSpec.getProfiles(), query.getProfiles())); }