Author: echatellier Date: 2014-05-21 11:01:26 +0200 (Wed, 21 May 2014) New Revision: 3985 Url: http://forge.codelutin.com/projects/isis-fish/repository/revisions/3985 Log: refs #2255: Remove enum because aspectj don't like enum :( Removed: trunk/src/main/java/fr/ifremer/isisfish/aspect/State.java Modified: trunk/src/main/java/fr/ifremer/isisfish/aspect/RuleAspect.java Modified: trunk/src/main/java/fr/ifremer/isisfish/aspect/RuleAspect.java =================================================================== --- trunk/src/main/java/fr/ifremer/isisfish/aspect/RuleAspect.java 2014-05-16 17:10:22 UTC (rev 3984) +++ trunk/src/main/java/fr/ifremer/isisfish/aspect/RuleAspect.java 2014-05-21 09:01:26 UTC (rev 3985) @@ -67,7 +67,7 @@ @Around("execution(* rules.*.init(..))") public Object initCall(final ProceedingJoinPoint jp) throws Throwable { - Object result = makeTimedCall(jp, State.INIT); + Object result = makeTimedCall(jp, 0); return result; } @@ -82,7 +82,7 @@ @Around("execution(* rules.*.preAction(..))") public Object initPreCall(final ProceedingJoinPoint jp) throws Throwable { - Object result = makeTimedCall(jp, State.PRE); + Object result = makeTimedCall(jp, 1); return result; } @@ -96,7 +96,7 @@ @Around("execution(* rules.*.postAction(..))") public Object initPostCall(final ProceedingJoinPoint jp) throws Throwable { - Object result = makeTimedCall(jp, State.POST); + Object result = makeTimedCall(jp, 2); return result; } @@ -107,7 +107,7 @@ * @param state state * @throws Throwable */ - protected Object makeTimedCall(ProceedingJoinPoint jp, State state) throws Throwable { + protected Object makeTimedCall(ProceedingJoinPoint jp, int state) throws Throwable { if (log.isTraceEnabled()) { log.trace("Rule aspect called : " + jp.getTarget().getClass().getSimpleName()); @@ -139,7 +139,7 @@ * @param state state * @param timeTaken time taken by {@code state} */ - protected void registerTime(JoinPoint jp, State state, long timeTaken) { + protected void registerTime(JoinPoint jp, int state, long timeTaken) { SimulationContext context = SimulationContext.get(); SimulationStorage simulation = context.getSimulationStorage(); @@ -153,15 +153,16 @@ String ruleName = calleeClass.getSimpleName(); SimulationInformation info = simulation.getInformation(); - + + // since 20140521: remove use of enum because aspectj don't like that switch (state) { - case INIT: + case 0: info.addRuleInitTime(ruleName, timeTaken); break; - case PRE: + case 1: info.addRulePreTime(ruleName, timeTaken); break; - case POST: + case 2: info.addRulePostTime(ruleName, timeTaken); break; default: Deleted: trunk/src/main/java/fr/ifremer/isisfish/aspect/State.java =================================================================== --- trunk/src/main/java/fr/ifremer/isisfish/aspect/State.java 2014-05-16 17:10:22 UTC (rev 3984) +++ trunk/src/main/java/fr/ifremer/isisfish/aspect/State.java 2014-05-21 09:01:26 UTC (rev 3985) @@ -1,36 +0,0 @@ -/* - * #%L - * IsisFish - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2014 Ifremer, Code Lutin, Chatellier Eric - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ -package fr.ifremer.isisfish.aspect; - -/** - * State phase to register. - * - * Avant, cette enum était dans RuleAspect. Mais depuis le passage à aspectj, il y a une erreur - * étrange d'accès: - * java.lang.IllegalAccessError: tried to access class fr.ifremer.isisfish.aspect.RuleAspect$1 from class fr.ifremer.isisfish.aspect.RuleAspect - */ -public enum State { - INIT, PRE, POST -}
participants (1)
-
echatellier@users.forge.codelutin.com