aboutsummaryrefslogtreecommitdiffstats
path: root/gradle/wrapper
Commit message (Expand)AuthorAgeFilesLines
* SONAR-19710 Update the build to Gradle 8.9Julien HENRY2024-08-272-1/+3
* SONAR-15595 Upgrade Gradle wrapper to 7.5.1Zipeng WU2022-12-012-1/+1
* Update gradle version used by the wrapperMalena Ebert2021-02-181-1/+1
* Update gradleMalena Ebert2021-02-041-1/+1
* Update gradle wrapper to version 6.8Malena Ebert2021-01-152-2/+1
* Upgrade Gradle to 6.3Evgeny Mandrikov2020-04-161-1/+1
* upgrade Gradle to 5.6.1Sébastien Lesaint2019-08-301-1/+1
* Upgrade gradle wrapper to 5.4.1Duarte Meneses2019-04-301-1/+1
* SONARCLOUD-422 Integrate bitbucket auth into sonar-enterpriseBenoît Gianinetti2019-03-061-1/+2
* SONAR-11268 replace Jenkins by Cirrus CISimon Brandhof2018-09-192-2/+1
* Introduce Bitbucket Cloud ApplicationJulien HENRY2018-05-161-0/+1
* Move To GradleDavid Rautureau2018-03-092-0/+5
*/ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
import org.aspectj.testing.Tester;

public class OverridingInterfaceObjectMethod {
	private static final int VALUE = 10;
	
	public static void main(String[] args) {
		Identifiable i = new C();
		Tester.checkEqual(i.hashCode(), 42); //System.identityHashCode(i));
		i.setId(new Id(VALUE));
		Tester.checkEqual(i.hashCode(), VALUE);
	}
}

//TODO explore complicated inheritance hierarchies

class C implements Identifiable {}

interface Base { }

interface Identifiable extends Base {
	void setId(Id id);
	Id getId();
}

class Id {
	public Id(int value) {
		this.value = value;
	}
	int value;
}
 
aspect IdentifiableAspect {
	private Id Identifiable.id = null;
	public Id Identifiable.getId() {
       return this.id;
    }
	public void Identifiable.setId(Id id) {
		this.id = id;
	}
 
	public int Identifiable.hashCode() {
		return (this.getId() == null)
			? super.hashCode()
			: this.getId().value;
	}
	
	public int Base.hashCode() {
		return 42;
	}
}