91 FileOutputStream fileStream = new FileOutputStream(file);
92 fileStream.write(buffer);
93 fileStream.close();
94 } catch (Exception e) { 95 } 96 }
97
98 public static long readData(String filePath, boolean encrypted, List<MsgHeader> packets) {
149 key++;
150 } while (j < packet.size_);
151 offset += j;
152 } catch (Exception e) {153 }154 }
155 }
156
185 key++;
186 } while (j < packet.size_);
187 offset += j;
188 } catch (Exception e) {189 }190 }
191 }
192}
When a catch
clause is empty, it essentially ignores any occurrences of the particular exception it handles. This could allow critical bugs to go undiagnosed because any relevant exceptions indicative of a bug would be discarded within this catch
block.
try {
// ...
} catch(Exception e) {
// Nothing here
}
Consider at least logging the exception to ensure that issues that may actually be bugs are not missed.
try {
// ...
} catch(Exception e) {
System.err.println(e.message); // It may be better to make use of a more robust logging solution like logback.
}