1.1 --- a/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/impl/StatisticImpl.java Thu Aug 08 10:10:38 2013 -0700 1.2 +++ b/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/impl/StatisticImpl.java Fri Aug 23 09:57:21 2013 +0100 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -26,8 +26,8 @@ 1.11 1.12 package com.sun.org.glassfish.external.statistics.impl; 1.13 import com.sun.org.glassfish.external.statistics.Statistic; 1.14 -import java.io.Serializable; 1.15 -import java.util.concurrent.atomic.AtomicLong; 1.16 +import java.lang.reflect.Method; 1.17 +import java.lang.reflect.Modifier; 1.18 import java.util.Map; 1.19 import java.util.concurrent.ConcurrentHashMap; 1.20 1.21 @@ -133,4 +133,13 @@ 1.22 protected static boolean isValidString(String str) { 1.23 return (str!=null && str.length()>0); 1.24 } 1.25 + 1.26 + protected void checkMethod(Method method) { 1.27 + if (method == null || method.getDeclaringClass() == null 1.28 + || !Statistic.class.isAssignableFrom(method.getDeclaringClass()) 1.29 + || Modifier.isStatic(method.getModifiers())) { 1.30 + throw new RuntimeException("Invalid method on invoke"); 1.31 + } 1.32 + } 1.33 + 1.34 }