|
50 | 50 | import com.google.common.eventbus.EventBus;
|
51 | 51 | import com.tobiasdiez.easybind.EasyBind;
|
52 | 52 | import com.tobiasdiez.easybind.optional.OptionalBinding;
|
| 53 | +import org.jspecify.annotations.Nullable; |
53 | 54 | import org.slf4j.Logger;
|
54 | 55 | import org.slf4j.LoggerFactory;
|
55 | 56 |
|
@@ -309,22 +310,21 @@ private Optional<Field> getSourceField(Field targetField, EntryType targetEntry,
|
309 | 310 | * If a database is given, this function will try to resolve any string
|
310 | 311 | * references in the field-value.
|
311 | 312 | * Also, if a database is given, this function will try to find values for
|
312 |
| - * unset fields in the entry linked by the "crossref" field, if any. |
| 313 | + * unset fields in the entry linked by the "crossref" ({@link StandardField#CROSSREF} field, if any. |
313 | 314 | *
|
314 | 315 | * @param field The field to return the value of.
|
315 |
| - * @param database maybenull |
316 |
| - * The database of the bibtex entry. |
| 316 | + * @param database The database of the bibtex entry. |
317 | 317 | * @return The resolved field value or null if not found.
|
318 | 318 | */
|
319 |
| - public Optional<String> getResolvedFieldOrAlias(Field field, BibDatabase database) { |
| 319 | + public Optional<String> getResolvedFieldOrAlias(Field field, @Nullable BibDatabase database) { |
320 | 320 | return genericGetResolvedFieldOrAlias(field, database, BibEntry::getFieldOrAlias);
|
321 | 321 | }
|
322 | 322 |
|
323 |
| - public Optional<String> getResolvedFieldOrAliasLatexFree(Field field, BibDatabase database) { |
| 323 | + public Optional<String> getResolvedFieldOrAliasLatexFree(Field field, @Nullable BibDatabase database) { |
324 | 324 | return genericGetResolvedFieldOrAlias(field, database, BibEntry::getFieldOrAliasLatexFree);
|
325 | 325 | }
|
326 | 326 |
|
327 |
| - private Optional<String> genericGetResolvedFieldOrAlias(Field field, BibDatabase database, BiFunction<BibEntry, Field, Optional<String>> getFieldOrAlias) { |
| 327 | + private Optional<String> genericGetResolvedFieldOrAlias(Field field, @Nullable BibDatabase database, BiFunction<BibEntry, Field, Optional<String>> getFieldOrAlias) { |
328 | 328 | if ((InternalField.TYPE_HEADER == field) || (InternalField.OBSOLETE_TYPE_HEADER == field)) {
|
329 | 329 | return Optional.of(type.get().getDisplayName());
|
330 | 330 | }
|
|
0 commit comments