Skip to content

Commit

Permalink
merge code analysis minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardttom2 committed Nov 29, 2017
1 parent 6b3e181 commit 0d21ce9
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2319,6 +2319,7 @@ public void addClass(Class clazz) {
* Code generation settings.
*/
public static class ByteCodeGeneration implements Serializable {
private static final long serialVersionUID = -4582655217918634675L;
private boolean enablePropertyGetter = false;
private boolean enableExpression = true;
private boolean enableSelectClause = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
package com.espertech.esper.codegen.compile;

public class CodegenCompilerException extends Exception {
private static final long serialVersionUID = 8791067524481989469L;
private final String code;

public CodegenCompilerException(String message, Throwable cause, String code) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import java.util.Arrays;

public final class HashableMultiKey implements Serializable {
private static final long serialVersionUID = -7019971786796246533L;
private final Object[] keys;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

public class ExprAppDotMethodImpl extends ExprNodeBase implements FilterSpecCompilerAdvIndexDescProvider, FilterExprAnalyzerAffectorProvider {

private static final long serialVersionUID = 2457510084054173183L;
private final EngineImportApplicationDotMethod desc;

public ExprAppDotMethodImpl(EngineImportApplicationDotMethod desc) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/
public class ExprFirstLastEverNode extends ExprAggregateNodeBase {

private static final long serialVersionUID = -7305990054785137679L;
private final boolean first;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,7 @@ public static CodegenExpression codegen(ExprInNodeForge forge, CodegenMethodScop
CodegenBlock ifRightNotNull = reftype.isPrimitive() ? block : block.ifRefNotNull(refname);
{
if (!leftTypeUncoerced.isPrimitive()) {
if (!leftTypeUncoerced.isPrimitive()) {
ifRightNotNull.ifRefNullReturnNull("left");
}
ifRightNotNull.ifRefNullReturnNull("left");
}
if (!forge.isMustCoerce()) {
ifRightNotNull.ifCondition(CodegenLegoCompareEquals.codegenEqualsNonNullNoCoerce(ref("leftCoerced"), leftTypeCoerced, ref(refname), reftype))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static CreateContextDesc walkCreateContext(EsperEPL2GrammarParser.CreateC

EsperEPL2GrammarParser.CreateContextChoiceContext choice = ctx.createContextDetail().createContextChoice();
if (choice != null) {
contextDetail = walkChoice(choice, astExprNodeMap, astPatternNodeMap, propertyEvalSpec, filterSpec);
contextDetail = walkChoice(choice, astExprNodeMap, astPatternNodeMap, propertyEvalSpec);
} else {
contextDetail = walkNested(ctx.createContextDetail().contextContextNested(), astExprNodeMap, astPatternNodeMap, propertyEvalSpec, filterSpec);
}
Expand All @@ -46,14 +46,14 @@ public static CreateContextDesc walkCreateContext(EsperEPL2GrammarParser.CreateC
private static ContextDetail walkNested(List<EsperEPL2GrammarParser.ContextContextNestedContext> nestedContexts, Map<Tree, ExprNode> astExprNodeMap, Map<Tree, EvalFactoryNode> astPatternNodeMap, PropertyEvalSpec propertyEvalSpec, FilterSpecRaw filterSpec) {
List<CreateContextDesc> contexts = new ArrayList<CreateContextDesc>(nestedContexts.size());
for (EsperEPL2GrammarParser.ContextContextNestedContext nestedctx : nestedContexts) {
ContextDetail contextDetail = walkChoice(nestedctx.createContextChoice(), astExprNodeMap, astPatternNodeMap, propertyEvalSpec, filterSpec);
ContextDetail contextDetail = walkChoice(nestedctx.createContextChoice(), astExprNodeMap, astPatternNodeMap, propertyEvalSpec);
CreateContextDesc desc = new CreateContextDesc(nestedctx.name.getText(), contextDetail);
contexts.add(desc);
}
return new ContextDetailNested(contexts);
}

private static ContextDetail walkChoice(EsperEPL2GrammarParser.CreateContextChoiceContext ctx, Map<Tree, ExprNode> astExprNodeMap, Map<Tree, EvalFactoryNode> astPatternNodeMap, PropertyEvalSpec propertyEvalSpec, FilterSpecRaw filterSpec) {
private static ContextDetail walkChoice(EsperEPL2GrammarParser.CreateContextChoiceContext ctx, Map<Tree, ExprNode> astExprNodeMap, Map<Tree, EvalFactoryNode> astPatternNodeMap, PropertyEvalSpec propertyEvalSpec) {

// temporal fixed (start+end) and overlapping (initiated/terminated)
if (ctx.START() != null || ctx.INITIATED() != null) {
Expand Down Expand Up @@ -91,7 +91,7 @@ private static ContextDetail walkChoice(EsperEPL2GrammarParser.CreateContextChoi
List<ContextDetailPartitionItem> rawSpecs = new ArrayList<ContextDetailPartitionItem>();
for (EsperEPL2GrammarParser.CreateContextPartitionItemContext partition : partitions) {

filterSpec = ASTFilterSpecHelper.walkFilterSpec(partition.eventFilterExpression(), propertyEvalSpec, astExprNodeMap);
FilterSpecRaw filterSpec = ASTFilterSpecHelper.walkFilterSpec(partition.eventFilterExpression(), propertyEvalSpec, astExprNodeMap);
propertyEvalSpec = null;

List<String> propertyNames = new ArrayList<String>();
Expand Down Expand Up @@ -121,7 +121,7 @@ private static ContextDetail walkChoice(EsperEPL2GrammarParser.CreateContextChoi
List<ContextDetailHashItem> rawSpecs = new ArrayList<ContextDetailHashItem>(coalesces.size());
for (EsperEPL2GrammarParser.CreateContextCoalesceItemContext coalesce : coalesces) {
ExprChainedSpec func = ASTLibFunctionHelper.getLibFunctionChainSpec(coalesce.libFunctionNoClass(), astExprNodeMap);
filterSpec = ASTFilterSpecHelper.walkFilterSpec(coalesce.eventFilterExpression(), propertyEvalSpec, astExprNodeMap);
FilterSpecRaw filterSpec = ASTFilterSpecHelper.walkFilterSpec(coalesce.eventFilterExpression(), propertyEvalSpec, astExprNodeMap);
propertyEvalSpec = null;
rawSpecs.add(new ContextDetailHashItem(func, filterSpec));
}
Expand Down Expand Up @@ -151,7 +151,7 @@ private static ContextDetail walkChoice(EsperEPL2GrammarParser.CreateContextChoi
String name = grp.i.getText();
items.add(new ContextDetailCategoryItem(exprNode, name));
}
filterSpec = ASTFilterSpecHelper.walkFilterSpec(ctx.eventFilterExpression(), propertyEvalSpec, astExprNodeMap);
FilterSpecRaw filterSpec = ASTFilterSpecHelper.walkFilterSpec(ctx.eventFilterExpression(), propertyEvalSpec, astExprNodeMap);
return new ContextDetailCategory(items, filterSpec);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ public void exitSelectionListElementExpr(EsperEPL2GrammarParser.SelectionListEle
boolean eventsAnnotation = false;
if (ctx.selectionListElementAnno() != null) {
String annotation = ctx.selectionListElementAnno().i.getText().toLowerCase(Locale.ENGLISH);
if (annotation.equals("eventbean") || annotation.equals("eventbean")) {
if (annotation.equals("eventbean")) {
eventsAnnotation = true;
} else {
throw ASTWalkException.from("Failed to recognize select-expression annotation '" + annotation + "', expected 'eventbean'", tokenStream, ctx);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

public class FilterForEvalContextPropDouble implements FilterSpecParamFilterForEvalDouble {

private static final long serialVersionUID = 7421157470374398746L;
private transient final EventPropertyGetter getter;
private final String propertyName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

public class FilterForEvalContextPropString implements FilterSpecParamFilterForEval {

private static final long serialVersionUID = 5250506869921316777L;
private transient final EventPropertyGetter getter;
private final String propertyName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.espertech.esper.epl.index.quadtree.AdvancedIndexConfigContextPartitionQuadTree;

public class FilterSpecLookupableAdvancedIndex extends FilterSpecLookupable {
private static final long serialVersionUID = 8315068953665699193L;
private final AdvancedIndexConfigContextPartitionQuadTree quadTreeConfig;
private final EventPropertyGetter x;
private final EventPropertyGetter y;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

public final class FilterSpecParamAdvancedIndexQuadTreeMXCIF extends FilterSpecParam {
private static final Logger log = LoggerFactory.getLogger(FilterSpecParamAdvancedIndexQuadTreeMXCIF.class);
private static final long serialVersionUID = 4840823619612773366L;

private FilterSpecParamFilterForEvalDouble xEval;
private FilterSpecParamFilterForEvalDouble yEval;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

public final class FilterSpecParamAdvancedIndexQuadTreePointRegion extends FilterSpecParam {
private static final Logger log = LoggerFactory.getLogger(FilterSpecParamAdvancedIndexQuadTreePointRegion.class);
private static final long serialVersionUID = -6532439019770165132L;

private FilterSpecParamFilterForEvalDouble xEval;
private FilterSpecParamFilterForEvalDouble yEval;
Expand Down

0 comments on commit 0d21ce9

Please sign in to comment.