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

#215: WsImport.doMain() not closing binding file upon subsequent invocations #244

Merged
merged 1 commit into from
Jun 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand Down Expand Up @@ -136,7 +136,9 @@ public static XMLStreamReader create(InputSource source, boolean rejectDTDs) {
}

// Otherwise, open URI
return get().doCreate(source.getSystemId(), new URL(source.getSystemId()).openStream(),rejectDTDs);
InputStream is = new URL(source.getSystemId()).openStream();
source.setByteStream(is);
return get().doCreate(source.getSystemId(), is, rejectDTDs);
} catch (IOException e) {
throw new XMLReaderException("stax.cantCreate",e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,14 @@ public final void parseBindings(ErrorReceiver receiver){
locator.setColumnNumber(reader.getLocation().getColumnNumber());
receiver.warning(locator, ConfigurationMessages.CONFIGURATION_NOT_BINDING_FILE(is.getSystemId()));
}
if (is.getByteStream() != null) {
try {
is.getByteStream().close();
is.setByteStream(null);
} catch (IOException ex) {
Logger.getLogger(WsimportOptions.class.getName()).log(Level.FINEST, null, ex);
}
}
}
}

Expand Down