@@ -1086,10 +1086,9 @@ public static String[] diffline(StringBuilder line1, StringBuilder line2) {
10861086 *
10871087 * @param out destination for the HTML output
10881088 * @throws IOException if an error happens while writing to {@code out}
1089- * @throws HistoryException if the history guru cannot be accesses
10901089 */
10911090 @ SuppressWarnings ("boxing" )
1092- public static void dumpConfiguration (Appendable out ) throws IOException , HistoryException {
1091+ public static void dumpConfiguration (Appendable out ) throws IOException {
10931092 out .append ("<table border=\" 1\" width=\" 100%\" >" );
10941093 out .append ("<tr><th>Variable</th><th>Value</th></tr>" );
10951094 RuntimeEnvironment env = RuntimeEnvironment .getInstance ();
@@ -1122,8 +1121,8 @@ public static void dumpConfiguration(Appendable out) throws IOException, History
11221121 }
11231122
11241123 /**
1125- * Just read the given source and dump as is to the given destination. Does
1126- * nothing, if one or more of the parameters is {@code null}.
1124+ * Just read the given source and dump as is to the given destination.
1125+ * Does nothing, if one or more of the parameters is {@code null}.
11271126 *
11281127 * @param out write destination
11291128 * @param in source to read
@@ -1134,6 +1133,7 @@ public static void dump(Writer out, Reader in) throws IOException {
11341133 if (in == null || out == null ) {
11351134 return ;
11361135 }
1136+
11371137 char [] buf = new char [8192 ];
11381138 int len = 0 ;
11391139 while ((len = in .read (buf )) >= 0 ) {
@@ -1148,13 +1148,11 @@ public static void dump(Writer out, Reader in) throws IOException {
11481148 * @param out dump destination
11491149 * @param dir directory, which should contains the file.
11501150 * @param filename the basename of the file to dump.
1151- * @param compressed if {@code true} the denoted file is assumed to be
1152- * gzipped.
1151+ * @param compressed if {@code true} the denoted file is assumed to be gzipped.
11531152 * @return {@code true} on success (everything read and written).
11541153 * @throws NullPointerException if a parameter is {@code null}.
11551154 */
1156- public static boolean dump (Writer out , File dir , String filename ,
1157- boolean compressed ) {
1155+ public static boolean dump (Writer out , File dir , String filename , boolean compressed ) {
11581156 return dump (out , new File (dir , filename ), compressed );
11591157 }
11601158
@@ -1163,17 +1161,17 @@ public static boolean dump(Writer out, File dir, String filename,
11631161 * gets caught and logged, but not re-thrown.
11641162 *
11651163 * @param out dump destination
1166- * @param file file to dump.
1167- * @param compressed if {@code true} the denoted file is assumed to be
1168- * gzipped.
1169- * @return {@code true} on success (everything read and written).
1170- * @throws NullPointerException if a parameter is {@code null}.
1164+ * @param file file to dump
1165+ * @param compressed if {@code true} the denoted file is assumed to be gzipped
1166+ * @return {@code true} on success (everything read and written)
1167+ * @throws NullPointerException if a parameter is {@code null}
11711168 */
11721169 public static boolean dump (Writer out , File file , boolean compressed ) {
11731170 if (!file .exists ()) {
11741171 return false ;
11751172 }
1176- /**
1173+
1174+ /*
11771175 * For backward compatibility, read the OpenGrok-produced document
11781176 * using the system default charset.
11791177 */
@@ -1183,21 +1181,21 @@ public static boolean dump(Writer out, File file, boolean compressed) {
11831181 }
11841182 return true ;
11851183 } catch (IOException e ) {
1186- LOGGER .log (Level .WARNING ,
1187- "An error occurred while piping file " + file + ": " , e );
1184+ LOGGER .log (Level .WARNING , String .format ("An error occurred while piping file '%s': " , file ), e );
11881185 }
1186+
11891187 return false ;
11901188 }
11911189
11921190 /**
1193- * Silently dump an xref file to the given destination. All
1194- * {@link IOException}s get caught and logged, but not re-thrown.
1191+ * Silently dump a xref file to the given destination.
1192+ * All {@link IOException}s get caught and logged, but not re-thrown.
11951193 * @param out dump destination
11961194 * @param file file to dump
11971195 * @param compressed if {@code true} the denoted file is assumed to be gzipped
11981196 * @param contextPath an optional override of "/source/" as the context path
11991197 * @return {@code true} on success (everything read and written)
1200- * @throws NullPointerException if a parameter is {@code null}.
1198+ * @throws NullPointerException if a parameter is {@code null}
12011199 */
12021200 public static boolean dumpXref (Writer out , File file , boolean compressed , String contextPath ) {
12031201
@@ -1214,26 +1212,26 @@ public static boolean dumpXref(Writer out, File file, boolean compressed, String
12141212 dumpXref (out , in , contextPath );
12151213 return true ;
12161214 } catch (IOException e ) {
1217- LOGGER .log (Level .WARNING , "An error occurred while piping file " + file , e );
1215+ LOGGER .log (Level .WARNING , String . format ( "An error occurred while piping file '%s'" , file ) , e );
12181216 }
12191217
12201218 return false ;
12211219 }
12221220
12231221 /**
1224- * Silently dump an xref file to the given destination. All
1225- * {@link IOException}s get caught and logged, but not re-thrown.
1222+ * Dump a xref file to the given destination.
12261223 * @param out dump destination
12271224 * @param in source to read
12281225 * @param contextPath an optional override of "/source/" as the context path
12291226 * @throws IOException as defined by the given reader/writer
1230- * @throws NullPointerException if a parameter is {@code null}.
1227+ * @throws NullPointerException if a parameter is {@code null}
12311228 */
1232- public static void dumpXref (Writer out , Reader in , String contextPath )
1233- throws IOException {
1229+ public static void dumpXref (Writer out , Reader in , String contextPath ) throws IOException {
1230+
12341231 if (in == null || out == null ) {
12351232 return ;
12361233 }
1234+
12371235 XrefSourceTransformer xform = new XrefSourceTransformer (in );
12381236 xform .setWriter (out );
12391237 xform .setContextPath (contextPath );
0 commit comments