Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
PermissionCacheEntry |
|
| 3.0;3 |
1 | package org.apache.commons.ognl.internal.entry; | |
2 | ||
3 | /* | |
4 | * Licensed to the Apache Software Foundation (ASF) under one | |
5 | * or more contributor license agreements. See the NOTICE file | |
6 | * distributed with this work for additional information | |
7 | * regarding copyright ownership. The ASF licenses this file | |
8 | * to you under the Apache License, Version 2.0 (the | |
9 | * "License"); you may not use this file except in compliance | |
10 | * with the License. You may obtain a copy of the License at | |
11 | * | |
12 | * http://www.apache.org/licenses/LICENSE-2.0 | |
13 | * | |
14 | * Unless required by applicable law or agreed to in writing, | |
15 | * software distributed under the License is distributed on an | |
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
17 | * KIND, either express or implied. See the License for the | |
18 | * specific language governing permissions and limitations | |
19 | * under the License. | |
20 | */ | |
21 | ||
22 | /* | |
23 | * $Id: PermissionCacheEntry.java 1194957 2011-10-29 18:04:20Z mcucchiara $ | |
24 | */ | |
25 | ||
26 | import java.lang.reflect.Method; | |
27 | ||
28 | public class PermissionCacheEntry | |
29 | implements CacheEntry | |
30 | { | |
31 | public Method method; | |
32 | ||
33 | public PermissionCacheEntry( Method method ) | |
34 | 43100003 | { |
35 | 43100003 | this.method = method; |
36 | 43100003 | } |
37 | ||
38 | @Override | |
39 | public boolean equals( Object o ) | |
40 | { | |
41 | 52249693 | if ( this == o ) |
42 | { | |
43 | 0 | return true; |
44 | } | |
45 | 52249693 | if ( !( o instanceof PermissionCacheEntry ) ) |
46 | { | |
47 | 0 | return false; |
48 | } | |
49 | ||
50 | 52249693 | PermissionCacheEntry that = (PermissionCacheEntry) o; |
51 | ||
52 | 52249693 | return !( method != null ? !method.equals( that.method ) : that.method != null ); |
53 | ||
54 | } | |
55 | ||
56 | @Override | |
57 | public int hashCode() | |
58 | { | |
59 | 43100728 | return method != null ? method.hashCode() : 0; |
60 | } | |
61 | } |