1 23 24 25 package com.sun.enterprise.tools.verifier.tests; 26 27 import com.sun.enterprise.tools.verifier.Result; 28 import com.sun.enterprise.tools.verifier.apiscan.classfile.ClosureCompilerImpl; 29 import com.sun.enterprise.deployment.Descriptor; 30 31 import java.util.Collection ; 32 33 36 public class ClassContainsNativeMethod 37 extends VerifierTest implements VerifierCheck { 38 public Result check(Descriptor descriptor) { 39 ComponentNameConstructor compName = 40 getVerifierContext().getComponentNameConstructor(); 41 Result result = getInitializedResult(); 42 result.setStatus(Result.PASSED); 43 ClosureCompilerImpl cc = ClosureCompilerImpl.class.cast( 44 getVerifierContext().getClosureCompiler()); 45 Collection <String > nativeMethods = cc.getNativeMethods(); 46 if(!nativeMethods.isEmpty()) { 47 addWarningDetails(result, compName); 48 result.warning(smh.getLocalString(getClass().getName() + ".warning", 49 "Supplied below is the list of method names " + 50 "(in the format <package.classname>.<methodName>) " + 51 "that are defined as native methods and used by the application:\n")); 52 for(String m : nativeMethods) { 53 result.warning("\n\t" + m); 54 } 55 result.warning(smh.getLocalString(getClass().getName() + ".suggestion", 56 "Please make sure that they are implemented on all operating systems.")); 57 } 58 return result; 59 } 60 } 61 | Popular Tags |