cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From swill <...@git.apache.org>
Subject [GitHub] cloudstack pull request: Vmdk findbugs
Date Tue, 24 May 2016 14:03:06 GMT
Github user swill commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1530#discussion_r64395993
  
    --- Diff: vmware-base/src/com/cloud/hypervisor/vmware/mo/VmdkFileDescriptor.java ---
    @@ -27,55 +27,53 @@
     
     import org.apache.log4j.Logger;
     
    +import com.cloud.utils.StringUtils;
    +import com.google.common.base.Preconditions;
    +
     public class VmdkFileDescriptor {
         private static final Logger s_logger = Logger.getLogger(VmdkFileDescriptor.class);
         private static final String VMDK_PROPERTY_CREATE_TYPE = "createType";
         private static final String VMDK_CREATE_TYPE_VMFSSPARSE = "vmfsSparse";
         private static final String VMDK_PROPERTY_ADAPTER_TYPE = "ddb.adapterType";
     
    -    private Properties _properties = new Properties();
    +    private final Properties _properties = new Properties();
         private String _baseFileName;
     
         public VmdkFileDescriptor() {
         }
     
         public void parse(byte[] vmdkFileContent) throws IOException {
    -        BufferedReader in = null;
    -        try {
    -            in = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(vmdkFileContent),"UTF-8"));
    +        try (BufferedReader in = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(vmdkFileContent),"UTF-8"));)
{
                 String line;
                 while ((line = in.readLine()) != null) {
                     // ignore empty and comment lines
                     line = line.trim();
    -                if (line.isEmpty())
    -                    continue;
    -                if (line.charAt(0) == '#')
    +                if (line.isEmpty() | line.charAt(0) == '#') {
    --- End diff --
    
    Is a single `|` really a valid operator in java???


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message