Skip to content

Commit

Permalink
NetDB: Fix and deprecate unused store() method
Browse files Browse the repository at this point in the history
was broken for LS2, would have thrown cast exception
  • Loading branch information
zzzi2p committed Nov 8, 2023
1 parent ea8b3f0 commit 8ce79f3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions router/java/src/net/i2p/router/NetworkDatabaseFacade.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,14 @@ public abstract void lookupLeaseSetRemotely(Hash key, Job onFindJob, Job onFaile
* @return the old entry if it already existed at that key
* @throws IllegalArgumentException if the data is not valid
* @since 0.9.16
* @deprecated unused
*/
@Deprecated
public DatabaseEntry store(Hash key, DatabaseEntry entry) throws IllegalArgumentException {
if (entry.getType() == DatabaseEntry.KEY_TYPE_ROUTERINFO)
if (!entry.isLeaseSet())
return store(key, (RouterInfo) entry);
if (entry.getType() == DatabaseEntry.KEY_TYPE_LEASESET)
else
return store(key, (LeaseSet) entry);
throw new IllegalArgumentException("unknown type");
}

/**
Expand Down

0 comments on commit 8ce79f3

Please sign in to comment.