Skip to content

Commit

Permalink
remove unused exceptions from the throws clause
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoayyed committed Nov 22, 2024
1 parent 7a3df02 commit de4db14
Show file tree
Hide file tree
Showing 57 changed files with 108 additions and 154 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ private class ConnectorChecker extends Checker {
}

@Override
public String call() throws Exception {
public String call() {
try {
return String.format("{ \"status\": \"%s\", \"target\": \"%s\"}",
connectorRestClient.check(coreAddress, domain, jwt, key)
Expand All @@ -243,7 +243,7 @@ private class ResourceChecker extends Checker {
}

@Override
public String call() throws Exception {
public String call() {
try {
return String.format("{ \"status\": \"%s\", \"target\": \"%s\"}",
resourceRestClient.check(coreAddress, domain, jwt, key)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ public HttpResourceStream(final ResponseHolder responseHolder) {
}

@Override
public InputStream getInputStream()
throws ResourceStreamNotFoundException {
public InputStream getInputStream() {

return responseHolder.getInputStream() == null
? new ByteArrayInputStream(new byte[0])
Expand All @@ -57,7 +56,7 @@ public Bytes length() {
}

@Override
public void close() throws IOException {
public void close() {
// No need for explict closing
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ private class ApplyFuture implements Callable<Pair<Serializable, Serializable>>,
}

@Override
public Pair<Serializable, Serializable> call() throws Exception {
public Pair<Serializable, Serializable> call() {
try {
ThreadContext.setApplication(this.application);
ThreadContext.setRequestCycle(this.requestCycle);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public BatchClientProxyImpl(

@Override
@SuppressWarnings("unchecked")
protected Object[] preProcessResult(final Message message) throws Exception {
protected Object[] preProcessResult(final Message message) {
BatchRequestItem bri = new BatchRequestItem();
bri.setMethod((String) message.get(Message.HTTP_REQUEST_METHOD));
bri.setRequestURI(StringUtils.substringAfter(
Expand All @@ -77,7 +77,7 @@ protected Object[] preProcessResult(final Message message) throws Exception {
}

@Override
protected Object handleResponse(final Message outMessage, final Class<?> serviceCls) throws Throwable {
protected Object handleResponse(final Message outMessage, final Class<?> serviceCls) {
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public BatchOfflineHTTPConduit(
@Override
protected void setupConnection(
final Message message, final Address address,
final HTTPClientPolicy csPolicy) throws IOException {
final HTTPClientPolicy csPolicy) {
}

@Override
Expand All @@ -65,7 +65,7 @@ protected OutputStream createOutputStream(
final Message message,
final boolean needToCacheRequest,
final boolean isChunking,
final int chunkThreshold) throws IOException {
final int chunkThreshold) {

baos = new ByteArrayOutputStream();
return baos;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@ public String run(final CommandTO command) {
}

@Override
protected EntityTO resolveReference(final Method method, final Object... args)
throws UnresolvedReferenceException {
protected EntityTO resolveReference(final Method method, final Object... args) {

throw new UnsupportedOperationException();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
public class AddDomainFilter implements ContainerResponseFilter {

@Override
public void filter(final ContainerRequestContext reqCtx, final ContainerResponseContext resCtx) throws IOException {
public void filter(final ContainerRequestContext reqCtx, final ContainerResponseContext resCtx) {
resCtx.getHeaders().add(RESTHeaders.DOMAIN, AuthContextUtils.getDomain());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
public class AddETagFilter implements ContainerResponseFilter {

@Override
public void filter(final ContainerRequestContext reqCtx, final ContainerResponseContext resCtx) throws IOException {
public void filter(final ContainerRequestContext reqCtx, final ContainerResponseContext resCtx) {
if (resCtx.getEntityTag() == null) {
AnyTO annotated = null;
if (resCtx.getEntity() instanceof AnyTO anyTO) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public String getCharacterEncoding() {
}

@Override
public ServletInputStream getInputStream() throws IOException {
public ServletInputStream getInputStream() {
return inputStream;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void setWriteListener(final WriteListener writeListener) {
}

@Override
public void write(final int b) throws IOException {
public void write(final int b) {
baos.write(b);
}
};
Expand Down Expand Up @@ -179,17 +179,17 @@ public String encodeRedirectURL(final String url) {
}

@Override
public void sendError(final int sc, final String msg) throws IOException {
public void sendError(final int sc, final String msg) {
setStatus(sc);
}

@Override
public void sendError(final int sc) throws IOException {
public void sendError(final int sc) {
setStatus(sc);
}

@Override
public void sendRedirect(final String location) throws IOException {
public void sendRedirect(final String location) {
setStatus(SC_MOVED_TEMPORARILY);
setHeader(HttpHeaders.LOCATION, location);
}
Expand Down Expand Up @@ -219,12 +219,12 @@ public ByteArrayOutputStream getUnderlyingOutputStream() {
}

@Override
public ServletOutputStream getOutputStream() throws IOException {
public ServletOutputStream getOutputStream() {
return servletOuputStream;
}

@Override
public PrintWriter getWriter() throws IOException {
public PrintWriter getWriter() {
return writer;
}

Expand Down Expand Up @@ -259,7 +259,7 @@ public int getBufferSize() {
}

@Override
public void flushBuffer() throws IOException {
public void flushBuffer() {
throw new UnsupportedOperationException();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ protected AbstractContentLoaderHandler(
protected abstract void create(String qName, Attributes atts);

@Override
public void startElement(final String uri, final String localName, final String qName, final Attributes atts)
throws SAXException {
public void startElement(final String uri, final String localName, final String qName, final Attributes atts) {

// skip root element
if (rootElement.equals(qName)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ protected void exportTable(
final int threshold,
final BidiMap<String, EntityType<?>> entities,
final Map<String, Pair<String, String>> relationTables,
final TransformerHandler handler) throws SQLException, MetaDataAccessException, SAXException {
final TransformerHandler handler) throws MetaDataAccessException, SAXException {

LOG.debug("Export table {}", tableName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class OpenJpaDialect extends DefaultJpaDialect {

@Override
public Object beginTransaction(final EntityManager entityManager, final TransactionDefinition definition)
throws PersistenceException, SQLException, TransactionException {
throws PersistenceException, TransactionException {

OpenJPAEntityManager openJpaEntityManager = getOpenJPAEntityManager(entityManager);

Expand All @@ -74,7 +74,7 @@ public Object beginTransaction(final EntityManager entityManager, final Transact

@Override
public ConnectionHandle getJdbcConnection(final EntityManager entityManager, final boolean readOnly)
throws PersistenceException, SQLException {
throws PersistenceException {

return new OpenJpaConnectionHandle(getOpenJPAEntityManager(entityManager));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected boolean existingData(final String domain) {
}

@Override
protected void createViews(final String domain) throws IOException {
protected void createViews(final String domain) {
// nothing to do
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ public interface NotificationJobDelegate {

TaskExec<NotificationTask> executeSingle(NotificationTask task, String executor);

void execute(String executor) throws JobExecutionException;
void execute(String executor);
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,17 @@ public interface ProvisioningActions {
* Action to be executed before to start the provisioning (push / pull) task execution.
*
* @param profile provisioning profile
* @throws JobExecutionException in case of generic failure
*/
default void beforeAll(ProvisioningProfile<?, ?> profile) throws JobExecutionException {
default void beforeAll(ProvisioningProfile<?, ?> profile) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'profile' is never used.
// do nothing
}

/**
* Action to be executed after the provisioning (push / pull) task completion.
*
* @param profile provisioning profile
* @throws JobExecutionException in case of generic failure
*/
default void afterAll(ProvisioningProfile<?, ?> profile) throws JobExecutionException {
default void afterAll(ProvisioningProfile<?, ?> profile) {
// do nothing
}
}
Loading

0 comments on commit de4db14

Please sign in to comment.