aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google
diff options
context:
space:
mode:
authorGravatar Laszlo Csomor <laszlocsomor@google.com>2015-03-25 14:47:10 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2015-03-25 20:03:31 +0000
commit916c1de3730089498e74907eccd6c9e9203e07f0 (patch)
treeb42d12b808d3be1dcdf68100b31b69550160fd40 /src/main/java/com/google
parent8b95e91f5e23c6ddc27aec884e1dca7b6036b215 (diff)
Blaze docs: open-source the Skylark API documentation.
-- MOS_MIGRATED_REVID=89499954
Diffstat (limited to 'src/main/java/com/google')
-rw-r--r--src/main/java/com/google/devtools/build/docgen/SkylarkDocumentationProcessor.java8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/main/java/com/google/devtools/build/docgen/SkylarkDocumentationProcessor.java b/src/main/java/com/google/devtools/build/docgen/SkylarkDocumentationProcessor.java
index deafa8a6a6..d93411d313 100644
--- a/src/main/java/com/google/devtools/build/docgen/SkylarkDocumentationProcessor.java
+++ b/src/main/java/com/google/devtools/build/docgen/SkylarkDocumentationProcessor.java
@@ -69,10 +69,8 @@ public class SkylarkDocumentationProcessor {
*/
public void generateDocumentation(String outputPath) throws IOException,
BuildEncyclopediaDocException {
- BufferedWriter bw = null;
File skylarkDocPath = new File(outputPath);
- try {
- bw = new BufferedWriter(new FileWriter(skylarkDocPath));
+ try (BufferedWriter bw = new BufferedWriter(new FileWriter(skylarkDocPath))) {
if (USE_TEMPLATE) {
bw.write(SourceFileReader.readTemplateContents(DocgenConsts.SKYLARK_BODY_TEMPLATE,
ImmutableMap.<String, String>of(
@@ -81,10 +79,6 @@ public class SkylarkDocumentationProcessor {
bw.write(generateAllBuiltinDoc());
}
System.out.println("Skylark documentation generated: " + skylarkDocPath.getAbsolutePath());
- } finally {
- if (bw != null) {
- bw.close();
- }
}
}