Skip to content
Merged
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 @@ -56,6 +56,7 @@ public AbstractCacheManager() {
* @throws IllegalArgumentException if the {@code name} argument is {@code null} or does not contain text.
* @throws CacheException if there is a problem lazily creating a {@code Cache} instance.
*/
@Override
@SuppressWarnings("unchecked")
public <K, V> Cache<K, V> getCache(String name) throws IllegalArgumentException, CacheException {
if (!StringUtils.hasText(name)) {
Expand Down Expand Up @@ -92,6 +93,7 @@ public <K, V> Cache<K, V> getCache(String name) throws IllegalArgumentException,
*
* @throws Exception if any of the managed caches can't destroy properly.
*/
@Override
public void destroy() throws Exception {
while (!caches.isEmpty()) {
for (Cache<?, ?> cache : caches.values()) {
Expand All @@ -101,6 +103,7 @@ public void destroy() throws Exception {
}
}

@Override
public String toString() {
Collection<Cache<?, ?>> values = caches.values();
StringBuilder sb = new StringBuilder(getClass().getSimpleName())
Expand Down
8 changes: 8 additions & 0 deletions cache/src/main/java/org/apache/shiro/cache/MapCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,26 +54,32 @@ public MapCache(String name, Map<K, V> backingMap) {
this.map = backingMap;
}

@Override
public V get(K key) throws CacheException {
return map.get(key);
}

@Override
public V put(K key, V value) throws CacheException {
return map.put(key, value);
}

@Override
public V remove(K key) throws CacheException {
return map.remove(key);
}

@Override
public void clear() throws CacheException {
map.clear();
}

@Override
public int size() {
return map.size();
}

@Override
public Set<K> keys() {
Set<K> keys = map.keySet();
if (!keys.isEmpty()) {
Expand All @@ -82,6 +88,7 @@ public Set<K> keys() {
return Collections.emptySet();
}

@Override
public Collection<V> values() {
Collection<V> values = map.values();
if (!values.isEmpty()) {
Expand All @@ -90,6 +97,7 @@ public Collection<V> values() {
return Collections.emptyList();
}

@Override
public String toString() {
return new StringBuilder("MapCache '")
.append(name).append("' (")
Expand Down
25 changes: 25 additions & 0 deletions config/core/src/main/java/org/apache/shiro/config/Ini.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public Ini(Ini defaults) {
* @return {@code true} if no sections have been configured, or if there are sections, but the sections themselves
* are all empty, {@code false} otherwise.
*/
@Override
public boolean isEmpty() {
Collection<Section> sections = this.sections.values();
if (!sections.isEmpty()) {
Expand Down Expand Up @@ -445,6 +446,7 @@ protected static String getSectionName(String line) {
return null;
}

@Override
public boolean equals(Object obj) {
if (obj instanceof Ini ini) {
return this.sections.equals(ini.sections);
Expand All @@ -457,6 +459,7 @@ public int hashCode() {
return this.sections.hashCode();
}

@Override
public String toString() {
if (this.sections == null || this.sections.isEmpty()) {
return "<empty INI>";
Expand All @@ -474,26 +477,32 @@ public String toString() {
}
}

@Override
public int size() {
return this.sections.size();
}

@Override
public boolean containsKey(Object key) {
return this.sections.containsKey(key);
}

@Override
public boolean containsValue(Object value) {
return this.sections.containsValue(value);
}

@Override
public Section get(Object key) {
return this.sections.get(key);
}

@Override
public Section put(String key, Section value) {
return this.sections.put(key, value);
}

@Override
public Section remove(Object key) {
return this.sections.remove(key);
}
Expand All @@ -502,18 +511,22 @@ public void putAll(Map<? extends String, ? extends Section> m) {
this.sections.putAll(m);
}

@Override
public void clear() {
this.sections.clear();
}

@Override
public Set<String> keySet() {
return Collections.unmodifiableSet(this.sections.keySet());
}

@Override
public Collection<Section> values() {
return Collections.unmodifiableCollection(this.sections.values());
}

@Override
public Set<Entry<String, Section>> entrySet() {
return Collections.unmodifiableSet(this.sections.entrySet());
}
Expand Down Expand Up @@ -651,34 +664,42 @@ public String getName() {
return this.name;
}

@Override
public void clear() {
this.props.clear();
}

@Override
public boolean containsKey(Object key) {
return this.props.containsKey(key);
}

@Override
public boolean containsValue(Object value) {
return this.props.containsValue(value);
}

@Override
public Set<Entry<String, String>> entrySet() {
return this.props.entrySet();
}

@Override
public String get(Object key) {
return this.props.get(key);
}

@Override
public boolean isEmpty() {
return this.props.isEmpty();
}

@Override
public Set<String> keySet() {
return this.props.keySet();
}

@Override
public String put(String key, String value) {
return this.props.put(key, value);
}
Expand All @@ -687,18 +708,22 @@ public void putAll(Map<? extends String, ? extends String> m) {
this.props.putAll(m);
}

@Override
public String remove(Object key) {
return this.props.remove(key);
}

@Override
public int size() {
return this.props.size();
}

@Override
public Collection<String> values() {
return this.props.values();
}

@Override
public String toString() {
String name = getName();
if (DEFAULT_SECTION_NAME.equals(name)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class InitializableBean implements Initializable {

public InitializableBean() {}

@Override
public void init() throws ShiroException {
initialized = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class SimpleBeanFactory implements org.apache.shiro.lang.util.Factory<SimpleBean
int factoryInt;
String factoryString;

@Override
public SimpleBean getInstance() {
return new SimpleBean(intProp: factoryInt, stringProp: factoryString)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class DefaultAnnotationResolver implements AnnotationResolver {
* @return the discovered annotation or {@code null} if an annotation instance could not be
* found.
*/
@Override
public Annotation getAnnotation(MethodInvocation mi, Class<? extends Annotation> clazz) {
if (mi == null) {
throw new IllegalArgumentException("method argument cannot be null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ protected void notifyLogout(PrincipalCollection principals) {
*
* @param principals the identifying principals of the {@code Subject}/account logging out.
*/
@Override
public void onLogout(PrincipalCollection principals) {
notifyLogout(principals);
}
Expand All @@ -187,6 +188,7 @@ public void onLogout(PrincipalCollection principals) {
* @throws AuthenticationException if there is any problem during the authentication process - see the
* interface's JavaDoc for a more detailed explanation.
*/
@Override
public final AuthenticationInfo authenticate(AuthenticationToken token) throws AuthenticationException {

if (token == null) {
Expand Down
10 changes: 10 additions & 0 deletions core/src/main/java/org/apache/shiro/authc/SimpleAccount.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ public SimpleAccount(PrincipalCollection principals, Object credentials, Set<Str
*
* @return all the principals, aka the identifying attributes, of this Account.
*/
@Override
public PrincipalCollection getPrincipals() {
return authcInfo.getPrincipals();
}
Expand All @@ -242,6 +243,7 @@ public void setPrincipals(PrincipalCollection principals) {
*
* @return this Account's credentials.
*/
@Override
public Object getCredentials() {
return authcInfo.getCredentials();
}
Expand All @@ -265,6 +267,7 @@ public void setCredentials(Object credentials) {
* was used or credentials were not hashed at all.
* @since 1.1
*/
@Override
public ByteSource getCredentialsSalt() {
return this.authcInfo.getCredentialsSalt();
}
Expand All @@ -286,6 +289,7 @@ public void setCredentialsSalt(ByteSource salt) {
*
* @return the Account's assigned roles.
*/
@Override
public Collection<String> getRoles() {
return authzInfo.getRoles();
}
Expand Down Expand Up @@ -326,6 +330,7 @@ public void addRole(Collection<String> roles) {
*
* @return all String-based permissions assigned to this Account.
*/
@Override
public Collection<String> getStringPermissions() {
return authzInfo.getStringPermissions();
}
Expand Down Expand Up @@ -364,6 +369,7 @@ public void addStringPermissions(Collection<String> permissions) {
*
* @return all object-based permissions assigned directly to this Account (not any of its realms).
*/
@Override
public Collection<Permission> getObjectPermissions() {
return authzInfo.getObjectPermissions();
}
Expand Down Expand Up @@ -445,6 +451,7 @@ public void setCredentialsExpired(boolean credentialsExpired) {
* @param info the <code>AuthenticationInfo</code> to merge into this account.
* @return this instance with the merged information from the specified argument.
*/
@Override
public AuthenticationInfo merge(AuthenticationInfo info) {
authcInfo.merge(info);

Expand All @@ -467,6 +474,7 @@ public AuthenticationInfo merge(AuthenticationInfo info) {
*
* @return <code>principals.hashCode()</code> if they are not null, 0 (zero) otherwise.
*/
@Override
public int hashCode() {
return (getPrincipals() != null ? getPrincipals().hashCode() : 0);
}
Expand All @@ -479,6 +487,7 @@ public int hashCode() {
* @return <code>true</code> if the specified object is also a {@link SimpleAccount SimpleAccount} and its
* {@link #getPrincipals() principals} are equal to this object's <code>principals</code>, <code>false</code> otherwise.
*/
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
Expand All @@ -496,6 +505,7 @@ public boolean equals(Object o) {
*
* @return the String representation of this Account object.
*/
@Override
public String toString() {
return getPrincipals() != null ? getPrincipals().toString() : "empty";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ public void setPassword(char[] password) {
* @return the {@link #getUsername() username}.
* @see org.apache.shiro.authc.AuthenticationToken#getPrincipal()
*/
@Override
public Object getPrincipal() {
return getUsername();
}
Expand All @@ -267,6 +268,7 @@ public Object getPrincipal() {
* @return the {@link #getPassword() password} char array.
* @see org.apache.shiro.authc.AuthenticationToken#getCredentials()
*/
@Override
public Object getCredentials() {
return getPassword();
}
Expand All @@ -282,6 +284,7 @@ public Object getCredentials() {
* explicitly omitted.
* @since 1.0
*/
@Override
public String getHost() {
return host;
}
Expand All @@ -308,6 +311,7 @@ public void setHost(String host) {
* across sessions, <tt>false</tt> otherwise (<tt>false</tt> by default).
* @since 0.9
*/
@Override
public boolean isRememberMe() {
return rememberMe;
}
Expand Down Expand Up @@ -354,6 +358,7 @@ public void clear() {
* @return the String representation of the <tt>UsernamePasswordToken</tt>, omitting
* the password.
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class AllowAllCredentialsMatcher implements CredentialsMatcher {
* @param info the account being verified for access
* @return <code>true</code> <em>always</em>. (except for simulated credentials)
*/
@Override
public boolean doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info) {
return info != SIMULATED_CREDENTIALS;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ protected boolean equals(Object tokenCredentials, Object accountCredentials) {
* @return {@code true} if the provided token credentials are equal to the stored account credentials,
* {@code false} otherwise
*/
@Override
public boolean doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info) {
Object tokenCredentials = getCredentials(token);
Object accountCredentials = getCredentials(info);
Expand Down
Loading
Loading