Skip to content

Commit 8f4709d

Browse files
SamCarlbergJLLeitschuh
authored andcommitted
Fix publishing operations being able to take any data type (#610)
1 parent 946d8bc commit 8f4709d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

core/src/main/java/edu/wpi/grip/core/operations/network/NetworkPublishOperation.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import edu.wpi.grip.core.util.Icon;
1010

1111
import com.google.common.collect.ImmutableList;
12-
import com.google.common.reflect.TypeToken;
1312

1413
import java.util.List;
1514

@@ -33,16 +32,15 @@ public abstract class NetworkPublishOperation<D> implements Operation {
3332
protected final Class<D> dataType;
3433
protected final InputSocket<D> dataSocket;
3534
protected final InputSocket<String> nameSocket;
36-
private final SocketHint<D> dataHint =
37-
new SocketHint.Builder<>((Class<D>) new TypeToken<D>(getClass()) {
38-
}.getRawType())
39-
.identifier("Data")
40-
.build();
4135
private final SocketHint<String> nameHint = SocketHints.Inputs.createTextSocketHint("Name", "");
4236

4337
protected NetworkPublishOperation(InputSocket.Factory isf, Class<D> dataType) {
4438
checkNotNull(isf);
4539
checkNotNull(dataType);
40+
final SocketHint<D> dataHint =
41+
new SocketHint.Builder<>(dataType)
42+
.identifier("Data")
43+
.build();
4644
this.dataType = dataType;
4745
this.dataSocket = isf.create(dataHint);
4846
this.nameSocket = isf.create(nameHint);

0 commit comments

Comments
 (0)