Skip to content

Commit

Permalink
Remove confusing and almost unused Asserts class
Browse files Browse the repository at this point in the history
  • Loading branch information
cbosdo committed Oct 9, 2023
1 parent 33d5f90 commit a9f7e65
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 181 deletions.
175 changes: 0 additions & 175 deletions java/code/src/com/redhat/rhn/common/util/Asserts.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
package com.redhat.rhn.frontend.struts;

import com.redhat.rhn.common.util.Asserts;
import com.redhat.rhn.common.util.DatePicker;
import com.redhat.rhn.common.util.ServletUtils;
import com.redhat.rhn.common.validator.ValidationMessage;
Expand Down Expand Up @@ -97,7 +96,9 @@ public ActionForward forwardParam(ActionForward base, String param, String value
* param and value.
*/
public ActionForward forwardParams(ActionForward base, Map params) {
Asserts.assertNotNull(base, "base");
if (base == null) {
throw new IllegalArgumentException("Base should not be null");
}
String newPath = ServletUtils.pathWithParams(base.getPath(), params);

ActionForward af = new ActionForward(newPath, base.getRedirect());
Expand Down
9 changes: 6 additions & 3 deletions java/code/src/com/redhat/rhn/manager/rhnset/RhnSetDecl.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
package com.redhat.rhn.manager.rhnset;

import com.redhat.rhn.common.util.Asserts;
import com.redhat.rhn.domain.channel.Channel;
import com.redhat.rhn.domain.rhnset.RhnSet;
import com.redhat.rhn.domain.rhnset.SetCleanup;
Expand Down Expand Up @@ -375,7 +374,9 @@ public void clear(User u) {
* @return the created set
*/
public RhnSet create(User u) {
Asserts.assertNotNull(u, "u");
if (u == null) {
throw new IllegalArgumentException("user should not be null");
}
return RhnSetManager.createSet(u.getId(), label, cleanup);
}

Expand All @@ -387,7 +388,9 @@ public RhnSet create(User u) {
* @return the set for user <code>u</code>
*/
public RhnSet get(User u) {
Asserts.assertNotNull(u, "u");
if (u == null) {
throw new IllegalArgumentException("user should not be null");
}
RhnSet s = lookup(u);
if (s == null) {
s = create(u);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

package com.redhat.rhn.taskomatic.task.payg.dimensions.rules.test;

import static com.redhat.rhn.common.util.Asserts.assertTrue;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.jmock.AbstractExpectations.returnValue;

import com.redhat.rhn.domain.product.SUSEProduct;
Expand Down

0 comments on commit a9f7e65

Please sign in to comment.