Skip to content

Commit 01622ef

Browse files
committed
lint.
1 parent 4283d11 commit 01622ef

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

appengine-java21/springboot-helloworld/src/main/java/com/example/appengine/demos/springboot/HelloworldController.java

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
1716
package com.example.appengine.demos.springboot;
1817

1918
import java.security.Principal;
@@ -42,27 +41,29 @@
4241

4342
/**
4443
*
45-
* @author ludo
44+
* Simple controller.
4645
*/
4746
@Controller
4847
@Slf4j
4948
public class HelloworldController {
5049

51-
/** Do something with the app engine datastore... */
52-
private final DatastoreService datastoreService;
50+
/**
51+
* Do something with the app engine datastore...
52+
*/
53+
private final DatastoreService ds;
5354

5455
/**
5556
*
56-
* @param datastoreService
57+
* @param datastoreService injected appengine service.
5758
*/
5859
@Autowired
5960
public HelloworldController(DatastoreService datastoreService) {
60-
this.datastoreService = Objects.requireNonNull(datastoreService);
61+
this.ds = Objects.requireNonNull(datastoreService);
6162
}
6263

6364
/**
64-
* Home page -> {@literal /WEB-INF/jsp/index.jsp}
65-
*
65+
* Home page -> {@literal /WEB-INF/jsp/index.jsp}.
66+
*
6667
* @return home page view.
6768
*/
6869
@RequestMapping("/")
@@ -73,7 +74,7 @@ public ModelAndView home() {
7374

7475
/**
7576
* Sample JSON/HTTP service.
76-
*
77+
*
7778
* @return a list of aliens.
7879
*/
7980
@RequestMapping(value = "/aliens", method = RequestMethod.GET)
@@ -84,23 +85,25 @@ public AliensResponse aliens() {
8485
}
8586

8687
/**
87-
* /admin endpoint handler
88-
* @param request Servlet request
89-
* @return
88+
* /admin endpoint handler.
89+
*
90+
* @param request servlet request.
91+
* @return the endpoint content.
9092
*/
9193
@RequestMapping(value = "/admin", method = RequestMethod.GET)
9294
@ResponseBody
9395
public AliensResponse admin(final HttpServletRequest request) {
9496
LOGGER.info("Returning the admin info...");
9597
Principal userPrincipal = request.getUserPrincipal();
9698
return AliensResponse.of(
97-
Collections.singletonList(Alien.of("userPrincipal", userPrincipal == null ? "null" : userPrincipal.toString()))
99+
Collections.singletonList(Alien.of("userPrincipal", userPrincipal == null ? "null" : userPrincipal.toString()))
98100
);
99101
}
100102

101103
@Data
102104
@AllArgsConstructor(staticName = "of")
103105
static class AliensResponse {
106+
104107
@NonNull
105108
private final List<Alien> aliens;
106109
}
@@ -110,6 +113,7 @@ static class AliensResponse {
110113
// Only used by Jackson through reflection
111114
@NoArgsConstructor(access = AccessLevel.PRIVATE, force = true)
112115
static class Alien {
116+
113117
@NonNull
114118
@NotEmpty
115119
private final String name;

appengine-java21/springboot-helloworld/src/main/java/com/example/appengine/demos/springboot/ServletInitializer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,4 @@ public class ServletInitializer extends SpringBootServletInitializer {
3030
protected SpringApplicationBuilder configure(final SpringApplicationBuilder application) {
3131
return application.sources(SpringBootExampleApplication.class);
3232
}
33-
3433
}

0 commit comments

Comments
 (0)