Example usage for java.lang IllegalArgumentException getClass

List of usage examples for java.lang IllegalArgumentException getClass

Introduction

In this page you can find the example usage for java.lang IllegalArgumentException getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:jp.terasoluna.fw.util.GenericPropertyUtilTest.java

/**
 * testResolveTypeClassClassTypeint06() <br>
 * <br>// w  w  w  . j av  a2  s .com
 *  <br>
 * G <br>
 * <br>
 * () genericClass:List.class<br>
 * () clazz:ArrayList(?String)<br>
 * () type:null<br>
 * () index:1<br>
 * <br>
 * () :IllegalArgumentException<br>
 * "Argument 'index'(1) is out of bounds of"<br>
 * + " generics parameters")<br>
 * <br>
 * index??????IllegalArgumentException?????? <br>
 * @throws Exception ?????
 */
@Test
public void testResolveTypeClassClassTypeint06() throws Exception {
    try {
        // 
        GenericPropertyUtil.resolveType(List.class, GenericPropertyUtil_ArrayListStub01.class, null, 1);
        // 
        fail("???????");
    } catch (IllegalArgumentException e) {
        String message = "Argument 'index'(1) is out of bounds of" + " generics parameters";
        assertEquals(message, e.getMessage());
        assertEquals(IllegalArgumentException.class.getName(), e.getClass().getName());
    }
}

From source file:jp.terasoluna.fw.util.GenericPropertyUtilTest.java

/**
 * testResolveTypeClassClassTypeint04() <br>
 * <br>/*w ww . j a  v  a2s  .c  om*/
 *  <br>
 * G <br>
 * <br>
 * () genericClass:List.class<br>
 * () clazz:ArrayList(?String)<br>
 * () type:null<br>
 * () index:-1<br>
 * <br>
 * () :IllegalArgumentException<br>
 * "Argument 'index'(-1) is out of bounds of"<br>
 * + " generics parameters")<br>
 * <br>
 * index??????IllegalArgumentException?????? <br>
 * @throws Exception ?????
 */
@Test
public void testResolveTypeClassClassTypeint04() throws Exception {
    try {
        // 
        GenericPropertyUtil.resolveType(List.class, GenericPropertyUtil_ArrayListStub01.class, null, -1);
        // 
        fail("???????");
    } catch (IllegalArgumentException e) {
        String message = "Argument 'index'(-1) is out of bounds of" + " generics parameters";
        assertEquals(message, e.getMessage());
        assertEquals(IllegalArgumentException.class.getName(), e.getClass().getName());
    }
}

From source file:jp.terasoluna.fw.util.GenericPropertyUtilTest.java

/**
 * testGetMethod01() <br>//from   ww  w  .j  a  va2  s. c  o  m
 * <br>
 *  <br>
 * G <br>
 * <br>
 * () bean:String string?getter, setter????<br>
 * () name:"string"<br>
 * <br>
 * () :IllegalArgumentException<br>
 * bean??? + " has no getter for property string"<br>
 * <br>
 * ???????IllegalArgumentException?????? <br>
 * @throws Exception ?????
 */
@Test
public void testGetMethod01() throws Exception {
    try {
        // 
        GenericPropertyUtil.getMethod(new GenericPropertyUtil_Stub02(), "string");
        // 
        fail("???????");
    } catch (IllegalArgumentException e) {
        String message = GenericPropertyUtil_Stub02.class.getName() + " has no getter for property string";
        assertEquals(message, e.getMessage());
        assertEquals(IllegalArgumentException.class.getName(), e.getClass().getName());
    }
}

From source file:jp.terasoluna.fw.util.GenericPropertyUtilTest.java

/**
 * testGetMethod02() <br>/*from   w  ww.j a  v  a 2  s  . c o m*/
 * <br>
 *  <br>
 * G <br>
 * <br>
 * () bean:String string1???????getter????<br>
 * () name:"string1"<br>
 * <br>
 * () :IllegalArgumentException<br>
 * bean??? + " has no getter for property string1"<br>
 * <br>
 * ???????IllegalArgumentException?????? <br>
 * @throws Exception ?????
 */
