Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignored warning of tests for deprecated methods #631

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public void testSetSize() {
assertEquals(template, testDimension);
}

@SuppressWarnings("static-method")
@SuppressWarnings({ "static-method", "removal" })
@Test
public void testExpand() {
// check work expand(Dimension)
Expand Down Expand Up @@ -238,7 +238,7 @@ public void testGetCopy() {
assertEquals(template, testDimension);
}

@SuppressWarnings("static-method")
@SuppressWarnings({ "static-method", "removal" })
@Test
public void testGetDifference() {
Dimension template1 = new Dimension(17, 18);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void testConstructorIntInt() {
assertEquals(-1, 2, new Point(-1, 2));
}

@SuppressWarnings("static-method")
@SuppressWarnings({ "static-method", "removal" })
@Test
public void testConstructorDoubleDouble() {
assertEquals((int) Math.PI, (int) -Math.E, new Point(Math.PI, -Math.E));
Expand Down Expand Up @@ -198,7 +198,7 @@ public void testGetDistancePoint() {
assertEquals(5, new Point(-1, -2).getDistance(new Point(-5, 1)), 0);
}

@SuppressWarnings("static-method")
@SuppressWarnings({ "static-method", "removal" })
@Test
public void testGetDistanceOrthogonal() {
assertEquals(53, new Point(10, 20).getDistanceOrthogonal(new Point(51, 32)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ public void testSetSize() {
assertEquals(-100, 200, 1024, 768, testRectangle);
}

@SuppressWarnings("static-method")
@SuppressWarnings({ "static-method", "removal" })
@Test
public void testCrop() {
Rectangle template = new Rectangle(10, 15, 70, 30);
Expand Down Expand Up @@ -504,7 +504,7 @@ public void testTranspose() {
assertEquals(2, 1, 4, 3, template);
}

@SuppressWarnings("static-method")
@SuppressWarnings({ "static-method", "removal" })
@Test
public void testUnionDimension() {
Rectangle template = new Rectangle(1, 2, 3, 4);
Expand Down Expand Up @@ -768,7 +768,7 @@ public void testGetTopRight() {
assertEquals(10, 10, 20, 30, rectangle);
}

@SuppressWarnings("static-method")
@SuppressWarnings({ "static-method", "removal" })
@Test
public void testGetCropped() {
// check work getCropped() with null Insets
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.draw2d/src/org/eclipse/draw2d/Label.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private void calculateLocations() {

calculatePlacement();
calculateAlignment();
Dimension offset = getSize().getDifference(getPreferredSize());
Dimension offset = getSize().getShrinked(getPreferredSize());
offset.width += getTextSize().width - getSubStringTextSize().width;
switch (labelAlignment) {
case CENTER:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
*/
public class Transform {

private double scaleX = 1.0, scaleY = 1.0, dx, dy, cos = 1.0, sin;
private double scaleX = 1.0;
private double scaleY = 1.0;
private double dx;
private double dy;
private double cos = 1.0;
private double sin;

/**
* Sets the value for the amount of scaling to be done along both axes.
Expand Down Expand Up @@ -83,7 +88,7 @@ public Point getTransformed(Point p) {
temp = x * cos - y * sin;
y = x * sin + y * cos;
x = temp;
return new Point(Math.round(x + dx), Math.round(y + dy));
return new Point((int) Math.round(x + dx), (int) Math.round(y + dy));
}

}
Loading