Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClasspathInput.java fixes #119

Open
amihaiemil opened this issue Mar 29, 2016 · 4 comments
Open

ClasspathInput.java fixes #119

amihaiemil opened this issue Mar 29, 2016 · 4 comments

Comments

@amihaiemil
Copy link
Member

com.jcabi.xml.ClasspathInput is currently filled with methods which are "//intentionally empty" or return null.
Some of them can be properly implemented, some of them I think should throw UnsupportedOperationException.

  1. Parameters baseURI and encoding can be specified in the constructor when instanciating the class in ClasspathResolver.resolveResource:
class ClasspathResolver implements LSResourceResolver {
    @Override
    @SuppressWarnings("PMD.UseObjectForClearerAPI")
    // @checkstyle ParameterNumber (1 line)
    public LSInput resolveResource(final String type, final String namespaceuri,
        final String publicid, final String systemid, final String baseuri) {
        LSInput input = null;
        if (systemid != null && getClass().getResource(systemid) != null) {
            input = new ClasspathInput(publicid, systemid, "UTF-8", baseuri);
        }
        return input;
    }
}

Then the getters and setters for the 2 can be properly implemented inside ClasspathInput .. also, encoding would be used by getStringData() rather than hardcoding "UTF-8" there.

  1. All other unimplemented setters can throw new UnsupportedOperationException();
  2. getCharacterStream() and getByteStream() should remain as they are or should return a mock of Reader/inputStream - they cannot throw UnsupportedOperationException since then tests fail (they are evantually called by the XML validators...)

I did these changes and the build was successfull.

@amihaiemil
Copy link
Member Author

@dmarkov Can you do something about this pls? Thanks.

@dmarkov
Copy link

dmarkov commented Apr 4, 2016

@yegor256 please take a look at it and dispatch (see par.21)

@amihaiemil
Copy link
Member Author

@yegor256 Can you take a look here, pls? Thanks.

@yegor256 yegor256 added the bug label Apr 18, 2016
@dmarkov
Copy link

dmarkov commented Apr 19, 2016

@amihaiemil thanks for the report, I topped your acc for 15 mins, payment ID AP-5X422939NA2268401

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants