diff --git a/commons/audit/core/src/main/java/org/forgerock/audit/util/DateUtil.java b/commons/audit/core/src/main/java/org/forgerock/audit/util/DateUtil.java index 2ec307195f..1b287059a1 100644 --- a/commons/audit/core/src/main/java/org/forgerock/audit/util/DateUtil.java +++ b/commons/audit/core/src/main/java/org/forgerock/audit/util/DateUtil.java @@ -12,6 +12,7 @@ * information: "Portions Copyrighted [year] [name of copyright owner]". * * Copyright © 2011-2015 ForgeRock AS. All rights reserved. + * Portions Copyrighted 2026 3A Systems, LLC. */ package org.forgerock.audit.util; @@ -211,6 +212,9 @@ public static int getDateDifferenceInDays(final Date start, final Date end, fina result++; } } + if (result == null) { + throw new IllegalArgumentException("start and end dates must not be null"); + } return result; } } diff --git a/commons/json-web-token/src/main/java/org/forgerock/json/jose/jwk/JWK.java b/commons/json-web-token/src/main/java/org/forgerock/json/jose/jwk/JWK.java index b1a27dd1fe..e6388ec6d6 100644 --- a/commons/json-web-token/src/main/java/org/forgerock/json/jose/jwk/JWK.java +++ b/commons/json-web-token/src/main/java/org/forgerock/json/jose/jwk/JWK.java @@ -12,6 +12,7 @@ * information: "Portions Copyrighted [year] [name of copyright owner]". * * Copyright 2013-2016 ForgeRock AS. + * Portions Copyrighted 2026 3A Systems, LLC. */ package org.forgerock.json.jose.jwk; @@ -89,13 +90,12 @@ protected JWK(KeyType kty, KeyUse use, String alg, String kid) { protected JWK(KeyType kty, KeyUse use, String alg, String kid, String x5u, String x5t, List x5c) { super(); if (kty == null) { - new JsonException("kty is a required field"); + throw new JsonException("kty is a required field"); } put(KTY, kty.toString()); - if (kid == null || kid.isEmpty()) { - new JsonException("kid is a required field"); + if (kid != null && !kid.isEmpty()) { + put(KID, kid); } - put(KID, kid); if (use != null) { put(USE, use.toString()); } diff --git a/commons/rest/api-descriptor/src/main/java/org/forgerock/api/markup/asciidoc/AsciiDocTable.java b/commons/rest/api-descriptor/src/main/java/org/forgerock/api/markup/asciidoc/AsciiDocTable.java index d937c52eb8..710afdb0fd 100644 --- a/commons/rest/api-descriptor/src/main/java/org/forgerock/api/markup/asciidoc/AsciiDocTable.java +++ b/commons/rest/api-descriptor/src/main/java/org/forgerock/api/markup/asciidoc/AsciiDocTable.java @@ -12,6 +12,7 @@ * information: "Portions copyright [year] [name of copyright owner]". * * Copyright 2016 ForgeRock AS. + * Portions Copyrighted 2026 3A Systems, LLC. */ package org.forgerock.api.markup.asciidoc; @@ -132,7 +133,7 @@ public AsciiDocTable columnsPerRow(final int columnsPerRow) { if (this.columnsPerRow != null) { throw new AsciiDocException("columnsPerRow already defined"); } - if (this.columnsPerRow < 1) { + if (columnsPerRow < 1) { throw new AsciiDocException("columnsPerRow < 1"); } this.columnsPerRow = columnsPerRow; diff --git a/persistit/core/src/main/java/com/persistit/BufferPool.java b/persistit/core/src/main/java/com/persistit/BufferPool.java index 8af3ee0c44..57c1fd96b6 100644 --- a/persistit/core/src/main/java/com/persistit/BufferPool.java +++ b/persistit/core/src/main/java/com/persistit/BufferPool.java @@ -1,6 +1,7 @@ /** * Copyright 2005-2012 Akiban Technologies, Inc. * Copyright 2015 ForgeRock AS + * Portions Copyrighted 2026 3A Systems, LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -565,12 +566,12 @@ boolean invalidateSmallVolume(final Volume volume, final boolean mustWrite) thro _hashLocks[hashIndex % HASH_LOCKS].lock(); try { for (Buffer buffer = _hashTable[hashIndex]; buffer != null; buffer = buffer.getNext()) { - if ((buffer.getVolume() == volume || volume == null) && !buffer.isFixed() && buffer.isValid()) { + if ((buffer.getVolume() == volume) && !buffer.isFixed() && buffer.isValid()) { if (buffer.claim(true, 0)) { // re-check after claim boolean invalidated = false; try { - if ((buffer.getVolume() == volume || volume == null) && !buffer.isFixed() + if ((buffer.getVolume() == volume) && !buffer.isFixed() && buffer.isValid()) { if (mustWrite && buffer.isDirty()) { buffer.writePage(); diff --git a/persistit/core/src/main/java/com/persistit/DefaultObjectCoder.java b/persistit/core/src/main/java/com/persistit/DefaultObjectCoder.java index 437935b671..a85f28b70e 100644 --- a/persistit/core/src/main/java/com/persistit/DefaultObjectCoder.java +++ b/persistit/core/src/main/java/com/persistit/DefaultObjectCoder.java @@ -1,5 +1,6 @@ /** * Copyright 2005-2012 Akiban Technologies, Inc. + * Portions Copyrighted 2026 3A Systems, LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -450,7 +451,7 @@ public void appendKeySegment(final Key key, final Object object, final CoderCont accessor.toKey(object, key); } } catch (final Exception e) { - throw new ConversionException("Encoding " + accessor.toString() + " for " + getClientClass(), e); + throw new ConversionException("Encoding " + String.valueOf(accessor) + " for " + getClientClass(), e); } } @@ -524,7 +525,7 @@ public void renderKeySegment(final Key key, final Object target, final Class cla accessor.fromKey(target, key); } } catch (final Exception e) { - throw new ConversionException("Decoding " + accessor.toString() + " for " + getClientClass(), e); + throw new ConversionException("Decoding " + String.valueOf(accessor) + " for " + getClientClass(), e); } } diff --git a/persistit/core/src/main/java/com/persistit/Exchange.java b/persistit/core/src/main/java/com/persistit/Exchange.java index 3842f42e91..7e5c37c702 100644 --- a/persistit/core/src/main/java/com/persistit/Exchange.java +++ b/persistit/core/src/main/java/com/persistit/Exchange.java @@ -1,6 +1,7 @@ /** * Copyright 2005-2012 Akiban Technologies, Inc. * Copyright 2015 ForgeRock AS + * Portions Copyrighted 2026 3A Systems, LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -4233,7 +4234,7 @@ public KeyHistogram computeHistogram(final Key start, final Key end, final int s checkPageType(buffer, treeDepth + 1, false); } - while (foundAt != -1) { + while (foundAt != -1 && buffer != null) { foundAt = buffer.traverse(_key, direction, foundAt); direction = GT; if (buffer.isAfterRightEdge(foundAt)) { diff --git a/persistit/core/src/main/java/com/persistit/ManagementImpl.java b/persistit/core/src/main/java/com/persistit/ManagementImpl.java index b1ed8ffa17..807f665c64 100644 --- a/persistit/core/src/main/java/com/persistit/ManagementImpl.java +++ b/persistit/core/src/main/java/com/persistit/ManagementImpl.java @@ -1,5 +1,6 @@ /** * Copyright 2005-2012 Akiban Technologies, Inc. + * Portions Copyrighted 2026 3A Systems, LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -439,7 +440,9 @@ public LogicalRecord[] getLogicalRecordArray(final String volumeName, final Stri } catch (final Exception e) { throw new WrappedRemoteException(e); } finally { - exchange.ignoreMVCCFetch(false); + if (exchange != null) { + exchange.ignoreMVCCFetch(false); + } } if (count < maxCount) { final LogicalRecord[] trimmed = new LogicalRecord[count]; diff --git a/persistit/core/src/main/java/com/persistit/RecoveryManager.java b/persistit/core/src/main/java/com/persistit/RecoveryManager.java index 8c93aad9cb..e590f5eb92 100644 --- a/persistit/core/src/main/java/com/persistit/RecoveryManager.java +++ b/persistit/core/src/main/java/com/persistit/RecoveryManager.java @@ -1,5 +1,6 @@ /** * Copyright 2011-2012 Akiban Technologies, Inc. + * Portions Copyrighted 2026 3A Systems, LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1371,8 +1372,10 @@ private void validateMemberFile(final long generation) throws PersistitIOExcepti + Buffer.MAX_BUFFER_SIZE, "PA record size %3$,d not in valid range " + "[%4$,d:%5$,d] at %1$s:%2$,d"); final long pageAddress = PA.getPageAddress(_readBuffer); - validate(pageAddress, file, startingAddress, lastRequiredPageNode.getPageAddress(), - "Mismatched page address %3$d at %1$s:%2$d"); + if (lastRequiredPageNode != null) { + validate(pageAddress, file, startingAddress, lastRequiredPageNode.getPageAddress(), + "Mismatched page address %3$d at %1$s:%2$d"); + } // confirm that we can read the data read(lastRequiredJournalAddress, recordSize); diff --git a/persistit/ui/src/main/java/com/persistit/ui/AdminUI.java b/persistit/ui/src/main/java/com/persistit/ui/AdminUI.java index 5a47719ae6..88c5867df0 100644 --- a/persistit/ui/src/main/java/com/persistit/ui/AdminUI.java +++ b/persistit/ui/src/main/java/com/persistit/ui/AdminUI.java @@ -1,5 +1,6 @@ /** * Copyright 2005-2012 Akiban Technologies, Inc. + * Portions Copyrighted 2026 3A Systems, LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -607,8 +608,8 @@ private void handleTabChanged() { newPanel.setIsShowing(true); changeMenuMap(newPanel.getMenuMap(), true); scheduleRefresh(-1); + newPanel.setDefaultButton(); } - newPanel.setDefaultButton(); } void changeMenuMap(final Map menuMap, final boolean add) { @@ -950,9 +951,9 @@ public void addButton(final AbstractButton button) { public void removeButton(final AbstractButton button) { if (_buttonList != null) { _buttonList.remove(button); + if (_buttonList.size() == 0) + _buttonList = null; } - if (_buttonList.size() == 0) - _buttonList = null; } public void stateChanged(final boolean selected) { diff --git a/persistit/ui/src/main/java/com/persistit/ui/AdminUITreePanel.java b/persistit/ui/src/main/java/com/persistit/ui/AdminUITreePanel.java index bbdd0fddbc..e2de70319c 100644 --- a/persistit/ui/src/main/java/com/persistit/ui/AdminUITreePanel.java +++ b/persistit/ui/src/main/java/com/persistit/ui/AdminUITreePanel.java @@ -1,5 +1,6 @@ /** * Copyright 2005-2012 Akiban Technologies, Inc. + * Portions Copyrighted 2026 3A Systems, LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -316,7 +317,7 @@ protected void refresh(final boolean reset) { treeInfoArray = management.getTreeInfoArray(_selectedVolumeName); } _treeInfoArrayModel.setInfoArray(treeInfoArray); - if (_selectedTreeName != null) { + if (_selectedTreeName != null && treeInfoArray != null) { for (int index = 0; index < treeInfoArray.length; index++) { if (_selectedTreeName.equals(treeInfoArray[index].getName())) { _treeTable.getSelectionModel().setSelectionInterval(index, index); diff --git a/persistit/ui/src/main/java/com/persistit/ui/InspectorPanel.java b/persistit/ui/src/main/java/com/persistit/ui/InspectorPanel.java index 70392f9d51..7fdf0367fc 100644 --- a/persistit/ui/src/main/java/com/persistit/ui/InspectorPanel.java +++ b/persistit/ui/src/main/java/com/persistit/ui/InspectorPanel.java @@ -1,5 +1,6 @@ /** * Copyright 2005-2012 Akiban Technologies, Inc. + * Portions Copyrighted 2026 3A Systems, LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -136,7 +137,7 @@ protected synchronized void refresh(final boolean reset) { } if (_showValue) { - new Thread(new Fetcher(getLogicalRecord())).start(); + new Thread(new Fetcher(lr)).start(); } else { refreshed(); } diff --git a/script/common/src/main/java/org/forgerock/script/jsr223/ScriptExecutor.java b/script/common/src/main/java/org/forgerock/script/jsr223/ScriptExecutor.java index 23269f2bb3..e7865d48bf 100644 --- a/script/common/src/main/java/org/forgerock/script/jsr223/ScriptExecutor.java +++ b/script/common/src/main/java/org/forgerock/script/jsr223/ScriptExecutor.java @@ -2,6 +2,7 @@ * DO NOT REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright (c) 2012 ForgeRock AS. All rights reserved. + * Portions Copyrighted 2026 3A Systems, LLC. * * The contents of this file are subject to the terms * of the Common Development and Distribution License @@ -108,7 +109,7 @@ public Object execute(Map variables) throws ScriptException { } else { ScriptEngine scriptEngine = this.scriptEngineManager.getEngineByName(this.language); if (null == scriptEngine) { - /* error */ + throw new ScriptException("No script engine available for language: " + this.language); } return postProcess(scriptEngine.eval(scriptSource, newContext)); } diff --git a/script/common/src/main/java/org/forgerock/script/registry/ScriptRegistryImpl.java b/script/common/src/main/java/org/forgerock/script/registry/ScriptRegistryImpl.java index c2112884f8..fef756c6c6 100644 --- a/script/common/src/main/java/org/forgerock/script/registry/ScriptRegistryImpl.java +++ b/script/common/src/main/java/org/forgerock/script/registry/ScriptRegistryImpl.java @@ -2,6 +2,7 @@ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright (c) 2013-2015 ForgeRock AS. All Rights Reserved + * Portions Copyrighted 2026 3A Systems, LLC. * * The contents of this file are subject to the terms * of the Common Development and Distribution License @@ -347,7 +348,7 @@ private String getLanguageName() { } private boolean isDependOn(ScriptName dependency) { - if (null != dependency || null != source) { + if (null != dependency && null != source) { ScriptName[] dep = source.getDependencies(); if (null != dep && dep.length > 0) { for (ScriptName name : dep) {