Skip to content

Commit db5bf8b

Browse files
SentryManrbygrave
andauthored
[http-client] Fix BeanParam on Eclipse (avaje#436)
* fix beanParam on eclipse low priority, but I guess eclipse prints out the entire method signature * Format BeanParamReader and remove test code that does not extend coverage --------- Co-authored-by: Rob Bygrave <[email protected]>
1 parent 99bb99a commit db5bf8b

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

http-generator-client/src/test/java/io/avaje/http/generator/client/ClientProcessorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void testGeneration() throws Exception {
5050

5151
final CompilationTask task =
5252
compiler.getTask(
53-
new PrintWriter(System.out), null, null, Arrays.asList("--release=11"), null, files);
53+
new PrintWriter(System.out), null, null, List.of("--release=" + Integer.getInteger("java.specification.version")), null, files);
5454
task.setProcessors(Arrays.asList(new ClientProcessor()));
5555

5656
assertThat(task.call()).isTrue();

http-generator-client/src/test/java/io/avaje/http/generator/client/clients/ExampleClient2.java

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

http-generator-core/src/main/java/io/avaje/http/generator/core/BeanParamReader.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ public void writeFormParams(Append writer) {
117117
ParamType paramType = field.element.paramType();
118118
String type = propertyParamType(paramType);
119119
if (type != null) {
120-
String accessor = (getter != null) ? getter.toString() : field.isPublic() ? field.varName() : null;
120+
String accessor = (getter != null)
121+
? getter.getSimpleName() + "()"
122+
: field.isPublic() ? field.varName() : null;
121123
if (accessor != null) {
122124
writer.append(" .%s(\"%s\", %s.%s)", type, field.paramName(), beanVarName, accessor).eol();
123125
}

0 commit comments

Comments
 (0)