Skip to content

Commit daaa02b

Browse files
authored
Add a spotless formatter to shorten uncessary FQNs (#1209)
* Add a spotless formatter to shorten uncessary FQNs * Auto-format: apply spotless formatting
1 parent 892f924 commit daaa02b

26 files changed

Lines changed: 1503 additions & 57 deletions

File tree

aws/aws-service-bundler/src/main/java/software/amazon/smithy/java/aws/servicebundle/bundler/AwsServiceBundler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public SmithyBundle bundle() {
186186
}
187187
}
188188

189-
private static String serializeModel(software.amazon.smithy.model.Model model) {
189+
private static String serializeModel(Model model) {
190190
return ObjectNode.printJson(ModelSerializer.builder()
191191
.build()
192192
.serialize(model));

aws/client/aws-client-restxml/src/it/java/software/amazon/smithy/java/aws/client/restxml/RestXmlProtocolTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.w3c.dom.NamedNodeMap;
2121
import org.w3c.dom.Node;
2222
import org.w3c.dom.NodeList;
23+
import org.xml.sax.InputSource;
2324
import software.amazon.smithy.java.io.ByteBufferUtils;
2425
import software.amazon.smithy.java.io.datastream.DataStream;
2526
import software.amazon.smithy.java.protocoltests.harness.HttpClientRequestTests;
@@ -80,7 +81,7 @@ private static Document parseXML(String xml) throws Exception {
8081
dbf.setIgnoringElementContentWhitespace(true);
8182

8283
DocumentBuilder db = dbf.newDocumentBuilder();
83-
return db.parse(new org.xml.sax.InputSource(new StringReader(xml)));
84+
return db.parse(new InputSource(new StringReader(xml)));
8485
}
8586

8687
private static void removeWhitespaceNodes(Node node) {

aws/server/aws-server-restjson/src/main/java/software/amazon/smithy/java/aws/server/restjson/router/BasicPathRouteMatcher.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import java.util.ArrayList;
99
import java.util.List;
1010
import java.util.Objects;
11+
import java.util.regex.Matcher;
1112
import java.util.regex.Pattern;
1213
import software.amazon.smithy.java.aws.server.restjson.router.PathPattern.Segment;
1314

@@ -40,7 +41,7 @@ public int getRank() {
4041

4142
@Override
4243
public Match match(String path) {
43-
java.util.regex.Matcher m = pattern.matcher(path);
44+
Matcher m = pattern.matcher(path);
4445

4546
if (!m.matches()) {
4647
return null;

benchmarks/serde-benchmarks/src/jmh/java/software/amazon/smithy/java/benchmarks/serde/JmhResultConverter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
package software.amazon.smithy.java.benchmarks.serde;
77

8+
import com.sun.management.OperatingSystemMXBean;
89
import java.io.IOException;
910
import java.io.PrintWriter;
1011
import java.lang.management.ManagementFactory;
@@ -289,7 +290,7 @@ private static String detectMachineInfo() {
289290

290291
// Fall back to cores + RAM summary
291292
int cores = Runtime.getRuntime().availableProcessors();
292-
long ramMb = ManagementFactory.getOperatingSystemMXBean() instanceof com.sun.management.OperatingSystemMXBean os
293+
long ramMb = ManagementFactory.getOperatingSystemMXBean() instanceof OperatingSystemMXBean os
293294
? os.getTotalMemorySize() / (1024 * 1024)
294295
: Runtime.getRuntime().maxMemory() / (1024 * 1024);
295296
String ramLabel = ramMb >= 1024 ? (ramMb / 1024) + "GB" : ramMb + "MB";

buildSrc/build.gradle.kts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
`kotlin-dsl`
3+
`java-library`
34
}
45

56
repositories {
@@ -17,4 +18,15 @@ dependencies {
1718

1819
// https://github.com/gradle/gradle/issues/15383
1920
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
21+
22+
testImplementation("org.junit.jupiter:junit-jupiter:5.11.4")
23+
testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.11.4")
24+
}
25+
26+
tasks.test {
27+
useJUnitPlatform()
28+
}
29+
30+
tasks.withType<JavaCompile>().configureEach {
31+
options.release.set(21)
2032
}

0 commit comments

Comments
 (0)