HalimKim opened a new pull request, #4124:
URL: https://github.com/apache/ambari/pull/4124
## What changes were proposed in this pull request?
Using try-with-resources instead of just try in
AbstractKerberosDescriptorFactory.java and AmbariMetaInfo.java
**AbstractKerberosDescriptorFactory.java:**
```diff
- try {
- return new Gson().fromJson(new FileReader(file),
+ try (FileReader reader = new FileReader(file)) {
+ return new Gson().fromJson(reader,
new TypeToken<Map<String, Object>>() {
}.getType());
```
**AmbariMetaInfo.java:**
```diff
- try {
- map = gson.fromJson(new FileReader(svc.getMetricsFile()), type);
+ try (FileReader reader = new FileReader(svc.getMetricsFile())) {
+ map = gson.fromJson(reader, type);
```
## How was this patch tested?
manual tests done
I've built ambari-server jar file and updated my original ambari-server jar.
With the change, I've tried kerberizing test in my cluster.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]