Skip to content

Commit

Permalink
[docs] Fix warnings about undocumented default constructors (#6151)
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul authored Jan 4, 2024
1 parent 0f060af commit 4210f56
Show file tree
Hide file tree
Showing 17 changed files with 55 additions and 3 deletions.
3 changes: 3 additions & 0 deletions cscore/src/main/java/edu/wpi/first/cscore/VideoCamera.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ public static class WhiteBalance {
public static final int kFixedOutdoor2 = 5000;
public static final int kFixedFluorescent1 = 5100;
public static final int kFixedFlourescent2 = 5200;

/** Default constructor. */
public WhiteBalance() {}
}

protected VideoCamera(int handle) {
Expand Down
5 changes: 4 additions & 1 deletion hal/src/generate/FRCNetComm.java.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package edu.wpi.first.hal;
/**
* JNI wrapper for library <b>FRC_NetworkCommunication</b><br>.
*/
public class FRCNetComm {
public final class FRCNetComm {
/**
* Resource type from UsageReporting.
*/
Expand All @@ -31,4 +31,7 @@ ${usage_reporting_types}

${usage_reporting_instances}
}

/** Utility class. */
private FRCNetComm() {}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion hal/src/main/java/edu/wpi/first/hal/CANAPITypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
* <p>This class defines enums for CAN device types and manufacturer IDs as specified in the WPILib
* documentation: https://docs.wpilib.org/en/stable/docs/software/can-devices/can-addressing.html
*/
public class CANAPITypes {
@SuppressWarnings("PMD.MissingStaticMethodInNonInstantiatableClass")
public final class CANAPITypes {
/**
* FRC CAN device type.
*
Expand Down Expand Up @@ -80,4 +81,7 @@ public enum CANManufacturer {
this.id = id;
}
}

/** Utility class. */
private CANAPITypes() {}
}
3 changes: 3 additions & 0 deletions hal/src/main/java/edu/wpi/first/hal/CANData.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ public class CANData {
/** CAN frame timestamp in milliseconds. */
public long timestamp;

/** Default constructor. */
public CANData() {}

/**
* API used from JNI to set the data.
*
Expand Down
3 changes: 3 additions & 0 deletions hal/src/main/java/edu/wpi/first/hal/CANStreamMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ public class CANStreamMessage {
@SuppressWarnings("MemberName")
public int messageID;

/** Default constructor. */
public CANStreamMessage() {}

/**
* API used from JNI to set the data.
*
Expand Down
3 changes: 3 additions & 0 deletions hal/src/main/java/edu/wpi/first/hal/ControlWord.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ public class ControlWord {
private boolean m_fmsAttached;
private boolean m_dsAttached;

/** Default constructor. */
public ControlWord() {}

void update(
boolean enabled,
boolean autonomous,
Expand Down
3 changes: 3 additions & 0 deletions hal/src/main/java/edu/wpi/first/hal/DMAJNISample.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ static class BaseStore {
private long m_timeStamp;
private Map<Integer, BaseStore> m_propertyMap = new HashMap<>();

/** Default constructor. */
public DMAJNISample() {}

public int update(int dmaHandle, double timeoutSeconds) {
m_timeStamp = DMAJNI.readDMA(dmaHandle, timeoutSeconds, m_dataBuffer, m_storage);
return m_storage[25];
Expand Down
3 changes: 3 additions & 0 deletions hal/src/main/java/edu/wpi/first/hal/MatchInfoData.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ public class MatchInfoData {
/** Stores the match type. */
public int matchType;

/** Default constructor. */
public MatchInfoData() {}

/**
* Called from JNI to set the structure data.
*
Expand Down
3 changes: 3 additions & 0 deletions hal/src/main/java/edu/wpi/first/hal/can/CANJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public class CANJNI extends JNIWrapper {
public static final int CAN_IS_FRAME_REMOTE = 0x80000000;
public static final int CAN_IS_FRAME_11BIT = 0x40000000;

/** Default constructor. */
public CANJNI() {}

/**
* Sends a CAN message.
*
Expand Down
3 changes: 3 additions & 0 deletions hal/src/main/java/edu/wpi/first/hal/can/CANStatus.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ public class CANStatus {
/** The CAN Bus transmit error count. */
public int transmitErrorCount;

/** Default constructor. */
public CANStatus() {}

/**
* Set CAN bus status.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ public class NIRioStatus {
public static final int kRIOStatusOperationTimedOut = -52007;
public static final int kRIOStatusFeatureNotSupported = kRioStatusOffset - 193;
public static final int kRIOStatusResourceNotInitialized = -52010;

/** Default constructor. */
public NIRioStatus() {}
}
3 changes: 3 additions & 0 deletions wpilibj/src/main/java/edu/wpi/first/wpilibj/DMASample.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ public static DMAReadStatus getValue(int value) {

private final DMAJNISample m_dmaSample = new DMAJNISample();

/** Default constructor. */
public DMASample() {}

public DMAReadStatus update(DMA dma, double timeoutSeconds) {
return DMAReadStatus.getValue(m_dmaSample.update(dma.m_dmaHandle, timeoutSeconds));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
* source. The source can either be a digital input or analog trigger but not both.
*/
public abstract class DigitalSource implements AutoCloseable {
/** Default constructor. */
public DigitalSource() {}

/**
* Returns true if this DigitalSource is an AnalogTrigger.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ public final class EventLoop {
private final Collection<Runnable> m_bindings = new LinkedHashSet<>();
private boolean m_running;

/** Default constructor. */
public EventLoop() {}

/**
* Bind a new action to run when the loop is polled.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ void update(boolean controllable, long time) {

private final List<AutoCloseable> m_closeables = new ArrayList<>();

/** Default constructor. */
public SendableBuilderImpl() {}

@Override
@SuppressWarnings("PMD.AvoidCatchingGenericException")
public void close() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ public class LongToObjectHashMap<V> {
@SuppressWarnings("unchecked")
private V[] m_values = (V[]) new Object[m_capacity];

/** Default constructor. */
public LongToObjectHashMap() {}

/**
* Puts a value {@code value} corresponding to key {@code key} in the map.
*
Expand Down

0 comments on commit 4210f56

Please sign in to comment.