Skip to content

Commit

Permalink
Remove unused private no-args constructors
Browse files Browse the repository at this point in the history
See merge request main/Sumatra!1876

sumatra-commit: c58d1fc35a2e858456f294b931709c78cc2c1f56
  • Loading branch information
g3force authored and TIGERs GitLab committed Sep 11, 2024
1 parent 2edac18 commit 80ae680
Show file tree
Hide file tree
Showing 53 changed files with 97 additions and 776 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import edu.tigers.sumatra.data.collector.IExportable;
import edu.tigers.sumatra.math.IMirrorable;
import edu.tigers.sumatra.math.vector.IVector2;
import edu.tigers.sumatra.math.vector.Vector2;
import lombok.AllArgsConstructor;
import lombok.Value;

Expand All @@ -29,13 +28,6 @@ public class BotBallState implements IMirrorable<BotBallState>, IExportable
/** Latency of reported position in [s]. Not including network and Sumatra delays. */
double age;

@SuppressWarnings("unused")
private BotBallState()
{
pos = Vector2.zero();
age = 0;
}

@Override
public BotBallState mirrored()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,6 @@ public class RobotInfo implements IMirrorable<RobotInfo>
private final BotBallState ballState;


@SuppressWarnings("unused")
private RobotInfo()
{
this(BotID.noBot(), 0);
}


private RobotInfo(final BotID botId, final long timestamp)
{
this.botId = botId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,16 @@
import edu.tigers.sumatra.math.vector.IVector2;
import edu.tigers.sumatra.math.vector.IVector3;
import edu.tigers.sumatra.math.vector.Vector2;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;


/**
* Bot related calculations.
*
* @author nicolai.ommer
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class BotMath
{
@SuppressWarnings("unused")
private BotMath()
{
}


/**
* Convert a bot-local vector to the equivalent global one.
*
Expand All @@ -36,8 +31,8 @@ public static Vector2 convertLocalBotVector2Global(final IVector2 local, final d
{
return local.turnNew(-AngleMath.PI_HALF + wpAngle);
}


/**
* Convert a global vector to a bot-local one
*
Expand All @@ -50,11 +45,11 @@ public static Vector2 convertGlobalBotVector2Local(final IVector2 global, final
{
return global.turnNew(AngleMath.PI_HALF - wpAngle);
}


/**
* Get front dribbler line of a robot.
*
*
* @param pos Position [mm] and orientation of robot [rad]
* @param radius Radius [mm] or robot
* @param center2DribblerDist Distance from center to dribbler.
Expand All @@ -68,7 +63,7 @@ public static ILineSegment getDribblerFrontLine(final IVector3 pos, final double
.addNew(Vector2.fromAngle(pos.z() - theta).scaleTo(radius));
IVector2 rightBotEdge = pos.getXYVector()
.addNew(Vector2.fromAngle(pos.z() + theta).scaleTo(radius));

return Lines.segmentFromPoints(leftBotEdge, rightBotEdge);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,20 @@

package edu.tigers.sumatra.math;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;


/**
* Utility for statistics math
*
* @author nicolai.ommer
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class StatisticsMath
{

@SuppressWarnings("unused")
private StatisticsMath()
{
}


/**
* Calculate mean value
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,6 @@ public class Arc implements IArc
private final double radius;


/**
* Used by berkely
*/
@SuppressWarnings("unused")
protected Arc()
{
center = Vector2f.ZERO_VECTOR;
radius = 1;
startAngle = 0;
rotation = 1;
}


/**
* @param center
* @param radius
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import edu.tigers.sumatra.math.vector.IVector2;
import edu.tigers.sumatra.math.vector.Vector2;
import edu.tigers.sumatra.math.vector.Vector2f;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -21,18 +23,10 @@
/**
* Circle related calculations.
* Please consider using the methods from {@link ICircle} instead of these static methods!
*
* @author nicolai.ommer
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class CircleMath
{

@SuppressWarnings("unused")
private CircleMath()
{
}


/**
* Get the intersection points of the two tangential lines that cross the external points.
*
Expand Down Expand Up @@ -185,7 +179,7 @@ public static IVector2 nearestPointOnArcLine(final IArc arc, final IVector2 poin
return endPoint;
} else if (intersections.size() == 1)
{
return intersections.get(0);
return intersections.getFirst();
}
throw new IllegalArgumentException(
"More than one intersection between half line starting from within a circle, this is impossible");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
import edu.tigers.sumatra.math.vector.Vector2;
import edu.tigers.sumatra.math.vector.Vector2f;
import edu.tigers.sumatra.math.vector.VectorMath;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.extern.log4j.Log4j2;

import java.util.Optional;

Expand All @@ -20,17 +21,10 @@
* This class groups all Line related calculations.
* Please consider using the methods from {@link ILine} instead of these static methods!
*/
@Log4j2
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class LineMath
{
private static final Logger log = LogManager.getLogger(LineMath.class.getName());


@SuppressWarnings("unused")
private LineMath()
{
}


/**
* calculates a point on a line between start and end, that is stepSize away from start
* calculation is based on Intercept theorem (Strahlensatz)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

/**
* Implementation of the {@link ILineSegment} interface. It provides a factory method to create new instances.
*
* @author Lukas Magel
*/
final class LineSegment extends ALine implements ILineSegment
{
Expand All @@ -34,18 +32,6 @@ final class LineSegment extends ALine implements ILineSegment
private transient IVector2 directionVector;


/**
* Used by berkely
*/
@SuppressWarnings("unused")
private LineSegment()
{
start = Vector2f.ZERO_VECTOR;
end = Vector2f.ZERO_VECTOR;
valid = false;
}


private LineSegment(final IVector2 start, final IVector2 end)
{
this.start = Vector2f.copy(start);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import edu.tigers.sumatra.math.rectangle.Rectangle;
import edu.tigers.sumatra.math.vector.IVector2;
import edu.tigers.sumatra.math.vector.Vector2;
import edu.tigers.sumatra.math.vector.Vector2f;
import lombok.Getter;


Expand All @@ -24,16 +23,6 @@ public abstract class APenaltyArea implements IPenaltyArea
private final double depth;


/**
* Used by berkely
*/
@SuppressWarnings("unused")
private APenaltyArea()
{
this(Vector2f.ZERO_VECTOR, 1, 2);
}


/**
* Creates a PenaltyArea
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import edu.tigers.sumatra.math.line.Lines;
import edu.tigers.sumatra.math.vector.IVector2;
import edu.tigers.sumatra.math.vector.Vector2;
import edu.tigers.sumatra.math.vector.Vector2f;

import java.util.List;

Expand All @@ -18,16 +17,6 @@
*/
public class PenaltyArea extends APenaltyArea
{
/**
* Used by berkely
*/
@SuppressWarnings("unused")
private PenaltyArea()
{
super(Vector2f.ZERO_VECTOR, 1, 2);
}


/**
* Creates a PenaltyArea
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import edu.tigers.sumatra.math.rectangle.Rectangle;
import edu.tigers.sumatra.math.vector.IVector2;
import edu.tigers.sumatra.math.vector.Vector2;
import edu.tigers.sumatra.math.vector.Vector2f;

import java.util.List;

Expand All @@ -28,16 +27,6 @@ public class PenaltyAreaRoundedCorners extends APenaltyArea
private final IArc posArc; // Positive y for PenAreaOur


/**
* Used by berkely
*/
@SuppressWarnings("unused")
private PenaltyAreaRoundedCorners()
{
this(Vector2f.ZERO_VECTOR, 1, 2, 1);
}


public PenaltyAreaRoundedCorners(IVector2 goalCenter, double depth, double length, double radius)
{
super(goalCenter, depth, length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ public final class Quadrilateral implements IQuadrilateral
private final List<IVector2> corners;


@SuppressWarnings("unused")
private Quadrilateral()
{
this.corners = new ArrayList<>();
}


private Quadrilateral(final List<IVector2> corners)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

/**
* Immutable implementation of {@link ITriangle}.
*
* @author Malte
*/
public final class Triangle implements ITriangle
{
Expand All @@ -31,16 +29,6 @@ public final class Triangle implements ITriangle
private final List<IVector2> corners;


@SuppressWarnings("unused")
private Triangle()
{
a = null;
b = null;
c = null;
corners = null;
}


/**
* @param a
* @param b
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import edu.tigers.sumatra.math.line.Lines;
import edu.tigers.sumatra.math.vector.IVector2;
import edu.tigers.sumatra.math.vector.Vector2;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;

import java.util.List;

Expand All @@ -16,15 +18,9 @@
* Triangle related calculations.
* Please consider using the methods from {@link ITriangle} instead of these static methods!
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class TriangleMath
{

@SuppressWarnings("unused")
private TriangleMath()
{
}


/**
* Create a new triangle by adding a margin.<br>
* The margin triangle is calculated by creating new edge lines that are spaced {@code margin} mm from the original
Expand Down
Loading

0 comments on commit 80ae680

Please sign in to comment.