boolean eof = false;
while ( !eof )
{
try {
names.add( din.readUTF() );
}
catch ( EOFException eofException )
{
eof = true;
}
}package org.test;
import java.io.DataInputStream;
import java.io.EOFException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
class EOF {
void test(DataInputStream din) throws IOException {
List<String> names = new ArrayList<>();
boolean eof = false;
while (!eof) {
try {
names.add(din.readUTF());
} catch (EOFException ex) {
eof = true;
}
}
}
}
--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/ddbe8cac-b2f7-4cc2-8891-03ea6d11775f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Tibor Blenessy | SonarSource
SonarJava Developer
import java.io.DataInputStream;
import java.io.EOFException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collection;
public class FileServiceUtil
{
public Collection<String> getFileNames( InputStream in ) throws Exception
{
Collection<String> names = new ArrayList<>();
DataInputStream din = new DataInputStream( in );
try
{
boolean eof = false;
while ( !eof )
{
try {
names.add( din.readUTF() );
}
catch ( EOFException eofException )
{
eof = true;
}
}
}
finally
{
din.close();
}
return names;
}
}
org.codehaus.mojo:sonar-maven-plugin:3.2:sonar
Should I try using a different version?
On the server we have SonarJava 4.10.0.10260 on SonarQube version 5.6.6 LTS.
Hermann
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/2d265d2b-b53e-4349-a7ce-7709693b1973%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
finally { // Warning is raised for below condition, Change this condition so that it does not always evaluate to "true"
if (session != null) {
session.close();
}
} sonar version is 7 and sonar scanner maven plugin is 3.3.
Best Regards
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/2dbc3efd-2734-4dce-b0cb-5f1c72ce31b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Tibor Blenessy | SonarSource
Language Analyzer Developer