try {
xr.parse(new InputSource(inputStream));
} catch (SAXException e) {
- IOException error = new IOException(
- RepoText.get().errorParsingManifestFile);
- error.initCause(e);
- throw error;
+ throw new IOException(RepoText.get().errorParsingManifestFile, e);
}
}
private void loadSystemConfig() throws IOException {
try {
systemConfig.load();
- } catch (ConfigInvalidException e1) {
- IOException e2 = new IOException(MessageFormat.format(JGitText
+ } catch (ConfigInvalidException e) {
+ throw new IOException(MessageFormat.format(JGitText
.get().systemConfigFileInvalid, systemConfig.getFile()
- .getAbsolutePath(), e1));
- e2.initCause(e1);
- throw e2;
+ .getAbsolutePath(),
+ e), e);
}
}
private void loadUserConfig() throws IOException {
try {
userConfig.load();
- } catch (ConfigInvalidException e1) {
- IOException e2 = new IOException(MessageFormat.format(JGitText
+ } catch (ConfigInvalidException e) {
+ throw new IOException(MessageFormat.format(JGitText
.get().userConfigFileInvalid, userConfig.getFile()
- .getAbsolutePath(), e1));
- e2.initCause(e1);
- throw e2;
+ .getAbsolutePath(),
+ e), e);
}
}
private void loadRepoConfig() throws IOException {
try {
repoConfig.load();
- } catch (ConfigInvalidException e1) {
- IOException e2 = new IOException(JGitText.get().unknownRepositoryFormat);
- e2.initCause(e1);
- throw e2;
+ } catch (ConfigInvalidException e) {
+ throw new IOException(JGitText.get().unknownRepositoryFormat, e);
}
}
try {
return read(fd, packIndex, reverseIndex);
} catch (IOException ioe) {
- final String path = idxFile.getAbsolutePath();
- final IOException err;
- err = new IOException(MessageFormat.format(
- JGitText.get().unreadablePackIndex, path));
- err.initCause(ioe);
- throw err;
+ throw new IOException(MessageFormat
+ .format(JGitText.get().unreadablePackIndex,
+ idxFile.getAbsolutePath()),
+ ioe);
} finally {
try {
fd.close();
try {
return read(fd);
} catch (IOException ioe) {
- final String path = idxFile.getAbsolutePath();
- final IOException err;
- err = new IOException(MessageFormat.format(JGitText.get().unreadablePackIndex, path));
- err.initCause(ioe);
- throw err;
+ throw new IOException(MessageFormat
+ .format(JGitText.get().unreadablePackIndex,
+ idxFile.getAbsolutePath()),
+ ioe);
} finally {
try {
fd.close();
n--;
String content = RawParseUtils.decode(buf, 0, n);
- IOException ioException = new IOException(MessageFormat.format(JGitText.get().notARef,
- name, content));
- ioException.initCause(notRef);
- throw ioException;
+ throw new IOException(MessageFormat.format(JGitText.get().notARef,
+ name, content), notRef);
}
return new LooseUnpeeled(otherSnapshot, name, id);
}
if (err instanceof IOException)
throw (IOException) err;
- IOException fail = new IOException(err.getMessage());
- fail.initCause(err);
- throw fail;
+ throw new IOException(err.getMessage(), err);
}
endPhase(monitor);
}
.equals(localIgnoreSubmoduleMode))
continue;
} catch (ConfigInvalidException e) {
- IOException e1 = new IOException(MessageFormat.format(
+ throw new IOException(MessageFormat.format(
JGitText.get().invalidIgnoreParamSubmodule,
- smw.getPath()));
- e1.initCause(e);
- throw e1;
+ smw.getPath()), e);
}
Repository subRepo = smw.getRepository();
if (subRepo != null) {
clear();
snapshot = newSnapshot;
} catch (IOException e) {
- final IOException e2 = new IOException(MessageFormat.format(JGitText.get().cannotReadFile, getFile()));
- e2.initCause(e);
- throw e2;
+ throw new IOException(MessageFormat
+ .format(JGitText.get().cannotReadFile, getFile()), e);
} catch (ConfigInvalidException e) {
throw new ConfigInvalidException(MessageFormat.format(JGitText.get().cannotReadFile, getFile()), e);
}
try {
xr.parse(new InputSource(in));
} catch (SAXException parsingError) {
- final IOException p;
- p = new IOException(MessageFormat.format(JGitText.get().errorListing, prefix));
- p.initCause(parsingError);
- throw p;
+ throw new IOException(
+ MessageFormat.format(
+ JGitText.get().errorListing, prefix),
+ parsingError);
} finally {
in.close();
}
conn.setRequestProperty(HDR_AUTHORIZATION, getType().getSchemeName()
+ " " + Base64.encodeBytes(token)); //$NON-NLS-1$
} catch (GSSException e) {
- IOException ioe = new IOException();
- ioe.initCause(e);
- throw ioe;
+ throw new IOException(e);
}
}
}
}
IOException error(final Throwable why) {
- final IOException e;
- e = new IOException(MessageFormat.format(JGitText.get().encryptionError, why.getMessage()));
- e.initCause(why);
- return e;
+ return new IOException(MessageFormat
+ .format(JGitText.get().encryptionError,
+ why.getMessage()), why);
}
private static class NoEncryption extends WalkEncryption {