Skip to content

Commit

Permalink
Updates based on PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rsenden authored and remkop committed Sep 11, 2022
1 parent bd7dcbc commit fbccfe4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/java/picocli/CommandLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -5997,6 +5997,7 @@ private Model() {}
public interface IScope extends IGetter, ISetter {}

/** This interface provides access to an {@link IScope} instance.
* @since 4.7
*/
public interface IScoped {
/** Get the {@link IScope} instance.
Expand Down Expand Up @@ -9176,14 +9177,15 @@ private String defaultValueFromProvider() {
* @since 4.3 */
public ScopeType scopeType() { return scopeType; }

/** Check whether the {@link #getValue()} method is able to get an actual value from the current {@link #getter()}. */
/** Check whether the {@link #getValue()} method is able to get an actual value from the current {@link #getter()}.
* @since 4.7 */
public boolean isValueGettable() {
if (getter instanceof IScoped) {
IScoped scoped = (IScoped) getter;
IScope scope = scoped.getScope();
if ( scope==null ) { return false; }
try {
Object obj = scope.get();
return obj != null;
return scope.get() != null;
} catch (Exception e) {
return false;
}
Expand Down

0 comments on commit fbccfe4

Please sign in to comment.