Skip to content

Commit b8010a6

Browse files
authored
Surround manual code with Eclipse formatter off in partial update (#2685)
Surround manual code with Eclipse formatter off in partial update
1 parent d35b3d8 commit b8010a6

File tree

15 files changed

+323
-126
lines changed

15 files changed

+323
-126
lines changed

customization-base/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<dependency>
5454
<groupId>com.github.javaparser</groupId>
5555
<artifactId>javaparser-core</artifactId>
56-
<version>3.25.6</version>
56+
<version>3.25.10</version>
5757
</dependency>
5858
<dependency>
5959
<groupId>org.apache.ant</groupId>

javagen/src/main/java/com/azure/autorest/template/PackageInfoTemplate.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.azure.autorest.extension.base.plugin.JavaSettings;
88
import com.azure.autorest.model.clientmodel.PackageInfo;
99
import com.azure.autorest.model.javamodel.JavaFile;
10+
import com.azure.autorest.partialupdate.util.PartialUpdateHandler;
1011

1112
import java.util.regex.Pattern;
1213

@@ -35,15 +36,15 @@ public final void write(PackageInfo packageInfo, JavaFile javaFile) {
3536

3637
javaFile.javadocComment((comment) -> {
3738
if (settings.isHandlePartialUpdate()) {
38-
comment.line("<!-- start generated doc -->");
39+
comment.line(PartialUpdateHandler.START_GENERATED_JAVA_DOC);
3940
}
4041

4142
for (String desc : NEW_LINE.split(packageInfo.getDescription(), -1)) {
4243
comment.description(desc);
4344
}
4445

4546
if (settings.isHandlePartialUpdate()) {
46-
comment.line("<!-- end generated doc -->");
47+
comment.line(PartialUpdateHandler.END_GENERATED_JAVA_DOC);
4748
}
4849
});
4950

partial-update-tests/existing/src/main/java/fixtures/bodystring/implementation/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Code generated by Microsoft (R) AutoRest Code Generator.
44

55
/**
6-
* Some other custom Javadocs which shouldn't be overwritten as they aren't contained in the generated Javadoc block.
6+
* Some other custom Javadocs which shouldn't be overwritten as they aren't contained in the generated Javadoc block. And it shouldn't be formatted.
77
* <p>
88
* <!-- start generated doc -->
99
* Package containing the implementations for AutoRestSwaggerBatService. Test Infrastructure for AutoRest Swagger BAT.

partial-update-tests/existing/src/main/java/fixtures/bodystring/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
* Package containing the classes for AutoRestSwaggerBatService. Test Infrastructure for AutoRest Swagger BAT.
88
* <!-- end generated doc -->
99
* <p>
10-
* Some other custom Javadocs which shouldn't be overwritten as they aren't contained in the generated Javadoc block.
10+
* Some other custom Javadocs which shouldn't be overwritten as they aren't contained in the generated Javadoc block. And it shouldn't be formatted.
1111
* */
1212
package fixtures.bodystring;

partial-update-tests/generated/src/main/java/fixtures/bodystring/StringOperationClient.java

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@
2323
@ServiceClient(builder = AutoRestSwaggerBatServiceClientBuilder.class)
2424
public final class StringOperationClient {
2525

26+
// @formatter:off
2627
// 1. manually add one field
27-
private EnumsImpl enumClient;
28+
private EnumsImpl enumClient;// @formatter:on
2829

30+
// @formatter:off
2931
/**
3032
* 1. manually add one constructor
3133
*
@@ -34,7 +36,7 @@ public final class StringOperationClient {
3436
*/
3537
StringOperationClient(StringOperationsImpl serviceClient, String test) {
3638
this.serviceClient = serviceClient;
37-
}
39+
}// @formatter:on
3840

3941
@Generated
4042
private final StringOperationsImpl serviceClient;
@@ -70,16 +72,16 @@ public Response<BinaryData> getNullWithResponse(RequestOptions requestOptions) {
7072
return this.serviceClient.getNullWithResponse(requestOptions);
7173
}
7274

75+
// @formatter:off
7376
/**
7477
* 2. manually update method signature
7578
*
7679
* <p><strong>Header Parameters</strong>
7780
*
7881
* <table border="1">
79-
* <caption>Header Parameters</caption>
80-
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
81-
* <tr><td>Content-Type</td><td>String</td><td>No</td><td>The content type. Allowed values:
82-
* "application/json".</td></tr>
82+
* <caption>Header Parameters</caption>
83+
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
84+
* <tr><td>Content-Type</td><td>String</td><td>No</td><td>The content type. Allowed values: "application/json".</td></tr>
8385
* </table>
8486
*
8587
* You can add these to a request with {@link RequestOptions#addHeader}
@@ -101,8 +103,9 @@ public Response<BinaryData> getNullWithResponse(RequestOptions requestOptions) {
101103
@ServiceMethod(returns = ReturnType.SINGLE)
102104
public Response<Void> putNullWithResponse(RequestOptions requestOptions, String test) {
103105
return this.serviceClient.putNullWithResponse(requestOptions);
104-
}
106+
}// @formatter:on
105107

108+
// @formatter:off
106109
/**
107110
* 3. manually update method access from public to private
108111
*
@@ -122,7 +125,7 @@ public Response<Void> putNullWithResponse(RequestOptions requestOptions, String
122125
@ServiceMethod(returns = ReturnType.SINGLE)
123126
Response<BinaryData> getEmptyWithResponse(RequestOptions requestOptions) {
124127
return this.serviceClient.getEmptyWithResponse(requestOptions);
125-
}
128+
}// @formatter:on
126129

127130
/**
128131
* Set string value empty ''.
@@ -340,14 +343,15 @@ public Response<BinaryData> getNullBase64UrlEncodedWithResponse(RequestOptions r
340343
return this.serviceClient.getNullBase64UrlEncodedWithResponse(requestOptions);
341344
}
342345

346+
// @formatter:off
343347
/**
344348
* 4. manually added method to test partial update
345349
*
346350
* @return a string
347351
*/
348352
public String manuallyAddedMethod() {
349353
return "manuallyAddedMethod";
350-
}
354+
}// @formatter:on
351355

352356
/**
353357
* This is an added method.

partial-update-tests/generated/src/main/java/fixtures/bodystring/implementation/package-info.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
// Licensed under the MIT License.
33
// Code generated by Microsoft (R) AutoRest Code Generator.
44
/**
5-
* Some other custom Javadocs which shouldn't be overwritten as they aren't contained in the generated Javadoc block.
5+
* <!-- @formatter:off -->
6+
* Some other custom Javadocs which shouldn't be overwritten as they aren't contained in the generated Javadoc block. And it shouldn't be formatted.
67
* <p>
8+
* <!-- @formatter:on -->
79
* <!-- start generated doc -->
810
* Package containing the implementations for AutoRestSwaggerBatService.
911
* Test Infrastructure for AutoRest Swagger BAT.

partial-update-tests/generated/src/main/java/fixtures/bodystring/package-info.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
* Package containing the classes for AutoRestSwaggerBatService.
77
* Test Infrastructure for AutoRest Swagger BAT.
88
* <!-- end generated doc -->
9+
* <!-- @formatter:off -->
910
* <p>
10-
* Some other custom Javadocs which shouldn't be overwritten as they aren't contained in the generated Javadoc block.
11+
* Some other custom Javadocs which shouldn't be overwritten as they aren't contained in the generated Javadoc block. And it shouldn't be formatted.
12+
* <!-- @formatter:on -->
1113
*/
1214
package fixtures.bodystring;

partial-update/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<dependency>
2222
<groupId>com.github.javaparser</groupId>
2323
<artifactId>javaparser-core</artifactId>
24-
<version>3.25.6</version>
24+
<version>3.25.10</version>
2525
</dependency>
2626
<dependency>
2727
<groupId>org.slf4j</groupId>

0 commit comments

Comments
 (0)