@@ -145,11 +145,10 @@ public void setPermissions(final Collection child, final String owner, final Str
145
145
146
146
private Optional <List <ACEAider >> getAces (@ Nullable final Permission permission ) {
147
147
final Optional <List <ACEAider >> maybeAces ;
148
- if (permission != null && permission instanceof ACLPermission ) {
149
- final ACLPermission aclPerm = (ACLPermission )permission ;
150
- final List <ACEAider > aces = new ArrayList <>(aclPerm .getACECount ());
151
- for (int i = 0 ; i < aclPerm .getACECount (); i ++) {
152
- aces .add (new ACEAider (aclPerm .getACEAccessType (i ), aclPerm .getACETarget (i ), aclPerm .getACEWho (i ), aclPerm .getACEMode (i )));
148
+ if (permission != null && permission instanceof ACLPermission aclPermission ) {
149
+ final List <ACEAider > aces = new ArrayList <>(aclPermission .getACECount ());
150
+ for (int i = 0 ; i < aclPermission .getACECount (); i ++) {
151
+ aces .add (new ACEAider (aclPermission .getACEAccessType (i ), aclPermission .getACETarget (i ), aclPermission .getACEWho (i ), aclPermission .getACEMode (i )));
153
152
}
154
153
maybeAces = Optional .of (aces );
155
154
} else {
@@ -312,34 +311,34 @@ public void unlockResource(final Resource resource) throws XMLDBException {
312
311
313
312
@ Override
314
313
public Permission getPermissions (final Collection coll ) throws XMLDBException {
315
- if (coll instanceof LocalCollection ) {
316
- return this .<Permission >read ((( LocalCollection ) coll ) .getPathURI ()).apply ((collection , broker , transaction ) -> collection .getPermissionsNoLock ());
314
+ if (coll instanceof LocalCollection localCollection ) {
315
+ return this .<Permission >read (localCollection .getPathURI ()).apply ((collection , broker , transaction ) -> collection .getPermissionsNoLock ());
317
316
}
318
317
return null ;
319
318
}
320
319
321
320
@ Override
322
321
public Permission getSubCollectionPermissions (final Collection parent , final String name ) throws XMLDBException {
323
- if (parent instanceof LocalCollection ) {
324
- return this .<Permission >read ((( LocalCollection ) parent ) .getPathURI ()).apply ((collection , broker , transaction ) -> collection .getChildCollectionEntry (broker , name ).getPermissions ());
322
+ if (parent instanceof LocalCollection localCollection ) {
323
+ return this .<Permission >read (localCollection .getPathURI ()).apply ((collection , broker , transaction ) -> collection .getChildCollectionEntry (broker , name ).getPermissions ());
325
324
} else {
326
325
return null ;
327
326
}
328
327
}
329
328
330
329
@ Override
331
330
public Permission getSubResourcePermissions (final Collection parent , final String name ) throws XMLDBException {
332
- if (parent instanceof LocalCollection ) {
333
- return this .<Permission >read ((( LocalCollection ) parent ) .getPathURI ()).apply ((collection , broker , transaction ) -> collection .getResourceEntry (broker , name ).getPermissions ());
331
+ if (parent instanceof LocalCollection localCollection ) {
332
+ return this .<Permission >read (localCollection .getPathURI ()).apply ((collection , broker , transaction ) -> collection .getResourceEntry (broker , name ).getPermissions ());
334
333
} else {
335
334
return null ;
336
335
}
337
336
}
338
337
339
338
@ Override
340
339
public Date getSubCollectionCreationTime (final Collection parent , final String name ) throws XMLDBException {
341
- if (parent instanceof LocalCollection ) {
342
- return this .<Date >read ((( LocalCollection ) parent ) .getPathURI ()).apply ((collection , broker , transaction ) -> new Date (collection .getChildCollectionEntry (broker , name ).getCreated ()));
340
+ if (parent instanceof LocalCollection localCollection ) {
341
+ return this .<Date >read (localCollection .getPathURI ()).apply ((collection , broker , transaction ) -> new Date (collection .getChildCollectionEntry (broker , name ).getCreated ()));
343
342
} else {
344
343
return null ;
345
344
}
0 commit comments