View Javadoc

1   /**
2    * Copyright (C) 2009 Erik Putrycz <erik.putrycz@gmail.com>
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *         http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package net.ep.db4o.javassist;
18  
19  import javassist.CtClass;
20  
21  import com.db4o.diagnostic.DiagnosticBase;
22  
23  public class ClassWithFinalMethod extends DiagnosticBase {
24  
25  	private CtClass _class;
26  	private String _method;
27  
28  	public ClassWithFinalMethod(CtClass class1, String method) {
29  		_class = class1;
30  		_method = method;
31  	}
32  
33  	@Override
34  	public String problem() {
35  		return "An object of class "
36  				+ _class.getName()
37  				+ " was stored. The method '" + _method + "' is declared final and thus, cannot be enhanced and use transparent activation.";
38  	}
39  
40  	@Override
41  	public Object reason() {
42  		return _class.getName();
43  	}
44  
45  	@Override
46  	public String solution() {
47  		return "Remove modifier final on the method '"
48  				+ _method + "' of " + _class.getName()
49  				+ ".";
50  	}
51  }