Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<String> 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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions persistit/core/src/main/java/com/persistit/BufferPool.java
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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);
}
}

Expand Down
3 changes: 2 additions & 1 deletion persistit/core/src/main/java/com/persistit/Exchange.java
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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];
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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);

Expand Down
7 changes: 4 additions & 3 deletions persistit/ui/src/main/java/com/persistit/ui/AdminUI.java
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -108,7 +109,7 @@ public Object execute(Map<String, Object> 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));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down
Loading