Skip to content

Commit 59c39d0

Browse files
committed
Revert "Adapt to SnowflakeId.generateId() switching its return type from String to long"
This reverts commit 6449282.
1 parent 50e53e4 commit 59c39d0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

rewrite-core/src/main/java/org/openrewrite/rpc/RewriteRpc.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ private <P> String maybeUnwrapExecutionContext(P p) {
154154
while (p2 instanceof DelegatingExecutionContext) {
155155
p2 = ((DelegatingExecutionContext) p2).getDelegate();
156156
}
157-
String pId = localObjectIds.computeIfAbsent(p2, p3 -> Long.toString(SnowflakeId.generateId()));
157+
String pId = localObjectIds.computeIfAbsent(p2, p3 -> SnowflakeId.generateId());
158158
if (p2 instanceof ExecutionContext) {
159159
((ExecutionContext) p2).putMessage("org.openrewrite.rpc.id", pId);
160160
}
@@ -188,7 +188,7 @@ List<String> getCursorIds(@Nullable Cursor cursor) {
188188
cursorIds = cursor.getPathAsStream().map(c -> {
189189
String id = c instanceof Tree ?
190190
((Tree) c).getId().toString() :
191-
localObjectIds.computeIfAbsent(c, c2 -> Long.toString(SnowflakeId.generateId()));
191+
localObjectIds.computeIfAbsent(c, c2 -> SnowflakeId.generateId());
192192
localObjects.put(id, c);
193193
return id;
194194
}).collect(Collectors.toList());

rewrite-core/src/main/java/org/openrewrite/rpc/request/PrepareRecipe.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static class Handler extends JsonRpcMethod<PrepareRecipe> {
3737
@Override
3838
protected Object handle(PrepareRecipe request) throws Exception {
3939
Recipe recipe = new RecipeLoader(null).load(request.getId(), request.getOptions());
40-
String instanceId = Long.toString(SnowflakeId.generateId());
40+
String instanceId = SnowflakeId.generateId();
4141
preparedRecipes.put(instanceId, recipe);
4242
return new PrepareRecipeResponse(instanceId, recipe.getDescriptor(),
4343
"edit:" + instanceId,

0 commit comments

Comments
 (0)