- try (LockHolder lh = Data.profiles.lockForReading()) {
- MobileLedgerProfile profile = null;
- for (int i = 0; i < Data.profiles.size(); i++) {
- MobileLedgerProfile p = Data.profiles.get(i);
- if (p.getUuid().equals(profileUUID)) {
- profile = p;
- break;
- }
- }
- if (profile == null) throw new RuntimeException(String.format(
- "Unable to find profile %s, which is supposed to contain " +
- "transaction %d with description %s", profileUUID, transactionId,
- description));
+ MobileLedgerProfile profile = Data.getProfile(profileUUID);
+ if (profile == null) throw new RuntimeException(String.format(
+ "Unable to find profile %s, which is supposed to contain " +
+ "transaction %d with description %s", profileUUID, transactionId, description));