Skip to content

Commit

Permalink
Minor refactoring around procedures
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewkerr9000 committed Feb 12, 2018
1 parent 5b42408 commit 59a5cc3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Expand Up @@ -160,7 +160,12 @@ public void registerProcedure( Class<?> proc, boolean overrideCurrentImplementat
* @param overrideCurrentImplementation set to true if procedures within this class should override older procedures with the same name
* @param warning the warning the procedure should generate when called
*/
public void registerProcedure( Class<?> proc, boolean overrideCurrentImplementation, Optional<String> warning )
public void registerProcedure( Class<?> proc, boolean overrideCurrentImplementation, String warning ) throws KernelException
{
registerProcedure( proc, overrideCurrentImplementation, Optional.of( warning ) );
}

private void registerProcedure( Class<?> proc, boolean overrideCurrentImplementation, Optional<String> warning )
throws
KernelException
{
Expand Down
Expand Up @@ -29,8 +29,8 @@
* Practically, this means that before the procedure is called, fields with this annotation are automatically
* populated with implementations of the specified APIs.
*
* In fact, apart from static fields, <i>only</i> fields with this annotation are allowed in classses that
* define procedure. Each of the fields must be public and non-final.
* In fact, apart from static fields, <i>only</i> fields with this annotation are allowed in classes that
* define procedures. Each of the fields must be public and non-final.
*
* @see Procedure
*/
Expand Down
Expand Up @@ -29,7 +29,6 @@
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -112,8 +111,7 @@ public void setup( Dependencies dependencies ) throws KernelException
ctx -> authManager.getUserManager( ctx.get( SECURITY_CONTEXT ).subject(), ctx.get( SECURITY_CONTEXT ).isAdmin() ), true );
if ( config.get( SecuritySettings.auth_providers ).size() > 1 )
{
procedures.registerProcedure( UserManagementProcedures.class, true,
Optional.of( "%s only applies to native users." ) );
procedures.registerProcedure( UserManagementProcedures.class, true, "%s only applies to native users." );
}
else
{
Expand Down

0 comments on commit 59a5cc3

Please sign in to comment.