0
嗨,我有与@Raw注释此应用程序。我的问题是,如果以下代码中的这两个函数由于RAW注释和WHY而有效? this.setX(some.getX());或some.setX(this.getX());原始功能如何使用它们
/**
* @invar …
* | getX() <= 0
*/
public class SomeClass {
@Raw
public float getX() {
return this.x;
}
public void setX(float x) throws IllegalArgumentException {
if (x > 0)
throw new IllegalArgumentException();
this.x = x;
}
private float x;
@Raw
public void someMethod(SomeClass some) throws NullPointerException {
this.setX(some.getX());
some.setX(this.getX());
}
}