Compliant/Non-Compliant Solutions for Java Coding
The following code segment was provided in Chapter 1 of Java Coding Guidelines: void readData() throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader( new FileInputStream(“file”))); // Read from the file String data = br.readLine(); } The code is presented as a noncompliant code example. Here is the compliant version of this code: void readData(){ ByteBuffer … Read more