Skip to content

Commit

Permalink
Merge pull request #1111 from amvanbaren/lambda-remove-parentheses
Browse files Browse the repository at this point in the history
(Java) Parentheses should be removed
  • Loading branch information
amvanbaren authored Feb 14, 2025
2 parents ecba15b + 063de4b commit 111bd7b
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ private String builtinExtensionMessage() {
}

private StreamingResponseBody builtinExtensionResponse() {
return (out) -> out.write(builtinExtensionMessage().getBytes(StandardCharsets.UTF_8));
return out -> out.write(builtinExtensionMessage().getBytes(StandardCharsets.UTF_8));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ private Map<Long, String> getChangedPublicIds(Map<Long, String> upstreamPublicId

private void updatePublicIdNulls(Map<Long, String> changedPublicIds, Set<String> newPublicIds, Map<Long, String> publicIdMap) {
// remove unchanged random public ids
changedPublicIds.entrySet().removeIf((e) -> {
changedPublicIds.entrySet().removeIf(e -> {
var publicId = e.getValue() == null ? publicIdMap.get(e.getKey()) : null;
var remove = publicId != null && !newPublicIds.contains(publicId);
if(remove) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public Path getWebResource(String namespace, String extension, String targetPlat
var fileExtIndex = fileEntry.getName().lastIndexOf('.');
var fileExt = fileExtIndex != -1 ? fileEntry.getName().substring(fileExtIndex) : "";
var file = filesCacheKeyGenerator.generateCachedWebResourcePath(namespace, extension, targetPlatform, version, name, fileExt);
FileUtil.writeSync(file, (p) -> {
FileUtil.writeSync(file, p -> {
try (var in = zip.getInputStream(fileEntry)) {
Files.copy(in, p);
} catch(IOException e) {
Expand All @@ -104,7 +104,7 @@ public Path getWebResource(String namespace, String extension, String targetPlat
}

var file = filesCacheKeyGenerator.generateCachedWebResourcePath(namespace, extension, targetPlatform, version, name, ".unpkg.json");
FileUtil.writeSync(file, (p) -> {
FileUtil.writeSync(file, p -> {
var baseUrl = UrlUtil.createApiUrl(UrlUtil.getBaseUrl(), "vscode", "unpkg", namespace, extension, version);
var mapper = new ObjectMapper();
var node = mapper.createArrayNode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public List<SitemapRow> fetchSitemapRows() {
.join(EXTENSION).on(EXTENSION.NAMESPACE_ID.eq(NAMESPACE.ID))
.where(EXTENSION.ACTIVE.eq(true))
.fetch()
.map((row) -> {
.map(row -> {
return new SitemapRow(
row.get(NAMESPACE.NAME),
row.get(EXTENSION.NAME),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ public List<ExtensionVersion> findVersionsForUrls(Extension extension, String ta
}

return query.fetch()
.map((row) -> {
.map(row -> {
var extVersion = new ExtensionVersion();
extVersion.setId(row.get(EXTENSION_VERSION.ID));
extVersion.setVersion(row.get(EXTENSION_VERSION.VERSION));
Expand Down Expand Up @@ -621,7 +621,7 @@ public ExtensionVersion findLatestReplacement(
query.addJoin(EXTENSION, EXTENSION.ID.eq(EXTENSION_VERSION.EXTENSION_ID));
query.addJoin(NAMESPACE, NAMESPACE.ID.eq(EXTENSION.NAMESPACE_ID));
query.addConditions(EXTENSION_VERSION.EXTENSION_ID.eq(extensionId));
return query.fetchOne((row) -> {
return query.fetchOne(row -> {
var namespace = new Namespace();
namespace.setId(row.get(NAMESPACE.ID));
namespace.setName(row.get(NAMESPACE.NAME));
Expand Down Expand Up @@ -686,7 +686,7 @@ public ExtensionVersion findLatest(
query.addJoin(USER_DATA, USER_DATA.ID.eq(PERSONAL_ACCESS_TOKEN.USER_DATA));
query.addJoin(SIGNATURE_KEY_PAIR, JoinType.LEFT_OUTER_JOIN, SIGNATURE_KEY_PAIR.ID.eq(EXTENSION_VERSION.SIGNATURE_KEY_PAIR_ID));
query.addConditions(EXTENSION_VERSION.EXTENSION_ID.eq(extension.getId()));
return query.fetchOne((row) -> toExtensionVersionFull(row, extension, null));
return query.fetchOne(row -> toExtensionVersionFull(row, extension, null));
}

public ExtensionVersion findLatest(
Expand Down Expand Up @@ -1063,7 +1063,7 @@ public ExtensionVersion findLatestForAllUrls(
EXTENSION_VERSION.VERSION,
EXTENSION_VERSION.PREVIEW
);
return query.fetchOne((row) -> {
return query.fetchOne(row -> {
if(row == null) {
return null;
}
Expand Down Expand Up @@ -1173,7 +1173,7 @@ public ExtensionVersion find(String namespaceName, String extensionName, String
query.addConditions(EXTENSION_VERSION.VERSION.eq(version));
}

return query.fetchOne((row) -> {
return query.fetchOne(row -> {
var extVersion = toExtensionVersionFull(row);
extVersion.getExtension().setDeprecated(row.get(EXTENSION.DEPRECATED));
extVersion.getExtension().setDownloadable(row.get(EXTENSION.DOWNLOADABLE));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public Path getCachedFile(FileResource resource) {
.build();

var path = filesCacheKeyGenerator.generateCachedExtensionPath(resource);
FileUtil.writeSync(path, (p) -> {
FileUtil.writeSync(path, p -> {
try (var stream = getS3Client().getObject(request)) {
Files.copy(stream, p);
} catch(IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public Path getCachedFile(FileResource resource) {
}

var path = filesCacheKeyGenerator.generateCachedExtensionPath(resource);
FileUtil.writeSync(path, (p) -> {
FileUtil.writeSync(path, p -> {
getContainerClient().getBlobClient(blobName).downloadToFile(p.toAbsolutePath().toString());
});
return path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public Path getCachedFile(FileResource resource) {

var objectId = getObjectId(resource);
var path = filesCacheKeyGenerator.generateCachedExtensionPath(resource);
FileUtil.writeSync(path, (p) -> {
FileUtil.writeSync(path, p -> {
getStorage().downloadTo(BlobId.of(bucketId, objectId), p);
});

Expand Down

0 comments on commit 111bd7b

Please sign in to comment.