Skip to content

Commit

Permalink
Merge pull request #508 from jsight/WINDUP-542
Browse files Browse the repository at this point in the history
WINDUP-542: Fix severe regression in AST performance
  • Loading branch information
lincolnthree committed Mar 24, 2015
2 parents f073e1a + f75a845 commit 5d305cf
Show file tree
Hide file tree
Showing 22 changed files with 927 additions and 231 deletions.
Expand Up @@ -43,9 +43,9 @@
import org.ocpsoft.rewrite.event.Rewrite;

/**
* Used to iterate over an implicit or explicit variable defined within the corresponding
* {@link ConfigurationRuleBuilder#when(Condition)} clause in the current rule.
*
* Used to iterate over an implicit or explicit variable defined within the corresponding {@link ConfigurationRuleBuilder#when(Condition)} clause in
* the current rule.
*
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
*/
public class Iteration extends DefaultOperationBuilder
Expand Down Expand Up @@ -94,8 +94,7 @@ public static IterationBuilderOver over(Class<? extends WindupVertexFrame> sourc
}

/**
* Begin an {@link Iteration} over the named selection. Also sets the name of the variable for this iteration's
* "current element".
* Begin an {@link Iteration} over the named selection. Also sets the name of the variable for this iteration's "current element".
*/
public static IterationBuilderOver over(String source)
{
Expand All @@ -105,8 +104,8 @@ public static IterationBuilderOver over(String source)
}

/**
* Begin an {@link Iteration} over the selection of the given type, named with the default name. Also sets the name
* of the variable for this iteration's "current element" to have the default value.
* Begin an {@link Iteration} over the selection of the given type, named with the default name. Also sets the name of the variable for this
* iteration's "current element" to have the default value.
*/
public static IterationBuilderOver over(Class<? extends WindupVertexFrame> sourceType)
{
Expand All @@ -117,8 +116,8 @@ public static IterationBuilderOver over(Class<? extends WindupVertexFrame> sourc
}

/**
* Begin an {@link Iteration} over the selection that is placed on the top of the {@link Variables}. Also sets the
* name of the variable for this iteration's "current element" (i.e payload) to have the default value.
* Begin an {@link Iteration} over the selection that is placed on the top of the {@link Variables}. Also sets the name of the variable for this
* iteration's "current element" (i.e payload) to have the default value.
*/
public static IterationBuilderOver over()
{
Expand All @@ -128,8 +127,8 @@ public static IterationBuilderOver over()
}

/**
* Change the name of the single variable of the given type. If this method is not called, the name is calculated
* using the {@link Iteration.singleVariableIterationName()} method.
* Change the name of the single variable of the given type. If this method is not called, the name is calculated using the
* {@link Iteration#singleVariableIterationName(String)} method.
*/
@Override
public IterationBuilderVar as(Class<? extends WindupVertexFrame> varType, String var)
Expand All @@ -139,8 +138,8 @@ public IterationBuilderVar as(Class<? extends WindupVertexFrame> varType, String
}

/**
* Change the name of the single variable. If this method is not called, the name is calculated using the {@link
* Iteration.singleVariableIterationName()} method.
* Change the name of the single variable. If this method is not called, the name is calculated using the
* {@link Iteration#singleVariableIterationName(String)} method.
*/
@Override
public IterationBuilderVar as(String var)
Expand Down Expand Up @@ -202,8 +201,8 @@ public void perform(Rewrite event, EvaluationContext context)
}

/**
* Called internally to actually process the Iteration. Loops over the frames to iterate, and performs their
* .perform( ... ) or .otherwise( ... ) parts.
* Called internally to actually process the Iteration. Loops over the frames to iterate, and performs their .perform( ... ) or .otherwise( ... )
* parts.
*/
public void perform(GraphRewrite event, EvaluationContext context)
{
Expand All @@ -224,8 +223,8 @@ public void perform(GraphRewrite event, EvaluationContext context)
}
conditionResult = condition.evaluate(event, context);
/*
* Add special clear layer for perform, because condition used one and could have added new variables.
* The condition result put into variables is ignored.
* Add special clear layer for perform, because condition used one and could have added new variables. The condition result put into
* variables is ignored.
*/
variables.push();
getPayloadManager().setCurrentPayload(variables, frame);
Expand Down
Expand Up @@ -25,8 +25,6 @@ public abstract class AbstractIterationOperation<T extends WindupVertexFrame> ex

/**
* When the variable name is not specified, let the Iteration to set the current payload variable name.
*
* @param variableName
*/
public AbstractIterationOperation()
{
Expand Down Expand Up @@ -184,9 +182,6 @@ public void remove()
* to be lowercased
* @param delimiterChars optional characters that are used to delimit word boundaries
* @return the camel case version of the word
* @see #underscore(String, char[])
* @see #upperCamelCase(String, char[])
* @see #lowerCamelCase(String, char[])
*/
public String camelCase(String lowerCaseAndUnderscoredWord,
boolean uppercaseFirstLetter,
Expand Down
Expand Up @@ -10,13 +10,12 @@
import org.ocpsoft.rewrite.config.Rule;

/**
* Provides a shorthand for stating the order of execution of {@link Rule}s within Windup. When a
* {@link AbstractRuleProvider} specifies a {@link RulePhase}, the results of calling
* {@link RulePhase#getExecuteAfter()} and {@link RulePhase#getExecuteBefore()} on the rule will appended to the results
* of {@link AbstractRuleProvider#getExecuteAfter()} and {@link RulePhase#getExecuteBefore()}.
*
* In this way, most {@link AbstractRuleProvider}s will be able to simply specify a {@link RulePhase} in order to
* determine their approximate placement within the execution lifecycle.
* Provides a shorthand for stating the order of execution of {@link Rule}s within Windup. When a {@link AbstractRuleProvider} specifies a
* {@link RulePhase}, the results of calling {@link RulePhase#getExecuteAfter()} and {@link RulePhase#getExecuteBefore()} on the rule will appended to
* the results of {@link RuleProviderMetadata#getExecuteAfter()} and {@link RulePhase#getExecuteBefore()}.
*
* In this way, most {@link AbstractRuleProvider}s will be able to simply specify a {@link RulePhase} in order to determine their approximate
* placement within the execution lifecycle.
*
* @author jsightler <jesse.sightler@gmail.com>
*/
Expand Down
Expand Up @@ -80,10 +80,11 @@ public void testDecompileSingleClass() throws DecompilationException, IOExceptio
{
final StringBuilder sb = new StringBuilder();
sb.append("Failed decompilation of " + res.getFailures().size() + " classes: ");
for (final DecompilationFailure dex : res.getFailures())
for (final DecompilationFailure e : res.getFailures())
{
sb.append("\n ").append(dex.getMessage());
final Throwable cause = dex.getCause();
sb.append("\n ").append(e.getMessage());
final Throwable cause = e.getCause();
cause.printStackTrace();
if (cause instanceof NullPointerException)
sb.append(" - NPE at ").append(cause.getStackTrace()[0]);
else
Expand Down

0 comments on commit 5d305cf

Please sign in to comment.