Skip to content

Commit 099a38a

Browse files
tweak "strong" wrapper type
1 parent 53cde44 commit 099a38a

File tree

14 files changed

+81
-101
lines changed

14 files changed

+81
-101
lines changed

luceedebug/src/main/java/luceedebug/Agent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ public static void premain(String argString, Instrumentation inst) throws Throwa
237237
//
238238
// See(lucee): loader/src/main/java/lucee/loader/engine/CFMLEngineFactory.java
239239
//
240-
System.setProperty("org.osgi.framework.bootdelegation", "com.sun.jdi,com.sun.jdi.connect,com.sun.jdi.event,com.sun.jdi.request,luceedebug,luceedebug_shadow.*");
240+
System.setProperty("org.osgi.framework.bootdelegation", "com.sun.jdi,com.sun.jdi.connect,com.sun.jdi.event,com.sun.jdi.request,luceedebug,luceedebug.strong,luceedebug_shadow.*");
241241

242242
// touch System.out before agent is loaded, otherwise trying to print from within the agent during jvm initialization phase
243243
// can trigger stackoverflows. And note that System.out.println("") doesn't seem to work, as if printing the empty string

luceedebug/src/main/java/luceedebug/DapServer.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626

2727
import com.sun.jdi.ObjectCollectedException;
2828

29+
import luceedebug.strong.CanonicalServerAbsPath;
30+
import luceedebug.strong.RawIdePath;
31+
2932
public class DapServer implements IDebugProtocolServer {
3033
private final ILuceeVm luceeVm_;
3134
private final Config config_;
@@ -70,19 +73,19 @@ private DapServer(ILuceeVm luceeVm, Config config) {
7073
this.config_ = config;
7174

7275
this.luceeVm_.registerStepEventCallback(jdwpThreadID -> {
73-
final var i32_threadID = (int)(long)jdwpThreadID.v;
76+
final var i32_threadID = (int)(long)jdwpThreadID.get();
7477
var event = new StoppedEventArguments();
7578
event.setReason("step");
7679
event.setThreadId(i32_threadID);
7780
clientProxy_.stopped(event);
7881
});
7982

8083
this.luceeVm_.registerBreakpointEventCallback((jdwpThreadID, bpID) -> {
81-
final int i32_threadID = (int)(long)jdwpThreadID.v;
84+
final int i32_threadID = (int)(long)jdwpThreadID.get();
8285
var event = new StoppedEventArguments();
8386
event.setReason("breakpoint");
8487
event.setThreadId(i32_threadID);
85-
event.setHitBreakpointIds(new Integer[] { bpID.v });
88+
event.setHitBreakpointIds(new Integer[] { bpID.get() });
8689
clientProxy_.stopped(event);
8790
});
8891

@@ -376,10 +379,10 @@ public CompletableFuture<VariablesResponse> variables(VariablesArguments args) {
376379

377380
@Override
378381
public CompletableFuture<SetBreakpointsResponse> setBreakpoints(SetBreakpointsArguments args) {
379-
final var idePath = new StrongString.RawIdePath(args.getSource().getPath());
380-
final var serverAbsPath = new StrongString.CanonicalServerAbsPath(applyPathTransformsIdeToCf(args.getSource().getPath()));
382+
final var idePath = new RawIdePath(args.getSource().getPath());
383+
final var serverAbsPath = new CanonicalServerAbsPath(applyPathTransformsIdeToCf(args.getSource().getPath()));
381384

382-
logger.finest("bp for " + idePath.v + " -> " + serverAbsPath.v);
385+
logger.finest("bp for " + idePath.get() + " -> " + serverAbsPath.get());
383386

384387
final int size = args.getBreakpoints().length;
385388
final int[] lines = new int[size];

luceedebug/src/main/java/luceedebug/ILuceeVm.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
import com.sun.jdi.*;
77

8-
import luceedebug.StrongInt.DapBreakpointID;
9-
import luceedebug.StrongLong.JdwpThreadID;
10-
import luceedebug.StrongString.CanonicalServerAbsPath;
11-
import luceedebug.StrongString.RawIdePath;
8+
import luceedebug.strong.DapBreakpointID;
9+
import luceedebug.strong.JdwpThreadID;
10+
import luceedebug.strong.CanonicalServerAbsPath;
11+
import luceedebug.strong.RawIdePath;
1212

1313
public interface ILuceeVm {
1414
public void registerStepEventCallback(Consumer<JdwpThreadID> cb);

luceedebug/src/main/java/luceedebug/StrongInt.java

Lines changed: 0 additions & 24 deletions
This file was deleted.

luceedebug/src/main/java/luceedebug/StrongLong.java

Lines changed: 0 additions & 28 deletions
This file was deleted.

luceedebug/src/main/java/luceedebug/StrongString.java

Lines changed: 0 additions & 30 deletions
This file was deleted.

luceedebug/src/main/java/luceedebug/coreinject/Breakpoint.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package luceedebug.coreinject;
22

33
import luceedebug.*;
4-
import luceedebug.StrongInt.DapBreakpointID;
4+
import luceedebug.strong.DapBreakpointID;
55

66
class Breakpoint implements IBreakpoint {
77
final int line;
@@ -23,6 +23,6 @@ public static Breakpoint Unbound(int line, DapBreakpointID ID) {
2323
}
2424

2525
public int getLine() { return line; }
26-
public int getID() { return ID.v; }
26+
public int getID() { return ID.get(); }
2727
public boolean getIsBound() { return isBound; }
2828
}

luceedebug/src/main/java/luceedebug/coreinject/KlassMap.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import java.util.HashMap;
44

55
import luceedebug.Config;
6-
import luceedebug.StrongString.CanonicalServerAbsPath;
6+
import luceedebug.strong.CanonicalServerAbsPath;
77

88
import com.sun.jdi.*;
99

luceedebug/src/main/java/luceedebug/coreinject/LuceeVm.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
import static luceedebug.coreinject.Iife.iife;
2929

3030
import luceedebug.*;
31-
import luceedebug.StrongInt.DapBreakpointID;
32-
import luceedebug.StrongLong.JdwpThreadID;
33-
import luceedebug.StrongString.CanonicalServerAbsPath;
34-
import luceedebug.StrongString.RawIdePath;
31+
import luceedebug.strong.DapBreakpointID;
32+
import luceedebug.strong.JdwpThreadID;
33+
import luceedebug.strong.CanonicalServerAbsPath;
34+
import luceedebug.strong.RawIdePath;
3535

3636
public class LuceeVm implements ILuceeVm {
3737
// This is a key into a map stored on breakpointRequest objects; the value should always be of Integer type
@@ -1080,7 +1080,7 @@ public String[] getTrackedCanonicalFileNames() {
10801080
final var result = new ArrayList<String>();
10811081
for (var klassMap : klassMap_.values()) {
10821082
for (var mapping : klassMap) {
1083-
result.add(mapping.sourceName.v);
1083+
result.add(mapping.sourceName.get());
10841084
}
10851085
}
10861086
return result.toArray(size -> new String[size]);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package luceedebug.strong;
2+
3+
public final class CanonicalServerAbsPath extends StrongT<String> {
4+
public CanonicalServerAbsPath(String v) {
5+
super(v);
6+
}
7+
}

0 commit comments

Comments
 (0)