Skip to content

Commit a6e4b86

Browse files
Updated javadoc and moved argument
1 parent f5e8908 commit a6e4b86

File tree

1 file changed

+3
-5
lines changed
  • modules/collect/src/main/java/com/opengamma/strata/collect/result

1 file changed

+3
-5
lines changed

modules/collect/src/main/java/com/opengamma/strata/collect/result/Result.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ public static <R> Result<R> ofNullable(R value) {
461461
}
462462

463463
/**
464-
* Returns a success result containing the value is present, else returns a failure result
464+
* Returns a success result containing the value if present, else returns a failure result
465465
* with the specified reason and message.
466466
* <p>
467467
* The message is produced using a template that contains zero to many "{}" placeholders.
@@ -490,16 +490,14 @@ public static <R> Result<R> ofOptional(
490490
}
491491

492492
/**
493-
* Returns a success result containing the value is present, else returns a failure result
493+
* Returns a success result containing the value if present, else returns a failure result
494494
* with a reason of {@link FailureReason#MISSING_DATA} and message to say an unexpected empty value was found.
495495
*
496496
* @param <R> the expected type of the result
497497
* @param value the potentially null value
498498
* @return a success result if the value is non-null, else a failure result
499499
*/
500-
public static <R> Result<R> ofOptional(
501-
Optional<R> value) {
502-
500+
public static <R> Result<R> ofOptional(Optional<R> value) {
503501
return ofOptional(value, FailureReason.MISSING_DATA, "Found empty where a value was expected");
504502
}
505503

0 commit comments

Comments
 (0)