fix style

git-svn-id: https://svn.apache.org/repos/asf/ant/ivy/core/trunk@701026 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Xavier Hanin 2008-10-02 08:05:49 +00:00
parent def1380280
commit 9f70cf9eae
4 changed files with 19 additions and 13 deletions

View File

@ -194,7 +194,8 @@ public class PomModuleDescriptorBuilder {
private ParserSettings parserSettings;
public PomModuleDescriptorBuilder(ModuleDescriptorParser parser, Resource res, ParserSettings ivySettings) {
public PomModuleDescriptorBuilder(
ModuleDescriptorParser parser, Resource res, ParserSettings ivySettings) {
ivyModuleDescriptor = new DefaultModuleDescriptor(parser, res);
ivyModuleDescriptor.setResolvedPublicationDate(new Date(res.getLastModified()));
for (int i = 0; i < MAVEN2_CONFIGURATIONS.length; i++) {
@ -242,7 +243,8 @@ public class PomModuleDescriptorBuilder {
DependencyResolver resolver = parserSettings.getResolver(mrid);
if (resolver != null) {
DefaultArtifact artifact = new DefaultArtifact(mrid, new Date(), artifactId, "jar", "jar");
DefaultArtifact artifact = new DefaultArtifact(
mrid, new Date(), artifactId, "jar", "jar");
ArtifactOrigin artifactOrigin = resolver.locate(artifact);
if (!ArtifactOrigin.isUnknown(artifactOrigin)) {

View File

@ -108,7 +108,8 @@ public final class PomModuleDescriptorParser implements ModuleDescriptorParser {
public ModuleDescriptor parseDescriptor(ParserSettings ivySettings, URL descriptorURL,
Resource res, boolean validate) throws ParseException, IOException {
PomModuleDescriptorBuilder mdBuilder = new PomModuleDescriptorBuilder(this, res, ivySettings);
PomModuleDescriptorBuilder mdBuilder = new PomModuleDescriptorBuilder(
this, res, ivySettings);
try {
PomReader domReader = new PomReader(descriptorURL, res);

View File

@ -89,10 +89,11 @@ public class PomReader {
InputStream stream = new AddDTDFilterInputStream(descriptorURL.openStream());
try {
Document pomDomDoc = XMLHelper.parseToDom(stream, res, new EntityResolver() {
public InputSource resolveEntity(String publicId, String systemId) throws SAXException,
IOException {
public InputSource resolveEntity(String publicId, String systemId)
throws SAXException, IOException {
if ((systemId != null) && systemId.endsWith("m2-entities.ent")) {
return new InputSource(PomReader.class.getResourceAsStream("m2-entities.ent"));
return new InputSource(
PomReader.class.getResourceAsStream("m2-entities.ent"));
}
return null;
}
@ -496,7 +497,8 @@ public class PomReader {
}
private static final class AddDTDFilterInputStream extends FilterInputStream {
private static String DOCTYPE = "<!DOCTYPE project SYSTEM \"m2-entities.ent\">\n";
private static final int MARK = 10000;
private static final String DOCTYPE = "<!DOCTYPE project SYSTEM \"m2-entities.ent\">\n";
private int count;
private byte[] prefix = DOCTYPE.getBytes();
@ -508,7 +510,7 @@ public class PomReader {
throw new IllegalArgumentException("The inputstream doesn't support mark");
}
in.mark(10000);
in.mark(MARK);
int bytesToSkip = 0;
LineNumberReader reader = new LineNumberReader(new InputStreamReader(in, "UTF-8"));
@ -541,8 +543,8 @@ public class PomReader {
public int read(byte[] b, int off, int len) throws IOException {
if (b == null) {
throw new NullPointerException();
} else if ((off < 0) || (off > b.length) || (len < 0) ||
((off + len) > b.length) || ((off + len) < 0)) {
} else if ((off < 0) || (off > b.length) || (len < 0)
|| ((off + len) > b.length) || ((off + len) < 0)) {
throw new IndexOutOfBoundsException();
} else if (len == 0) {
return 0;

View File

@ -195,13 +195,14 @@ public abstract class XMLHelper {
}
public static Document parseToDom(InputStream stream, Resource res, EntityResolver entityResolver) throws IOException,
SAXException {
public static Document parseToDom(
InputStream stream, Resource res, EntityResolver entityResolver)
throws IOException, SAXException {
DocumentBuilder docBuilder = getDocBuilder(entityResolver);
Document pomDomDoc;
try {
pomDomDoc = docBuilder.parse(stream, res.getName());
} catch (SAXException e ) {
} catch (SAXException e) {
e.printStackTrace();
throw e;
} finally {