@Test
public void testGetMethod02() throws Exception {
    try {
        // 
        GenericPropertyUtil.getMethod(new GenericPropertyUtil_Stub02(), "string1");
        // 
        fail("???????");
    } catch (IllegalArgumentException e) {
        String message = GenericPropertyUtil_Stub02.class.getName() + " has no getter for property string1";
        assertEquals(message, e.getMessage());
        assertEquals(IllegalArgumentException.class.getName(), e.getClass().getName());
    }
}

From source file:jp.terasoluna.fw.util.GenericPropertyUtilTest.java

/**
 * testGetMethod04() <br>// w  w  w.  j  a va 2s. c  om
 * <br>
 *  <br>
 * G <br>
 * <br>
 * () bean:bean1???????getter????<br>
 * () name:"bean1.string"<br>
 * <br>
 * () :IllegalArgumentException<br>
 * "Failed to detect getter for "<br>
 * + bean??? + "#bean1.string"<br>
 * ??NoSuchMethodException<br>
 * <br>
 * PropertyUtils#getPropertyDescriptor?NoSuchMethodException???? <br>
 * @throws Exception ?????
 */
@Test
public void testGetMethod04() throws Exception {
    try {
        // 
        GenericPropertyUtil.getMethod(new GenericPropertyUtil_Stub02(), "bean1.string");
        // 
        fail("???????");
    } catch (IllegalArgumentException e) {
        String message = "Failed to detect getter for " + GenericPropertyUtil_Stub02.class.getName()
                + "#bean1.string";
        assertEquals(message, e.getMessage());
        assertEquals(IllegalArgumentException.class.getName(), e.getClass().getName());
        assertTrue(e.getCause() instanceof NoSuchMethodException);
    }
}

From source file:jp.terasoluna.fw.util.GenericPropertyUtilTest.java

/**
 * testGetMethod05() <br>//from w w  w .  ja  v a2  s  .co m
 * <br>
 *  <br>
 * G <br>
 * <br>
 * () bean:bean2????getter??<br>
 * (getter??RuntimeException??)<br>
 * () name:"bean2.string"<br>
 * () PropertyUtils#getPropertyDescriptor??: InvocationTargetException JavaBean?getter?RuntimeException<br>
 * <br>
 * () :IllegalArgumentException<br>
 * "Failed to detect getter for "<br>
 * + bean??? + "#bean2.string"<br>
 * ??InvocationTargetException<br>
 * <br>
 * PropertyUtils#getPropertyDescriptor?InvocationTargetException???? <br>
 * @throws Exception ?????
 */
@Test
public void testGetMethod05() throws Exception {
    try {
        // 
        GenericPropertyUtil.getMethod(new GenericPropertyUtil_Stub02(), "bean2.string");
        // 
        fail("???????");
    } catch (IllegalArgumentException e) {
        String message = "Failed to detect getter for " + GenericPropertyUtil_Stub02.class.getName()
                + "#bean2.string";
        assertEquals(message, e.getMessage());
        assertEquals(IllegalArgumentException.class.getName(), e.getClass().getName());
        assertTrue(e.getCause() instanceof InvocationTargetException);
    }
}

From source file:jp.terasoluna.fw.util.GenericPropertyUtilTest.java

/**
 * testGetMethod06() <br>/* ww  w. j a  v  a 2  s .  co  m*/
 * <br>
 *  <br>
 * G <br>
 * <br>
 * () bean:String string2????getter??<br>
 * () name:"string2"<br>
 * () PropertyUtils#getPropertyDescriptor??: IllegalAccessException
 * PropertyUtilsBean??IllegalAccessException<br>
 * <br>
 * () :IllegalArgumentException<br>
 * "Failed to detect getter for "<br>
 * + bean??? + "#string2"<br>
 * ??IllegalAccessException<br>
 * <br>
 * PropertyUtils#getPropertyDescriptor?IllegalAccessException???? <br>
 * @throws Exception ?????
 */
@Test
public void testGetMethod06() throws Exception {
    // ??
    BeanUtilsBean beanUtilsBean = BeanUtilsBean.getInstance();
    ReflectionTestUtils.setField(beanUtilsBean, "propertyUtilsBean",
            new GenericPropertyUtil_PropertyUtilsBeanStub01());
    try {

        // 
        GenericPropertyUtil.getMethod(new GenericPropertyUtil_Stub02(), "string2");
        // 
        fail("???????");
    } catch (IllegalArgumentException e) {
        String message = "Failed to detect getter for " + GenericPropertyUtil_Stub02.class.getName()
                + "#string2";
        assertEquals(message, e.getMessage());
        assertEquals(IllegalArgumentException.class.getName(), e.getClass().getName());
        assertTrue(e.getCause() instanceof IllegalAccessException);
    }
}

From source file:ru.medved.json.wssoap.WebServiceSampler.java

/**
 * Sample the URL using Apache SOAP driver. Implementation note for myself
 * and those that are curious. Current logic marks the end after the
 * response has been read. If read response is set to false, the buffered
 * reader will read, but do nothing with it. Essentially, the stream from
 * the server goes into the ether.// ww w  .  ja v  a 2 s  . c  o m
 */
@Override
public SampleResult sample() {
    SampleResult result = new SampleResult();
    result.setSuccessful(false); // Assume it will fail
    result.setResponseCode("000"); // ditto $NON-NLS-1$
    result.setSampleLabel(getName());
    try {
        result.setURL(this.getUrl());
        org.w3c.dom.Element rdoc = createDocument();
        if (rdoc == null) {
            throw new SOAPException("Could not create document", null);
        }
        // set the response defaults
        result.setDataEncoding(ENCODING);
        result.setContentType("text/xml"); // $NON-NLS-1$
        result.setDataType(SampleResult.TEXT);
        result.setSamplerData(fileContents);// WARNING - could be large

        Envelope msgEnv = Envelope.unmarshall(rdoc);
        // create a new message
        Message msg = new Message();
        result.sampleStart();
        SOAPHTTPConnection spconn = null;
        // if a blank HeaderManager exists, try to
        // get the SOAPHTTPConnection. After the first
        // request, there should be a connection object
        // stored with the cookie header info.
        if (this.getHeaderManager() != null && this.getHeaderManager().getSOAPHeader() != null) {
            spconn = (SOAPHTTPConnection) this.getHeaderManager().getSOAPHeader();
        } else {
            spconn = new SOAPHTTPConnection();
        }

        spconn.setTimeout(getTimeoutAsInt());

        // set the auth. thanks to KiYun Roe for contributing the patch
        // I cleaned up the patch slightly. 5-26-05
        if (getAuthManager() != null) {
            if (getAuthManager().getAuthForURL(getUrl()) != null) {
                AuthManager authmanager = getAuthManager();
                Authorization auth = authmanager.getAuthForURL(getUrl());
                spconn.setUserName(auth.getUser());
                spconn.setPassword(auth.getPass());
            } else {
                log.warn("the URL for the auth was null." + " Username and password not set");
            }
        }
        // check the proxy
        String phost = "";
        int pport = 0;
        // if use proxy is set, we try to pick up the
        // proxy host and port from either the text
        // fields or from JMeterUtil if they were passed
        // from command line
        if (this.getUseProxy()) {
            if (this.getProxyHost().length() > 0 && this.getProxyPort() > 0) {
                phost = this.getProxyHost();
                pport = this.getProxyPort();
            } else {
                if (System.getProperty("http.proxyHost") != null
                        || System.getProperty("http.proxyPort") != null) {
                    phost = System.getProperty("http.proxyHost");
                    pport = Integer.parseInt(System.getProperty("http.proxyPort"));
                }
            }
            // if for some reason the host is blank and the port is
            // zero, the sampler will fail silently
            if (phost.length() > 0 && pport > 0) {
                spconn.setProxyHost(phost);
                spconn.setProxyPort(pport);
                if (PROXY_USER.length() > 0 && PROXY_PASS.length() > 0) {
                    spconn.setProxyUserName(PROXY_USER);
                    spconn.setProxyPassword(PROXY_PASS);
                }
            }
        }
        // by default we maintain the session.
        spconn.setMaintainSession(true);
        msg.setSOAPTransport(spconn);
        msg.send(this.getUrl(), this.getSoapAction(), msgEnv);
        @SuppressWarnings("unchecked") // API uses raw types
        final Map<String, String> headers = spconn.getHeaders();
        result.setResponseHeaders(convertSoapHeaders(headers));

        if (this.getHeaderManager() != null) {
            this.getHeaderManager().setSOAPHeader(spconn);
        }

        BufferedReader br = null;
        if (spconn.receive() != null) {
            br = spconn.receive();
            SOAPContext sc = spconn.getResponseSOAPContext();
            // Set details from the actual response
            // Needs to be done before response can be stored
            final String contentType = sc.getContentType();
            result.setContentType(contentType);
            result.setEncodingAndType(contentType);
            int length = 0;
            if (getReadResponse()) {
                StringWriter sw = new StringWriter();
                length = IOUtils.copy(br, sw);
                result.sampleEnd();
                result.setResponseData(sw.toString().getBytes(result.getDataEncodingWithDefault()));
            } else {
                // by not reading the response
                // for real, it improves the
                // performance on slow clients
                length = br.read();
                result.sampleEnd();
                result.setResponseData(JMeterUtils.getResString("read_response_message"), null); //$NON-NLS-1$
            }
            // It is not possible to access the actual HTTP response code, so we assume no data means failure
            if (length > 0) {
                result.setSuccessful(true);
                result.setResponseCodeOK();
                result.setResponseMessageOK();
            } else {
                result.setSuccessful(false);
                result.setResponseCode("999");
                result.setResponseMessage("Empty response");
            }
        } else {
            result.sampleEnd();
            result.setSuccessful(false);
            final String contentType = spconn.getResponseSOAPContext().getContentType();
            result.setContentType(contentType);
            result.setEncodingAndType(contentType);
            result.setResponseData(
                    spconn.getResponseSOAPContext().toString().getBytes(result.getDataEncodingWithDefault()));
        }
        if (br != null) {
            br.close();
        }
        // reponse code doesn't really apply, since
        // the soap driver doesn't provide a
        // response code
    } catch (IllegalArgumentException exception) {
        String message = exception.getMessage();
        log.warn(message);
        result.setResponseMessage(message);
    } catch (SAXException exception) {
        log.warn(exception.toString());
        result.setResponseMessage(exception.getMessage());
    } catch (SOAPException exception) {
        log.warn(exception.toString());
        result.setResponseMessage(exception.getMessage());
    } catch (MalformedURLException exception) {
        String message = exception.getMessage();
        log.warn(message);
        result.setResponseMessage(message);
    } catch (IOException exception) {
        String message = exception.getMessage();
        log.warn(message);
        result.setResponseMessage(message);
    } catch (NoClassDefFoundError error) {
        log.error("Missing class: ", error);
        result.setResponseMessage(error.toString());
    } catch (Exception exception) {
        if ("javax.mail.MessagingException".equals(exception.getClass().getName())) {
            log.warn(exception.toString());
            result.setResponseMessage(exception.getMessage());
        } else {
            log.error("Problem processing the SOAP request", exception);
            result.setResponseMessage(exception.toString());
        }
    } finally {
        // Make sure the sample start time and sample end time are recorded
        // in order not to confuse the statistics calculation methods: if
        //  an error occurs and an exception is thrown it is possible that
        // the result.sampleStart() or result.sampleEnd() won't be called
        if (result.getStartTime() == 0) {
            result.sampleStart();
        }
        if (result.getEndTime() == 0) {
            result.sampleEnd();
        }
    }
    return result;
}

From source file:org.apache.jmeter.protocol.http.sampler.WebServiceSampler.java

/**
 * Sample the URL using Apache SOAP driver. Implementation note for myself
 * and those that are curious. Current logic marks the end after the
 * response has been read. If read response is set to false, the buffered
 * reader will read, but do nothing with it. Essentially, the stream from
 * the server goes into the ether./*w w  w  .ja va2 s . com*/
 */
@Override
public SampleResult sample() {
    SampleResult result = new SampleResult();
    result.setSuccessful(false); // Assume it will fail
    result.setResponseCode("000"); // ditto $NON-NLS-1$
    result.setSampleLabel(getName());
    try {
        result.setURL(this.getUrl());
        org.w3c.dom.Element rdoc = createDocument();
        if (rdoc == null) {
            throw new SOAPException("Could not create document", null);
        }
        // set the response defaults
        result.setDataEncoding(ENCODING);
        result.setContentType("text/xml"); // $NON-NLS-1$
        result.setDataType(SampleResult.TEXT);
        result.setSamplerData(fileContents);// WARNING - could be large

        Envelope msgEnv = Envelope.unmarshall(rdoc);
        result.sampleStart();
        SOAPHTTPConnection spconn = null;
        // if a blank HeaderManager exists, try to
        // get the SOAPHTTPConnection. After the first
        // request, there should be a connection object
        // stored with the cookie header info.
        if (this.getHeaderManager() != null && this.getHeaderManager().getSOAPHeader() != null) {
            spconn = (SOAPHTTPConnection) this.getHeaderManager().getSOAPHeader();
        } else {
            spconn = new SOAPHTTPConnection();
        }
        spconn.setTimeout(getTimeoutAsInt());

        // set the auth. thanks to KiYun Roe for contributing the patch
        // I cleaned up the patch slightly. 5-26-05
        if (getAuthManager() != null) {
            if (getAuthManager().getAuthForURL(getUrl()) != null) {
                AuthManager authmanager = getAuthManager();
                Authorization auth = authmanager.getAuthForURL(getUrl());
                spconn.setUserName(auth.getUser());
                spconn.setPassword(auth.getPass());
            } else {
                log.warn("the URL for the auth was null." + " Username and password not set");
            }
        }
        // check the proxy
        String phost = "";
        int pport = 0;
        // if use proxy is set, we try to pick up the
        // proxy host and port from either the text
        // fields or from JMeterUtil if they were passed
        // from command line
        if (this.getUseProxy()) {
            if (this.getProxyHost().length() > 0 && this.getProxyPort() > 0) {
                phost = this.getProxyHost();
                pport = this.getProxyPort();
            } else {
                if (System.getProperty("http.proxyHost") != null
                        || System.getProperty("http.proxyPort") != null) {
                    phost = System.getProperty("http.proxyHost");
                    pport = Integer.parseInt(System.getProperty("http.proxyPort"));
                }
            }
            // if for some reason the host is blank and the port is
            // zero, the sampler will fail silently
            if (phost.length() > 0 && pport > 0) {
                spconn.setProxyHost(phost);
                spconn.setProxyPort(pport);
                if (PROXY_USER.length() > 0 && PROXY_PASS.length() > 0) {
                    spconn.setProxyUserName(PROXY_USER);
                    spconn.setProxyPassword(PROXY_PASS);
                }
            }
        }

        HeaderManager headerManager = this.getHeaderManager();
        Hashtable<String, String> reqHeaders = null;
        if (headerManager != null) {
            int size = headerManager.getHeaders().size();
            reqHeaders = new Hashtable<String, String>(size);
            for (int i = 0; i < size; i++) {
                Header header = headerManager.get(i);
                reqHeaders.put(header.getName(), header.getValue());
            }
        }
        spconn.setMaintainSession(getMaintainSession());
        spconn.send(this.getUrl(), this.getSoapAction(), reqHeaders, msgEnv, null, new SOAPContext());

        @SuppressWarnings("unchecked") // API uses raw types
        final Map<String, String> headers = spconn.getHeaders();
        result.setResponseHeaders(convertSoapHeaders(headers));

        if (this.getHeaderManager() != null) {
            this.getHeaderManager().setSOAPHeader(spconn);
        }

        BufferedReader br = null;
        if (spconn.receive() != null) {
            br = spconn.receive();
            SOAPContext sc = spconn.getResponseSOAPContext();
            // Set details from the actual response
            // Needs to be done before response can be stored
            final String contentType = sc.getContentType();
            result.setContentType(contentType);
            result.setEncodingAndType(contentType);
            int length = 0;
            if (getReadResponse()) {
                StringWriter sw = new StringWriter();
                length = IOUtils.copy(br, sw);
                result.sampleEnd();
                result.setResponseData(sw.toString().getBytes(result.getDataEncodingWithDefault()));
            } else {
                // by not reading the response
                // for real, it improves the
                // performance on slow clients
                length = br.read();
                result.sampleEnd();
                result.setResponseData(JMeterUtils.getResString("read_response_message"), null); //$NON-NLS-1$
            }
            // It is not possible to access the actual HTTP response code, so we assume no data means failure
            if (length > 0) {
                result.setSuccessful(true);
                result.setResponseCodeOK();
                result.setResponseMessageOK();
            } else {
                result.setSuccessful(false);
                result.setResponseCode("999");
                result.setResponseMessage("Empty response");
            }
        } else {
            result.sampleEnd();
            result.setSuccessful(false);
            final String contentType = spconn.getResponseSOAPContext().getContentType();
            result.setContentType(contentType);
            result.setEncodingAndType(contentType);
            result.setResponseData(
                    spconn.getResponseSOAPContext().toString().getBytes(result.getDataEncodingWithDefault()));
        }
        if (br != null) {
            br.close();
        }
        // reponse code doesn't really apply, since
        // the soap driver doesn't provide a
        // response code
    } catch (IllegalArgumentException exception) {
        String message = exception.getMessage();
        log.warn(message);
        result.setResponseMessage(message);
    } catch (SAXException exception) {
        log.warn(exception.toString());
        result.setResponseMessage(exception.getMessage());
    } catch (SOAPException exception) {
        log.warn(exception.toString());
        result.setResponseMessage(exception.getMessage());
    } catch (MalformedURLException exception) {
        String message = exception.getMessage();
        log.warn(message);
        result.setResponseMessage(message);
    } catch (IOException exception) {
        String message = exception.getMessage();
        log.warn(message);
        result.setResponseMessage(message);
    } catch (NoClassDefFoundError error) {
        log.error("Missing class: ", error);
        result.setResponseMessage(error.toString());
    } catch (Exception exception) {
        if ("javax.mail.MessagingException".equals(exception.getClass().getName())) {
            log.warn(exception.toString());
            result.setResponseMessage(exception.getMessage());
        } else {
            log.error("Problem processing the SOAP request", exception);
            result.setResponseMessage(exception.toString());
        }
    } finally {
        // Make sure the sample start time and sample end time are recorded
        // in order not to confuse the statistics calculation methods: if
        //  an error occurs and an exception is thrown it is possible that
        // the result.sampleStart() or result.sampleEnd() won't be called
        if (result.getStartTime() == 0) {
            result.sampleStart();
        }
        if (result.getEndTime() == 0) {
            result.sampleEnd();
        }
    }
    return result;
}

