Skip to content

Commit

Permalink
Issue highsource#11. Building the bridge.
Browse files Browse the repository at this point in the history
  • Loading branch information
highsource committed Dec 5, 2014
1 parent b8eb9f7 commit 6438f4b
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ protected void processClassOutline(ClassOutline classOutline) {
currentHashCode,
currentHashCode
.mul(JExpr.lit(getCodeGeneratorFactory().getMultiplier())));
codeGenerator.append(block, currentHashCode, exposedType,
possibleTypes, value, hasSetValue, isAlwaysSet);
codeGenerator.append(block, exposedType, possibleTypes,
isAlwaysSet, currentHashCode, value, hasSetValue);
}
}
body._return(currentHashCode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public BlockHashCodeCodeGenerator(
}

@Override
public void append(JBlock block, JVar currentHashCode, JType type,
Collection<JType> possibleTypes, JVar value,
JExpression hasSetValue, boolean isAlwaysSet) {
public void append(JBlock block, JType type, Collection<JType> possibleTypes,
boolean isAlwaysSet, JVar currentHashCode,
JVar value, JExpression hasSetValue) {
final JBlock subBlock;
if (isAlwaysSet) {
subBlock = block;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

public interface HashCodeCodeGenerator extends CodeGenerator {

public void append(JBlock block, JVar currentHashCode, JType type,
Collection<JType> possibleTypes, JVar value,
JExpression hasSetValue, boolean isAlwaysSet);
public void append(JBlock block, JType type, Collection<JType> possibleTypes,
boolean isAlwaysSet, JVar currentHashCode,
JVar value, JExpression hasSetValue);
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ private void append(JBlock block, JVar currentHashCode, JVar value,
.ne(JExpr._null());
block.assign(currentHashCode, currentHashCode.mul(JExpr
.lit(getCodeGeneratorFactory().getMultiplier())));
codeGenerator.append(block, currentHashCode, valueType,
possibleValueTypes, subValue, hasSetValue, isAlwaysSet);
codeGenerator.append(block, valueType, possibleValueTypes,
isAlwaysSet, currentHashCode, subValue, hasSetValue);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ private void appendElement(final JBlock subBlock, JVar currentHashCode,
final JExpression hasSetValue = isAlwaysSet ? JExpr.TRUE : value
.ne(JExpr._null());
getCodeGeneratorFactory().getCodeGenerator(type).append(subBlock,
currentHashCode, type, possibleTypes, value, hasSetValue,
isAlwaysSet);
type, possibleTypes, isAlwaysSet, currentHashCode, value,
hasSetValue);
}

private JClass getElementType(final JClass _class) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ protected void append(JBlock block, JVar currentHashCode,
JExpr.cast(jaxbElement, value));
valueJAXBElement.annotate(SuppressWarnings.class).param(
"value", "unchecked");
codeGenerator.append(subBlock, currentHashCode, jaxbElement,
new HashSet<JType>(jaxbElements), valueJAXBElement,
JExpr.TRUE, true);
codeGenerator.append(subBlock, jaxbElement, new HashSet<JType>(jaxbElements),
true, currentHashCode,
valueJAXBElement, JExpr.TRUE);
}

if (!arrays.isEmpty()) {
Expand Down Expand Up @@ -106,9 +106,9 @@ private void appendArray(final JBlock block, JVar currentHashCode,
// "unchecked");
final HashCodeCodeGenerator codeGenerator = getCodeGeneratorFactory()
.getCodeGenerator(type);
codeGenerator.append(block, currentHashCode, type,
Collections.singleton(type), valueArray,
JExpr.TRUE, true);
codeGenerator.append(block, type, Collections.singleton(type),
true, currentHashCode,
valueArray, JExpr.TRUE);
}

private JType getValueType(final Set<JType> valueTypes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public ValueBasedBlockHashCodeCodeGenerator(
}

@Override
public void append(JBlock block, JVar currentHashCode, JType exposedType,
Collection<JType> possibleTypes, JVar value,
JExpression hasSetValue, boolean isAlwaysSet) {
public void append(JBlock block, JType exposedType, Collection<JType> possibleTypes,
boolean isAlwaysSet, JVar currentHashCode,
JVar value, JExpression hasSetValue) {

final JExpression valueHashCode = generateHashCode(block, exposedType,
value);
Expand Down

0 comments on commit 6438f4b

Please sign in to comment.