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

BEANUTILS-539/BEANUTILS-509: 1.X line, switch WeakFastHashMap for ConcurrentWeakHashMap #95

Open
wants to merge 1 commit into
base: 1.X
Choose a base branch
from
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
28 changes: 1 addition & 27 deletions src/main/java/org/apache/commons/beanutils/BeanUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -474,32 +474,6 @@ public static boolean initCause(final Throwable throwable, final Throwable cause
* @since 1.8.0
*/
public static <K, V> Map<K, V> createCache() {
return new WeakFastHashMap<K, V>();
}

/**
* Return whether a Map is fast
* @param map The map
* @return Whether it is fast or not.
* @since 1.8.0
*/
public static boolean getCacheFast(final Map<?, ?> map) {
if (map instanceof WeakFastHashMap) {
return ((WeakFastHashMap<?, ?>) map).getFast();
} else {
return false;
}
}

/**
* Set whether fast on a Map
* @param map The map
* @param fast Whether it should be fast or not.
* @since 1.8.0
*/
public static void setCacheFast(final Map<?, ?> map, final boolean fast) {
if (map instanceof WeakFastHashMap) {
((WeakFastHashMap<?, ?>)map).setFast(fast);
}
return new ConcurrentWeakKeyHashMap<K, V>();
}
}
Loading