Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Conversation

@WonderCsabo
Copy link
Member

Fixes #1750 .

@dodgex can you take a look? I wonder, we may want to introduce a new method in the handler interface for this (isEnabled()), which has a true default implementation in the base classes.

@dodgex
Copy link
Member

dodgex commented Apr 17, 2016

i think i'd prefer to have an isEnabled() in base annotation handler that by default returns true and can be overridden by each handler to return what ever it needs to return. also I'd say to have the option check in the isEnabled() and not passing a boolean in the constructor.

@Override
public boolean isEnabled() {
    return environment.getOptionBooleanValue(OPTION_TRACE);
}

also the check if a processor should run (if(isEnabled())) should be at the place where the methods are called.

if(processor.isEnabled()) {
  processor.validate(...);
  processor.process(...);
}

or if you do not want to have the check wherever validate and/or process are called add a new method that is called and that one does the enabled check and call the concrete validation/processing. (but i think that is a bit to much)

if you want to keep the current implementation just remove one of the two empty lines in TraceHandler :P

@WonderCsabo
Copy link
Member Author

Thanks @dodgex! I will refactor it for the isEnabled() method. I think it is not a breaking change because the default implementation will retain the old behaviour.

@WonderCsabo
Copy link
Member Author

Superseded by #1782 .

@WonderCsabo WonderCsabo deleted the 1750_fixEnablingAnnotations branch May 31, 2016 12:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants