Skip to content

Commit 8d80166

Browse files
philwebbrwinch
authored andcommitted
Update exception variable names
Consistently use `ex` for caught exception and `cause` for Exception constructor arguments. Issue gh-8945
1 parent e913048 commit 8d80166

194 files changed

Lines changed: 635 additions & 633 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎acl/src/main/java/org/springframework/security/acls/domain/IdentityUnavailableException.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ public IdentityUnavailableException(String msg) {
3434
* Constructs an <code>IdentityUnavailableException</code> with the specified message
3535
* and root cause.
3636
* @param msg the detail message
37-
* @param t root cause
37+
* @param cause root cause
3838
*/
39-
public IdentityUnavailableException(String msg, Throwable t) {
40-
super(msg, t);
39+
public IdentityUnavailableException(String msg, Throwable cause) {
40+
super(msg, cause);
4141
}
4242

4343
}

‎acl/src/main/java/org/springframework/security/acls/domain/ObjectIdentityImpl.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ public ObjectIdentityImpl(Object object) throws IdentityUnavailableException {
7777
Method method = typeClass.getMethod("getId", new Class[] {});
7878
result = method.invoke(object);
7979
}
80-
catch (Exception e) {
81-
throw new IdentityUnavailableException("Could not extract identity from object " + object, e);
80+
catch (Exception ex) {
81+
throw new IdentityUnavailableException("Could not extract identity from object " + object, ex);
8282
}
8383

8484
Assert.notNull(result, "getId() is required to return a non-null value");

‎acl/src/main/java/org/springframework/security/acls/jdbc/AclClassIdUtils.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ private boolean hasValidClassIdType(ResultSet resultSet) {
8585
try {
8686
hasClassIdType = classIdTypeFrom(resultSet) != null;
8787
}
88-
catch (SQLException e) {
89-
log.debug("Unable to obtain the class id type", e);
88+
catch (SQLException ex) {
89+
log.debug("Unable to obtain the class id type", ex);
9090
}
9191
return hasClassIdType;
9292
}
@@ -101,8 +101,8 @@ private <T extends Serializable> Class<T> classIdTypeFrom(String className) {
101101
try {
102102
targetType = Class.forName(className);
103103
}
104-
catch (ClassNotFoundException e) {
105-
log.debug("Unable to find class id type on classpath", e);
104+
catch (ClassNotFoundException ex) {
105+
log.debug("Unable to find class id type on classpath", ex);
106106
}
107107
}
108108
return targetType;

‎acl/src/main/java/org/springframework/security/acls/jdbc/BasicLookupStrategy.java‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,26 +194,26 @@ private List<AccessControlEntryImpl> readAces(AclImpl acl) {
194194
try {
195195
return (List<AccessControlEntryImpl>) this.fieldAces.get(acl);
196196
}
197-
catch (IllegalAccessException e) {
198-
throw new IllegalStateException("Could not obtain AclImpl.aces field", e);
197+
catch (IllegalAccessException ex) {
198+
throw new IllegalStateException("Could not obtain AclImpl.aces field", ex);
199199
}
200200
}
201201

202202
private void setAclOnAce(AccessControlEntryImpl ace, AclImpl acl) {
203203
try {
204204
this.fieldAcl.set(ace, acl);
205205
}
206-
catch (IllegalAccessException e) {
207-
throw new IllegalStateException("Could not or set AclImpl on AccessControlEntryImpl fields", e);
206+
catch (IllegalAccessException ex) {
207+
throw new IllegalStateException("Could not or set AclImpl on AccessControlEntryImpl fields", ex);
208208
}
209209
}
210210

211211
private void setAces(AclImpl acl, List<AccessControlEntryImpl> aces) {
212212
try {
213213
this.fieldAces.set(acl, aces);
214214
}
215-
catch (IllegalAccessException e) {
216-
throw new IllegalStateException("Could not set AclImpl entries", e);
215+
catch (IllegalAccessException ex) {
216+
throw new IllegalStateException("Could not set AclImpl entries", ex);
217217
}
218218
}
219219

‎acl/src/main/java/org/springframework/security/acls/model/AlreadyExistsException.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ public AlreadyExistsException(String msg) {
3434
* Constructs an <code>AlreadyExistsException</code> with the specified message and
3535
* root cause.
3636
* @param msg the detail message
37-
* @param t root cause
37+
* @param cause root cause
3838
*/
39-
public AlreadyExistsException(String msg, Throwable t) {
40-
super(msg, t);
39+
public AlreadyExistsException(String msg, Throwable cause) {
40+
super(msg, cause);
4141
}
4242

4343
}

‎acl/src/main/java/org/springframework/security/acls/model/ChildrenExistException.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ public ChildrenExistException(String msg) {
3434
* Constructs an <code>ChildrenExistException</code> with the specified message and
3535
* root cause.
3636
* @param msg the detail message
37-
* @param t root cause
37+
* @param cause root cause
3838
*/
39-
public ChildrenExistException(String msg, Throwable t) {
40-
super(msg, t);
39+
public ChildrenExistException(String msg, Throwable cause) {
40+
super(msg, cause);
4141
}
4242

4343
}

‎acl/src/main/java/org/springframework/security/acls/model/NotFoundException.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ public NotFoundException(String msg) {
3434
* Constructs an <code>NotFoundException</code> with the specified message and root
3535
* cause.
3636
* @param msg the detail message
37-
* @param t root cause
37+
* @param cause root cause
3838
*/
39-
public NotFoundException(String msg, Throwable t) {
40-
super(msg, t);
39+
public NotFoundException(String msg, Throwable cause) {
40+
super(msg, cause);
4141
}
4242

4343
}

‎acl/src/main/java/org/springframework/security/acls/model/UnloadedSidException.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ public UnloadedSidException(String msg) {
3636
* Constructs an <code>NotFoundException</code> with the specified message and root
3737
* cause.
3838
* @param msg the detail message
39-
* @param t root cause
39+
* @param cause root cause
4040
*/
41-
public UnloadedSidException(String msg, Throwable t) {
42-
super(msg, t);
41+
public UnloadedSidException(String msg, Throwable cause) {
42+
super(msg, cause);
4343
}
4444

4545
}

‎acl/src/test/java/org/springframework/security/acls/domain/AclImplTests.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,8 @@ public MutableAcl updateAcl(MutableAcl acl) throws NotFoundException {
628628
((AuditableAccessControlEntry) ac).isAuditFailure()));
629629
}
630630
}
631-
catch (IllegalAccessException e) {
632-
e.printStackTrace();
631+
catch (IllegalAccessException ex) {
632+
ex.printStackTrace();
633633
}
634634

635635
return acl;

‎acl/src/test/java/org/springframework/security/acls/jdbc/JdbcMutableAclServiceTests.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ public void createTables() throws Exception {
121121
// new DatabaseSeeder(dataSource, new
122122
// ClassPathResource("createAclSchemaPostgres.sql"));
123123
}
124-
catch (Exception e) {
125-
e.printStackTrace();
126-
throw e;
124+
catch (Exception ex) {
125+
ex.printStackTrace();
126+
throw ex;
127127
}
128128
}
129129

0 commit comments

Comments
 (0)