Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add generics to ActionSet #79

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 @@ -19,6 +19,7 @@

package org.apache.fop.render.intermediate.extensions;

import java.util.HashMap;
import java.util.Map;

/**
Expand All @@ -29,7 +30,7 @@
public class ActionSet {

private int lastGeneratedID;
private Map actionRegistry = new java.util.HashMap();
private Map<String, AbstractAction> actionRegistry = new HashMap<>();

/**
* Generates a new synthetic ID for an action.
Expand All @@ -51,7 +52,7 @@ public synchronized String generateNewID(AbstractAction action) {
* @return the action or null if no action with this ID is stored
*/
public AbstractAction get(String id) {
return (AbstractAction)this.actionRegistry.get(id);
return this.actionRegistry.get(id);
}

/**
Expand Down Expand Up @@ -79,8 +80,7 @@ public void clear() {
}

private AbstractAction normalize(AbstractAction action) {
for (Object o : this.actionRegistry.values()) {
AbstractAction a = (AbstractAction) o;
for (AbstractAction a : this.actionRegistry.values()) {
if (a.isSame(action)) {
return a;
}
Expand Down