Skip to content

Commit 4520108

Browse files
committed
Minor tweaks
1 parent cb5a3fd commit 4520108

File tree

5 files changed

+5
-8
lines changed

5 files changed

+5
-8
lines changed

src/main/java/bwapi/ClientData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package bwapi;
22
import java.nio.ByteBuffer;
3-
class ClientData {
3+
final class ClientData {
44
private WrappedBuffer buffer;
55
private GameData gameData;
66
ClientData() {

src/main/java/bwapi/FrameBuffer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ class FrameBuffer {
2222
private int stepBot = 0;
2323
private ArrayList<ByteBuffer> dataBuffer = new ArrayList<>();
2424

25-
// Synchronization locks
2625
private final Lock lockWrite = new ReentrantLock();
2726
final Lock lockSize = new ReentrantLock();
2827
final Condition conditionSize = lockSize.newCondition();

src/main/java/bwapi/Unit.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ public Order getOrder() {
10191019

10201020
/**
10211021
* Retrieves the secondary Order that the unit is assigned. Secondary
1022-
* orders are step in the background as a sub-order. An example would be {@link Order#TrainFighter},
1022+
* orders are run in the background as a sub-order. An example would be {@link Order#TrainFighter},
10231023
* because a @Carrier can move and train fighters at the same time.
10241024
*
10251025
* @return The secondary {@link Order} that the unit is executing.

src/test/java/DumpToClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public static void main(String[] args) throws IOException {
9191
try (PrintWriter out = new PrintWriter(sw)) {
9292
out.println("package bwapi;");
9393
out.println("import java.nio.ByteBuffer;");
94-
out.println("class ClientData {");
94+
out.println("final class ClientData {");
9595
out.println(" private WrappedBuffer buffer;");
9696
out.println(" private GameData gameData;");
9797
out.println(" ClientData() {");

src/test/java/bwapi/ClientDataBenchmark.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ public static class EmptyState {
1919

2020
@Setup(Level.Invocation)
2121
public void setup() {
22-
client = new Client(ByteBuffer.allocateDirect(ClientData.GameData.SIZE));
2322
game = new Game();
24-
game.clientData().setBuffer(client.mapFile());
23+
game.clientData().setBuffer(ByteBuffer.allocateDirect(ClientData.GameData.SIZE));
2524
strings = buildStrings();
2625
}
2726

@@ -35,10 +34,9 @@ public static class FilledWithStrings {
3534

3635
@Setup(Level.Invocation)
3736
public void setup() {
38-
client = new Client(ByteBuffer.allocateDirect(ClientData.GameData.SIZE));
3937
data = client.clientData().gameData();
4038
game = new Game();
41-
game.clientData().setBuffer(client.mapFile());
39+
game.clientData().setBuffer(ByteBuffer.allocateDirect(ClientData.GameData.SIZE));
4240
String[] strings = buildStrings();
4341
for (String s : strings) {
4442
GameDataUtils.addString(client.clientData().gameData(), s);

0 commit comments

Comments
 (0)