From source file:org.sonar.plugins.spcaf.SpcafSensor.java

private void parseReport(SpcafReportParser parser, File reportFile) {
    LOG.info("SPCAF: Parsing report: " + reportFile);

    List<SpcafIssue> parse = parser.parse(reportFile);
    LOG.info("SPCAF: Notifications:" + parse.size());

    allFiles.clear();/* w  ww .  java 2  s  .  c  o  m*/
    addTree(fileSystem.baseDir().toPath(), allFiles);

    LOG.info("");
    LOG.info("--------------------");
    LOG.info("SPCAF: Input files");
    LOG.info("--------------------");
    for (InputFile file : fileSystem.inputFiles(fileSystem.predicates().all())) {
        LOG.info(file.absolutePath());
    }
    LOG.info("--------------------");

    List<String> allowedExtensions;
    switch (SpcafConf.repositoryKey().toLowerCase()) {
    case "spcaf-aspx":
        allowedExtensions = Arrays.asList(spcafPlugin.ASPX_SUFFIXES_DEFAULT_VALUE.split(","));
        break;
    case "spcaf-cs":
        allowedExtensions = Arrays.asList(new String[] { ".cs", ".dll" });
        break;
    case "spcaf-css":
        allowedExtensions = Arrays.asList(spcafPlugin.CSS_SUFFIXES_DEFAULT_VALUE.split(","));
        break;
    case "spcaf-ps1":
        allowedExtensions = Arrays.asList(spcafPlugin.PS1_SUFFIXES_DEFAULT_VALUE.split(","));
        break;
    case "spcaf-js":
        allowedExtensions = Arrays.asList(spcafPlugin.JS_SUFFIXES_DEFAULT_VALUE.split(","));
        break;
    case "spcaf-xml":
        allowedExtensions = Arrays.asList(spcafPlugin.XML_SUFFIXES_DEFAULT_VALUE.split(","));
        break;
    default:
        return;
    }

    LOG.info("Allowed Extensions:" + StringUtils.join(allowedExtensions.toArray(), ","));

    for (SpcafIssue issue : parse) {

        try {

            Path p = Paths.get(issue.filePath());
            String fileName = p.getFileName().toString();

            String ext = FilenameUtils.getExtension(fileName);

            // Skip files that we aren't checking under the current repo
            if (!allowedExtensions.contains("." + ext)) {
                continue;
            }

            LOG.info("SPCAF: Issue[" + issue.ruleKey() + "] " + issue.message());
            LOG.info("SPCAF: Issue Filename:" + fileName);

            File file = null;
            // Simplify .cs and .webpart files
            if (ext.equals("cs")) {
                file = p.toFile();
            } else if (ext.equals("webpart")) {
                for (File inputFile : fileSystem.files(fileSystem.predicates().all())) {
                    if (inputFile.getName().equals(fileName)) {
                        file = inputFile;
                        break;
                    }
                }
            } else if (ext.equals("dll")) {
                for (File inputFile : fileSystem.files(fileSystem.predicates().all())) {
                    if (inputFile.getName().equals("AssemblyInfo.cs")) {
                        file = inputFile;
                        break;
                    }
                }
            } else {
                file = getCorrectFile(issue.md5(), fileName);
            }

            if (file == null) {
                logSkippedIssue(issue, "\"" + fileName + "\" is not in SonarQube Repository.");
                continue;
            }

            String correctedPath = file.getAbsolutePath().replace('\\', '/');
            LOG.info("SPCAF: Physical file located: " + correctedPath);

            InputFile inputFile = null;
            for (InputFile currentInputFile : fileSystem.inputFiles(fileSystem.predicates().all())) {
                if (currentInputFile.absolutePath().equals(correctedPath)
                        && currentInputFile.type().equals(InputFile.Type.MAIN)) {
                    inputFile = currentInputFile;
                    break;
                }
            }

            if (inputFile == null) {
                continue;
            }

            LOG.info("SPCAF: Input file path:" + inputFile.absolutePath());

            if (inputFile == null) {
                logSkippedIssue(issue, "\"" + fileName + "\" is not in SonarQube Input Files.");
                continue;
            }

            LOG.info("Repository file located");

            Issuable issuable = perspectives.as(Issuable.class, inputFile);

            if (issuable == null) {
                logSkippedIssue(issue, "\"" + fileName + "\" is not issuable in SonarQube.");
            } else {
                issuable.addIssue(issuable.newIssueBuilder()
                        .ruleKey(RuleKey.of(SpcafConf.repositoryKey(), issue.ruleKey())).line(issue.line())
                        .message(issue.message()).build());
                LOG.info("SPCAF: Issue added for " + issue.ruleKey() + " on " + fileName);
            }
        } catch (IllegalArgumentException ex) {
            LOG.warn("SPCAF: Illegal Argument Exception in injecting issues has occurred");
            LOG.warn("SPCAF: Current issue: " + issue.toString());
            LOG.warn("SPCAF: Exception type: " + (ex.getMessage() == null ? "null" : ex.getMessage()));
            LOG.warn("SPCAF: StackTrace type: " + (ex.getStackTrace() == null ? "null" : ex.getStackTrace()));
        } catch (NullPointerException ex) {
            LOG.warn("SPCAF: Null Pointer Exception in injecting issues has occurred");
            LOG.warn("SPCAF: Current issue:" + issue.toString());
            LOG.warn("SPCAF: Exception type: " + (ex.getMessage() == null ? "null" : ex.getMessage()));
            LOG.warn("SPCAF: StackTrace type: " + (ex.getStackTrace() == null ? "null" : ex.getStackTrace()));
        } catch (MessageException ex) {
            LOG.warn("SPCAF: Message Exception in injecting issues has occurred");
            LOG.warn("SPCAF: Current issue: " + issue.toString());
            LOG.warn("SPCAF: Exception type: " + (ex.getMessage() == null ? "null" : ex.getMessage()));
            LOG.warn("SPCAF: StackTrace type: " + (ex.getStackTrace() == null ? "null" : ex.getStackTrace()));
        } catch (Exception ex) {
            LOG.warn("SPCAF: General Exception in injecting issues has occurred");
            LOG.warn("SPCAF: Current issue: " + issue.toString());
            LOG.warn("SPCAF: Exception type: " + ex.getClass().getName());
        }
    }
}