rem stringlengths 1 53.3k | add stringlengths 0 80.5k | context stringlengths 6 326k | meta stringlengths 141 403 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
move = Move.create(INT_MOVE, resultOperand, new OPT_IntConstantOperand(0)); | move = Move.create(INT_MOVE, resultOperand, IC(0)); | public static byte simplify(OPT_AbstractRegisterPool regpool, OPT_Instruction s) { switch (s.getOpcode()) { //////////////////// // GUARD operations //////////////////// case GUARD_COMBINE_opcode: { OPT_Operand op2 = Binary.getVal2(s); if (op2 instanceof OPT_TrueGuardOperand) { OPT_Operand op1 = Binary.getVal1(s); if (op1 instanceof OPT_TrueGuardOperand) { // BOTH TrueGuards: FOLD Move.mutate(s, GUARD_MOVE, Binary.getClearResult(s), op1); return MOVE_FOLDED; } else { // ONLY OP2 IS TrueGuard: MOVE REDUCE Move.mutate(s, GUARD_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } return UNCHANGED; //////////////////// // TRAP operations //////////////////// case TRAP_IF_opcode: { OPT_Operand op1 = TrapIf.getVal1(s); OPT_Operand op2 = TrapIf.getVal2(s); if (op1.isConstant()) { if (op2.isConstant()) { int willTrap = TrapIf.getCond(s).evaluate(op1, op2); if (willTrap == OPT_ConditionOperand.TRUE) { Trap.mutate(s, TRAP, TrapIf.getClearGuardResult(s), TrapIf.getClearTCode(s)); return TRAP_REDUCED; } else if (willTrap == OPT_ConditionOperand.FALSE) { Move.mutate(s, GUARD_MOVE, TrapIf.getClearGuardResult(s), TG()); return MOVE_FOLDED; } } else { // canonicalize TrapIf.mutate(s, TRAP_IF, TrapIf.getClearGuardResult(s), TrapIf.getClearVal2(s), TrapIf.getClearVal1(s), TrapIf.getClearCond(s).flipOperands(), TrapIf.getClearTCode(s)); } } } return UNCHANGED; case NULL_CHECK_opcode: { OPT_Operand ref = NullCheck.getRef(s); if (ref.isNullConstant()) { Trap.mutate(s, TRAP, NullCheck.getClearGuardResult(s), OPT_TrapCodeOperand.NullPtr()); return TRAP_REDUCED; } else if (ref.isStringConstant()) { Move.mutate(s, GUARD_MOVE, NullCheck.getClearGuardResult(s), TG()); return MOVE_FOLDED; } else if (ref.isAddressConstant()) { if (ref.asAddressConstant().value.isZero()) { Trap.mutate(s, TRAP, NullCheck.getClearGuardResult(s), OPT_TrapCodeOperand.NullPtr()); return TRAP_REDUCED; } else { // Make the slightly suspect assumption that all non-zero address // constants are actually valid pointers. Not necessarily true, // but unclear what else we can do. Move.mutate(s, GUARD_MOVE, NullCheck.getClearGuardResult(s), TG()); return MOVE_FOLDED; } } return UNCHANGED; } case INT_ZERO_CHECK_opcode: { OPT_Operand op = ZeroCheck.getValue(s); if (op.isIntConstant()) { int val = op.asIntConstant().value; if (val == 0) { Trap.mutate(s, TRAP, ZeroCheck.getClearGuardResult(s), OPT_TrapCodeOperand.DivByZero()); return TRAP_REDUCED; } else { Move.mutate(s, GUARD_MOVE, ZeroCheck.getClearGuardResult(s), TG()); return MOVE_FOLDED; } } } return UNCHANGED; case LONG_ZERO_CHECK_opcode: { OPT_Operand op = ZeroCheck.getValue(s); if (op.isLongConstant()) { long val = op.asLongConstant().value; if (val == 0L) { Trap.mutate(s, TRAP, ZeroCheck.getClearGuardResult(s), OPT_TrapCodeOperand.DivByZero()); return TRAP_REDUCED; } else { Move.mutate(s, GUARD_MOVE, ZeroCheck.getClearGuardResult(s), TG()); return MOVE_FOLDED; } } } return UNCHANGED; case CHECKCAST_opcode: { OPT_Operand ref = TypeCheck.getRef(s); if (ref.isNullConstant()) { Empty.mutate(s, NOP); return REDUCED; } else if (ref.isStringConstant()) { s.operator = CHECKCAST_NOTNULL; return simplify(regpool, s); } else { VM_TypeReference lhsType = TypeCheck.getType(s).getTypeRef(); VM_TypeReference rhsType = ref.getType(); byte ans = OPT_ClassLoaderProxy.includesType(lhsType, rhsType); if (ans == OPT_Constants.YES) { Empty.mutate(s, NOP); return REDUCED; } // NOTE: OPT_Constants.NO can't help us because (T)null always succeeds } } return UNCHANGED; case CHECKCAST_NOTNULL_opcode: { OPT_Operand ref = TypeCheck.getRef(s); VM_TypeReference lhsType = TypeCheck.getType(s).getTypeRef(); VM_TypeReference rhsType = ref.getType(); byte ans = OPT_ClassLoaderProxy.includesType(lhsType, rhsType); if (ans == OPT_Constants.YES) { Empty.mutate(s, NOP); return REDUCED; } else if (ans == OPT_Constants.NO) { VM_Type rType = rhsType.peekResolvedType(); if (rType != null && rType.isClassType() && rType.asClass().isFinal()) { // only final (or precise) rhs types can be optimized since rhsType may be conservative Trap.mutate(s, TRAP, null, OPT_TrapCodeOperand.CheckCast()); return TRAP_REDUCED; } } } return UNCHANGED; case INSTANCEOF_opcode: { OPT_Operand ref = InstanceOf.getRef(s); if (ref.isNullConstant()) { Move.mutate(s, INT_MOVE, InstanceOf.getClearResult(s), IC(0)); return MOVE_FOLDED; } else if (ref.isStringConstant()) { s.operator = INSTANCEOF_NOTNULL; return simplify(regpool, s); } VM_TypeReference lhsType = InstanceOf.getType(s).getTypeRef(); VM_TypeReference rhsType = ref.getType(); byte ans = OPT_ClassLoaderProxy.includesType(lhsType, rhsType); // NOTE: OPT_Constants.YES doesn't help because ref may be null and null instanceof T is false if (ans == OPT_Constants.NO) { VM_Type rType = rhsType.peekResolvedType(); if (rType != null && rType.isClassType() && rType.asClass().isFinal()) { // only final (or precise) rhs types can be optimized since rhsType may be conservative Move.mutate(s, INT_MOVE, InstanceOf.getClearResult(s), IC(0)); return MOVE_FOLDED; } } } return UNCHANGED; case INSTANCEOF_NOTNULL_opcode: { OPT_Operand ref = InstanceOf.getRef(s); VM_TypeReference lhsType = InstanceOf.getType(s).getTypeRef(); VM_TypeReference rhsType = ref.getType(); byte ans = OPT_ClassLoaderProxy.includesType(lhsType, rhsType); if (ans == OPT_Constants.YES) { Move.mutate(s, INT_MOVE, InstanceOf.getClearResult(s), IC(1)); return MOVE_FOLDED; } else if (ans == OPT_Constants.NO) { VM_Type rType = rhsType.peekResolvedType(); if (rType != null && rType.isClassType() && rType.asClass().isFinal()) { // only final (or precise) rhs types can be optimized since rhsType may be conservative Move.mutate(s, INT_MOVE, InstanceOf.getClearResult(s), IC(0)); return MOVE_FOLDED; } } } return UNCHANGED; //////////////////// // Conditional moves //////////////////// case INT_COND_MOVE_opcode: { OPT_Operand val1 = CondMove.getVal1(s); OPT_Operand val2 = CondMove.getVal2(s); if (val1.isConstant()) { if (val2.isConstant()) { // BOTH CONSTANTS: FOLD int cond = CondMove.getCond(s).evaluate(val1, val2); if (cond != OPT_ConditionOperand.UNKNOWN) { OPT_Operand val = (cond == OPT_ConditionOperand.TRUE) ? CondMove.getClearTrueValue(s) : CondMove.getClearFalseValue(s); Move.mutate(s, INT_MOVE, CondMove.getClearResult(s), val); return val.isConstant() ? MOVE_FOLDED : MOVE_REDUCED; } } else { // Canonicalize by switching operands and fliping code. OPT_Operand tmp = CondMove.getClearVal1(s); CondMove.setVal1(s, CondMove.getClearVal2(s)); CondMove.setVal2(s, tmp); CondMove.getCond(s).flipOperands(); } } OPT_Operand tv = CondMove.getTrueValue(s); OPT_Operand fv = CondMove.getFalseValue(s); if (tv.similar(fv)) { Move.mutate(s, INT_MOVE, CondMove.getClearResult(s), tv); return tv.isConstant() ? MOVE_FOLDED : MOVE_REDUCED; } if (tv.isIntConstant() && fv.isIntConstant() && !CondMove.getCond(s).isFLOATINGPOINT()) { int itv = tv.asIntConstant().value; int ifv = fv.asIntConstant().value; OPT_Operator op = null; if(val1.isLong()) { op = BOOLEAN_CMP_LONG; } else if(val1.isFloat()) { op = BOOLEAN_CMP_FLOAT; } else if(val1.isDouble()) { op = BOOLEAN_CMP_DOUBLE; } else { op = BOOLEAN_CMP_INT; } if (itv == 1 && ifv == 0) { BooleanCmp.mutate(s, op, CondMove.getClearResult(s), CondMove.getClearVal1(s), CondMove.getClearVal2(s), CondMove.getClearCond(s), new OPT_BranchProfileOperand()); return REDUCED; } if (itv == 0 && ifv == 1) { BooleanCmp.mutate(s, op, CondMove.getClearResult(s), CondMove.getClearVal1(s), CondMove.getClearVal2(s), CondMove.getClearCond(s).flipCode(), new OPT_BranchProfileOperand()); return REDUCED; } } } return UNCHANGED; case LONG_COND_MOVE_opcode: { OPT_Operand val1 = CondMove.getVal1(s); if (val1.isConstant()) { OPT_Operand val2 = CondMove.getVal2(s); if (val2.isConstant()) { // BOTH CONSTANTS: FOLD int cond = CondMove.getCond(s).evaluate(val1, val2); if (cond != OPT_ConditionOperand.UNKNOWN) { OPT_Operand val = (cond == OPT_ConditionOperand.TRUE) ? CondMove.getClearTrueValue(s) : CondMove.getClearFalseValue(s); Move.mutate(s, LONG_MOVE, CondMove.getClearResult(s), val); return val.isConstant() ? MOVE_FOLDED : MOVE_REDUCED; } } else { // Canonicalize by switching operands and fliping code. OPT_Operand tmp = CondMove.getClearVal1(s); CondMove.setVal1(s, CondMove.getClearVal2(s)); CondMove.setVal2(s, tmp); CondMove.getCond(s).flipOperands(); } } if (CondMove.getTrueValue(s).similar(CondMove.getFalseValue(s))) { OPT_Operand val = CondMove.getClearTrueValue(s); Move.mutate(s, LONG_MOVE, CondMove.getClearResult(s), val); return val.isConstant() ? MOVE_FOLDED : MOVE_REDUCED; } } return UNCHANGED; case FLOAT_COND_MOVE_opcode: { OPT_Operand val1 = CondMove.getVal1(s); if (val1.isConstant()) { OPT_Operand val2 = CondMove.getVal2(s); if (val2.isConstant()) { // BOTH CONSTANTS: FOLD int cond = CondMove.getCond(s).evaluate(val1, val2); if (cond != OPT_ConditionOperand.UNKNOWN) { OPT_Operand val = (cond == OPT_ConditionOperand.TRUE) ? CondMove.getClearTrueValue(s) : CondMove.getClearFalseValue(s); Move.mutate(s, FLOAT_MOVE, CondMove.getClearResult(s), val); return val.isConstant() ? MOVE_FOLDED : MOVE_REDUCED; } } else { // Canonicalize by switching operands and fliping code. OPT_Operand tmp = CondMove.getClearVal1(s); CondMove.setVal1(s, CondMove.getClearVal2(s)); CondMove.setVal2(s, tmp); CondMove.getCond(s).flipOperands(); } } if (CondMove.getTrueValue(s).similar(CondMove.getFalseValue(s))) { OPT_Operand val = CondMove.getClearTrueValue(s); Move.mutate(s, FLOAT_MOVE, CondMove.getClearResult(s), val); return val.isConstant() ? MOVE_FOLDED : MOVE_REDUCED; } } return UNCHANGED; case DOUBLE_COND_MOVE_opcode: { OPT_Operand val1 = CondMove.getVal1(s); if (val1.isConstant()) { OPT_Operand val2 = CondMove.getVal2(s); if (val2.isConstant()) { // BOTH CONSTANTS: FOLD int cond = CondMove.getCond(s).evaluate(val1, val2); if (cond != OPT_ConditionOperand.UNKNOWN) { OPT_Operand val = (cond == OPT_ConditionOperand.TRUE) ? CondMove.getClearTrueValue(s) : CondMove.getClearFalseValue(s); Move.mutate(s, DOUBLE_MOVE, CondMove.getClearResult(s), val); return val.isConstant() ? MOVE_FOLDED : MOVE_REDUCED; } } else { // Canonicalize by switching operands and fliping code. OPT_Operand tmp = CondMove.getClearVal1(s); CondMove.setVal1(s, CondMove.getClearVal2(s)); CondMove.setVal2(s, tmp); CondMove.getCond(s).flipOperands(); } } if (CondMove.getTrueValue(s).similar(CondMove.getFalseValue(s))) { OPT_Operand val = CondMove.getClearTrueValue(s); Move.mutate(s, DOUBLE_MOVE, CondMove.getClearResult(s), val); return val.isConstant() ? MOVE_FOLDED : MOVE_REDUCED; } } return UNCHANGED; case REF_COND_MOVE_opcode: { OPT_Operand val1 = CondMove.getVal1(s); if (val1.isConstant()) { OPT_Operand val2 = CondMove.getVal2(s); if (val2.isConstant()) { // BOTH CONSTANTS: FOLD int cond = CondMove.getCond(s).evaluate(val1, val2); if (cond != OPT_ConditionOperand.UNKNOWN) { OPT_Operand val = (cond == OPT_ConditionOperand.TRUE) ? CondMove.getClearTrueValue(s) : CondMove.getClearFalseValue(s); Move.mutate(s, REF_MOVE, CondMove.getClearResult(s), val); return val.isConstant() ? MOVE_FOLDED : MOVE_REDUCED; } } else { // Canonicalize by switching operands and fliping code. OPT_Operand tmp = CondMove.getClearVal1(s); CondMove.setVal1(s, CondMove.getClearVal2(s)); CondMove.setVal2(s, tmp); CondMove.getCond(s).flipOperands(); } } if (CondMove.getTrueValue(s).similar(CondMove.getFalseValue(s))) { OPT_Operand val = CondMove.getClearTrueValue(s); Move.mutate(s, REF_MOVE, CondMove.getClearResult(s), val); return val.isConstant() ? MOVE_FOLDED : MOVE_REDUCED; } } return UNCHANGED; case GUARD_COND_MOVE_opcode: { OPT_Operand val1 = CondMove.getVal1(s); if (val1.isConstant()) { OPT_Operand val2 = CondMove.getVal2(s); if (val2.isConstant()) { // BOTH CONSTANTS: FOLD int cond = CondMove.getCond(s).evaluate(val1, val2); if (cond == OPT_ConditionOperand.UNKNOWN) { OPT_Operand val = (cond == OPT_ConditionOperand.TRUE) ? CondMove.getClearTrueValue(s) : CondMove.getClearFalseValue(s); Move.mutate(s, GUARD_MOVE, CondMove.getClearResult(s), val); return val.isConstant() ? MOVE_FOLDED : MOVE_REDUCED; } } else { // Canonicalize by switching operands and fliping code. OPT_Operand tmp = CondMove.getClearVal1(s); CondMove.setVal1(s, CondMove.getClearVal2(s)); CondMove.setVal2(s, tmp); CondMove.getCond(s).flipOperands(); } } if (CondMove.getTrueValue(s).similar(CondMove.getFalseValue(s))) { OPT_Operand val = CondMove.getClearTrueValue(s); Move.mutate(s, GUARD_MOVE, CondMove.getClearResult(s), val); return val.isConstant() ? MOVE_FOLDED : MOVE_REDUCED; } } return UNCHANGED; //////////////////// // INT ALU operations //////////////////// case BOOLEAN_NOT_opcode: if (CF_INT) { OPT_Operand op = Unary.getVal(s); if (op.isIntConstant()) { // CONSTANT: FOLD int val = op.asIntConstant().value; if (val == 0) { Move.mutate(s, INT_MOVE, Unary.getClearResult(s), IC(1)); } else { Move.mutate(s, INT_MOVE, Unary.getClearResult(s), IC(0)); } return MOVE_FOLDED; } } return UNCHANGED; case BOOLEAN_CMP_INT_opcode: if (CF_INT) { OPT_Operand op1 = BooleanCmp.getVal1(s); OPT_Operand op2 = BooleanCmp.getVal2(s); if (op1.isConstant()) { if (op2.isConstant()) { // BOTH CONSTANTS: FOLD int cond = BooleanCmp.getCond(s).evaluate(op1, op2); if (cond != OPT_ConditionOperand.UNKNOWN) { Move.mutate(s, INT_MOVE, BooleanCmp.getResult(s), (cond == OPT_ConditionOperand.TRUE) ? IC(1):IC(0)); return MOVE_FOLDED; } } else { // Canonicalize by switching operands and fliping code. OPT_Operand tmp = BooleanCmp.getClearVal1(s); BooleanCmp.setVal1(s, BooleanCmp.getClearVal2(s)); BooleanCmp.setVal2(s, tmp); BooleanCmp.getCond(s).flipOperands(); } } } return UNCHANGED; case BOOLEAN_CMP_ADDR_opcode: if (CF_ADDR) { OPT_Operand op1 = BooleanCmp.getVal1(s); OPT_Operand op2 = BooleanCmp.getVal2(s); if (op1.isConstant()) { if (op2.isConstant()) { // BOTH CONSTANTS: FOLD int cond = BooleanCmp.getCond(s).evaluate(op1, op2); if (cond != OPT_ConditionOperand.UNKNOWN) { Move.mutate(s, REF_MOVE, BooleanCmp.getResult(s), (cond == OPT_ConditionOperand.TRUE) ? IC(1):IC(0)); return MOVE_FOLDED; } } else { // Canonicalize by switching operands and fliping code. OPT_Operand tmp = BooleanCmp.getClearVal1(s); BooleanCmp.setVal1(s, BooleanCmp.getClearVal2(s)); BooleanCmp.setVal2(s, tmp); BooleanCmp.getCond(s).flipOperands(); } } } return UNCHANGED; case INT_ADD_opcode: if (CF_INT) { canonicalizeCommutativeOperator(s); OPT_Operand op2 = Binary.getVal2(s); if (op2.isIntConstant()) { int val2 = op2.asIntConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isIntConstant()) { // BOTH CONSTANTS: FOLD int val1 = op1.asIntConstant().value; Move.mutate(s, INT_MOVE, Binary.getClearResult(s), IC(val1 + val2)); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2 == 0) { Move.mutate(s, INT_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } } return UNCHANGED; case INT_AND_opcode: if (CF_INT) { canonicalizeCommutativeOperator(s); OPT_Operand op2 = Binary.getVal2(s); if (op2.isIntConstant()) { int val2 = op2.asIntConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isIntConstant()) { // BOTH CONSTANTS: FOLD int val1 = op1.asIntConstant().value; Move.mutate(s, INT_MOVE, Binary.getClearResult(s), IC(val1 & val2)); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2 == 0) { // x & 0 == 0 Move.mutate(s, INT_MOVE, Binary.getClearResult(s), IC(0)); return MOVE_FOLDED; } if (val2 == -1) { // x & -1 == x & 0xffffffff == x Move.mutate(s, INT_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } } return UNCHANGED; case INT_DIV_opcode: if (CF_INT) { OPT_Operand op2 = GuardedBinary.getVal2(s); if (op2.isIntConstant()) { int val2 = op2.asIntConstant().value; if (val2 == 0) { // TODO: This instruction is actually unreachable. // There will be an INT_ZERO_CHECK // guarding this instruction that will result in an // ArithmeticException. We // should probabbly just remove the INT_DIV as dead code. return UNCHANGED; } OPT_Operand op1 = GuardedBinary.getVal1(s); if (op1.isIntConstant()) { // BOTH CONSTANTS: FOLD int val1 = op1.asIntConstant().value; Move.mutate(s, INT_MOVE, GuardedBinary.getClearResult(s), IC(val1/val2)); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2 == 1) { // x / 1 == x; Move.mutate(s, INT_MOVE, GuardedBinary.getClearResult(s), GuardedBinary.getClearVal1(s)); return MOVE_REDUCED; } // x / c == x >> (log c) if c is power of 2 int power = PowerOf2(val2); if (power != -1) { Binary.mutate(s, INT_SHR, GuardedBinary.getClearResult(s), GuardedBinary.getClearVal1(s), IC(power)); return REDUCED; } } } } return UNCHANGED; case INT_MUL_opcode: if (CF_INT) { canonicalizeCommutativeOperator(s); OPT_Operand op2 = Binary.getVal2(s); if (op2.isIntConstant()) { int val2 = op2.asIntConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isIntConstant()) { // BOTH CONSTANTS: FOLD int val1 = op1.asIntConstant().value; Move.mutate(s, INT_MOVE, Binary.getClearResult(s), IC(val1*val2)); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2 == -1) { // x * -1 == -x Unary.mutate(s, INT_NEG, Binary.getClearResult(s), Binary.getClearVal1(s)); return REDUCED; } if (val2 == 0) { // x * 0 == 0 Move.mutate(s, INT_MOVE, Binary.getClearResult(s), IC(0)); return MOVE_FOLDED; } if (val2 == 1) { // x * 1 == x Move.mutate(s, INT_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } // try to reduce x*c into shift and adds, but only if cost is cheap if (s.getPrev() != null) { // don't attempt to reduce if this instruction isn't // part of a well-formed sequence int cost = 0; for(int i=1; i < 32; i++) { if((val2 & (1 << i)) != 0) { // each 1 requires a shift and add cost++; } } if (cost < 5) { // generate shift and adds OPT_RegisterOperand val1Operand = Binary.getClearVal1(s).asRegister(); OPT_RegisterOperand resultOperand = regpool.makeTempInt(); OPT_Instruction move; if ((val2 & 1) == 1) { // result = val1 * 1 move = Move.create(INT_MOVE, resultOperand, val1Operand); } else { // result = 0 move = Move.create(INT_MOVE, resultOperand, new OPT_IntConstantOperand(0)); } move.copyPosition(s); s.insertBefore(move); for(int i=1; i < 32; i++) { if((val2 & (1 << i)) != 0) { OPT_RegisterOperand tempInt = regpool.makeTempInt(); OPT_Instruction shift = Binary.create(INT_SHL, tempInt, val1Operand.copyRO(), new OPT_IntConstantOperand(i) ); shift.copyPosition(s); s.insertBefore(shift); OPT_Instruction add = Binary.create(INT_ADD, resultOperand.copyRO(), resultOperand.copyRO(), tempInt.copyRO() ); add.copyPosition(s); s.insertBefore(add); } } Move.mutate(s, INT_MOVE, Binary.getClearResult(s), resultOperand.copyRO()); return REDUCED; } } } } } return UNCHANGED; case INT_NEG_opcode: if (CF_INT) { OPT_Operand op = Unary.getVal(s); if (op.isIntConstant()) { // CONSTANT: FOLD int val = op.asIntConstant().value; Move.mutate(s, INT_MOVE, Unary.getClearResult(s), IC(-val)); return MOVE_FOLDED; } } return UNCHANGED; case INT_NOT_opcode: if (CF_INT) { OPT_Operand op = Unary.getVal(s); if (op.isIntConstant()) { // CONSTANT: FOLD int val = op.asIntConstant().value; Move.mutate(s, INT_MOVE, Unary.getClearResult(s), IC(~val)); return MOVE_FOLDED; } } return UNCHANGED; case INT_OR_opcode: if (CF_INT) { canonicalizeCommutativeOperator(s); OPT_Operand op2 = Binary.getVal2(s); if (op2.isIntConstant()) { int val2 = op2.asIntConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isIntConstant()) { // BOTH CONSTANTS: FOLD int val1 = op1.asIntConstant().value; Move.mutate(s, INT_MOVE, Binary.getClearResult(s), IC(val1 | val2)); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2 == -1) { // x | -1 == x | 0xffffffff == 0xffffffff == -1 Move.mutate(s, INT_MOVE, Binary.getClearResult(s), IC(-1)); return MOVE_FOLDED; } if (val2 == 0) { // x | 0 == x Move.mutate(s, INT_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } } return UNCHANGED; case INT_REM_opcode: if (CF_INT) { OPT_Operand op2 = GuardedBinary.getVal2(s); if (op2.isIntConstant()) { int val2 = op2.asIntConstant().value; if (val2 == 0) { // TODO: This instruction is actually unreachable. // There will be an INT_ZERO_CHECK // guarding this instruction that will result in an // ArithmeticException. We // should probabbly just remove the INT_REM as dead code. return UNCHANGED; } OPT_Operand op1 = GuardedBinary.getVal1(s); if (op1.isIntConstant()) { // BOTH CONSTANTS: FOLD int val1 = op1.asIntConstant().value; Move.mutate(s, INT_MOVE, GuardedBinary.getClearResult(s), IC(val1%val2)); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if ((val2 == 1)||(val2 == -1)) { // x % 1 == 0 Move.mutate(s, INT_MOVE, GuardedBinary.getClearResult(s), IC(0)); return MOVE_FOLDED; } // x % c == x & (c-1) if c is power of 2 int power = PowerOf2(val2); if (power != -1) { Binary.mutate(s, INT_AND, GuardedBinary.getClearResult(s), GuardedBinary.getClearVal1(s), IC(val2-1)); return REDUCED; } } } } return UNCHANGED; case INT_SHL_opcode: if (CF_INT) { OPT_Operand op2 = Binary.getVal2(s); if (op2.isIntConstant()) { int val2 = op2.asIntConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isIntConstant()) { // BOTH CONSTANTS: FOLD int val1 = op1.asIntConstant().value; Move.mutate(s, INT_MOVE, Binary.getClearResult(s), IC(val1 << val2)); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2 == 0) { // x << 0 == x Move.mutate(s, INT_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } } return UNCHANGED; case INT_SHR_opcode: if (CF_INT) { OPT_Operand op2 = Binary.getVal2(s); if (op2.isIntConstant()) { int val2 = op2.asIntConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isIntConstant()) { // BOTH CONSTANTS: FOLD int val1 = op1.asIntConstant().value; Move.mutate(s, INT_MOVE, Binary.getClearResult(s), IC(val1 >> val2)); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2 == 0) { // x >> 0 == x Move.mutate(s, INT_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } } return UNCHANGED; case INT_SUB_opcode: if (CF_INT) { OPT_Operand op2 = Binary.getVal2(s); if (op2.isIntConstant()) { int val2 = op2.asIntConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isIntConstant()) { // BOTH CONSTANTS: FOLD int val1 = op1.asIntConstant().value; Move.mutate(s, INT_MOVE, Binary.getClearResult(s), IC(val1 - val2)); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2 == 0) { // x - 0 == x Move.mutate(s, INT_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } // x - c = x + -c // prefer adds, since some architectures have addi but not subi Binary.mutate(s, INT_ADD, Binary.getClearResult(s), Binary.getClearVal1(s), IC(-val2)); return REDUCED; } } } return UNCHANGED; case INT_USHR_opcode: if (CF_INT) { OPT_Operand op2 = Binary.getVal2(s); if (op2.isIntConstant()) { int val2 = op2.asIntConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isIntConstant()) { // BOTH CONSTANTS: FOLD int val1 = op1.asIntConstant().value; Move.mutate(s, INT_MOVE, Binary.getClearResult(s), IC(val1 >>> val2)); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2 == 0) { // x >>> 0 == x Move.mutate(s, INT_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } } return UNCHANGED; case INT_XOR_opcode: if (CF_INT) { canonicalizeCommutativeOperator(s); OPT_Operand op2 = Binary.getVal2(s); if (op2.isIntConstant()) { int val2 = op2.asIntConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isIntConstant()) { // BOTH CONSTANTS: FOLD int val1 = op1.asIntConstant().value; Move.mutate(s, INT_MOVE, Binary.getClearResult(s), IC(val1 ^ val2)); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2 == -1) { // x ^ -1 == x ^ 0xffffffff = ~x Unary.mutate(s, INT_NOT, Binary.getClearResult(s), Binary.getClearVal1(s)); return REDUCED; } if (val2 == 0) { // x ^ 0 == x Move.mutate(s, INT_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } } return UNCHANGED; //////////////////// // WORD ALU operations //////////////////// case REF_ADD_opcode: if (CF_ADDR) { canonicalizeCommutativeOperator(s); OPT_Operand op2 = Binary.getVal2(s); if (op2.isConstant()) { Address val2 = getAddressValue(op2); OPT_Operand op1 = Binary.getVal1(s); if (op1.isConstant()) { // BOTH CONSTANTS: FOLD Address val1 = getAddressValue(op1); Move.mutate(s, REF_MOVE, Binary.getClearResult(s), AC(val1.add(val2.toWord().toOffset()))); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2.isZero()) { // x + 0 == x if (op1.isIntLike()) { Unary.mutate(s, INT_2ADDRSigExt, Binary.getClearResult(s), Binary.getClearVal1(s)); } else { Move.mutate(s, REF_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); } return MOVE_REDUCED; } } } } return UNCHANGED; case REF_AND_opcode: if (CF_ADDR) { canonicalizeCommutativeOperator(s); OPT_Operand op2 = Binary.getVal2(s); if (op2.isAddressConstant()) { Word val2 = op2.asAddressConstant().value.toWord(); OPT_Operand op1 = Binary.getVal1(s); if (op1.isAddressConstant()) { // BOTH CONSTANTS: FOLD Word val1 = op1.asAddressConstant().value.toWord(); Move.mutate(s, REF_MOVE, Binary.getClearResult(s), AC(val1.and(val2).toAddress())); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2.isZero()) { // x & 0 == 0 Move.mutate(s, REF_MOVE, Binary.getClearResult(s), AC(Address.zero())); return MOVE_FOLDED; } if (val2.isMax()) { // x & -1 == x & 0xffffffff == x Move.mutate(s, REF_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } } return UNCHANGED; case REF_SHL_opcode: if (CF_ADDR) { OPT_Operand op2 = Binary.getVal2(s); if (op2.isIntConstant()) { int val2 = op2.asIntConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isAddressConstant()) { // BOTH CONSTANTS: FOLD Word val1 = op1.asAddressConstant().value.toWord(); Move.mutate(s, REF_MOVE, Binary.getClearResult(s), AC(val1.lsh(val2).toAddress())); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2 == 0) { // x << 0 == x Move.mutate(s, REF_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } } return UNCHANGED; case REF_SHR_opcode: if (CF_ADDR) { OPT_Operand op2 = Binary.getVal2(s); if (op2.isIntConstant()) { int val2 = op2.asIntConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isAddressConstant()) { // BOTH CONSTANTS: FOLD Word val1 = op1.asAddressConstant().value.toWord(); Move.mutate(s, REF_MOVE, Binary.getClearResult(s), AC(val1.rsha(val2).toAddress())); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2 == 0) { // x >> 0 == x Move.mutate(s, REF_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } } return UNCHANGED; case REF_NOT_opcode: if (CF_ADDR) { OPT_Operand op = Unary.getVal(s); if (op.isAddressConstant()) { // CONSTANT: FOLD Word val = op.asAddressConstant().value.toWord(); Move.mutate(s, REF_MOVE, Unary.getClearResult(s), AC(val.not().toAddress())); return MOVE_FOLDED; } } return UNCHANGED; case REF_OR_opcode: if (CF_ADDR) { canonicalizeCommutativeOperator(s); OPT_Operand op2 = Binary.getVal2(s); if (op2.isAddressConstant()) { Word val2 = op2.asAddressConstant().value.toWord(); OPT_Operand op1 = Binary.getVal1(s); if (op1.isAddressConstant()) { // BOTH CONSTANTS: FOLD Word val1 = op1.asAddressConstant().value.toWord(); Move.mutate(s, REF_MOVE, Binary.getClearResult(s), AC(val1.or(val2).toAddress())); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2.isMax()) { // x | -1 == x | 0xffffffff == 0xffffffff == -1 Move.mutate(s, REF_MOVE, Binary.getClearResult(s), AC(Address.max())); return MOVE_FOLDED; } if (val2.isZero()) { // x | 0 == x Move.mutate(s, REF_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } } return UNCHANGED; case REF_SUB_opcode: if (CF_ADDR) { OPT_Operand op2 = Binary.getVal2(s); if (op2.isConstant()) { Address val2 = getAddressValue(op2); OPT_Operand op1 = Binary.getVal1(s); if (op1.isConstant()) { // BOTH CONSTANTS: FOLD Address val1 = getAddressValue(op1); Move.mutate(s, REF_MOVE, Binary.getClearResult(s), AC(val1.sub(val2.toWord().toOffset()))); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2.isZero()) { // x - 0 == x if (op1.isIntLike()) { Unary.mutate(s, INT_2ADDRSigExt, Binary.getClearResult(s), Binary.getClearVal1(s)); } else { Move.mutate(s, REF_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); } return MOVE_REDUCED; } // x - c = x + -c // prefer adds, since some architectures have addi but not subi Binary.mutate(s, REF_ADD, Binary.getClearResult(s), Binary.getClearVal1(s), AC(Address.zero().sub(val2.toWord().toOffset()))); return REDUCED; } } } return UNCHANGED; case REF_USHR_opcode: if (CF_ADDR) { OPT_Operand op2 = Binary.getVal2(s); if (op2.isIntConstant()) { int val2 = op2.asIntConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isAddressConstant()) { // BOTH CONSTANTS: FOLD Word val1 = op1.asAddressConstant().value.toWord(); Move.mutate(s, REF_MOVE, Binary.getClearResult(s), AC(val1.rshl(val2).toAddress())); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2 == 0) { // x >>> 0 == x Move.mutate(s, REF_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } } return UNCHANGED; case REF_XOR_opcode: if (CF_ADDR) { canonicalizeCommutativeOperator(s); OPT_Operand op2 = Binary.getVal2(s); if (op2.isAddressConstant()) { Word val2 = op2.asAddressConstant().value.toWord(); OPT_Operand op1 = Binary.getVal1(s); if (op1.isAddressConstant()) { // BOTH CONSTANTS: FOLD Word val1 = op1.asAddressConstant().value.toWord(); Move.mutate(s, REF_MOVE, Binary.getClearResult(s), AC(val1.xor(val2).toAddress())); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2.isMax()) { // x ^ -1 == x ^ 0xffffffff = ~x Unary.mutate(s, REF_NOT, Binary.getClearResult(s), Binary.getClearVal1(s)); return REDUCED; } if (val2.isZero()) { // x ^ 0 == x Move.mutate(s, REF_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } } return UNCHANGED; //////////////////// // LONG ALU operations //////////////////// case LONG_ADD_opcode: if (CF_LONG) { canonicalizeCommutativeOperator(s); OPT_Operand op2 = Binary.getVal2(s); if (op2.isLongConstant()) { long val2 = op2.asLongConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isLongConstant()) { // BOTH CONSTANTS: FOLD long val1 = op1.asLongConstant().value; Move.mutate(s, LONG_MOVE, Binary.getClearResult(s), LC(val1+val2)); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2 == 0L) { // x + 0 == x Move.mutate(s, LONG_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } } return UNCHANGED; case LONG_AND_opcode: if (CF_LONG) { canonicalizeCommutativeOperator(s); OPT_Operand op2 = Binary.getVal2(s); if (op2.isLongConstant()) { long val2 = op2.asLongConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isLongConstant()) { // BOTH CONSTANTS: FOLD long val1 = op1.asLongConstant().value; Move.mutate(s, LONG_MOVE, Binary.getClearResult(s), LC(val1 & val2)); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2 == 0L) { // x & 0L == 0L Move.mutate(s, LONG_MOVE, Binary.getClearResult(s), LC(0L)); return MOVE_FOLDED; } if (val2 == -1) { // x & -1L == x & 0xff...ff == x Move.mutate(s, LONG_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } } return UNCHANGED; case LONG_CMP_opcode: if (CF_LONG) { OPT_Operand op2 = Binary.getVal2(s); if (op2.isLongConstant()) { OPT_Operand op1 = Binary.getVal1(s); if (op1.isLongConstant()) { // BOTH CONSTANTS: FOLD long val1 = op1.asLongConstant().value; long val2 = op2.asLongConstant().value; int result = (val1 > val2) ? 1 : ((val1 == val2) ? 0 : -1); Move.mutate(s, INT_MOVE, Binary.getClearResult(s), IC(result)); return MOVE_FOLDED; } } } return UNCHANGED; case LONG_DIV_opcode: if (CF_LONG) { OPT_Operand op2 = GuardedBinary.getVal2(s); if (op2.isLongConstant()) { long val2 = op2.asLongConstant().value; if (val2 == 0L) { // TODO: This instruction is actually unreachable. // There will be a LONG_ZERO_CHECK // guarding this instruction that will result in an // ArithmeticException. We // should probabbly just remove the LONG_DIV as dead code. return UNCHANGED; } OPT_Operand op1 = GuardedBinary.getVal1(s); if (op1.isLongConstant()) { // BOTH CONSTANTS: FOLD long val1 = op1.asLongConstant().value; Move.mutate(s, LONG_MOVE, GuardedBinary.getClearResult(s), LC(val1/val2)); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2 == 1L) { // x / 1L == x Move.mutate(s, LONG_MOVE, GuardedBinary.getClearResult(s), GuardedBinary.getClearVal1(s)); return MOVE_REDUCED; } } } } return UNCHANGED; case LONG_MUL_opcode: if (CF_LONG) { canonicalizeCommutativeOperator(s); OPT_Operand op2 = Binary.getVal2(s); if (op2.isLongConstant()) { long val2 = op2.asLongConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isLongConstant()) { // BOTH CONSTANTS: FOLD long val1 = op1.asLongConstant().value; Move.mutate(s, LONG_MOVE, Binary.getClearResult(s), LC(val1*val2)); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2 == -1L) { // x * -1 == -x Move.mutate(s, LONG_NEG, Binary.getClearResult(s), Binary.getClearVal1(s)); return REDUCED; } if (val2 == 0L) { // x * 0L == 0L Move.mutate(s, LONG_MOVE, Binary.getClearResult(s), LC(0L)); return MOVE_FOLDED; } if (val2 == 1L) { // x * 1L == x Move.mutate(s, LONG_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } } return UNCHANGED; case LONG_NEG_opcode: if (CF_LONG) { OPT_Operand op = Unary.getVal(s); if (op.isLongConstant()) { // CONSTANT: FOLD long val = op.asLongConstant().value; Move.mutate(s, LONG_MOVE, Unary.getClearResult(s), LC(-val)); return MOVE_FOLDED; } } return UNCHANGED; case LONG_NOT_opcode: if (CF_LONG) { OPT_Operand op = Unary.getVal(s); if (op.isLongConstant()) { long val = op.asLongConstant().value; // CONSTANT: FOLD Move.mutate(s, LONG_MOVE, Binary.getClearResult(s), LC(~val)); return MOVE_FOLDED; } } return UNCHANGED; case LONG_OR_opcode: if (CF_LONG) { canonicalizeCommutativeOperator(s); OPT_Operand op2 = Binary.getVal2(s); if (op2.isLongConstant()) { long val2 = op2.asLongConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isLongConstant()) { // BOTH CONSTANTS: FOLD long val1 = op1.asLongConstant().value; Move.mutate(s, LONG_MOVE, Binary.getClearResult(s), LC(val1 | val2)); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2 == 0L) { // x | 0L == x Move.mutate(s, LONG_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } if (val2 == -1L) { // x | -1L == x | 0xff..ff == 0xff..ff == -1L Move.mutate(s, LONG_MOVE, Binary.getClearResult(s), LC(-1L)); return MOVE_FOLDED; } } } } return UNCHANGED; case LONG_REM_opcode: if (CF_LONG) { OPT_Operand op2 = GuardedBinary.getVal2(s); if (op2.isLongConstant()) { long val2 = op2.asLongConstant().value; if (val2 == 0L) { // TODO: This instruction is actually unreachable. // There will be a LONG_ZERO_CHECK // guarding this instruction that will result in an // ArithmeticException. We // should probabbly just remove the LONG_REM as dead code. return UNCHANGED; } OPT_Operand op1 = GuardedBinary.getVal1(s); if (op1.isLongConstant()) { // BOTH CONSTANTS: FOLD long val1 = op1.asLongConstant().value; Move.mutate(s, LONG_MOVE, GuardedBinary.getClearResult(s), LC(val1%val2)); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2 == 1L) { // x % 1L == 0 Move.mutate(s, LONG_MOVE, GuardedBinary.getClearResult(s), LC(0)); return MOVE_FOLDED; } } } } return UNCHANGED; case LONG_SHL_opcode: if (CF_LONG) { OPT_Operand op2 = Binary.getVal2(s); if (op2.isIntConstant()) { int val2 = op2.asIntConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isLongConstant()) { // BOTH CONSTANTS: FOLD long val1 = op1.asLongConstant().value; Move.mutate(s, LONG_MOVE, Binary.getClearResult(s), LC(val1 << val2)); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2 == 0) { // x << 0 == x Move.mutate(s, LONG_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } } return UNCHANGED; case LONG_SHR_opcode: if (CF_LONG) { OPT_Operand op2 = Binary.getVal2(s); if (op2.isIntConstant()) { int val2 = op2.asIntConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isLongConstant()) { // BOTH CONSTANTS: FOLD long val1 = op1.asLongConstant().value; Move.mutate(s, LONG_MOVE, Binary.getClearResult(s), LC(val1 >> val2)); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2 == 0) { // x >> 0L == x Move.mutate(s, LONG_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } } return UNCHANGED; case LONG_SUB_opcode: if (CF_LONG) { OPT_Operand op2 = Binary.getVal2(s); if (op2.isLongConstant()) { long val2 = op2.asLongConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isLongConstant()) { // BOTH CONSTANTS: FOLD long val1 = op1.asLongConstant().value; Move.mutate(s, LONG_MOVE, Binary.getClearResult(s), LC(val1-val2)); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2 == 0L) { // x - 0 == x Move.mutate(s, LONG_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } //-#if RVM_FOR_64_ADDR // x - c = x + -c // prefer adds, since some architectures have addi but not subi Binary.mutate(s, LONG_ADD, Binary.getClearResult(s), Binary.getClearVal1(s), LC(-val2)); return REDUCED; //-#endif } } } return UNCHANGED; case LONG_USHR_opcode: if (CF_LONG) { OPT_Operand op2 = Binary.getVal2(s); if (op2.isIntConstant()) { int val2 = op2.asIntConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isLongConstant()) { // BOTH CONSTANTS: FOLD long val1 = op1.asLongConstant().value; Move.mutate(s, LONG_MOVE, Binary.getClearResult(s), LC(val1 >>> val2)); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2 == 0) { // x >>> 0L == x Move.mutate(s, LONG_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } } return UNCHANGED; case LONG_XOR_opcode: if (CF_LONG) { canonicalizeCommutativeOperator(s); OPT_Operand op2 = Binary.getVal2(s); if (op2.isLongConstant()) { long val2 = op2.asLongConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isLongConstant()) { // BOTH CONSTANTS: FOLD long val1 = op1.asLongConstant().value; Move.mutate(s, LONG_MOVE, Binary.getClearResult(s), LC(val1 ^ val2)); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2 == -1L) { // x ^ -1L == x ^ 0xff..ff = ~x Unary.mutate(s, LONG_NOT, Binary.getClearResult(s), Binary.getClearVal1(s)); return REDUCED; } if (val2 == 0L) { // x ^ 0L == x Move.mutate(s, LONG_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } } return UNCHANGED; //////////////////// // FLOAT ALU operations //////////////////// case FLOAT_ADD_opcode: if (CF_FLOAT) { canonicalizeCommutativeOperator(s); OPT_Operand op2 = Binary.getVal2(s); if (op2.isFloatConstant()) { float val2 = op2.asFloatConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isFloatConstant()) { // BOTH CONSTANTS: FOLD float val1 = op1.asFloatConstant().value; Move.mutate(s, FLOAT_MOVE, Binary.getClearResult(s), FC(val1 + val2)); return MOVE_FOLDED; } if (val2 == 0.0f) { // x + 0.0 is x (even is x is a Nan). Move.mutate(s, FLOAT_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } return UNCHANGED; case FLOAT_CMPG_opcode: if (CF_INT) { OPT_Operand op2 = Binary.getVal2(s); if (op2.isFloatConstant()) { OPT_Operand op1 = Binary.getVal1(s); if (op1.isFloatConstant()) { // BOTH CONSTANTS: FOLD float val1 = op1.asFloatConstant().value; float val2 = op2.asFloatConstant().value; int result = (val1 < val2) ? -1 : ((val1 == val2) ? 0 : 1); Move.mutate(s, INT_MOVE, Binary.getClearResult(s), IC(result)); return MOVE_FOLDED; } } } return UNCHANGED; case FLOAT_CMPL_opcode: if (CF_INT) { OPT_Operand op2 = Binary.getVal2(s); if (op2.isFloatConstant()) { OPT_Operand op1 = Binary.getVal1(s); if (op1.isFloatConstant()) { // BOTH CONSTANTS: FOLD float val1 = op1.asFloatConstant().value; float val2 = op2.asFloatConstant().value; int result = (val1 > val2) ? 1 : ((val1 == val2) ? 0 : -1); Move.mutate(s, INT_MOVE, Binary.getClearResult(s), IC(result)); return MOVE_FOLDED; } } } return UNCHANGED; case FLOAT_DIV_opcode: if (CF_FLOAT) { OPT_Operand op2 = Binary.getVal2(s); if (op2.isFloatConstant()) { OPT_Operand op1 = Binary.getVal1(s); if (op1.isFloatConstant()) { // BOTH CONSTANTS: FOLD float val1 = op1.asFloatConstant().value; float val2 = op2.asFloatConstant().value; Move.mutate(s, FLOAT_MOVE, Binary.getClearResult(s), FC(val1/val2)); return MOVE_FOLDED; } } } return UNCHANGED; case FLOAT_MUL_opcode: if (CF_FLOAT) { canonicalizeCommutativeOperator(s); OPT_Operand op2 = Binary.getVal2(s); if (op2.isFloatConstant()) { float val2 = op2.asFloatConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isFloatConstant()) { // BOTH CONSTANTS: FOLD float val1 = op1.asFloatConstant().value; Move.mutate(s, FLOAT_MOVE, Binary.getClearResult(s), FC(val1*val2)); return MOVE_FOLDED; } if (val2 == 1.0f) { // x * 1.0 is x, even if x is a NaN Move.mutate(s, FLOAT_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } return UNCHANGED; case FLOAT_NEG_opcode: if (CF_FLOAT) { OPT_Operand op = Unary.getVal(s); if (op.isFloatConstant()) { // CONSTANT: FOLD float val = op.asFloatConstant().value; Move.mutate(s, FLOAT_MOVE, Unary.getClearResult(s), FC(-val)); return MOVE_FOLDED; } } return UNCHANGED; case FLOAT_REM_opcode: if (CF_FLOAT) { OPT_Operand op2 = Binary.getVal2(s); if (op2.isFloatConstant()) { OPT_Operand op1 = Binary.getVal1(s); if (op1.isFloatConstant()) { // BOTH CONSTANTS: FOLD float val1 = op1.asFloatConstant().value; float val2 = op2.asFloatConstant().value; Move.mutate(s, FLOAT_MOVE, Binary.getClearResult(s), FC(val1%val2)); return MOVE_FOLDED; } } } return UNCHANGED; case FLOAT_SUB_opcode: if (CF_FLOAT) { OPT_Operand op2 = Binary.getVal2(s); if (op2.isFloatConstant()) { float val2 = op2.asFloatConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isFloatConstant()) { // BOTH CONSTANTS: FOLD float val1 = op1.asFloatConstant().value; Move.mutate(s, FLOAT_MOVE, Binary.getClearResult(s), FC(val1 - val2)); return MOVE_FOLDED; } if (val2 == 0.0f) { // x - 0.0 is x, even if x is a NaN Move.mutate(s, FLOAT_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } return UNCHANGED; //////////////////// // DOUBLE ALU operations //////////////////// case DOUBLE_ADD_opcode: if (CF_DOUBLE) { canonicalizeCommutativeOperator(s); OPT_Operand op2 = Binary.getVal2(s); if (op2.isDoubleConstant()) { double val2 = op2.asDoubleConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isDoubleConstant()) { // BOTH CONSTANTS: FOLD double val1 = op1.asDoubleConstant().value; Move.mutate(s, DOUBLE_MOVE, Binary.getClearResult(s), DC(val1 + val2)); return MOVE_FOLDED; } if (val2 == 0.0) { // x + 0.0 is x, even if x is a NaN Move.mutate(s, DOUBLE_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } return UNCHANGED; case DOUBLE_CMPG_opcode: if (CF_INT) { OPT_Operand op2 = Binary.getVal2(s); if (op2.isDoubleConstant()) { OPT_Operand op1 = Binary.getVal1(s); if (op1.isDoubleConstant()) { // BOTH CONSTANTS: FOLD double val1 = op1.asDoubleConstant().value; double val2 = op2.asDoubleConstant().value; int result = (val1 < val2) ? -1 : ((val1 == val2) ? 0 : 1); Move.mutate(s, INT_MOVE, Binary.getClearResult(s), IC(result)); return MOVE_FOLDED; } } } return UNCHANGED; case DOUBLE_CMPL_opcode: if (CF_INT) { OPT_Operand op2 = Binary.getVal2(s); if (op2.isDoubleConstant()) { OPT_Operand op1 = Binary.getVal1(s); if (op1.isDoubleConstant()) { // BOTH CONSTANTS: FOLD double val1 = op1.asDoubleConstant().value; double val2 = op2.asDoubleConstant().value; int result = (val1 > val2) ? 1 : ((val1 == val2) ? 0 : -1); Move.mutate(s, DOUBLE_MOVE, Binary.getClearResult(s), IC(result)); return MOVE_FOLDED; } } } return UNCHANGED; case DOUBLE_DIV_opcode: if (CF_DOUBLE) { OPT_Operand op2 = Binary.getVal2(s); if (op2.isDoubleConstant()) { OPT_Operand op1 = Binary.getVal1(s); if (op1.isDoubleConstant()) { // BOTH CONSTANTS: FOLD double val1 = op1.asDoubleConstant().value; double val2 = op2.asDoubleConstant().value; Move.mutate(s, DOUBLE_MOVE, Binary.getClearResult(s), DC(val1/val2)); return MOVE_FOLDED; } } } return UNCHANGED; case DOUBLE_MUL_opcode: if (CF_DOUBLE) { canonicalizeCommutativeOperator(s); OPT_Operand op2 = Binary.getVal2(s); if (op2.isDoubleConstant()) { double val2 = op2.asDoubleConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isDoubleConstant()) { // BOTH CONSTANTS: FOLD double val1 = op1.asDoubleConstant().value; Move.mutate(s, DOUBLE_MOVE, Binary.getClearResult(s), DC(val1*val2)); return MOVE_FOLDED; } if (val2 == 1.0) { // x * 1.0 is x even if x is a NaN Move.mutate(s, DOUBLE_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } return UNCHANGED; case DOUBLE_NEG_opcode: if (CF_DOUBLE) { OPT_Operand op = Unary.getVal(s); if (op.isDoubleConstant()) { // CONSTANT: FOLD double val = op.asDoubleConstant().value; Move.mutate(s, DOUBLE_MOVE, Unary.getClearResult(s), DC(-val)); return MOVE_FOLDED; } } return UNCHANGED; case DOUBLE_REM_opcode: if (CF_DOUBLE) { OPT_Operand op2 = Binary.getVal2(s); if (op2.isDoubleConstant()) { OPT_Operand op1 = Binary.getVal1(s); if (op1.isDoubleConstant()) { // BOTH CONSTANTS: FOLD double val1 = op1.asDoubleConstant().value; double val2 = op2.asDoubleConstant().value; Move.mutate(s, DOUBLE_MOVE, Binary.getClearResult(s), DC(val1%val2)); return MOVE_FOLDED; } } } return UNCHANGED; case DOUBLE_SUB_opcode: if (CF_DOUBLE) { OPT_Operand op2 = Binary.getVal2(s); if (op2.isDoubleConstant()) { double val2 = op2.asDoubleConstant().value; OPT_Operand op1 = Binary.getVal1(s); if (op1.isDoubleConstant()) { // BOTH CONSTANTS: FOLD double val1 = op1.asDoubleConstant().value; Move.mutate(s, DOUBLE_MOVE, Binary.getClearResult(s), DC(val1 - val2)); return MOVE_FOLDED; } if (val2 == 0.0) { // x - 0.0 is x, even if x is a NaN Move.mutate(s, DOUBLE_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } return UNCHANGED; //////////////////// // CONVERSION operations //////////////////// case DOUBLE_2FLOAT_opcode: if (CF_FLOAT) { OPT_Operand op = Unary.getVal(s); if (op.isDoubleConstant()) { // CONSTANT: FOLD double val = op.asDoubleConstant().value; Move.mutate(s, FLOAT_MOVE, Unary.getClearResult(s), FC((float)val)); return MOVE_FOLDED; } } return UNCHANGED; case DOUBLE_2INT_opcode: if (CF_INT) { OPT_Operand op = Unary.getVal(s); if (op.isDoubleConstant()) { // CONSTANT: FOLD double val = op.asDoubleConstant().value; Move.mutate(s, INT_MOVE, Unary.getClearResult(s), IC((int)val)); return MOVE_FOLDED; } } return UNCHANGED; case DOUBLE_2LONG_opcode: if (CF_LONG) { OPT_Operand op = Unary.getVal(s); if (op.isDoubleConstant()) { // CONSTANT: FOLD double val = op.asDoubleConstant().value; Move.mutate(s, LONG_MOVE, Unary.getClearResult(s), LC((long)val)); return MOVE_FOLDED; } } return UNCHANGED; case DOUBLE_AS_LONG_BITS_opcode: if (CF_LONG) { OPT_Operand op = Unary.getVal(s); if (op.isDoubleConstant()) { // CONSTANT: FOLD double val = op.asDoubleConstant().value; Move.mutate(s, LONG_MOVE, Unary.getClearResult(s), LC(Double.doubleToLongBits(val))); return MOVE_FOLDED; } } return UNCHANGED; case INT_2DOUBLE_opcode: if (CF_DOUBLE) { OPT_Operand op = Unary.getVal(s); if (op.isIntConstant()) { // CONSTANT: FOLD int val = op.asIntConstant().value; Move.mutate(s, DOUBLE_MOVE, Unary.getClearResult(s), DC((double)val)); return MOVE_FOLDED; } } return UNCHANGED; case INT_2BYTE_opcode: if (CF_INT) { OPT_Operand op = Unary.getVal(s); if (op.isIntConstant()) { // CONSTANT: FOLD int val = op.asIntConstant().value; Move.mutate(s, INT_MOVE, Unary.getClearResult(s), IC((byte)val)); return MOVE_FOLDED; } } return UNCHANGED; case INT_2USHORT_opcode: if (CF_INT) { OPT_Operand op = Unary.getVal(s); if (op.isIntConstant()) { // CONSTANT: FOLD int val = op.asIntConstant().value; Move.mutate(s, INT_MOVE, Unary.getClearResult(s), IC((char)val)); return MOVE_FOLDED; } } return UNCHANGED; case INT_2FLOAT_opcode: if (CF_FLOAT) { OPT_Operand op = Unary.getVal(s); if (op.isIntConstant()) { // CONSTANT: FOLD int val = op.asIntConstant().value; Move.mutate(s, FLOAT_MOVE, Unary.getClearResult(s), FC((float)val)); return MOVE_FOLDED; } } return UNCHANGED; case INT_2LONG_opcode: if (CF_LONG) { OPT_Operand op = Unary.getVal(s); if (op.isIntConstant()) { // CONSTANT: FOLD int val = op.asIntConstant().value; Move.mutate(s, LONG_MOVE, Unary.getClearResult(s), LC((long)val)); return MOVE_FOLDED; } } return UNCHANGED; case INT_2ADDRSigExt_opcode: if (CF_ADDR) { OPT_Operand op = Unary.getVal(s); if (op.isIntConstant()) { // CONSTANT: FOLD int val = op.asIntConstant().value; Move.mutate(s, REF_MOVE, Unary.getClearResult(s), AC(Address.fromIntSignExtend(val))); return MOVE_FOLDED; } } return UNCHANGED; case INT_2ADDRZerExt_opcode: if (CF_ADDR) { OPT_Operand op = Unary.getVal(s); if (op.isIntConstant()) { // CONSTANT: FOLD int val = op.asIntConstant().value; Move.mutate(s, REF_MOVE, Unary.getClearResult(s), AC(Address.fromIntZeroExtend(val))); return MOVE_FOLDED; } } return UNCHANGED; //-#if RVM_FOR_64_ADDR case LONG_2ADDR_opcode: if (CF_ADDR) { OPT_Operand op = Unary.getVal(s); if (op.isLongConstant()) { // CONSTANT: FOLD long val = op.asLongConstant().value; Move.mutate(s, REF_MOVE, Unary.getClearResult(s), AC(Address.fromLong(val))); return MOVE_FOLDED; } } return UNCHANGED; //-#endif case INT_2SHORT_opcode: if (CF_INT) { OPT_Operand op = Unary.getVal(s); if (op.isIntConstant()) { // CONSTANT: FOLD int val = op.asIntConstant().value; Move.mutate(s, INT_MOVE, Unary.getClearResult(s), IC((short)val)); return MOVE_FOLDED; } } return UNCHANGED; case INT_BITS_AS_FLOAT_opcode: if (CF_FLOAT) { OPT_Operand op = Unary.getVal(s); if (op.isIntConstant()) { // CONSTANT: FOLD int val = op.asIntConstant().value; Move.mutate(s, FLOAT_MOVE, Unary.getClearResult(s), FC(Float.intBitsToFloat(val))); return MOVE_FOLDED; } } return UNCHANGED; case ADDR_2INT_opcode: if (CF_INT) { OPT_Operand op = Unary.getVal(s); if (op.isAddressConstant()) { // CONSTANT: FOLD Address val = op.asAddressConstant().value; Move.mutate(s, INT_MOVE, Unary.getClearResult(s), IC(val.toInt())); return MOVE_FOLDED; } } return UNCHANGED; case ADDR_2LONG_opcode: if (CF_LONG) { OPT_Operand op = Unary.getVal(s); if (op.isAddressConstant()) { // CONSTANT: FOLD Address val = op.asAddressConstant().value; Move.mutate(s, LONG_MOVE, Unary.getClearResult(s), LC(val.toLong())); return MOVE_FOLDED; } } return UNCHANGED; case FLOAT_2DOUBLE_opcode: if (CF_DOUBLE) { OPT_Operand op = Unary.getVal(s); if (op.isFloatConstant()) { // CONSTANT: FOLD float val = op.asFloatConstant().value; Move.mutate(s, DOUBLE_MOVE, Unary.getClearResult(s), DC((double)val)); return MOVE_FOLDED; } } return UNCHANGED; case FLOAT_2INT_opcode: if (CF_INT) { OPT_Operand op = Unary.getVal(s); if (op.isFloatConstant()) { // CONSTANT: FOLD float val = op.asFloatConstant().value; Move.mutate(s, INT_MOVE, Unary.getClearResult(s), IC((int)val)); return MOVE_FOLDED; } } return UNCHANGED; case FLOAT_2LONG_opcode: if (CF_LONG) { OPT_Operand op = Unary.getVal(s); if (op.isFloatConstant()) { // CONSTANT: FOLD float val = op.asFloatConstant().value; Move.mutate(s, LONG_MOVE, Unary.getClearResult(s), LC((long)val)); return MOVE_FOLDED; } } return UNCHANGED; case FLOAT_AS_INT_BITS_opcode: if (CF_INT) { OPT_Operand op = Unary.getVal(s); if (op.isFloatConstant()) { // CONSTANT: FOLD float val = op.asFloatConstant().value; Move.mutate(s, INT_MOVE, Unary.getClearResult(s), IC(Float.floatToIntBits(val))); return MOVE_FOLDED; } } return UNCHANGED; case LONG_2FLOAT_opcode: if (CF_FLOAT) { OPT_Operand op = Unary.getVal(s); if (op.isLongConstant()) { // CONSTANT: FOLD long val = op.asLongConstant().value; Move.mutate(s, FLOAT_MOVE, Unary.getClearResult(s), FC((float)val)); return MOVE_FOLDED; } } return UNCHANGED; case LONG_2INT_opcode: if (CF_INT) { OPT_Operand op = Unary.getVal(s); if (op.isLongConstant()) { // CONSTANT: FOLD long val = op.asLongConstant().value; Move.mutate(s, INT_MOVE, Unary.getClearResult(s), IC((int)val)); return MOVE_FOLDED; } } return UNCHANGED; case LONG_2DOUBLE_opcode: if (CF_DOUBLE) { OPT_Operand op = Unary.getVal(s); if (op.isLongConstant()) { // CONSTANT: FOLD long val = op.asLongConstant().value; Move.mutate(s, DOUBLE_MOVE, Unary.getClearResult(s), DC((double)val)); return MOVE_FOLDED; } } return UNCHANGED; case LONG_BITS_AS_DOUBLE_opcode: if (CF_DOUBLE) { OPT_Operand op = Unary.getVal(s); if (op.isLongConstant()) { // CONSTANT: FOLD long val = op.asLongConstant().value; Move.mutate(s, DOUBLE_MOVE, Unary.getClearResult(s), DC(Double.longBitsToDouble(val))); return MOVE_FOLDED; } } return UNCHANGED; default: return UNCHANGED; } } | 49871 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49871/885bdbb0bcc20101dd619f5136dd2850f157204a/OPT_Simplifier.java/buggy/rvm/src/vm/compilers/optimizing/optimizations/local/OPT_Simplifier.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
760,
1160,
16499,
12,
15620,
67,
7469,
3996,
2864,
960,
6011,
16,
16456,
67,
11983,
272,
13,
288,
565,
1620,
261,
87,
18,
588,
22808,
10756,
288,
1377,
368,
3517,
759,
1377,
368,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
760,
1160,
16499,
12,
15620,
67,
7469,
3996,
2864,
960,
6011,
16,
16456,
67,
11983,
272,
13,
288,
565,
1620,
261,
87,
18,
588,
22808,
10756,
288,
1377,
368,
3517,
759,
1377,
368,
... |
Relative.untranslateRelative(c); c.popStyle(); | public static void layoutContent(Context c, Box box, List contentList) { //Here we should always be inside something that corresponds to a block-level element //for formatting purposes Rectangle bounds = new Rectangle(); bounds.width = c.getExtents().width; Border border = c.getCurrentStyle().getBorderWidth(c.getBlockFormattingContext().getWidth(), c.getBlockFormattingContext().getHeight()); Border margin = c.getCurrentStyle().getMarginWidth(c.getBlockFormattingContext().getWidth(), c.getBlockFormattingContext().getHeight()); Border padding = c.getCurrentStyle().getPaddingWidth(c.getBlockFormattingContext().getWidth(), c.getBlockFormattingContext().getHeight()); //below should maybe be done somewhere else? bounds.width -= margin.left + border.left + padding.left + padding.right + border.right + margin.right; validateBounds(bounds); bounds.x = 0; bounds.y = 0; bounds.height = 0; //dummy style to make sure that text nodes don't get extra padding and such c.pushStyle(new CascadedStyle()); int blockLineHeight = FontUtil.lineHeight(c); LineMetrics blockLineMetrics = c.getTextRenderer().getLineMetrics(c.getGraphics(), FontUtil.getFont(c), "thequickbrownfoxjumpedoverthelazydogTHEQUICKBROWNFOXJUMPEDOVERTHELAZYDOG"); // prepare remaining width and first linebox int remaining_width = bounds.width; LineBox curr_line = newLine(box, bounds, null); c.setFirstLine(true); // account for text-indent CalculatedStyle parentStyle = c.getCurrentStyle(); remaining_width = TextIndent.doTextIndent(parentStyle, remaining_width, curr_line); // more setup LineBox prev_line = new LineBox(); prev_line.setParent(box); prev_line.y = bounds.y; prev_line.height = 0; InlineBox prev_inline = null; InlineBox prev_align_inline = null; // adjust the first line for float tabs remaining_width = FloatUtil.adjustForTab(c, prev_line, remaining_width); CalculatedStyle currentStyle = parentStyle; boolean isFirstLetter = true; List pendingPushStyles = null; // loop until no more nodes while (contentList.size() > 0) { Object o = contentList.get(0); contentList.remove(0); if (o instanceof FirstLineStyle) {//can actually only be the first object in list box.firstLineStyle = ((FirstLineStyle) o).getStyle(); continue; } if (o instanceof FirstLetterStyle) {//can actually only be the first or second object in list box.firstLetterStyle = ((FirstLetterStyle) o).getStyle(); continue; } if (o instanceof StylePush) { CascadedStyle style; StylePush sp = (StylePush) o; if (sp.getPseudoElement() != null) { style = c.getCss().getPseudoElementStyle(sp.getElement(), sp.getPseudoElement()); } else { style = c.getCss().getCascadedStyle(sp.getElement(), false);//already restyled by ContentUtil } c.pushStyle(style); if (pendingPushStyles == null) { pendingPushStyles = new LinkedList(); } pendingPushStyles.add((StylePush) o); Relative.translateRelative(c); continue; } if (o instanceof StylePop) { Relative.untranslateRelative(c); c.popStyle(); if (pendingPushStyles != null && pendingPushStyles.size() != 0) { pendingPushStyles.remove(pendingPushStyles.size() - 1);//was a redundant one } else { if (prev_inline != null) { if (prev_inline.popstyles == null) { prev_inline.popstyles = new LinkedList(); } prev_inline.popstyles.add(o); } } continue; } Content currentContent = (Content) o; if (currentContent.getStyle() != null) { c.pushStyle(currentContent.getStyle()); } // loop until no more text in this node InlineBox new_inline = null; int start = 0; do { new_inline = null; if (currentContent instanceof AbsolutelyPositionedContent) { // Uu.p("this might be a problem, but it could just be an absolute block"); // result = new BoxLayout().layout(c,content); Box absolute = Absolute.generateAbsoluteBox(c, currentContent); curr_line.addChild(absolute); break; } // debugging check if (bounds.width < 0) { Uu.p("bounds width = " + bounds.width); Uu.dump_stack(); System.exit(-1); } // the crash warning code if (bounds.width < 1) { Uu.p("warning. width < 1 " + bounds.width); } currentStyle = c.getCurrentStyle(); // look at current inline // break off the longest section that will fit new_inline = calculateInline(c, currentContent, remaining_width, bounds.width, prev_align_inline, isFirstLetter, box.firstLetterStyle, box.firstLineStyle, curr_line, start); // Uu.p("got back inline: " + new_inline); // if this inline needs to be on a new line if (prev_align_inline != null && new_inline.break_before) { // Uu.p("break before"); remaining_width = bounds.width; saveLine(curr_line, currentStyle, prev_line, bounds.width, bounds.x, c, box, false, blockLineHeight); bounds.height += curr_line.height; prev_line = curr_line; curr_line = newLine(box, bounds, prev_line); remaining_width = FloatUtil.adjustForTab(c, curr_line, remaining_width); //have to discard it and recalculate, particularly if this was the first line //HACK: is my thinking straight? - tobe prev_align_inline.break_after = true; new_inline = null; continue; } // save the new inline to the list // Uu.p("adding inline child: " + new_inline); //the inline might be set to size 0,0 after this, if it is first whitespace on line. // Cannot discard because it may contain style-pushes curr_line.addInlineChild(c, new_inline); // Uu.p("current line = " + curr_line); if (new_inline instanceof InlineTextBox) { start = ((InlineTextBox) new_inline).end_index; } isFirstLetter = false; new_inline.pushstyles = pendingPushStyles; pendingPushStyles = null; // calc new height of the line // don't count floats and absolutes if (!new_inline.floated && !new_inline.absolute) { adjustLineHeight(c, curr_line, new_inline, blockLineHeight, blockLineMetrics); } if (!(currentContent instanceof FloatedBlockContent)) { // calc new width of the line curr_line.width += new_inline.width; } // reduce the available width remaining_width = remaining_width - new_inline.width; // if the last inline was at the end of a line, then go to next line if (new_inline.break_after) { // Uu.p("break after"); // then remaining_width = max_width remaining_width = bounds.width; // save the line saveLine(curr_line, currentStyle, prev_line, bounds.width, bounds.x, c, box, false, blockLineHeight); // increase bounds height to account for the new line bounds.height += curr_line.height; prev_line = curr_line; curr_line = newLine(box, bounds, prev_line); remaining_width = FloatUtil.adjustForTab(c, curr_line, remaining_width); } // set the inline to use for left alignment if (!isOutsideFlow(currentContent)) { prev_align_inline = new_inline; // } } prev_inline = new_inline; } while (new_inline == null || !new_inline.isEndOfParentContent()); if (currentContent.getStyle() != null) { c.popStyle(); } } // save the final line saveLine(curr_line, currentStyle, prev_line, bounds.width, bounds.x, c, box, true, blockLineHeight); finishBlock(box, curr_line, bounds); // Uu.p("- InlineLayout.layoutContent(): " + box); //pop the dummy style c.popStyle(); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/8f81e5fe9f6f8593d3c596d30a3f100cb87dbf27/InlineBoxing.java/clean/src/java/org/xhtmlrenderer/layout/InlineBoxing.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
918,
3511,
1350,
12,
1042,
276,
16,
8549,
3919,
16,
987,
913,
682,
13,
288,
3639,
368,
26715,
732,
1410,
3712,
506,
4832,
5943,
716,
13955,
358,
279,
1203,
17,
2815,
930,
363... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
918,
3511,
1350,
12,
1042,
276,
16,
8549,
3919,
16,
987,
913,
682,
13,
288,
3639,
368,
26715,
732,
1410,
3712,
506,
4832,
5943,
716,
13955,
358,
279,
1203,
17,
2815,
930,
363... | |
ModelAndView next = new ModelAndView("wiki"); viewError(request, next, e); | logger.error("Failure while loading stylesheet for virtualWiki " + virtualWiki, e); | public ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) { try { String virtualWiki = JAMWikiServlet.getVirtualWikiFromURI(request); String topicName = JAMWikiServlet.getTopicFromURI(request); String stylesheet = JAMWikiServlet.getCachedContent(request, virtualWiki, WikiBase.SPECIAL_PAGE_STYLESHEET, false); response.setContentType("text/css; charset=utf-8"); // cache for 30 minutes (60 * 30 = 1800) // FIXME - make configurable response.setHeader("Cache-Control", "max-age=1800"); PrintWriter out = response.getWriter(); out.print(stylesheet); out.close(); } catch (Exception e) { ModelAndView next = new ModelAndView("wiki"); viewError(request, next, e); } // do not load defaults or redirect - return as raw CSS return null; } | 50517 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50517/d21041c0f41f31ecaa9760e7617d74e59bdfbd87/StylesheetServlet.java/buggy/src/java/org/jamwiki/servlets/StylesheetServlet.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
3164,
1876,
1767,
15713,
3061,
12,
2940,
18572,
590,
16,
12446,
766,
13,
288,
202,
202,
698,
288,
1082,
202,
780,
5024,
25438,
273,
804,
2192,
25438,
4745,
18,
588,
6466,
25438,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
3164,
1876,
1767,
15713,
3061,
12,
2940,
18572,
590,
16,
12446,
766,
13,
288,
202,
202,
698,
288,
1082,
202,
780,
5024,
25438,
273,
804,
2192,
25438,
4745,
18,
588,
6466,
25438,... |
break; | continue Loop; | static Object interpret(Context cx, Scriptable scope, Scriptable thisObj, Object[] args, double[] argsDbl, int argShift, int argCount, NativeFunction fnOrScript, InterpreterData idata) throws JavaScriptException { if (cx.interpreterSecurityDomain != idata.securityDomain) { if (argsDbl != null) { args = getArgsArray(args, argsDbl, argShift, argCount); } SecurityController sc = idata.securityController; Object savedDomain = cx.interpreterSecurityDomain; cx.interpreterSecurityDomain = idata.securityDomain; try { return sc.callWithDomain(idata.securityDomain, cx, fnOrScript, scope, thisObj, args); } finally { cx.interpreterSecurityDomain = savedDomain; } } final Object DBL_MRK = Interpreter.DBL_MRK; final Scriptable undefined = Undefined.instance; final int VAR_SHFT = 0; final int maxVars = idata.itsMaxVars; final int LOCAL_SHFT = VAR_SHFT + maxVars; final int STACK_SHFT = LOCAL_SHFT + idata.itsMaxLocals;// stack[VAR_SHFT <= i < LOCAL_SHFT]: variables// stack[LOCAL_SHFT <= i < TRY_STACK_SHFT]: used for newtemp/usetemp// stack[STACK_SHFT <= i < STACK_SHFT + idata.itsMaxStack]: stack data// sDbl[i]: if stack[i] is DBL_MRK, sDbl[i] holds the number value int maxFrameArray = idata.itsMaxFrameArray; if (maxFrameArray != STACK_SHFT + idata.itsMaxStack) Kit.codeBug(); Object[] stack = new Object[maxFrameArray]; double[] sDbl = new double[maxFrameArray]; int stackTop = STACK_SHFT - 1; int withDepth = 0; int definedArgs = fnOrScript.argCount; if (definedArgs > argCount) { definedArgs = argCount; } for (int i = 0; i != definedArgs; ++i) { Object arg = args[argShift + i]; stack[VAR_SHFT + i] = arg; if (arg == DBL_MRK) { sDbl[VAR_SHFT + i] = argsDbl[argShift + i]; } } for (int i = definedArgs; i != maxVars; ++i) { stack[VAR_SHFT + i] = undefined; } DebugFrame debuggerFrame = null; if (cx.debugger != null) { debuggerFrame = cx.debugger.getFrame(cx, idata); } if (idata.itsFunctionType != 0) { InterpretedFunction f = (InterpretedFunction)fnOrScript; if (!idata.useDynamicScope) { scope = fnOrScript.getParentScope(); } if (idata.itsCheckThis) { thisObj = ScriptRuntime.getThis(thisObj); } if (idata.itsNeedsActivation) { if (argsDbl != null) { args = getArgsArray(args, argsDbl, argShift, argCount); argShift = 0; argsDbl = null; } scope = ScriptRuntime.initVarObj(cx, scope, fnOrScript, thisObj, args); } } else { ScriptRuntime.initScript(cx, scope, fnOrScript, thisObj, idata.itsFromEvalCode); } if (idata.itsNestedFunctions != null) { if (idata.itsFunctionType != 0 && !idata.itsNeedsActivation) Kit.codeBug(); for (int i = 0; i < idata.itsNestedFunctions.length; i++) { InterpreterData fdata = idata.itsNestedFunctions[i]; if (fdata.itsFunctionType == FunctionNode.FUNCTION_STATEMENT) { createFunction(cx, scope, fdata, idata.itsFromEvalCode); } } } // Wrapped regexps for functions are stored in InterpretedFunction // but for script which should not contain references to scope // the regexps re-wrapped during each script execution Scriptable[] scriptRegExps = null; boolean useActivationVars = false; if (debuggerFrame != null) { if (argsDbl != null) { args = getArgsArray(args, argsDbl, argShift, argCount); argShift = 0; argsDbl = null; } if (idata.itsFunctionType != 0 && !idata.itsNeedsActivation) { useActivationVars = true; scope = ScriptRuntime.initVarObj(cx, scope, fnOrScript, thisObj, args); } debuggerFrame.onEnter(cx, scope, thisObj, args); } InterpreterData savedData = cx.interpreterData; cx.interpreterData = idata; Object result = undefined; // If javaException != null on exit, it will be throw instead of // normal return Throwable javaException = null; int exceptionPC = -1; byte[] iCode = idata.itsICode; String[] strings = idata.itsStringTable; int pc = 0; int pcPrevBranch = pc; final int instructionThreshold = cx.instructionThreshold; // During function call this will be set to -1 so catch can properly // adjust it int instructionCount = cx.instructionCount; // arbitrary number to add to instructionCount when calling // other functions final int INVOCATION_COST = 100; Loop: for (;;) { try { int op = 0xFF & iCode[pc++]; switch (op) { // Back indent to ease imlementation reading case Icode_CATCH: { // The following code should be executed inside try/catch inside main // loop, not in the loop catch block itself to deal with exceptions // from observeInstructionCount. A special bytecode is used only to // simplify logic. if (javaException == null) Kit.codeBug(); int pcNew = -1; boolean doCatch = false; int handlerOffset = getExceptionHandler(idata.itsExceptionTable, exceptionPC); if (handlerOffset >= 0) { final int SCRIPT_CAN_CATCH = 0, ONLY_FINALLY = 1, OTHER = 2; int exType; if (javaException instanceof JavaScriptException) { exType = SCRIPT_CAN_CATCH; } else if (javaException instanceof EcmaError) { // an offical ECMA error object, exType = SCRIPT_CAN_CATCH; } else if (javaException instanceof EvaluatorException) { exType = SCRIPT_CAN_CATCH; } else if (javaException instanceof RuntimeException) { exType = ONLY_FINALLY; } else { // Error instance exType = OTHER; } if (exType != OTHER) { // Do not allow for JS to interfere with Error instances // (exType == OTHER), as they can be used to terminate // long running script if (exType == SCRIPT_CAN_CATCH) { // Allow JS to catch only JavaScriptException and // EcmaError pcNew = idata.itsExceptionTable[handlerOffset + EXCEPTION_CATCH_SLOT]; if (pcNew >= 0) { // Has catch block doCatch = true; } } if (pcNew < 0) { pcNew = idata.itsExceptionTable[handlerOffset + EXCEPTION_FINALLY_SLOT]; } } } if (debuggerFrame != null && !(javaException instanceof Error)) { debuggerFrame.onExceptionThrown(cx, javaException); } if (pcNew < 0) { break Loop; } // We caught an exception // restore scope at try point int tryWithDepth = idata.itsExceptionTable[ handlerOffset + EXCEPTION_WITH_DEPTH_SLOT]; while (tryWithDepth != withDepth) { if (scope == null) Kit.codeBug(); scope = ScriptRuntime.leaveWith(scope); --withDepth; } if (doCatch) { stackTop = STACK_SHFT - 1; int exLocal = idata.itsExceptionTable[ handlerOffset + EXCEPTION_LOCAL_SLOT]; stack[LOCAL_SHFT + exLocal] = ScriptRuntime.getCatchObject( cx, scope, javaException); } else { stackTop = STACK_SHFT; // Call finally handler with javaException on stack top to // distinguish from normal invocation through GOSUB // which would contain DBL_MRK on the stack stack[stackTop] = javaException; } // clear exception javaException = null; // Notify instruction observer if necessary // and point pc and pcPrevBranch to start of catch/finally block if (instructionThreshold != 0) { if (instructionCount > instructionThreshold) { // Note: this can throw Error cx.observeInstructionCount(instructionCount); instructionCount = 0; } } pcPrevBranch = pc = pcNew; continue Loop; } case Token.THROW: { Object value = stack[stackTop]; if (value == DBL_MRK) value = doubleWrap(sDbl[stackTop]); --stackTop; int sourceLine = getShort(iCode, pc); javaException = new JavaScriptException(value, idata.itsSourceFile, sourceLine); exceptionPC = pc - 1; if (instructionThreshold != 0) { instructionCount += pc - pcPrevBranch; if (instructionCount > instructionThreshold) { cx.observeInstructionCount(instructionCount); instructionCount = 0; } } pcPrevBranch = pc = getJavaCatchPC(iCode); continue Loop; } case Token.GE : { --stackTop; Object rhs = stack[stackTop + 1]; Object lhs = stack[stackTop]; boolean valBln; if (rhs == DBL_MRK || lhs == DBL_MRK) { double rDbl = stack_double(stack, sDbl, stackTop + 1); double lDbl = stack_double(stack, sDbl, stackTop); valBln = (rDbl <= lDbl); } else { valBln = ScriptRuntime.cmp_LE(rhs, lhs); } stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; } case Token.LE : { --stackTop; Object rhs = stack[stackTop + 1]; Object lhs = stack[stackTop]; boolean valBln; if (rhs == DBL_MRK || lhs == DBL_MRK) { double rDbl = stack_double(stack, sDbl, stackTop + 1); double lDbl = stack_double(stack, sDbl, stackTop); valBln = (lDbl <= rDbl); } else { valBln = ScriptRuntime.cmp_LE(lhs, rhs); } stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; } case Token.GT : { --stackTop; Object rhs = stack[stackTop + 1]; Object lhs = stack[stackTop]; boolean valBln; if (rhs == DBL_MRK || lhs == DBL_MRK) { double rDbl = stack_double(stack, sDbl, stackTop + 1); double lDbl = stack_double(stack, sDbl, stackTop); valBln = (rDbl < lDbl); } else { valBln = ScriptRuntime.cmp_LT(rhs, lhs); } stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; } case Token.LT : { --stackTop; Object rhs = stack[stackTop + 1]; Object lhs = stack[stackTop]; boolean valBln; if (rhs == DBL_MRK || lhs == DBL_MRK) { double rDbl = stack_double(stack, sDbl, stackTop + 1); double lDbl = stack_double(stack, sDbl, stackTop); valBln = (lDbl < rDbl); } else { valBln = ScriptRuntime.cmp_LT(lhs, rhs); } stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; } case Token.IN : { Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); boolean valBln = ScriptRuntime.in(lhs, rhs, scope); stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; } case Token.INSTANCEOF : { Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); boolean valBln = ScriptRuntime.instanceOf(lhs, rhs, scope); stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; } case Token.EQ : { --stackTop; boolean valBln = do_eq(stack, sDbl, stackTop); stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; } case Token.NE : { --stackTop; boolean valBln = !do_eq(stack, sDbl, stackTop); stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; } case Token.SHEQ : { --stackTop; boolean valBln = do_sheq(stack, sDbl, stackTop); stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; } case Token.SHNE : { --stackTop; boolean valBln = !do_sheq(stack, sDbl, stackTop); stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; } case Token.IFNE : { boolean valBln = stack_boolean(stack, sDbl, stackTop); --stackTop; if (!valBln) { if (instructionThreshold != 0) { instructionCount += pc + 2 - pcPrevBranch; if (instructionCount > instructionThreshold) { cx.observeInstructionCount(instructionCount); instructionCount = 0; } } pcPrevBranch = pc = getTarget(iCode, pc); continue Loop; } pc += 2; break; } case Token.IFEQ : { boolean valBln = stack_boolean(stack, sDbl, stackTop); --stackTop; if (valBln) { if (instructionThreshold != 0) { instructionCount += pc + 2 - pcPrevBranch; if (instructionCount > instructionThreshold) { cx.observeInstructionCount(instructionCount); instructionCount = 0; } } pcPrevBranch = pc = getTarget(iCode, pc); continue Loop; } pc += 2; break; } case Icode_IFEQ_POP : { boolean valBln = stack_boolean(stack, sDbl, stackTop); --stackTop; if (valBln) { if (instructionThreshold != 0) { instructionCount += pc + 2 - pcPrevBranch; if (instructionCount > instructionThreshold) { cx.observeInstructionCount(instructionCount); instructionCount = 0; } } pcPrevBranch = pc = getTarget(iCode, pc); stack[stackTop--] = null; continue Loop; } pc += 2; break; } case Token.GOTO : if (instructionThreshold != 0) { instructionCount += pc + 2 - pcPrevBranch; if (instructionCount > instructionThreshold) { cx.observeInstructionCount(instructionCount); instructionCount = 0; } } pcPrevBranch = pc = getTarget(iCode, pc); continue Loop; case Icode_GOSUB : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = pc + 2; if (instructionThreshold != 0) { instructionCount += pc + 2 - pcPrevBranch; if (instructionCount > instructionThreshold) { cx.observeInstructionCount(instructionCount); instructionCount = 0; } } pcPrevBranch = pc = getTarget(iCode, pc); continue Loop; case Icode_RETSUB : { int slot = (iCode[pc] & 0xFF); if (instructionThreshold != 0) { instructionCount += pc + 1 - pcPrevBranch; if (instructionCount > instructionThreshold) { cx.observeInstructionCount(instructionCount); instructionCount = 0; } } int newPC; Object value = stack[LOCAL_SHFT + slot]; if (value != DBL_MRK) { // Invocation from exception handler, restore object to rethrow javaException = (Throwable)value; exceptionPC = pc - 1; newPC = getJavaCatchPC(iCode); } else { // Normal return from GOSUB newPC = (int)sDbl[LOCAL_SHFT + slot]; } pcPrevBranch = pc = newPC; continue Loop; } case Token.POP : stack[stackTop] = null; stackTop--; break; case Icode_DUP : stack[stackTop + 1] = stack[stackTop]; sDbl[stackTop + 1] = sDbl[stackTop]; stackTop++; break; case Icode_DUPSECOND : { stack[stackTop + 1] = stack[stackTop - 1]; sDbl[stackTop + 1] = sDbl[stackTop - 1]; stackTop++; break; } case Icode_SWAP : { Object o = stack[stackTop]; stack[stackTop] = stack[stackTop - 1]; stack[stackTop - 1] = o; double d = sDbl[stackTop]; sDbl[stackTop] = sDbl[stackTop - 1]; sDbl[stackTop - 1] = d; break; } case Token.POPV : result = stack[stackTop]; if (result == DBL_MRK) result = doubleWrap(sDbl[stackTop]); stack[stackTop] = null; --stackTop; break; case Token.RETURN : result = stack[stackTop]; if (result == DBL_MRK) result = doubleWrap(sDbl[stackTop]); --stackTop; break Loop; case Token.RETURN_POPV : break Loop; case Icode_RETUNDEF : result = undefined; break Loop; case Token.BITNOT : { int rIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = ~rIntValue; break; } case Token.BITAND : { int rIntValue = stack_int32(stack, sDbl, stackTop); --stackTop; int lIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lIntValue & rIntValue; break; } case Token.BITOR : { int rIntValue = stack_int32(stack, sDbl, stackTop); --stackTop; int lIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lIntValue | rIntValue; break; } case Token.BITXOR : { int rIntValue = stack_int32(stack, sDbl, stackTop); --stackTop; int lIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lIntValue ^ rIntValue; break; } case Token.LSH : { int rIntValue = stack_int32(stack, sDbl, stackTop); --stackTop; int lIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lIntValue << rIntValue; break; } case Token.RSH : { int rIntValue = stack_int32(stack, sDbl, stackTop); --stackTop; int lIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lIntValue >> rIntValue; break; } case Token.URSH : { int rIntValue = stack_int32(stack, sDbl, stackTop) & 0x1F; --stackTop; double lDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = ScriptRuntime.toUint32(lDbl) >>> rIntValue; break; } case Token.ADD : --stackTop; do_add(stack, sDbl, stackTop); break; case Token.SUB : { double rDbl = stack_double(stack, sDbl, stackTop); --stackTop; double lDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lDbl - rDbl; break; } case Token.NEG : { double rDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = -rDbl; break; } case Token.POS : { double rDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = rDbl; break; } case Token.MUL : { double rDbl = stack_double(stack, sDbl, stackTop); --stackTop; double lDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lDbl * rDbl; break; } case Token.DIV : { double rDbl = stack_double(stack, sDbl, stackTop); --stackTop; double lDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; // Detect the divide by zero or let Java do it ? sDbl[stackTop] = lDbl / rDbl; break; } case Token.MOD : { double rDbl = stack_double(stack, sDbl, stackTop); --stackTop; double lDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lDbl % rDbl; break; } case Token.NOT : { stack[stackTop] = stack_boolean(stack, sDbl, stackTop) ? Boolean.FALSE : Boolean.TRUE; break; } case Token.BINDNAME : { String name = strings[getIndex(iCode, pc)]; stack[++stackTop] = ScriptRuntime.bind(scope, name); pc += 2; break; } case Token.SETNAME : { String name = strings[getIndex(iCode, pc)]; Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Scriptable lhs = (Scriptable)stack[stackTop]; stack[stackTop] = ScriptRuntime.setName(lhs, rhs, scope, name); pc += 2; break; } case Token.DELPROP : { Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.delete(cx, scope, lhs, rhs); break; } case Token.GETPROP : { String name = (String)stack[stackTop]; --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.getProp(lhs, name, scope); break; } case Token.SETPROP : { Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; String name = (String)stack[stackTop]; --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.setProp(lhs, name, rhs, scope); break; } case Token.GETELEM : do_getElem(cx, stack, sDbl, stackTop, scope); --stackTop; break; case Token.SETELEM : do_setElem(cx, stack, sDbl, stackTop, scope); stackTop -= 2; break; case Icode_PROPINC : case Icode_PROPDEC : { String name = (String)stack[stackTop]; --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.postIncrDecr(lhs, name, scope, op == Icode_PROPINC); break; } case Icode_ELEMINC : case Icode_ELEMDEC : { Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.postIncrDecrElem(lhs, rhs, scope, op == Icode_ELEMINC); break; } case Token.LOCAL_SAVE : { int slot = (iCode[pc] & 0xFF); stack[LOCAL_SHFT + slot] = stack[stackTop]; sDbl[LOCAL_SHFT + slot] = sDbl[stackTop]; --stackTop; ++pc; break; } case Token.LOCAL_LOAD : { int slot = (iCode[pc] & 0xFF); ++stackTop; stack[stackTop] = stack[LOCAL_SHFT + slot]; sDbl[stackTop] = sDbl[LOCAL_SHFT + slot]; ++pc; break; } case Icode_CALLSPECIAL : { if (instructionThreshold != 0) { instructionCount += INVOCATION_COST; cx.instructionCount = instructionCount; instructionCount = -1; } int callType = iCode[pc] & 0xFF; boolean isNew = (iCode[pc + 1] != 0); int sourceLine = getShort(iCode, pc + 2); int count = getIndex(iCode, pc + 4); stackTop -= count; Object[] outArgs = getArgsArray(stack, sDbl, stackTop + 1, count); Object functionThis; if (isNew) { functionThis = null; } else { functionThis = stack[stackTop]; if (functionThis == DBL_MRK) { functionThis = doubleWrap(sDbl[stackTop]); } --stackTop; } Object function = stack[stackTop]; if (function == DBL_MRK) function = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.callSpecial( cx, function, isNew, functionThis, outArgs, scope, thisObj, callType, idata.itsSourceFile, sourceLine); instructionCount = cx.instructionCount; pc += 6; break; } case Token.CALL : { if (instructionThreshold != 0) { instructionCount += INVOCATION_COST; cx.instructionCount = instructionCount; instructionCount = -1; } int count = getIndex(iCode, pc + 2); stackTop -= count; int calleeArgShft = stackTop + 1; Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Object lhs = stack[stackTop]; Scriptable calleeScope = scope; if (idata.itsNeedsActivation) { calleeScope = ScriptableObject.getTopLevelScope(scope); } Scriptable calleeThis; if (rhs instanceof Scriptable || rhs == null) { calleeThis = (Scriptable)rhs; } else { calleeThis = ScriptRuntime.toObject(cx, calleeScope, rhs); } if (lhs instanceof InterpretedFunction) { // Inlining of InterpretedFunction.call not to create // argument array InterpretedFunction f = (InterpretedFunction)lhs; stack[stackTop] = interpret(cx, calleeScope, calleeThis, stack, sDbl, calleeArgShft, count, f, f.itsData); } else if (lhs instanceof Function) { Function f = (Function)lhs; Object[] outArgs = getArgsArray(stack, sDbl, calleeArgShft, count); stack[stackTop] = f.call(cx, calleeScope, calleeThis, outArgs); } else { if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); else if (lhs == undefined) { // special code for better error message for call // to undefined lhs = strings[getIndex(iCode, pc)]; if (lhs == null) lhs = undefined; } throw ScriptRuntime.typeError1("msg.isnt.function", ScriptRuntime.toString(lhs)); } instructionCount = cx.instructionCount; pc += 4; break; } case Token.NEW : { if (instructionThreshold != 0) { instructionCount += INVOCATION_COST; cx.instructionCount = instructionCount; instructionCount = -1; } int count = getIndex(iCode, pc + 2); stackTop -= count; int calleeArgShft = stackTop + 1; Object lhs = stack[stackTop]; if (lhs instanceof InterpretedFunction) { // Inlining of InterpretedFunction.construct not to create // argument array InterpretedFunction f = (InterpretedFunction)lhs; Scriptable newInstance = f.createObject(cx, scope); Object callResult = interpret(cx, scope, newInstance, stack, sDbl, calleeArgShft, count, f, f.itsData); if (callResult instanceof Scriptable && callResult != undefined) { stack[stackTop] = callResult; } else { stack[stackTop] = newInstance; } } else if (lhs instanceof Function) { Function f = (Function)lhs; Object[] outArgs = getArgsArray(stack, sDbl, calleeArgShft, count); stack[stackTop] = f.construct(cx, scope, outArgs); } else { if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); else if (lhs == undefined) { // special code for better error message for call // to undefined lhs = strings[getIndex(iCode, pc)]; if (lhs == null) lhs = undefined; } throw ScriptRuntime.typeError1("msg.isnt.function", ScriptRuntime.toString(lhs)); } instructionCount = cx.instructionCount; pc += 4; break; } case Token.TYPEOF : { Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.typeof(lhs); break; } case Icode_TYPEOFNAME : { String name = strings[getIndex(iCode, pc)]; stack[++stackTop] = ScriptRuntime.typeofName(scope, name); pc += 2; break; } case Icode_NAME_AND_THIS : { String name = strings[getIndex(iCode, pc)]; boolean skipGetThis = (0 != iCode[pc + 2]); stackTop = do_nameAndThis(stack, stackTop, scope, name, skipGetThis); pc += 3; break; } case Token.STRING : stack[++stackTop] = strings[getIndex(iCode, pc)]; pc += 2; break; case Icode_SHORTNUMBER : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = getShort(iCode, pc); pc += 2; break; case Icode_INTNUMBER : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = getInt(iCode, pc); pc += 4; break; case Token.NUMBER : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = idata.itsDoubleTable[getIndex(iCode, pc)]; pc += 2; break; case Token.NAME : { String name = strings[getIndex(iCode, pc)]; stack[++stackTop] = ScriptRuntime.name(scope, name); pc += 2; break; } case Icode_NAMEINC : case Icode_NAMEDEC : { String name = strings[getIndex(iCode, pc)]; stack[++stackTop] = ScriptRuntime.postIncrDecr(scope, name, op == Icode_NAMEINC); pc += 2; break; } case Token.SETVAR : { int slot = (iCode[pc] & 0xFF); if (!useActivationVars) { stack[VAR_SHFT + slot] = stack[stackTop]; sDbl[VAR_SHFT + slot] = sDbl[stackTop]; } else { Object val = stack[stackTop]; if (val == DBL_MRK) val = doubleWrap(sDbl[stackTop]); activationPut(fnOrScript, scope, slot, val); } ++pc; break; } case Token.GETVAR : { int slot = (iCode[pc] & 0xFF); ++stackTop; if (!useActivationVars) { stack[stackTop] = stack[VAR_SHFT + slot]; sDbl[stackTop] = sDbl[VAR_SHFT + slot]; } else { stack[stackTop] = activationGet(fnOrScript, scope, slot); } ++pc; break; } case Icode_VARINC : case Icode_VARDEC : { int slot = (iCode[pc] & 0xFF); ++stackTop; if (!useActivationVars) { Object val = stack[VAR_SHFT + slot]; stack[stackTop] = val; double d; if (val == DBL_MRK) { d = sDbl[VAR_SHFT + slot]; sDbl[stackTop] = d; } else { d = ScriptRuntime.toNumber(val); } stack[VAR_SHFT + slot] = DBL_MRK; sDbl[VAR_SHFT + slot] = (op == Icode_VARINC) ? d + 1.0 : d - 1.0; } else { Object val = activationGet(fnOrScript, scope, slot); stack[stackTop] = val; double d = ScriptRuntime.toNumber(val); val = doubleWrap((op == Icode_VARINC) ? d + 1.0 : d - 1.0); activationPut(fnOrScript, scope, slot, val); } ++pc; break; } case Token.ZERO : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = 0; break; case Token.ONE : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = 1; break; case Token.NULL : stack[++stackTop] = null; break; case Token.THIS : stack[++stackTop] = thisObj; break; case Token.THISFN : stack[++stackTop] = fnOrScript; break; case Token.FALSE : stack[++stackTop] = Boolean.FALSE; break; case Token.TRUE : stack[++stackTop] = Boolean.TRUE; break; case Token.UNDEFINED : stack[++stackTop] = Undefined.instance; break; case Token.ENTERWITH : { Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); --stackTop; scope = ScriptRuntime.enterWith(lhs, scope); ++withDepth; break; } case Token.LEAVEWITH : scope = ScriptRuntime.leaveWith(scope); --withDepth; break; case Token.CATCH_SCOPE : { String name = strings[getIndex(iCode, pc)]; stack[stackTop] = ScriptRuntime.newCatchScope(name, stack[stackTop]); pc += 2; break; } case Token.ENUM_INIT : { int slot = (iCode[pc] & 0xFF); Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); --stackTop; stack[LOCAL_SHFT + slot] = ScriptRuntime.enumInit(lhs, scope); ++pc; break; } case Token.ENUM_NEXT : case Token.ENUM_ID : { int slot = (iCode[pc] & 0xFF); Object val = stack[LOCAL_SHFT + slot]; ++stackTop; stack[stackTop] = (op == Token.ENUM_NEXT) ? (Object)ScriptRuntime.enumNext(val) : (Object)ScriptRuntime.enumId(val); ++pc; break; } case Icode_PUSH_PARENT : { Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[++stackTop] = ScriptRuntime.getParent(lhs); break; } case Icode_GETPROTO : case Icode_GETSCOPEPARENT : { Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); Object val; if (op == Icode_GETPROTO) { val = ScriptRuntime.getProto(lhs, scope); } else { val = ScriptRuntime.getParent(lhs, scope); } stack[stackTop] = val; break; } case Icode_SETPROTO : case Icode_SETPARENT : { Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); Object val; if (op == Icode_SETPROTO) { val = ScriptRuntime.setProto(lhs, rhs, scope); } else { val = ScriptRuntime.setParent(lhs, rhs, scope); } stack[stackTop] = val; break; } case Icode_SCOPE : stack[++stackTop] = scope; break; case Icode_CLOSURE : { int i = getIndex(iCode, pc); InterpreterData closureData = idata.itsNestedFunctions[i]; stack[++stackTop] = createFunction(cx, scope, closureData, idata.itsFromEvalCode); pc += 2; break; } case Token.REGEXP : { int i = getIndex(iCode, pc); Scriptable regexp; if (idata.itsFunctionType != 0) { regexp = ((InterpretedFunction)fnOrScript).itsRegExps[i]; } else { if (scriptRegExps == null) { scriptRegExps = wrapRegExps(cx, scope, idata); } regexp = scriptRegExps[i]; } stack[++stackTop] = regexp; pc += 2; break; } case Icode_LITERAL_NEW : { int i = getInt(iCode, pc); ++stackTop; stack[stackTop] = new Object[i]; sDbl[stackTop] = 0; pc += 4; break; } case Icode_LITERAL_SET : { Object value = stack[stackTop]; if (value == DBL_MRK) value = doubleWrap(sDbl[stackTop]); --stackTop; int i = (int)sDbl[stackTop]; ((Object[])stack[stackTop])[i] = value; sDbl[stackTop] = i + 1; break; } case Token.ARRAYLIT : case Token.OBJECTLIT : { int offset = getInt(iCode, pc); Object[] data = (Object[])stack[stackTop]; Object val; if (op == Token.ARRAYLIT) { int[] skipIndexces = null; if (offset >= 0) { skipIndexces = (int[])idata.literalIds[offset]; } val = ScriptRuntime.newArrayLiteral(data, skipIndexces, cx, scope); } else { Object[] ids = (Object[])idata.literalIds[offset]; val = ScriptRuntime.newObjectLiteral(ids, data, cx, scope); } stack[stackTop] = val; pc += 4; break; } case Icode_LINE : { cx.interpreterLineIndex = pc; if (debuggerFrame != null) { int line = getShort(iCode, pc); debuggerFrame.onLineChange(cx, line); } pc += 2; break; } default : { dumpICode(idata); throw new RuntimeException("Unknown icode : "+op+" @ pc : "+(pc-1)); } // end of interpreter switch } } catch (Throwable ex) { if (instructionThreshold != 0) { if (instructionCount < 0) { // throw during function call instructionCount = cx.instructionCount; } else { // throw during any other operation instructionCount += pc - pcPrevBranch; cx.instructionCount = instructionCount; } } javaException = ex; exceptionPC = pc; pc = getJavaCatchPC(iCode); continue Loop; } } cx.interpreterData = savedData; if (debuggerFrame != null) { if (javaException != null) { debuggerFrame.onExit(cx, true, javaException); } else { debuggerFrame.onExit(cx, false, result); } } if (idata.itsNeedsActivation || debuggerFrame != null) { ScriptRuntime.popActivation(cx); } if (instructionThreshold != 0) { if (instructionCount > instructionThreshold) { cx.observeInstructionCount(instructionCount); instructionCount = 0; } cx.instructionCount = instructionCount; } if (javaException != null) { if (javaException instanceof JavaScriptException) { throw (JavaScriptException)javaException; } else if (javaException instanceof RuntimeException) { throw (RuntimeException)javaException; } else { // Must be instance of Error or code bug throw (Error)javaException; } } return result; } | 19042 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/19042/369d8e109106915195bef3af1282543ab09e3869/Interpreter.java/clean/src/org/mozilla/javascript/Interpreter.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
760,
1033,
10634,
12,
1042,
9494,
16,
22780,
2146,
16,
22780,
15261,
16,
18701,
1033,
8526,
833,
16,
1645,
8526,
833,
40,
3083,
16,
18701,
509,
1501,
10544,
16,
509,
1501,
1380,
16,
18701... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
760,
1033,
10634,
12,
1042,
9494,
16,
22780,
2146,
16,
22780,
15261,
16,
18701,
1033,
8526,
833,
16,
1645,
8526,
833,
40,
3083,
16,
18701,
509,
1501,
10544,
16,
509,
1501,
1380,
16,
18701... |
this._nLeftRight = 0; this._pathLast = path; this._timerHover.restart(); | _nLeftRight = 0; _pathLast = path; _timerHover.restart(); | public void dragOver(DropTargetDragEvent e) { if( e==null || this._raGhost == null || this._ptLast == null || JDragTree.this._ptOffset == null || JDragTree.this._imgGhost == null || this._raCueLine == null ) { return; } // Even if the mouse is not moving, this method is still invoked 10 times per second Point pt = e.getLocation(); if(pt==null) { return; } if (pt.equals(this._ptLast)) return; // Try to determine whether the user is flicking the cursor right or left int nDeltaLeftRight = pt.x - this._ptLast.x; if ( (this._nLeftRight > 0 && nDeltaLeftRight < 0) || (this._nLeftRight < 0 && nDeltaLeftRight > 0) ) this._nLeftRight = 0; this._nLeftRight += nDeltaLeftRight; this._ptLast = pt; Graphics2D g2 = (Graphics2D) JDragTree.this.getGraphics(); if( g2 == null ) { return; } // If a drag image is not supported by the platform, then draw my own drag image if (!DragSource.isDragImageSupported()) { JDragTree.this.paintImmediately(this._raGhost.getBounds()); // Rub out the last ghost image and cue line // And remember where we are about to draw the new ghost image this._raGhost.setRect(pt.x - JDragTree.this._ptOffset.x, pt.y - JDragTree.this._ptOffset.y, JDragTree.this._imgGhost.getWidth(), JDragTree.this._imgGhost.getHeight()); g2.drawImage(JDragTree.this._imgGhost, AffineTransform.getTranslateInstance(this._raGhost.getX(), this._raGhost.getY()), null); } else // Just rub out the last cue line JDragTree.this.paintImmediately(this._raCueLine.getBounds()); TreePath path = JDragTree.this.getClosestPathForLocation(pt.x, pt.y); if (!(path == this._pathLast)) { this._nLeftRight = 0; // We've moved up or down, so reset left/right movement trend this._pathLast = path; this._timerHover.restart(); } // In any case draw (over the ghost image if necessary) a cue line indicating where a drop will occur Rectangle raPath = JDragTree.this.getPathBounds(path); this._raCueLine.setRect(0, raPath.y+(int)raPath.getHeight(), JDragTree.this.getWidth(), 2); g2.setColor(this._colorCueLine); g2.fill(this._raCueLine); this._nShift = 0; // And include the cue line in the area to be rubbed out next time this._raGhost = this._raGhost.createUnion(this._raCueLine); // Do this if you want to prohibit dropping onto the drag source if (path.equals(JDragTree.this._pathSource)) e.rejectDrag(); else e.acceptDrag(e.getDropAction()); } | 47012 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47012/0458430a0dc8a713aa2b4d64f000cbbaaeb4adea/JDragTree.java/buggy/src/thaw/gui/JDragTree.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1875,
1071,
918,
8823,
4851,
12,
7544,
2326,
11728,
1133,
425,
13,
1082,
288,
2398,
309,
12,
425,
631,
2011,
747,
333,
6315,
354,
43,
2564,
422,
446,
747,
333,
6315,
337,
3024,
422,
446,
747... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1875,
1071,
918,
8823,
4851,
12,
7544,
2326,
11728,
1133,
425,
13,
1082,
288,
2398,
309,
12,
425,
631,
2011,
747,
333,
6315,
354,
43,
2564,
422,
446,
747,
333,
6315,
337,
3024,
422,
446,
747... |
} | protected boolean updateSelection(IStructuredSelection selection) { if (!super.updateSelection(selection)) return false; if (getSelectedNonResources().size() > 0) return false; List selectedResources = getSelectedResources(); if (selectedResources.size() == 0) return false; boolean projSelected = selectionIsOfType(IResource.PROJECT); boolean fileFoldersSelected = selectionIsOfType(IResource.FILE | IResource.FOLDER); if (!projSelected && !fileFoldersSelected) return false; // selection must be homogeneous if (projSelected && fileFoldersSelected) return false; // must have a common parent IContainer firstParent = ((IResource) selectedResources.get(0)).getParent(); if (firstParent == null) return false; Iterator resourcesEnum = selectedResources.iterator(); while (resourcesEnum.hasNext()) { IResource currentResource = (IResource) resourcesEnum.next(); if (!currentResource.getParent().equals(firstParent)) { return false; } // resource location must exist if (currentResource.getLocation() == null) { return false; } } return true;} | 55805 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55805/77fa4fa7cf032f952882d781c1d0551256b402ef/CopyAction.java/clean/bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/navigator/CopyAction.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4750,
1250,
1089,
6233,
12,
45,
30733,
6233,
4421,
13,
288,
202,
430,
16051,
9565,
18,
2725,
6233,
12,
10705,
3719,
202,
202,
2463,
629,
31,
202,
202,
430,
261,
588,
7416,
3989,
3805,
7675,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4750,
1250,
1089,
6233,
12,
45,
30733,
6233,
4421,
13,
288,
202,
430,
16051,
9565,
18,
2725,
6233,
12,
10705,
3719,
202,
202,
2463,
629,
31,
202,
202,
430,
261,
588,
7416,
3989,
3805,
7675,
... | |
imcode.server.User user = (imcode.server.User)session.getValue("logon.isDone"); | imcode.server.User user = (imcode.server.User)session.getAttribute("logon.isDone"); | public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { String host = req.getHeader("Host") ; String start_url = Utility.getDomainPref( "start_url",host ) ; // Get the session HttpSession session = req.getSession(true); // Does the session indicate this user already logged in? imcode.server.User user = (imcode.server.User)session.getValue("logon.isDone"); // marker object if (user == null) { // No logon.isDone means he hasn't logged in. // Save the request URL as the true target and redirect to the login page. String scheme = req.getScheme(); String serverName = req.getServerName(); int p = req.getServerPort(); String port = (p == 80) ? "" : ":" + p; res.sendRedirect(scheme + "://" + serverName + port + start_url) ; return ; } res.setContentType("text/html"); PrintWriter out = res.getWriter(); out.print(getPage(req,res)) ; } | 8781 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8781/d8b0fdd81e15dafac8d97309e61402a5d67547a5/ImageBrowse.java/buggy/servlets/ImageBrowse.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
23611,
12,
2940,
18572,
1111,
16,
12446,
400,
13,
1216,
16517,
16,
1860,
202,
95,
202,
202,
780,
1479,
4697,
202,
33,
1111,
18,
588,
1864,
2932,
2594,
7923,
274,
202,
202... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
23611,
12,
2940,
18572,
1111,
16,
12446,
400,
13,
1216,
16517,
16,
1860,
202,
95,
202,
202,
780,
1479,
4697,
202,
33,
1111,
18,
588,
1864,
2932,
2594,
7923,
274,
202,
202... |
public void mMISC() throws RecognitionException { int MISC_StartIndex = input.index(); try { int type = MISC; int start = getCharIndex(); int line = getLine(); int charPosition = getCharPositionInLine(); int channel = Token.DEFAULT_CHANNEL; if ( backtracking>0 && alreadyParsedRule(input, 48) ) { return ; } // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1012:17: ( '!' | '@' | '$' | '%' | '^' | '&' | '*' | '_' | '-' | '+' | '|' | ',' | '{' | '}' | '[' | ']' | '=' | '/' | '(' | ')' | '\'' | '\\' | '||' | '&&' | '<<<' | '++' | '--' | '>>>' | '==' | '+=' | '=+' | '-=' | '=-' | '*=' | '=*' | '/=' | '=/' | '>>=' ) int alt1=38; switch ( input.LA(1) ) { case '!': alt1=1; break; case '@': alt1=2; break; case '$': alt1=3; break; case '%': alt1=4; break; case '^': alt1=5; break; case '&': int LA1_6 = input.LA(2); if ( LA1_6=='&' ) { alt1=24; } else { alt1=6;} break; case '*': int LA1_7 = input.LA(2); if ( LA1_7=='=' ) { alt1=34; } else { alt1=7;} break; case '_': alt1=8; break; case '-': switch ( input.LA(2) ) { case '-': alt1=27; break; case '=': alt1=32; break; default: alt1=9;} break; case '+': switch ( input.LA(2) ) { case '+': alt1=26; break; case '=': alt1=30; break; default: alt1=10;} break; case '|': int LA1_11 = input.LA(2); if ( LA1_11=='|' ) { alt1=23; } else { alt1=11;} break; case ',': alt1=12; break; case '{': alt1=13; break; case '}': alt1=14; break; case '[': alt1=15; break; case ']': alt1=16; break; case '=': switch ( input.LA(2) ) { case '+': alt1=31; break; case '-': alt1=33; break; case '=': alt1=29; break; case '/': alt1=37; break; case '*': alt1=35; break; default: alt1=17;} break; case '/': int LA1_18 = input.LA(2); if ( LA1_18=='=' ) { alt1=36; } else { alt1=18;} break; case '(': alt1=19; break; case ')': alt1=20; break; case '\'': alt1=21; break; case '\\': alt1=22; break; case '<': alt1=25; break; case '>': int LA1_24 = input.LA(2); if ( LA1_24=='>' ) { int LA1_45 = input.LA(3); if ( LA1_45=='=' ) { alt1=38; } else if ( LA1_45=='>' ) { alt1=28; } else { if (backtracking>0) {failed=true; return ;} NoViableAltException nvae = new NoViableAltException("1011:1: MISC : ( \'!\' | \'@\' | \'$\' | \'%\' | \'^\' | \'&\' | \'*\' | \'_\' | \'-\' | \'+\' | \'|\' | \',\' | \'{\' | \'}\' | \'[\' | \']\' | \'=\' | \'/\' | \'(\' | \')\' | \'\\\'\' | \'\\\\\' | \'||\' | \'&&\' | \'<<<\' | \'++\' | \'--\' | \'>>>\' | \'==\' | \'+=\' | \'=+\' | \'-=\' | \'=-\' | \'*=\' | \'=*\' | \'/=\' | \'=/\' | \'>>=\' );", 1, 45, input); throw nvae; } } else { if (backtracking>0) {failed=true; return ;} NoViableAltException nvae = new NoViableAltException("1011:1: MISC : ( \'!\' | \'@\' | \'$\' | \'%\' | \'^\' | \'&\' | \'*\' | \'_\' | \'-\' | \'+\' | \'|\' | \',\' | \'{\' | \'}\' | \'[\' | \']\' | \'=\' | \'/\' | \'(\' | \')\' | \'\\\'\' | \'\\\\\' | \'||\' | \'&&\' | \'<<<\' | \'++\' | \'--\' | \'>>>\' | \'==\' | \'+=\' | \'=+\' | \'-=\' | \'=-\' | \'*=\' | \'=*\' | \'/=\' | \'=/\' | \'>>=\' );", 1, 24, input); throw nvae; } break; default: if (backtracking>0) {failed=true; return ;} NoViableAltException nvae = new NoViableAltException("1011:1: MISC : ( \'!\' | \'@\' | \'$\' | \'%\' | \'^\' | \'&\' | \'*\' | \'_\' | \'-\' | \'+\' | \'|\' | \',\' | \'{\' | \'}\' | \'[\' | \']\' | \'=\' | \'/\' | \'(\' | \')\' | \'\\\'\' | \'\\\\\' | \'||\' | \'&&\' | \'<<<\' | \'++\' | \'--\' | \'>>>\' | \'==\' | \'+=\' | \'=+\' | \'-=\' | \'=-\' | \'*=\' | \'=*\' | \'/=\' | \'=/\' | \'>>=\' );", 1, 0, input); throw nvae; } switch (alt1) { case 1 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1012:17: '!' { match('!'); if (failed) return ; } break; case 2 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1012:23: '@' { match('@'); if (failed) return ; } break; case 3 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1012:29: '$' { match('$'); if (failed) return ; } break; case 4 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1012:35: '%' { match('%'); if (failed) return ; } break; case 5 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1012:41: '^' { match('^'); if (failed) return ; } break; case 6 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1012:47: '&' { match('&'); if (failed) return ; } break; case 7 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1012:53: '*' { match('*'); if (failed) return ; } break; case 8 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1012:59: '_' { match('_'); if (failed) return ; } break; case 9 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1012:65: '-' { match('-'); if (failed) return ; } break; case 10 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1012:71: '+' { match('+'); if (failed) return ; } break; case 11 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1013:19: '|' { match('|'); if (failed) return ; } break; case 12 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1013:25: ',' { match(','); if (failed) return ; } break; case 13 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1013:31: '{' { match('{'); if (failed) return ; } break; case 14 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1013:37: '}' { match('}'); if (failed) return ; } break; case 15 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1013:43: '[' { match('['); if (failed) return ; } break; case 16 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1013:49: ']' { match(']'); if (failed) return ; } break; case 17 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1013:55: '=' { match('='); if (failed) return ; } break; case 18 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1013:61: '/' { match('/'); if (failed) return ; } break; case 19 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1013:67: '(' { match('('); if (failed) return ; } break; case 20 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1013:73: ')' { match(')'); if (failed) return ; } break; case 21 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1013:79: '\'' { match('\''); if (failed) return ; } break; case 22 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1013:86: '\\' { match('\\'); if (failed) return ; } break; case 23 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1014:19: '||' { match("||"); if (failed) return ; } break; case 24 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1014:26: '&&' { match("&&"); if (failed) return ; } break; case 25 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1014:33: '<<<' { match("<<<"); if (failed) return ; } break; case 26 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1014:41: '++' { match("++"); if (failed) return ; } break; case 27 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1014:48: '--' { match("--"); if (failed) return ; } break; case 28 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1014:55: '>>>' { match(">>>"); if (failed) return ; } break; case 29 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1014:63: '==' { match("=="); if (failed) return ; } break; case 30 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1014:70: '+=' { match("+="); if (failed) return ; } break; case 31 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1014:77: '=+' { match("=+"); if (failed) return ; } break; case 32 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1014:84: '-=' { match("-="); if (failed) return ; } break; case 33 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1014:91: '=-' { match("=-"); if (failed) return ; } break; case 34 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1014:97: '*=' { match("*="); if (failed) return ; } break; case 35 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1014:104: '=*' { match("=*"); if (failed) return ; } break; case 36 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1015:19: '/=' { match("/="); if (failed) return ; } break; case 37 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1015:26: '=/' { match("=/"); if (failed) return ; } break; case 38 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:1015:33: '>>=' { match(">>="); if (failed) return ; } break; } if ( token==null ) {emit(type,line,charPosition,channel,start,getCharIndex()-1);} } finally { if ( backtracking>0 ) { memoize(input, 48, MISC_StartIndex); } } } | 31577 /local/tlutelli/issta_data/temp/all_java3context/java/2006_temp/2006/31577/cb210a30853642e270a3bba6ce570409f6046852/RuleParserLexer.java/buggy/drools-compiler/src/main/java/org/drools/lang/RuleParserLexer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
312,
7492,
2312,
1435,
1216,
9539,
288,
3639,
509,
20806,
2312,
67,
16792,
273,
810,
18,
1615,
5621,
3639,
775,
288,
5411,
509,
618,
273,
20806,
2312,
31,
5411,
509,
787,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
312,
7492,
2312,
1435,
1216,
9539,
288,
3639,
509,
20806,
2312,
67,
16792,
273,
810,
18,
1615,
5621,
3639,
775,
288,
5411,
509,
618,
273,
20806,
2312,
31,
5411,
509,
787,
273,
... | ||
"Service Name: " + this.serviceName + "Total Lifetime Registrations : " + this.lifetimeRegistrationCount + "Current Registrant Count : " + this.currentRegistrantCount + "Resource Creation Time: " + this.resourceCreationTime; | " Service Name: " + this.serviceName + " Total Lifetime Registrations : " + this.lifetimeRegistrationCount + " Current Registrant Count : " + this.currentRegistrantCount + " Resource Creation Time: " + this.resourceCreationTime; | public String toString() { return super.toString() + "Service Name: " + this.serviceName + "Total Lifetime Registrations : " + this.lifetimeRegistrationCount + "Current Registrant Count : " + this.currentRegistrantCount + "Resource Creation Time: " + this.resourceCreationTime; } | 8719 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8719/d2a1300baa777da0fa95af04538dedb02d1de956/MDSAggregatorMonitorPacket.java/clean/usage/java/packets/source/src/org/globus/usage/packets/MDSAggregatorMonitorPacket.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
514,
1762,
1435,
377,
288,
3639,
327,
2240,
18,
10492,
1435,
397,
3639,
315,
1179,
1770,
30,
315,
397,
333,
18,
15423,
397,
540,
315,
5269,
11695,
2374,
2526,
3337,
1012,
294,
315,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
514,
1762,
1435,
377,
288,
3639,
327,
2240,
18,
10492,
1435,
397,
3639,
315,
1179,
1770,
30,
315,
397,
333,
18,
15423,
397,
540,
315,
5269,
11695,
2374,
2526,
3337,
1012,
294,
315,
... |
public static ICalTimeZone fromVTimeZone(ZComponent comp) { | public static ICalTimeZone fromVTimeZone(ZComponent comp) throws ServiceException { | public static ICalTimeZone fromVTimeZone(ZComponent comp) { String tzname = comp.getPropVal(ICalTok.TZID, null); ZComponent standard = null; ZComponent daylight = null; // Find the most recent STANDARD and DAYLIGHT components. "Most recent" // means the component's DTSTART is later in time than that of all other // components. Thus, if multiple STANDARD components are specifieid in // a VTIMEZONE, we end up using only the most recent definition. The // assumption is that all other STANDARD components are for past dates // and they no longer matter. We're forced to make this assumption // because this class is a subclass of SimpleTimeZone, which doesn't // allow historical information. for (Iterator<ZComponent> iter = comp.getComponentIterator(); iter.hasNext(); ) { ZComponent tzComp = iter.next(); if (tzComp == null) continue; ICalTok tok = tzComp.getTok(); if (ICalTok.STANDARD.equals(tok)) { if (standard == null) { standard = tzComp; continue; } else standard = moreRecentTzComp(standard, tzComp); } else if (ICalTok.DAYLIGHT.equals(tok)) { if (daylight == null) { daylight = tzComp; continue; } else daylight = moreRecentTzComp(daylight, tzComp); } } // If both STANDARD and DAYLIGHT have no RRULE and their DTSTART has // the same month and date, they have the same onset date. Discard // the older one. (This happened with Asia/Singapore TZ definition // created by Apple iCal; see bug 7335.) if (standard != null && daylight != null) { String stdRule = standard.getPropVal(ICalTok.RRULE, null); String dayRule = daylight.getPropVal(ICalTok.RRULE, null); // The rules should be either both non-null or both null. // If only one is null then the VTIMEZONE is invalid, but we'll be // lenient and treat it as if both were null. if (stdRule == null || dayRule == null) { String stdStart = standard.getPropVal(ICalTok.DTSTART, null); String dayStart = daylight.getPropVal(ICalTok.DTSTART, null); if (stdStart != null && dayStart != null) { try { // stdStart = yyyymmddThhmiss // stdStartMMDD = mmdd String stdStartMMDD = stdStart.substring(4, 8); String dayStartMMDD = dayStart.substring(4, 8); if (stdStartMMDD.equals(dayStartMMDD)) { standard = moreRecentTzComp(standard, daylight); daylight = null; } } catch (StringIndexOutOfBoundsException e) { // DTSTART values must have been malformed. Just do // something reasonable and go on. standard = moreRecentTzComp(standard, daylight); daylight = null; } } } } // If only DAYLIGHT is given, make it the STANDARD. if (standard == null) { standard = daylight; daylight = null; } if (standard == null) throw new IllegalArgumentException("VTIMEZONE has neither STANDARD nor DAYLIGHT: TZID=" + tzname); String stddtStart = null; int stdoffsetTime = 0; String stdrrule = null; if (standard != null) { stddtStart = standard.getPropVal(ICalTok.DTSTART, null); String stdtzOffsetTo = standard.getPropVal(ICalTok.TZOFFSETTO, null); stdoffsetTime = tzOffsetToTime(stdtzOffsetTo); if (daylight != null) { // Rule is interesting only if daylight savings is in use. stdrrule = standard.getPropVal(ICalTok.RRULE, null); } } String daydtStart = null; int dayoffsetTime = stdoffsetTime; String dayrrule = null; if (daylight != null) { daydtStart = daylight.getPropVal(ICalTok.DTSTART, null); String daytzOffsetTo = daylight.getPropVal(ICalTok.TZOFFSETTO, null); dayoffsetTime = tzOffsetToTime(daytzOffsetTo); dayrrule = daylight.getPropVal(ICalTok.RRULE, null); } ICalTimeZone tz = new ICalTimeZone(tzname, stdoffsetTime, stddtStart, stdrrule, dayoffsetTime, daydtStart, dayrrule); return tz; } | 6965 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6965/ba4bbfe9548a819cd6487039ffcd4d2d0c415661/ICalTimeZone.java/clean/ZimbraServer/src/java/com/zimbra/cs/mailbox/calendar/ICalTimeZone.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
467,
3005,
16760,
628,
58,
16760,
12,
62,
1841,
1161,
13,
1216,
16489,
288,
3639,
514,
6016,
529,
273,
1161,
18,
588,
4658,
3053,
12,
2871,
287,
20477,
18,
21647,
734,
16,
44... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
467,
3005,
16760,
628,
58,
16760,
12,
62,
1841,
1161,
13,
1216,
16489,
288,
3639,
514,
6016,
529,
273,
1161,
18,
588,
4658,
3053,
12,
2871,
287,
20477,
18,
21647,
734,
16,
44... |
legendItems.add( new LegendItemHints( LEGEND_ENTRY, | columnList.add( new LegendItemHints( LEGEND_ENTRY, | public final Size compute( IDisplayServer xs, Chart cm, SeriesDefinition[] seda, RunTimeContext rtc ) throws ChartException { // THREE CASES: // 1. ALL SERIES IN ONE ARRAYLIST // 2. ONE SERIES PER ARRAYLIST // 3. ALL OTHERS final Legend lg = cm.getLegend( ); if ( !lg.isSetOrientation( ) ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.GENERATION, "exception.legend.orientation.horzvert", //$NON-NLS-1$ Messages.getResourceBundle( xs.getULocale( ) ) ); } if ( !lg.isSetDirection( ) ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.GENERATION, "exception.legend.direction.tblr", //$NON-NLS-1$ Messages.getResourceBundle( xs.getULocale( ) ) ); } // INITIALIZATION OF VARS USED IN FOLLOWING LOOPS final Orientation orientation = lg.getOrientation( ); final Direction direction = lg.getDirection( ); Label la = LabelImpl.create( ); la.setCaption( TextImpl.copyInstance( lg.getText( ) ) ); ClientArea ca = lg.getClientArea( ); LineAttributes lia = ca.getOutline( ); double dSeparatorThickness = lia.getThickness( ); double dWidth = 0, dHeight = 0; la.getCaption( ).setValue( "X" ); //$NON-NLS-1$ final ITextMetrics itm = xs.getTextMetrics( la ); double dItemHeight = itm.getFullHeight( ); Series se; List al; double dScale = xs.getDpiResolution( ) / 72d; Insets insCA = ca.getInsets( ).scaledInstance( dScale ); final boolean bPaletteByCategory = ( cm.getLegend( ) .getItemType( ) .getValue( ) == LegendItemType.CATEGORIES ); final double maxWrappingSize = lg.getWrappingSize( ) * dScale; Series seBase; final List legendItems = new ArrayList( ); final double dHorizontalSpacing = 3 * dScale; final double dVerticalSpacing = 3 * dScale; // Get maximum block width/height available Block bl = cm.getBlock( ); Bounds boFull = bl.getBounds( ).scaledInstance( dScale ); Insets ins = bl.getInsets( ).scaledInstance( dScale ); Insets lgIns = lg.getInsets( ).scaledInstance( dScale ); double dAvailableWidth = boFull.getWidth( ) - ins.getLeft( ) - ins.getRight( ) - lgIns.getLeft( ) - lgIns.getRight( ); double dAvailableHeight = boFull.getHeight( ) - ins.getTop( ) - ins.getBottom( ) - lgIns.getTop( ) - lgIns.getBottom( ) - cm.getTitle( ) .getBounds( ) .scaledInstance( dScale ) .getHeight( ); // Calculate if minSlice applicable. boolean bMinSliceDefined = false; String sMinSliceLabel = null; boolean bMinSliceApplied = false; int[] filteredMinSliceEntry = null; if ( cm instanceof ChartWithoutAxes ) { bMinSliceDefined = ( (ChartWithoutAxes) cm ).isSetMinSlice( ); sMinSliceLabel = ( (ChartWithoutAxes) cm ).getMinSliceLabel( ); if ( sMinSliceLabel == null || sMinSliceLabel.length( ) == 0 ) { sMinSliceLabel = IConstants.UNDEFINED_STRING; } else { sMinSliceLabel = rtc.externalizedMessage( sMinSliceLabel ); } } // calculate if need an extra legend item when minSlice defined. if ( bMinSliceDefined && bPaletteByCategory && cm instanceof ChartWithoutAxes ) { Map renders = rtc.getSeriesRenderers( ); if ( renders != null && !( (ChartWithoutAxes) cm ).getSeriesDefinitions( ) .isEmpty( ) ) { // OK TO ASSUME THAT 1 BASE SERIES DEFINITION EXISTS SeriesDefinition sdBase = (SeriesDefinition) ( (ChartWithoutAxes) cm ).getSeriesDefinitions( ) .get( 0 ); EList sdA = sdBase.getSeriesDefinitions( ); SeriesDefinition[] sdOrtho = (SeriesDefinition[]) sdA.toArray( new SeriesDefinition[sdA.size( )] ); DataSetIterator dsiOrtho = null; BaseRenderer br; boolean started = false; ENTRANCE: for ( int i = 0; i < sdOrtho.length; i++ ) { List sdRuntimeSA = sdOrtho[i].getRunTimeSeries( ); Series[] alRuntimeSeries = (Series[]) sdRuntimeSA.toArray( new Series[sdRuntimeSA.size( )] ); for ( int j = 0; j < alRuntimeSeries.length; j++ ) { try { dsiOrtho = new DataSetIterator( alRuntimeSeries[j].getDataSet( ) ); LegendItemRenderingHints lirh = (LegendItemRenderingHints) renders.get( alRuntimeSeries[j] ); if ( lirh == null ) { filteredMinSliceEntry = null; break ENTRANCE; } br = lirh.getRenderer( ); // ask each render for filtered min slice info int[] fsa = br.getFilteredMinSliceEntry( dsiOrtho ); if ( fsa != null && fsa.length > 0 ) { bMinSliceApplied = true; } if ( !started ) { started = true; filteredMinSliceEntry = fsa; } else { // get duplicate indices for all renderers filteredMinSliceEntry = getDuplicateIndices( fsa, filteredMinSliceEntry ); if ( filteredMinSliceEntry == null || filteredMinSliceEntry.length == 0 ) { filteredMinSliceEntry = null; break ENTRANCE; } } } catch ( Exception ex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, ex ); } } } // assign a zero-length array for successive convenience if ( filteredMinSliceEntry == null ) { filteredMinSliceEntry = new int[0]; } } } // COMPUTATIONS HERE MUST BE IN SYNC WITH THE ACTUAL RENDERER if ( orientation.getValue( ) == Orientation.VERTICAL ) { double dW, dMaxW = 0; double dRealHeight = 0, dExtraWidth = 0, dDeltaHeight; if ( bPaletteByCategory ) { SeriesDefinition sdBase = null; if ( cm instanceof ChartWithAxes ) { // ONLY SUPPORT 1 BASE AXIS FOR NOW final Axis axPrimaryBase = ( (ChartWithAxes) cm ).getBaseAxes( )[0]; if ( axPrimaryBase.getSeriesDefinitions( ).isEmpty( ) ) { return SizeImpl.create( 0, 0 ); } // OK TO ASSUME THAT 1 BASE SERIES DEFINITION EXISTS sdBase = (SeriesDefinition) axPrimaryBase.getSeriesDefinitions( ) .get( 0 ); } else if ( cm instanceof ChartWithoutAxes ) { if ( ( (ChartWithoutAxes) cm ).getSeriesDefinitions( ) .isEmpty( ) ) { return SizeImpl.create( 0, 0 ); } // OK TO ASSUME THAT 1 BASE SERIES DEFINITION EXISTS sdBase = (SeriesDefinition) ( (ChartWithoutAxes) cm ).getSeriesDefinitions( ) .get( 0 ); } // OK TO ASSUME THAT 1 BASE RUNTIME SERIES EXISTS seBase = (Series) sdBase.getRunTimeSeries( ).get( 0 ); DataSetIterator dsiBase = null; try { dsiBase = new DataSetIterator( seBase.getDataSet( ) ); } catch ( Exception ex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.GENERATION, ex ); } FormatSpecifier fs = null; if ( sdBase != null ) { fs = sdBase.getFormatSpecifier( ); } int pos = -1; while ( dsiBase.hasNext( ) ) { Object obj = dsiBase.next( ); pos++; // filter the not-used legend. if ( bMinSliceApplied && Arrays.binarySearch( filteredMinSliceEntry, pos ) >= 0 ) { continue; } String lgtext = String.valueOf( obj ); if ( fs != null ) { try { lgtext = ValueFormatter.format( obj, fs, rtc.getULocale( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } la.getCaption( ).setValue( lgtext ); itm.reuse( la, maxWrappingSize ); BoundingBox bb = null; try { bb = Methods.computeBox( xs, IConstants.ABOVE, la, 0, 0 ); } catch ( IllegalArgumentException uiex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, uiex ); } double dFWidth = bb.getWidth( ); double dFHeight = bb.getHeight( ); dDeltaHeight = insCA.getTop( ) + dFHeight + insCA.getBottom( ); if ( dHeight + dDeltaHeight > dAvailableHeight ) { dExtraWidth += dWidth + insCA.getLeft( ) + insCA.getRight( ) + ( 3 * dItemHeight ) / 2 + dHorizontalSpacing; dWidth = dFWidth; dRealHeight = Math.max( dRealHeight, dHeight ); dHeight = dDeltaHeight; } else { dWidth = Math.max( dFWidth, dWidth ); dHeight += dDeltaHeight; } legendItems.add( new LegendItemHints( LEGEND_ENTRY, new Point( dExtraWidth, dHeight - dDeltaHeight ), dFWidth, dFHeight, la.getCaption( ).getValue( ), pos ) ); } // compute the extra MinSlice legend item if applicable. if ( bMinSliceApplied ) { la.getCaption( ).setValue( sMinSliceLabel ); itm.reuse( la, maxWrappingSize ); BoundingBox bb = null; try { bb = Methods.computeBox( xs, IConstants.ABOVE, la, 0, 0 ); } catch ( IllegalArgumentException uiex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, uiex ); } double dFWidth = bb.getWidth( ); double dFHeight = bb.getHeight( ); dDeltaHeight = insCA.getTop( ) + dFHeight + insCA.getBottom( ); if ( dHeight + dDeltaHeight > dAvailableHeight ) { dExtraWidth += dWidth + insCA.getLeft( ) + insCA.getRight( ) + ( 3 * dItemHeight ) / 2 + dHorizontalSpacing; dWidth = dFWidth; dRealHeight = Math.max( dRealHeight, dHeight ); dHeight = dDeltaHeight; } else { dWidth = Math.max( dFWidth, dWidth ); dHeight += dDeltaHeight; } legendItems.add( new LegendItemHints( LEGEND_MINSLICE_ENTRY, new Point( dExtraWidth, dHeight - dDeltaHeight ), dFWidth, dFHeight, la.getCaption( ).getValue( ), dsiBase.size( ) ) ); } dWidth += insCA.getLeft( ) + ( 3 * dItemHeight ) / 2 + dHorizontalSpacing + insCA.getRight( ) + dExtraWidth; dHeight = Math.max( dRealHeight, dHeight ); } else if ( direction.getValue( ) == Direction.TOP_BOTTOM ) { // (VERTICAL => TB) dSeparatorThickness += dVerticalSpacing; for ( int j = 0; j < seda.length; j++ ) { al = seda[j].getRunTimeSeries( ); FormatSpecifier fs = seda[j].getFormatSpecifier( ); boolean oneVisibleSerie = false; for ( int i = 0; i < al.size( ); i++ ) { se = (Series) al.get( i ); if ( se.isVisible( ) ) { oneVisibleSerie = true; } else { continue; } Object obj = se.getSeriesIdentifier( ); String lgtext = rtc.externalizedMessage( String.valueOf( obj ) ); if ( fs != null ) { try { lgtext = ValueFormatter.format( lgtext, fs, rtc.getULocale( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } la.getCaption( ).setValue( lgtext ); itm.reuse( la, maxWrappingSize ); BoundingBox bb = null; try { bb = Methods.computeBox( xs, IConstants.ABOVE, la, 0, 0 ); } catch ( IllegalArgumentException uiex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, uiex ); } dW = bb.getWidth( ); double dFHeight = bb.getHeight( ); double dExtraHeight = 0; String extraText = null; dDeltaHeight = insCA.getTop( ) + dFHeight + insCA.getBottom( ); if ( lg.isShowValue( ) ) { DataSetIterator dsiBase = null; try { dsiBase = new DataSetIterator( se.getDataSet( ) ); } catch ( Exception ex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.GENERATION, ex ); } // Use first value for each series. if ( dsiBase.hasNext( ) ) { obj = dsiBase.next( ); String valueText = String.valueOf( obj ); if ( fs != null ) { try { lgtext = ValueFormatter.format( obj, fs, rtc.getULocale( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } Label seLabel = LabelImpl.copyInstance( se.getLabel( ) ); seLabel.getCaption( ).setValue( valueText ); itm.reuse( seLabel ); dW = Math.max( dW, itm.getFullWidth( ) ); dExtraHeight = itm.getFullHeight( ); extraText = seLabel.getCaption( ).getValue( ); dDeltaHeight += dExtraHeight + 2 * dScale; } } if ( dHeight + dDeltaHeight > dAvailableHeight ) { dExtraWidth += dMaxW + insCA.getLeft( ) + insCA.getRight( ) + ( 3 * dItemHeight ) / 2 + dHorizontalSpacing; dMaxW = dW; dRealHeight = Math.max( dRealHeight, dHeight ); dHeight = dDeltaHeight; } else { dMaxW = Math.max( dW, dMaxW ); dHeight += dDeltaHeight; } legendItems.add( new LegendItemHints( LEGEND_ENTRY, new Point( dExtraWidth, dHeight - dDeltaHeight ), dW, dFHeight, la.getCaption( ).getValue( ), dExtraHeight, extraText ) ); } // SETUP HORIZONTAL SEPARATOR SPACING if ( oneVisibleSerie && j < seda.length - 1 && ( lg.getSeparator( ) == null || lg.getSeparator( ) .isVisible( ) ) ) { dHeight += dSeparatorThickness; legendItems.add( new LegendItemHints( LEGEND_SEPERATOR, new Point( dExtraWidth, dHeight - dSeparatorThickness / 2 ), dMaxW + insCA.getLeft( ) + insCA.getRight( ) + ( 3 * dItemHeight ) / 2, 0, null, 0, null ) ); } } // LEFT INSETS + LEGEND ITEM WIDTH + HORIZONTAL SPACING + MAX // ITEM WIDTH + RIGHT INSETS dWidth = insCA.getLeft( ) + ( 3 * dItemHeight ) / 2 + dHorizontalSpacing + dMaxW + insCA.getRight( ) + dExtraWidth; dHeight = Math.max( dRealHeight, dHeight ); } else if ( direction.getValue( ) == Direction.LEFT_RIGHT ) { // (VERTICAL => LR) dSeparatorThickness += dHorizontalSpacing; for ( int j = 0; j < seda.length; j++ ) { al = seda[j].getRunTimeSeries( ); FormatSpecifier fs = seda[j].getFormatSpecifier( ); boolean oneVisibleSerie = false; for ( int i = 0; i < al.size( ); i++ ) { se = (Series) al.get( i ); if ( se.isVisible( ) ) { oneVisibleSerie = true; } else { continue; } Object obj = se.getSeriesIdentifier( ); String lgtext = rtc.externalizedMessage( String.valueOf( obj ) ); if ( fs != null ) { try { lgtext = ValueFormatter.format( lgtext, fs, rtc.getULocale( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } la.getCaption( ).setValue( lgtext ); itm.reuse( la, maxWrappingSize ); BoundingBox bb = null; try { bb = Methods.computeBox( xs, IConstants.ABOVE, la, 0, 0 ); } catch ( IllegalArgumentException uiex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, uiex ); } dW = bb.getWidth( ); double dFHeight = bb.getHeight( ); double dExtraHeight = 0; String extraText = null; dDeltaHeight = insCA.getTop( ) + dFHeight + insCA.getBottom( ); if ( lg.isShowValue( ) ) { DataSetIterator dsiBase = null; try { dsiBase = new DataSetIterator( se.getDataSet( ) ); } catch ( Exception ex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.GENERATION, ex ); } // Use first value for each series. if ( dsiBase.hasNext( ) ) { obj = dsiBase.next( ); String valueText = String.valueOf( obj ); if ( fs != null ) { try { lgtext = ValueFormatter.format( obj, fs, rtc.getULocale( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } Label seLabel = LabelImpl.copyInstance( se.getLabel( ) ); seLabel.getCaption( ).setValue( valueText ); itm.reuse( seLabel ); dW = Math.max( dW, itm.getFullWidth( ) ); dExtraHeight = itm.getFullHeight( ); extraText = seLabel.getCaption( ).getValue( ); dDeltaHeight += itm.getFullHeight( ) + 2 * dScale; } } if ( dHeight + dDeltaHeight > dAvailableHeight ) { dExtraWidth += dMaxW + insCA.getLeft( ) + insCA.getRight( ) + ( 3 * dItemHeight ) / 2 + dHorizontalSpacing; dMaxW = dW; dRealHeight = Math.max( dRealHeight, dHeight ); dHeight = dDeltaHeight; } else { dMaxW = Math.max( dW, dMaxW ); dHeight += dDeltaHeight; } legendItems.add( new LegendItemHints( LEGEND_ENTRY, new Point( dExtraWidth, dHeight - dDeltaHeight ), dW, dFHeight, la.getCaption( ).getValue( ), dExtraHeight, extraText ) ); } if ( oneVisibleSerie ) { dExtraWidth += dMaxW + insCA.getLeft( ) + insCA.getRight( ) + ( 3 * dItemHeight ) / 2 + dHorizontalSpacing; } dMaxW = 0; dRealHeight = Math.max( dRealHeight, dHeight ); dHeight = 0; // SETUP VERTICAL SEPARATOR SPACING if ( oneVisibleSerie && j < seda.length - 1 && ( lg.getSeparator( ) == null || lg.getSeparator( ) .isVisible( ) ) ) { dExtraWidth += dSeparatorThickness; legendItems.add( new LegendItemHints( LEGEND_SEPERATOR, new Point( dExtraWidth - dSeparatorThickness / 2, 0 ), 0, dRealHeight, null, 0, null ) ); } } // LEFT INSETS + LEGEND ITEM WIDTH + HORIZONTAL SPACING + // MAX ITEM WIDTH + RIGHT INSETS dWidth += dExtraWidth; dHeight = Math.max( dRealHeight, dHeight ); } else { throw new ChartException( ChartEnginePlugin.ID, ChartException.GENERATION, "exception.illegal.rendering.direction", //$NON-NLS-1$ new Object[]{ direction.getName( ) }, Messages.getResourceBundle( xs.getULocale( ) ) ); } } else if ( orientation.getValue( ) == Orientation.HORIZONTAL ) { double dH, dMaxH = 0; double dRealWidth = 0, dExtraHeight = 0, dDeltaWidth; if ( bPaletteByCategory ) { SeriesDefinition sdBase = null; if ( cm instanceof ChartWithAxes ) { // ONLY SUPPORT 1 BASE AXIS FOR NOW final Axis axPrimaryBase = ( (ChartWithAxes) cm ).getBaseAxes( )[0]; if ( axPrimaryBase.getSeriesDefinitions( ).isEmpty( ) ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.GENERATION, "exception.base.axis.no.series.definitions", //$NON-NLS-1$ Messages.getResourceBundle( xs.getULocale( ) ) ); } // OK TO ASSUME THAT 1 BASE SERIES DEFINITION EXISTS sdBase = (SeriesDefinition) axPrimaryBase.getSeriesDefinitions( ) .get( 0 ); } else if ( cm instanceof ChartWithoutAxes ) { if ( ( (ChartWithoutAxes) cm ).getSeriesDefinitions( ) .isEmpty( ) ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.GENERATION, "exception.base.axis.no.series.definitions", //$NON-NLS-1$ Messages.getResourceBundle( xs.getULocale( ) ) ); } // OK TO ASSUME THAT 1 BASE SERIES DEFINITION EXISTS sdBase = (SeriesDefinition) ( (ChartWithoutAxes) cm ).getSeriesDefinitions( ) .get( 0 ); } // OK TO ASSUME THAT 1 BASE RUNTIME SERIES EXISTS seBase = (Series) sdBase.getRunTimeSeries( ).get( 0 ); DataSetIterator dsiBase = null; try { dsiBase = new DataSetIterator( seBase.getDataSet( ) ); } catch ( Exception ex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.GENERATION, ex ); } FormatSpecifier fs = null; if ( sdBase != null ) { fs = sdBase.getFormatSpecifier( ); } int pos = -1; while ( dsiBase.hasNext( ) ) { Object obj = dsiBase.next( ); pos++; // filter the not-used legend. if ( bMinSliceApplied && Arrays.binarySearch( filteredMinSliceEntry, pos ) >= 0 ) { continue; } String lgtext = String.valueOf( obj ); if ( fs != null ) { try { lgtext = ValueFormatter.format( obj, fs, rtc.getULocale( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } la.getCaption( ).setValue( lgtext ); itm.reuse( la, maxWrappingSize ); BoundingBox bb = null; try { bb = Methods.computeBox( xs, IConstants.ABOVE, la, 0, 0 ); } catch ( IllegalArgumentException uiex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, uiex ); } double dFWidth = bb.getWidth( ); double dFHeight = bb.getHeight( ); dDeltaWidth = insCA.getLeft( ) + dFWidth + ( 3 * dItemHeight ) / 2 + insCA.getRight( ); if ( dWidth + dDeltaWidth > dAvailableWidth ) { dExtraHeight += dHeight + insCA.getTop( ) + insCA.getBottom( ) + dVerticalSpacing; dHeight = dFHeight; dRealWidth = Math.max( dRealWidth, dWidth ); dWidth = dDeltaWidth; } else { dHeight = Math.max( dFHeight, dHeight ); dWidth += dDeltaWidth; } legendItems.add( new LegendItemHints( LEGEND_ENTRY, new Point( dWidth - dDeltaWidth, dExtraHeight ), dFWidth, dFHeight, la.getCaption( ).getValue( ), pos ) ); } // compute the extra MinSlice legend item if applicable. if ( bMinSliceApplied ) { la.getCaption( ).setValue( sMinSliceLabel ); itm.reuse( la, maxWrappingSize ); BoundingBox bb = null; try { bb = Methods.computeBox( xs, IConstants.ABOVE, la, 0, 0 ); } catch ( IllegalArgumentException uiex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, uiex ); } double dFWidth = bb.getWidth( ); double dFHeight = bb.getHeight( ); dDeltaWidth = insCA.getLeft( ) + dFWidth + ( 3 * dItemHeight ) / 2 + insCA.getRight( ); if ( dWidth + dDeltaWidth > dAvailableWidth ) { dExtraHeight += dHeight + insCA.getTop( ) + insCA.getBottom( ) + dVerticalSpacing; dHeight = dFHeight; dRealWidth = Math.max( dRealWidth, dWidth ); dWidth = dDeltaWidth; } else { dHeight = Math.max( dFHeight, dHeight ); dWidth += dDeltaWidth; } legendItems.add( new LegendItemHints( LEGEND_MINSLICE_ENTRY, new Point( dWidth - dDeltaWidth, dExtraHeight ), dFWidth, dFHeight, la.getCaption( ).getValue( ), dsiBase.size( ) ) ); } dHeight += dExtraHeight + insCA.getTop( ) + insCA.getBottom( ) + dVerticalSpacing; dWidth = Math.max( dWidth, dRealWidth ); } else if ( direction.getValue( ) == Direction.TOP_BOTTOM ) { // (HORIZONTAL => TB) dSeparatorThickness += dVerticalSpacing; for ( int j = 0; j < seda.length; j++ ) { dWidth = 0; al = seda[j].getRunTimeSeries( ); FormatSpecifier fs = seda[j].getFormatSpecifier( ); boolean oneVisibleSerie = false; for ( int i = 0; i < al.size( ); i++ ) { se = (Series) al.get( i ); if ( se.isVisible( ) ) { oneVisibleSerie = true; } else { continue; } Object obj = se.getSeriesIdentifier( ); String lgtext = rtc.externalizedMessage( String.valueOf( obj ) ); if ( fs != null ) { try { lgtext = ValueFormatter.format( lgtext, fs, rtc.getULocale( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } la.getCaption( ).setValue( lgtext ); itm.reuse( la, maxWrappingSize ); BoundingBox bb = null; try { bb = Methods.computeBox( xs, IConstants.ABOVE, la, 0, 0 ); } catch ( IllegalArgumentException uiex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, uiex ); } dH = bb.getHeight( ); double dFHeight = dH; double dFWidth = bb.getWidth( ); double dEHeight = 0; String extraText = null; dDeltaWidth = insCA.getLeft( ) + ( 3 * dItemHeight ) / 2 + dFWidth + insCA.getRight( ) + dHorizontalSpacing; if ( lg.isShowValue( ) ) { DataSetIterator dsiBase = null; try { dsiBase = new DataSetIterator( se.getDataSet( ) ); } catch ( Exception ex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.GENERATION, ex ); } // Use first value for each series. if ( dsiBase.hasNext( ) ) { obj = dsiBase.next( ); String valueText = String.valueOf( obj ); if ( fs != null ) { try { lgtext = ValueFormatter.format( obj, fs, rtc.getULocale( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } Label seLabel = LabelImpl.copyInstance( se.getLabel( ) ); seLabel.getCaption( ).setValue( valueText ); itm.reuse( seLabel ); dEHeight = itm.getFullHeight( ); extraText = seLabel.getCaption( ).getValue( ); dH += dEHeight + 2 * dScale; dDeltaWidth = Math.max( dDeltaWidth, itm.getFullWidth( ) ); } } if ( dWidth + dDeltaWidth > dAvailableWidth ) { dExtraHeight += dMaxH + insCA.getTop( ) + insCA.getBottom( ) + dVerticalSpacing; dMaxH = dH; dRealWidth = Math.max( dRealWidth, dWidth ); dWidth = dDeltaWidth; } else { dMaxH = Math.max( dH, dMaxH ); dWidth += dDeltaWidth; } legendItems.add( new LegendItemHints( LEGEND_ENTRY, new Point( dWidth - dDeltaWidth, dExtraHeight ), dFWidth, dFHeight, la.getCaption( ).getValue( ), dEHeight, extraText ) ); } if ( oneVisibleSerie ) { dExtraHeight += dMaxH + insCA.getTop( ) + insCA.getBottom( ) + dVerticalSpacing; } dMaxH = 0; dRealWidth = Math.max( dRealWidth, dWidth ); dWidth = 0; // SETUP HORIZONTAL SEPARATOR SPACING if ( oneVisibleSerie && j < seda.length - 1 && ( lg.getSeparator( ) == null || lg.getSeparator( ) .isVisible( ) ) ) { dHeight += dSeparatorThickness; legendItems.add( new LegendItemHints( LEGEND_SEPERATOR, new Point( 0, dExtraHeight - dSeparatorThickness / 2 ), dRealWidth, 0, null, 0, null ) ); } } dHeight += dExtraHeight; dWidth = Math.max( dRealWidth, dWidth ); } else if ( direction.getValue( ) == Direction.LEFT_RIGHT ) { // (HORIZONTAL => LR) dSeparatorThickness += dHorizontalSpacing; for ( int j = 0; j < seda.length; j++ ) { al = seda[j].getRunTimeSeries( ); FormatSpecifier fs = seda[j].getFormatSpecifier( ); boolean oneVisibleSerie = false; for ( int i = 0; i < al.size( ); i++ ) { se = (Series) al.get( i ); if ( se.isVisible( ) ) { oneVisibleSerie = true; } else { continue; } Object obj = se.getSeriesIdentifier( ); String lgtext = rtc.externalizedMessage( String.valueOf( obj ) ); if ( fs != null ) { try { lgtext = ValueFormatter.format( lgtext, fs, rtc.getULocale( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } la.getCaption( ).setValue( lgtext ); itm.reuse( la, maxWrappingSize ); BoundingBox bb = null; try { bb = Methods.computeBox( xs, IConstants.ABOVE, la, 0, 0 ); } catch ( IllegalArgumentException uiex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, uiex ); } dH = bb.getHeight( ); double dFHeight = dH; double dFWidth = bb.getWidth( ); double dEHeight = 0; String extraText = null; dDeltaWidth = insCA.getLeft( ) + ( 3 * dItemHeight ) / 2 + dFWidth + insCA.getRight( ) + dHorizontalSpacing; if ( lg.isShowValue( ) ) { DataSetIterator dsiBase = null; try { dsiBase = new DataSetIterator( se.getDataSet( ) ); } catch ( Exception ex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.GENERATION, ex ); } // Use first value for each series. if ( dsiBase.hasNext( ) ) { obj = dsiBase.next( ); String valueText = String.valueOf( obj ); if ( fs != null ) { try { lgtext = ValueFormatter.format( obj, fs, rtc.getULocale( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } Label seLabel = LabelImpl.copyInstance( se.getLabel( ) ); seLabel.getCaption( ).setValue( valueText ); itm.reuse( seLabel ); dEHeight = itm.getFullHeight( ); extraText = seLabel.getCaption( ).getValue( ); dH += dEHeight + 2 * dScale; dDeltaWidth = Math.max( dDeltaWidth, itm.getFullWidth( ) ); } } if ( dWidth + dDeltaWidth > dAvailableWidth ) { dExtraHeight += dMaxH + insCA.getTop( ) + insCA.getBottom( ) + dVerticalSpacing; dMaxH = dH; dRealWidth = Math.max( dRealWidth, dWidth ); dWidth = dDeltaWidth; } else { dMaxH = Math.max( dH, dMaxH ); dWidth += dDeltaWidth; } legendItems.add( new LegendItemHints( LEGEND_ENTRY, new Point( dWidth - dDeltaWidth, dExtraHeight ), dFWidth, dFHeight, la.getCaption( ).getValue( ), dEHeight, extraText ) ); } // SETUP VERTICAL SEPARATOR SPACING if ( oneVisibleSerie && j < seda.length - 1 && ( lg.getSeparator( ) == null || lg.getSeparator( ) .isVisible( ) ) ) { dWidth += dSeparatorThickness; legendItems.add( new LegendItemHints( LEGEND_SEPERATOR, new Point( dWidth - dSeparatorThickness / 2, dExtraHeight ), 0, dMaxH + insCA.getTop( ) + insCA.getBottom( ) + dVerticalSpacing, null, 0, null ) ); } } dHeight += insCA.getTop( ) + dVerticalSpacing + insCA.getBottom( ) + dMaxH + dExtraHeight; dWidth = Math.max( dRealWidth, dWidth ); } else { throw new ChartException( ChartEnginePlugin.ID, ChartException.GENERATION, "exception.illegal.rendering.direction", //$NON-NLS-1$ new Object[]{ direction }, Messages.getResourceBundle( xs.getULocale( ) ) ); } } else { throw new ChartException( ChartEnginePlugin.ID, ChartException.GENERATION, "exception.illegal.rendering.orientation", //$NON-NLS-1$ new Object[]{ orientation }, Messages.getResourceBundle( xs.getULocale( ) ) ); } // consider legend title size. Label lgTitle = lg.getTitle( ); Size titleSize = null; if ( lgTitle != null && lgTitle.isSetVisible( ) && lgTitle.isVisible( ) ) { lgTitle = LabelImpl.copyInstance( lgTitle ); // handle external resource string final String sPreviousValue = lgTitle.getCaption( ).getValue( ); lgTitle.getCaption( ) .setValue( rtc.externalizedMessage( sPreviousValue ) ); BoundingBox bb = null; try { bb = Methods.computeBox( xs, IConstants.ABOVE, lgTitle, 0, 0 ); } catch ( IllegalArgumentException uiex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, uiex ); } int iTitlePos = lg.getTitlePosition( ).getValue( ); // swap left/right if ( rtc.isRightToLeft( ) ) { if ( iTitlePos == Position.LEFT ) { iTitlePos = Position.RIGHT; } else if ( iTitlePos == Position.RIGHT ) { iTitlePos = Position.LEFT; } } double shadowness = 3 * dScale; switch ( iTitlePos ) { case Position.ABOVE : case Position.BELOW : dHeight += bb.getHeight( ) + 2 * shadowness; dWidth = Math.max( dWidth, bb.getWidth( ) + 2 * shadowness ); break; case Position.LEFT : case Position.RIGHT : dWidth += bb.getWidth( ) + 2 * shadowness; dHeight = Math.max( dHeight, bb.getHeight( ) + 2 * shadowness ); break; } titleSize = SizeImpl.create( bb.getWidth( ) + 2 * shadowness, bb.getHeight( ) + 2 * shadowness ); } itm.dispose( ); // DISPOSE RESOURCE AFTER USE if ( rtc != null ) { LegendItemHints[] liha = (LegendItemHints[]) legendItems.toArray( new LegendItemHints[legendItems.size( )] ); // update context hints here. LegendLayoutHints lilh = new LegendLayoutHints( SizeImpl.create( dWidth, dHeight ), titleSize, bMinSliceApplied, sMinSliceLabel, liha ); rtc.setLegendLayoutHints( lilh ); } sz = SizeImpl.create( dWidth, dHeight ); return sz; } | 5230 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5230/bdbe857d641e2e27600409e7bb20f1950ed1536b/LegendBuilder.java/buggy/chart/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/computation/LegendBuilder.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
727,
6321,
3671,
12,
1599,
291,
1601,
2081,
9280,
16,
14804,
5003,
16,
1082,
202,
6485,
1852,
8526,
24336,
69,
16,
1939,
950,
1042,
436,
5111,
262,
1216,
14804,
503,
202,
95,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
727,
6321,
3671,
12,
1599,
291,
1601,
2081,
9280,
16,
14804,
5003,
16,
1082,
202,
6485,
1852,
8526,
24336,
69,
16,
1939,
950,
1042,
436,
5111,
262,
1216,
14804,
503,
202,
95,
... |
outputFileName = getSimpleClassName(className) + WSDL_FILENAME_SUFFIX; | outputFileName = Java2WSDLUtils.getSimpleClassName(className) + WSDL_FILENAME_SUFFIX; | public Java2WSDLCodegenEngine(Map optionsMap) throws Exception { //create a new Java2WSDLBuilder and populate it File outputFolder; Java2WSDLCommandLineOption option = loadOption(Java2WSDLConstants.OUTPUT_LOCATION_OPTION, Java2WSDLConstants.OUTPUT_LOCATION_OPTION_LONG, optionsMap); String outputFolderName = option == null ? System.getProperty("user.dir") : option.getOptionValue(); outputFolder = new File(outputFolderName); if (!outputFolder.exists()) { outputFolder.mkdir(); } else if (!outputFolder.isDirectory()) { throw new Exception("The specivied location " + outputFolderName + "is not a folder"); } option = loadOption(Java2WSDLConstants.CLASSNAME_OPTION, Java2WSDLConstants.CLASSNAME_OPTION_LONG, optionsMap); String className = option == null ? null : option.getOptionValue(); if (className == null || className.equals("")) { throw new Exception("class name must be present!"); } option = loadOption(Java2WSDLConstants.OUTPUT_FILENAME_OPTION, Java2WSDLConstants.OUTPUT_FILENAME_OPTION_LONG, optionsMap); String outputFileName = option == null ? null : option.getOptionValue(); //derive a file name from the class name if the filename is not specified if (outputFileName == null) { outputFileName = getSimpleClassName(className) + WSDL_FILENAME_SUFFIX; } //first create a file in the given location File outputFile = new File(outputFolder, outputFileName); FileOutputStream out; try { if (!outputFile.exists()) { outputFile.createNewFile(); } out = new FileOutputStream(outputFile); } catch (IOException e) { throw new Exception(e); } //if the class path is present, create a URL class loader with those //class path entries present. if not just take the TCCL option = loadOption(Java2WSDLConstants.CLASSPATH_OPTION, Java2WSDLConstants.CLASSPATH_OPTION_LONG, optionsMap); ClassLoader classLoader; if (option != null) { ArrayList optionValues = option.getOptionValues(); URL[] urls = new URL[optionValues.size()]; String[] classPathEntries = (String[]) optionValues.toArray(new String[optionValues.size()]); try { for (int i = 0; i < classPathEntries.length; i++) { String classPathEntry = classPathEntries[i]; //this should be a file(or a URL) if (isURL(classPathEntry)) { urls[i] = new URL(classPathEntry); } else { urls[i] = new File(classPathEntry).toURL(); } } } catch (MalformedURLException e) { throw new Exception(e); } classLoader = new URLClassLoader(urls, Thread.currentThread().getContextClassLoader()); } else { classLoader = Thread.currentThread().getContextClassLoader(); } //Now we are done with loading the basic values - time to create the builder java2WsdlBuilder = new Java2WSDLBuilder(out, className, classLoader); //set the other parameters to the builder option = loadOption(Java2WSDLConstants.SCHEMA_TARGET_NAMESPACE_OPTION, Java2WSDLConstants.SCHEMA_TARGET_NAMESPACE_OPTION_LONG, optionsMap); java2WsdlBuilder.setSchemaTargetNamespace(option == null ? null : option.getOptionValue()); option = loadOption(Java2WSDLConstants.SCHEMA_TARGET_NAMESPACE_PREFIX_OPTION, Java2WSDLConstants.SCHEMA_TARGET_NAMESPACE_PREFIX_OPTION_LONG, optionsMap); java2WsdlBuilder.setSchemaTargetNamespacePrefix(option == null ? null : option.getOptionValue()); option = loadOption(Java2WSDLConstants.TARGET_NAMESPACE_OPTION, Java2WSDLConstants.TARGET_NAMESPACE_OPTION_LONG, optionsMap); java2WsdlBuilder.setTargetNamespace(option == null ? null : option.getOptionValue()); option = loadOption(Java2WSDLConstants.TARGET_NAMESPACE_PREFIX_OPTION, Java2WSDLConstants.TARGET_NAMESPACE_PREFIX_OPTION_LONG, optionsMap); java2WsdlBuilder.setTargetNamespacePrefix(option == null ? null : option.getOptionValue()); option = loadOption(Java2WSDLConstants.SERVICE_NAME_OPTION, Java2WSDLConstants.SERVICE_NAME_OPTION_LONG, optionsMap); java2WsdlBuilder.setServiceName(option == null ? getSimpleClassName(className) : option.getOptionValue()); option = loadOption(Java2WSDLConstants.STYLE_OPTION, Java2WSDLConstants.STYLE_OPTION, optionsMap); if (option != null) { java2WsdlBuilder.setStyle(option.getOptionValue()); } option = loadOption(Java2WSDLConstants.LOCATION_OPTION, Java2WSDLConstants.LOCATION_OPTION, optionsMap); if (option != null) { java2WsdlBuilder.setLocationUri(option.getOptionValue()); } option = loadOption(Java2WSDLConstants.USE_OPTION, Java2WSDLConstants.USE_OPTION, optionsMap); if (option != null) { java2WsdlBuilder.setUse(option.getOptionValue()); } } | 49300 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49300/7bad74b73737d86baefe9febc019cb5c52d01c03/Java2WSDLCodegenEngine.java/buggy/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2WSDLCodegenEngine.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
5110,
22,
2651,
8914,
1085,
4507,
4410,
12,
863,
702,
863,
13,
1216,
1185,
288,
3639,
368,
2640,
279,
394,
225,
5110,
22,
2651,
8914,
1263,
471,
6490,
518,
3639,
1387,
876,
3899,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
5110,
22,
2651,
8914,
1085,
4507,
4410,
12,
863,
702,
863,
13,
1216,
1185,
288,
3639,
368,
2640,
279,
394,
225,
5110,
22,
2651,
8914,
1263,
471,
6490,
518,
3639,
1387,
876,
3899,
... |
super("DataChannel reader thread: "+name); | super("Channel reader thread: "+name); | public ReaderThread(String name) { super("DataChannel reader thread: "+name); } | 48095 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/48095/d249d5246d33855ab3bcbce28c0828dd02dfad0d/Channel.java/clean/remoting/src/main/java/hudson/remoting/Channel.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
540,
1071,
5393,
3830,
12,
780,
508,
13,
288,
5411,
2240,
2932,
2909,
2949,
2650,
30,
13773,
529,
1769,
3639,
289,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
540,
1071,
5393,
3830,
12,
780,
508,
13,
288,
5411,
2240,
2932,
2909,
2949,
2650,
30,
13773,
529,
1769,
3639,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
public java.sql.ResultSet searchRecords( int in_code, String in_name) { | public java.sql.ResultSet searchRecords(String in_egn, String in_name) { | public java.sql.ResultSet searchRecords( int in_code, String in_name) // -OK comprator = 5; { comprator = 5; this.code = in_code; this.name = in_name; try { registerParameters(); setRs(getCstm().executeQuery()); } catch(java.sql.SQLException sqle) { sqle.printStackTrace(); } return getRs(); } | 12667 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12667/5d411ac32556eaff59a6d73d1a54beed1e833c7e/dbPerson.java/clean/src/nom/dbPerson.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
2252,
18,
4669,
18,
13198,
1623,
6499,
12,
509,
316,
67,
710,
16,
514,
316,
67,
529,
13,
368,
300,
3141,
225,
532,
683,
639,
273,
1381,
31,
565,
288,
3639,
532,
683,
639,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
2252,
18,
4669,
18,
13198,
1623,
6499,
12,
509,
316,
67,
710,
16,
514,
316,
67,
529,
13,
368,
300,
3141,
225,
532,
683,
639,
273,
1381,
31,
565,
288,
3639,
532,
683,
639,
273,
... |
public Tree Block(Tree[] stats) { return Block(stats[0].pos, stats); | public Tree Block(int pos, Tree[] stats) { Block tree = make.Block(pos, stats); global.nextPhase(); tree.setType(stats.length == 0 ? definitions.UNIT_TYPE() : stats[stats.length - 1].type); global.prevPhase(); return tree; | public Tree Block(Tree[] stats) { return Block(stats[0].pos, stats); } | 5590 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5590/16afd2fc1ad46de3adc22b75e972e2019226c745/TreeGen.java/buggy/sources/scalac/ast/TreeGen.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
4902,
3914,
12,
2471,
8526,
3177,
13,
288,
202,
2463,
3914,
12,
5296,
63,
20,
8009,
917,
16,
3177,
1769,
565,
289,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
4902,
3914,
12,
2471,
8526,
3177,
13,
288,
202,
2463,
3914,
12,
5296,
63,
20,
8009,
917,
16,
3177,
1769,
565,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
insertionPosition = getItemCount((Control)widget); | insertionPosition = getItemCount((Control) widget); | public void insert(Object parentElementOrTreePath, Object element, int position) { Assert.isNotNull(parentElementOrTreePath); Assert.isNotNull(element); if (getComparator() != null || hasFilters()) { add(parentElementOrTreePath, new Object[] { element }); return; } Widget[] items = internalFindItems(parentElementOrTreePath); for (int i = 0; i < items.length; i++) { Widget widget = items[i]; if (widget instanceof Item) { Item item = (Item) widget; Item[] childItems = getChildren(item); if (getExpanded(item) || (childItems.length > 0 && childItems[0].getData() != null)) { // item has real children, go ahead and add int insertionPosition = position; if (insertionPosition == -1) { insertionPosition = getItemCount(item); } createTreeItem(item, element, position); } } else { int insertionPosition = position; if (insertionPosition == -1) { insertionPosition = getItemCount((Control)widget); } createTreeItem(widget, element, position); } } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/7dea322b00f8363f209617dc36ba0b47497db00d/AbstractTreeViewer.java/buggy/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractTreeViewer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
2243,
12,
921,
30363,
1162,
2471,
743,
16,
1033,
930,
16,
1082,
202,
474,
1754,
13,
288,
202,
202,
8213,
18,
291,
5962,
12,
2938,
1046,
1162,
2471,
743,
1769,
202,
202,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
2243,
12,
921,
30363,
1162,
2471,
743,
16,
1033,
930,
16,
1082,
202,
474,
1754,
13,
288,
202,
202,
8213,
18,
291,
5962,
12,
2938,
1046,
1162,
2471,
743,
1769,
202,
202,
... |
poolsize = safeProps.getPropertyAsInt("PoolSize", 100); | poolsize = safeProps.getPropertyAsInt("PoolSize", 100); | public void init(Object id, HashMap registry, Properties properties) throws org.openejb.OpenEJBException { containerID = id; deploymentRegistry = registry; if ( properties == null ) properties = new Properties(); SafeToolkit toolkit = SafeToolkit.getToolkit("CastorCMP11_EntityContainer"); SafeProperties safeProps = toolkit.getSafeProperties(properties); poolsize = safeProps.getPropertyAsInt("PoolSize", 100); Global_TX_Database = safeProps.getProperty("Global_TX_Database"); Local_TX_Database = safeProps.getProperty("Local_TX_Database"); String globalTxLogName = safeProps.getProperty("Global_TX_Log", "castor_global_tx.log"); String localTxLogName = safeProps.getProperty("Local_TX_Log", "castor_local_tx.log"); try { globalTransactionLogWriter = new java.io.PrintWriter( new java.io.FileWriter( globalTxLogName ) ); localTransactionLogWriter = new java.io.PrintWriter( new java.io.FileWriter( localTxLogName ) ); } catch ( java.io.IOException e ) { // TODO:1: Log this warning. // log( "Warning: Cannot open the log files "+localTxLogName+" and "+globalTxLogName+", using system out instead." ); globalTransactionLogWriter = new java.io.PrintWriter( new java.io.OutputStreamWriter( System.out ) ); localTransactionLogWriter = new java.io.PrintWriter( new java.io.OutputStreamWriter( System.out ) ); } /* * Castor JDO obtains a reference to the TransactionManager throught the InitialContext. * The new InitialContext will use the deployment's JNDI Context, which is normal inside * the container system, so we need to bind the TransactionManager to the deployment's name space * The biggest problem with this is that the bean itself may access the TransactionManager if it * knows the JNDI name, so we bind the TransactionManager into dynamically created transient name * space based every time the container starts. It nearly impossible for the bean to anticipate * and use the binding directly. It may be possible, however, to locate it using a Context listing method. */ String transactionManagerJndiName = "java:openejb/"+(new java.rmi.dgc.VMID()).toString().replace(':', '_'); /* * Because the Tyrex root (used by Castor) is different from the IntraVM root, * we have to bind the TxMgr under env in the IntraVM/comp * IntraVM/comp is bound under TyrexRoot/comp so beans can use java:comp indifferently. */ String transactionManagerJndiNameTyrex = "env/"+(new java.rmi.dgc.VMID()).toString().replace(':', '_'); /* * This container uses two different JDO objects. One whose transactions are managed by a tx manager * and which is not. The following code configures both. */ jdo_ForGlobalTransaction = new JDO(); jdo_ForGlobalTransaction.setLogWriter( globalTransactionLogWriter ); // Assign the TransactionManager JNDI name to the dynamically generated JNDI name jdo_ForGlobalTransaction.setTransactionManager("java:comp/"+transactionManagerJndiNameTyrex); jdo_ForGlobalTransaction.setDatabasePooling( true ); jdo_ForGlobalTransaction.setConfiguration(Global_TX_Database); jdo_ForGlobalTransaction.setDatabaseName("Global_TX_Database"); jdo_ForGlobalTransaction.setCallbackInterceptor(this); jdo_ForGlobalTransaction.setInstanceFactory(this); // Make sure the DB is registered as a as synchronization object before the transaction begins. jdo_ForLocalTransaction = new JDO(); jdo_ForLocalTransaction.setLogWriter( localTransactionLogWriter ); jdo_ForLocalTransaction.setConfiguration(Local_TX_Database); jdo_ForLocalTransaction.setDatabaseName("Local_TX_Database"); jdo_ForLocalTransaction.setCallbackInterceptor(this); jdo_ForLocalTransaction.setInstanceFactory(this); /* * This block of code is necessary to avoid a chicken and egg problem. The DeploymentInfo * objects must have a reference to their container during this assembly process, but the * container is created after the DeploymentInfo necessitating this loop to assign all * deployment info object's their containers. * * In addition the loop is leveraged for other oprations like creating the method ready pool * and the keyGenerator pool. */ org.openejb.DeploymentInfo [] deploys = this.deployments(); /* * the JndiTxReference will dynamically obtian a reference to the TransactionManger the first * time it used. The same Reference is shared by all deployments, which is not a problem. */ JndiTxReference txReference = new JndiTxReference(); for ( int x = 0; x < deploys.length; x++ ) { org.openejb.core.DeploymentInfo di = (org.openejb.core.DeploymentInfo)deploys[x]; di.setContainer(this); // also added this line to create the Method Ready Pool for each deployment methodReadyPoolMap.put(di.getDeploymentID(),new LinkedListStack(poolsize/2)); KeyGenerator kg = null; try { kg = KeyGeneratorFactory.createKeyGenerator(di); keyGeneratorMap.put(di.getDeploymentID(), kg); } catch ( Exception e ) { e.printStackTrace(); throw new org.openejb.SystemException("Unable to create KeyGenerator for deployment id = "+di.getDeploymentID(), e); } // bind the TransactionManager to the dynamically generated JNDI name try { if ( di instanceof org.openejb.tyrex.TyrexDeploymentInfo ) { ((javax.naming.Context)di.getJndiEnc().lookup("java:comp")).bind("comp/"+transactionManagerJndiNameTyrex,txReference); } else { di.getJndiEnc().bind(transactionManagerJndiName,txReference); jdo_ForGlobalTransaction.setTransactionManager(transactionManagerJndiName); } } catch ( Exception e ) { e.printStackTrace(); throw new org.openejb.SystemException("Unable to bind TransactionManager to deployment id = "+di.getDeploymentID()+" using JNDI name = \""+transactionManagerJndiName+"\"", e); } try { /** * The following code adds a findByPrimaryKey query-statement to the list of queries * held by the deployment descriptor. The container is required to generate this query * automatically, which is what this code does. */ String findByPrimarKeyQuery = "SELECT e FROM "+di.getBeanClass().getName()+" e WHERE "; if ( kg.isKeyComplex() ) { Field [] pkFields = di.getPrimaryKeyClass().getFields(); for ( int i = 1; i <= pkFields.length; i++ ) { findByPrimarKeyQuery += "e."+pkFields[i-1].getName()+" = $"+i; if ( (i+1)<=pkFields.length ) findByPrimarKeyQuery += " AND "; } } else { findByPrimarKeyQuery += "e."+di.getPrimaryKeyField().getName()+" = $1"; } Method findByPrimaryKeyMethod = di.getHomeInterface().getMethod("findByPrimaryKey", new Class []{di.getPrimaryKeyClass()}); di.addQuery(findByPrimaryKeyMethod, findByPrimarKeyQuery); } catch ( Exception e ) { throw new org.openejb.SystemException("Could not generate a query statement for the findByPrimaryKey method of the deployment = "+di.getDeploymentID(),e); } } } | 47052 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47052/3672264daeda35528fc1545391d5f3b38764b0ff/CastorCMP11_EntityContainer.java/clean/openejb0/src/facilities/org/openejb/alt/containers/castor_cmp11/CastorCMP11_EntityContainer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1208,
12,
921,
612,
16,
4317,
4023,
16,
6183,
1790,
13,
565,
1216,
2358,
18,
3190,
73,
10649,
18,
3678,
22719,
503,
565,
288,
3639,
24257,
273,
612,
31,
3639,
6314,
4243,
273... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1208,
12,
921,
612,
16,
4317,
4023,
16,
6183,
1790,
13,
565,
1216,
2358,
18,
3190,
73,
10649,
18,
3678,
22719,
503,
565,
288,
3639,
24257,
273,
612,
31,
3639,
6314,
4243,
273... |
if (arg1 instanceof KNode) arg1 = NumberValue.numberValue(arg1); if (arg2 instanceof KNode) arg2 = NumberValue.numberValue(arg2); | arg2 = NumberValue.numberCast(arg2); | public Object combine (Object arg1, Object arg2) { if (arg1 == Values.empty) return arg2; // FIXME - verify that arg2 is comparable. int flags = returnMax ? Compare.TRUE_IF_GRT : Compare.TRUE_IF_LSS; if (arg1 instanceof KNode) arg1 = NumberValue.numberValue(arg1); if (arg2 instanceof KNode) arg2 = NumberValue.numberValue(arg2); return Compare.apply(flags, arg1, arg2, null) ? arg1 : arg2; } | 36870 /local/tlutelli/issta_data/temp/all_java3context/java/2006_temp/2006/36870/402ef9a49086223b27654d9cdf8099b117c70108/MinMax.java/clean/gnu/xquery/util/MinMax.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
1033,
8661,
261,
921,
1501,
21,
16,
1033,
1501,
22,
13,
225,
288,
565,
309,
261,
3175,
21,
422,
6876,
18,
5531,
13,
1377,
327,
1501,
22,
31,
368,
9852,
300,
3929,
716,
1501,
22,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
1033,
8661,
261,
921,
1501,
21,
16,
1033,
1501,
22,
13,
225,
288,
565,
309,
261,
3175,
21,
422,
6876,
18,
5531,
13,
1377,
327,
1501,
22,
31,
368,
9852,
300,
3929,
716,
1501,
22,... |
createButtonLayouts(editorComposite); | createActionsLayouts(editorComposite); | public void createPartControl(Composite parent) { if (getRepositoryTaskData() == null) { Composite composite = new Composite(parent, SWT.NULL); composite.setLayout(new GridLayout()); Label noBugLabel = new Label(composite, SWT.NULL); noBugLabel.setText("Could not download task data, possibly due to timeout or connectivity problem.\n" + "Please check connection and try again."); return; } toolkit = new FormToolkit(parent.getDisplay()); form = toolkit.createScrolledForm(parent); editorComposite = form.getBody(); editorComposite.setLayout(new GridLayout()); editorComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); createContextMenu(); createReportHeaderLayout(editorComposite); Composite attribComp = createAttributeLayout(editorComposite); createCustomAttributeLayout(attribComp); createDescriptionLayout(editorComposite); createAttachmentLayout(editorComposite); createCommentLayout(editorComposite, form); createButtonLayouts(editorComposite); // editorComposite.setMenu(contextMenuManager.createContextMenu(editorComposite)); form.reflow(true); getSite().getPage().addSelectionListener(selectionListener); getSite().setSelectionProvider(selectionProvider); } | 51989 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51989/e235f4d0973bf11e55b6148a30f92b0d8c13681f/AbstractRepositoryTaskEditor.java/clean/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/AbstractRepositoryTaskEditor.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
752,
1988,
3367,
12,
9400,
982,
13,
288,
202,
202,
430,
261,
588,
3305,
2174,
751,
1435,
422,
446,
13,
288,
1082,
202,
9400,
9635,
273,
394,
14728,
12,
2938,
16,
348,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
752,
1988,
3367,
12,
9400,
982,
13,
288,
202,
202,
430,
261,
588,
3305,
2174,
751,
1435,
422,
446,
13,
288,
1082,
202,
9400,
9635,
273,
394,
14728,
12,
2938,
16,
348,
8... |
manager.getTaskList().addQuery(new BugzillaRepositoryQuery("repositoryUrl", "queryUrl", "label", "1", manager.getTaskList())); | manager.getTaskList().addQuery( new BugzillaRepositoryQuery("repositoryUrl", "queryUrl", "label", "1", manager.getTaskList())); | public void testCreateQueryWithSameName() { AbstractRepositoryQuery query = new BugzillaRepositoryQuery("repositoryUrl", "queryUrl", "label", "1", manager.getTaskList()); manager.getTaskList().addQuery(query); assertEquals(1, manager.getTaskList().getQueries().size()); AbstractRepositoryQuery readQuery = manager.getTaskList().getQueries().iterator().next(); assertEquals(query, readQuery); manager.getTaskList().addQuery(new BugzillaRepositoryQuery("repositoryUrl", "queryUrl", "label", "1", manager.getTaskList())); assertEquals(1, manager.getTaskList().getQueries().size()); } | 51989 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51989/e65bd50dcb74fc7c8f87622f06bd918df99be9b2/TaskListManagerTest.java/buggy/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/tests/TaskListManagerTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1842,
1684,
1138,
1190,
8650,
461,
1435,
288,
202,
202,
7469,
3305,
1138,
843,
273,
394,
16907,
15990,
3305,
1138,
2932,
9071,
1489,
3113,
315,
2271,
1489,
3113,
315,
1925,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1842,
1684,
1138,
1190,
8650,
461,
1435,
288,
202,
202,
7469,
3305,
1138,
843,
273,
394,
16907,
15990,
3305,
1138,
2932,
9071,
1489,
3113,
315,
2271,
1489,
3113,
315,
1925,
... |
String[] columnPathFrags = columnPath.split("/"); | String[] columnPathFrags = columnPath.replaceAll("\\Q[@\\E","/@").split("/"); | public static List populateColumnPath( String rootPath, String columnPath ) { assert rootPath != null; assert columnPath != null; List result = new ArrayList(); if( columnPath.startsWith( rootPath )) { columnPath = columnPath.replaceFirst("\\Q"+rootPath+"/\\E", ""); result.add( columnPath ); }else { String[] rootPathFrags = rootPath.split("/"); String[] columnPathFrags = columnPath.split("/"); int indexOfFirstDifferentElement = findFirstDifferentItem( rootPathFrags, columnPathFrags ); String temp = ""; for( int i = 0; i < rootPathFrags.length - 1 - indexOfFirstDifferentElement; i ++) { temp += "../"; } temp = addXPathFragsToAString( columnPathFrags, indexOfFirstDifferentElement+1, temp); result.add( temp ); } return result; } | 5230 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5230/a5b7258516eabb3103c780abd79474e551541aaf/XPathPopulationUtil.java/buggy/data/org.eclipse.birt.report.data.oda.xml/src/org/eclipse/birt/report/data/oda/xml/util/ui/XPathPopulationUtil.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
760,
987,
6490,
1494,
743,
12,
514,
13959,
16,
514,
1057,
743,
262,
202,
95,
1082,
202,
11231,
13959,
480,
446,
31,
202,
202,
11231,
1057,
743,
480,
446,
31,
202,
202,
682,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
760,
987,
6490,
1494,
743,
12,
514,
13959,
16,
514,
1057,
743,
262,
202,
95,
1082,
202,
11231,
13959,
480,
446,
31,
202,
202,
11231,
1057,
743,
480,
446,
31,
202,
202,
682,
... |
return rs.getString(1); | return rs.getString( 1 ); | String sproc_GetPhonetypeName( int phonetype_id, int lang_id ) { String sql = "select typename from phonetypes " + "where phonetype_id = ? and lang_id = ? "; Object[] paramValues = new Object[]{ new Integer(phonetype_id), new Integer(lang_id) }; ArrayList queryResult = sqlProcessor.executeQuery( sql, paramValues, new SQLProcessor.ResultProcessor() { Object mapOneRowFromResultsetToObject( ResultSet rs ) throws SQLException { return rs.getString(1); } } ); return (String)queryResult.get(0); } | 8781 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8781/21dc5f1786b0b1be4057d7b7e4ed7a929c47e2d2/DatabaseService.java/clean/server/src/imcode/server/db/DatabaseService.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
514,
272,
9381,
67,
967,
3731,
265,
5872,
461,
12,
509,
22105,
5872,
67,
350,
16,
509,
3303,
67,
350,
262,
288,
3639,
514,
1847,
273,
315,
4025,
26735,
628,
22105,
15180,
315,
397,
5411... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
514,
272,
9381,
67,
967,
3731,
265,
5872,
461,
12,
509,
22105,
5872,
67,
350,
16,
509,
3303,
67,
350,
262,
288,
3639,
514,
1847,
273,
315,
4025,
26735,
628,
22105,
15180,
315,
397,
5411... |
if (delta != null && (delta.getFlags() & (IJavaElementDelta.F_CONTENT | IJavaElementDelta.F_CHILDREN)) != 0) update(createContext(false)); | if (delta != null && (delta.getFlags() & (IJavaElementDelta.F_CONTENT | IJavaElementDelta.F_CHILDREN)) != 0) { fUpdatingCount++; try { update(createContext(false)); } finally { fUpdatingCount--; } } | public void elementChanged(ElementChangedEvent e) { if (hasErrorOnCaretLine(e.getDelta().getCompilationUnitAST())) return; IJavaElementDelta delta= findElement(fInput, e.getDelta()); if (delta != null && (delta.getFlags() & (IJavaElementDelta.F_CONTENT | IJavaElementDelta.F_CHILDREN)) != 0) update(createContext(false)); } | 9698 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/9698/115d30f1570af95d1e353b86da4e8b0e5795d21f/DefaultJavaFoldingStructureProvider.java/clean/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/folding/DefaultJavaFoldingStructureProvider.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3196,
202,
482,
918,
930,
5033,
12,
1046,
27553,
425,
13,
288,
1082,
202,
430,
261,
5332,
668,
1398,
39,
20731,
1670,
12,
73,
18,
588,
9242,
7675,
588,
19184,
2802,
9053,
1435,
3719,
9506,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3196,
202,
482,
918,
930,
5033,
12,
1046,
27553,
425,
13,
288,
1082,
202,
430,
261,
5332,
668,
1398,
39,
20731,
1670,
12,
73,
18,
588,
9242,
7675,
588,
19184,
2802,
9053,
1435,
3719,
9506,
2... |
Font font = projectGroup.getFont(); | private Composite createUserSpecifiedProjectLocationGroup(Composite projectGroup, boolean enabled) { // location label locationLabel = new Label(projectGroup, SWT.NONE); locationLabel.setText(LOCATION_LABEL); locationLabel.setEnabled(enabled); // project location entry field locationPathField = new Text(projectGroup, SWT.BORDER); GridData data = new GridData(GridData.FILL_HORIZONTAL); data.widthHint = SIZING_TEXT_FIELD_WIDTH; locationPathField.setLayoutData(data); locationPathField.setEnabled(enabled); // browse button this.browseButton = new Button(projectGroup, SWT.PUSH); this.browseButton.setText(BROWSE_LABEL); this.browseButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { handleLocationBrowseButtonPressed(); } }); this.browseButton.setEnabled(enabled); // Set the initial value first before listener // to avoid handling an event during the creation. if (originalPath == null) setLocationForSelection(); else locationPathField.setText(originalPath.toOSString()); createLocationListener(); return projectGroup;} | 55805 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55805/109bbe95e5c9aa69a0bb91e5a7c4f88521727119/ProjectLocationMoveDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/ProjectLocationMoveDialog.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3238,
5711,
3512,
273,
1984,
1114,
18,
588,
5711,
5621,
14728,
5711,
3512,
273,
1984,
1114,
18,
588,
5711,
5621,
22992,
17068,
4109,
2735,
1114,
12,
9400,
5711,
3512,
273,
1984,
1114,
18,
588,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3238,
5711,
3512,
273,
1984,
1114,
18,
588,
5711,
5621,
14728,
5711,
3512,
273,
1984,
1114,
18,
588,
5711,
5621,
22992,
17068,
4109,
2735,
1114,
12,
9400,
5711,
3512,
273,
1984,
1114,
18,
588,
... | |
public void ruleAction(int ruleNumber) { if (bad_rule != 0) return; switch (ruleNumber) { // // Rule 1: identifier ::= IDENTIFIER // case 1: { if (prsStream.getKind(btParser.getToken(1)) != X10Parsersym.TK_IDENTIFIER) { System.out.println("Parser turning keyword " + prsStream.getName(btParser.getToken(1)) + " at " + prsStream.getLine(btParser.getToken(1)) + ":" + prsStream.getColumn(btParser.getToken(1)) + " into an identifier"); } break; } // // Rule 2: PrimitiveType ::= NumericType // case 2: break; // // Rule 3: PrimitiveType ::= boolean // case 3: { btParser.setSym1(nf.CanonicalTypeNode(pos(), ts.Boolean())); break; } // // Rule 4: NumericType ::= IntegralType // case 4: break; // // Rule 5: NumericType ::= FloatingPointType // case 5: break; // // Rule 6: IntegralType ::= byte // case 6: { btParser.setSym1(nf.CanonicalTypeNode(pos(), ts.Byte())); break; } // // Rule 7: IntegralType ::= char // case 7: { btParser.setSym1(nf.CanonicalTypeNode(pos(), ts.Char())); break; } // // Rule 8: IntegralType ::= short // case 8: { btParser.setSym1(nf.CanonicalTypeNode(pos(), ts.Short())); break; } // // Rule 9: IntegralType ::= int // case 9: { btParser.setSym1(nf.CanonicalTypeNode(pos(), ts.Int())); break; } // // Rule 10: IntegralType ::= long // case 10: { btParser.setSym1(nf.CanonicalTypeNode(pos(), ts.Long())); break; } // // Rule 11: FloatingPointType ::= float // case 11: { btParser.setSym1(nf.CanonicalTypeNode(pos(), ts.Float())); break; } // // Rule 12: FloatingPointType ::= double // case 12: { btParser.setSym1(nf.CanonicalTypeNode(pos(), ts.Double())); break; } // // Rule 13: ReferenceType ::= ClassOrInterfaceType // case 13: break; // // Rule 14: ReferenceType ::= ArrayType // case 14: break; // // Rule 15: ClassOrInterfaceType ::= ClassType // case 15: break; // // Rule 16: ClassType ::= TypeName // case 16: {//vj assert(btParser.getSym(2) == null); // generic not yet supported Name a = (Name) btParser.getSym(1); btParser.setSym1(a.toType()); break; } // // Rule 17: InterfaceType ::= TypeName // case 17: {//vj assert(btParser.getSym(2) == null); // generic not yet supported Name a = (Name) btParser.getSym(1); btParser.setSym1(a.toType()); break; } // // Rule 18: TypeName ::= identifier // case 18: { polyglot.lex.Identifier a = id(btParser.getToken(1)); btParser.setSym1(new Name(nf, ts, pos(), a.getIdentifier())); break; } // // Rule 19: TypeName ::= TypeName DOT identifier // case 19: { Name a = (Name) btParser.getSym(1); polyglot.lex.Identifier b = id(btParser.getToken(3)); btParser.setSym1(new Name(nf, ts, pos(btParser.getFirstToken(), btParser.getLastToken()), a, b.getIdentifier())); break; } // // Rule 20: ClassName ::= TypeName // case 20: break; // // Rule 21: TypeVariable ::= identifier // case 21: break; // // Rule 22: ArrayType ::= Type LBRACKET RBRACKET // case 22: { TypeNode a = (TypeNode) btParser.getSym(1); btParser.setSym1(array(a, pos(), 1)); break; } // // Rule 23: TypeParameter ::= TypeVariable TypeBoundopt // case 23: bad_rule = 23; break; // // Rule 24: TypeBound ::= extends ClassOrInterfaceType AdditionalBoundListopt // case 24: bad_rule = 24; break; // // Rule 25: AdditionalBoundList ::= AdditionalBound // case 25: bad_rule = 25; break; // // Rule 26: AdditionalBoundList ::= AdditionalBoundList AdditionalBound // case 26: bad_rule = 26; break; // // Rule 27: AdditionalBound ::= AND InterfaceType // case 27: bad_rule = 27; break; // // Rule 28: TypeArguments ::= LESS ActualTypeArgumentList GREATER // case 28: bad_rule = 28; break; // // Rule 29: ActualTypeArgumentList ::= ActualTypeArgument // case 29: bad_rule = 29; break; // // Rule 30: ActualTypeArgumentList ::= ActualTypeArgumentList COMMA ActualTypeArgument // case 30: bad_rule = 30; break; // // Rule 31: Wildcard ::= QUESTION WildcardBoundsOpt // case 31: bad_rule = 31; break; // // Rule 32: WildcardBounds ::= extends ReferenceType // case 32: bad_rule = 32; break; // // Rule 33: WildcardBounds ::= super ReferenceType // case 33: bad_rule = 33; break; // // Rule 34: PackageName ::= identifier // case 34: { polyglot.lex.Identifier a = id(btParser.getToken(1)); btParser.setSym1(new Name(nf, ts, pos(), a.getIdentifier())); break; } // // Rule 35: PackageName ::= PackageName DOT identifier // case 35: { Name a = (Name) btParser.getSym(1); polyglot.lex.Identifier b = id(btParser.getToken(3)); btParser.setSym1(new Name(nf, ts, pos(btParser.getFirstToken(), btParser.getLastToken()), a, b.getIdentifier())); break; } // // Rule 36: ExpressionName ::= identifier // case 36: { polyglot.lex.Identifier a = id(btParser.getToken(1)); btParser.setSym1(new Name(nf, ts, pos(), a.getIdentifier())); break; } // // Rule 37: ExpressionName ::= AmbiguousName DOT identifier // case 37: { Name a = (Name) btParser.getSym(1); polyglot.lex.Identifier b = id(btParser.getToken(3)); btParser.setSym1(new Name(nf, ts, pos(btParser.getFirstToken(), btParser.getLastToken()), a, b.getIdentifier())); break; } // // Rule 38: MethodName ::= identifier // case 38: { polyglot.lex.Identifier a = id(btParser.getToken(1)); btParser.setSym1(new Name(nf, ts, pos(), a.getIdentifier())); break; } // // Rule 39: MethodName ::= AmbiguousName DOT identifier // case 39: { Name a = (Name) btParser.getSym(1); polyglot.lex.Identifier b = id(btParser.getToken(3)); btParser.setSym1(new Name(nf, ts, pos(btParser.getFirstToken(), btParser.getLastToken()), a, b.getIdentifier())); break; } // // Rule 40: PackageOrTypeName ::= identifier // case 40: { polyglot.lex.Identifier a = id(btParser.getToken(1)); btParser.setSym1(new Name(nf, ts, pos(), a.getIdentifier())); break; } // // Rule 41: PackageOrTypeName ::= PackageOrTypeName DOT identifier // case 41: { Name a = (Name) btParser.getSym(1); polyglot.lex.Identifier b = id(btParser.getToken(3)); btParser.setSym1(new Name(nf, ts, pos(btParser.getFirstToken(), btParser.getLastToken()), a, b.getIdentifier())); break; } // // Rule 42: AmbiguousName ::= identifier // case 42: { polyglot.lex.Identifier a = id(btParser.getToken(1)); btParser.setSym1(new Name(nf, ts, pos(), a.getIdentifier())); break; } // // Rule 43: AmbiguousName ::= AmbiguousName DOT identifier // case 43: { Name a = (Name) btParser.getSym(1); polyglot.lex.Identifier b = id(btParser.getToken(3)); btParser.setSym1(new Name(nf, ts, pos(btParser.getFirstToken(), btParser.getLastToken()), a, b.getIdentifier())); break; } // // Rule 44: CompilationUnit ::= Commentsopt PackageDeclarationopt ImportDeclarationsopt TypeDeclarationsopt // case 44: { Object comment = btParser.getSym(1); PackageNode a = (PackageNode) btParser.getSym(2); List b = (List) btParser.getSym(3), c = (List) btParser.getSym(4); Node n = nf.SourceFile(pos(btParser.getFirstToken(), btParser.getLastToken()), a, b, c); if (comment != null) { n.setComment(comment.toString()); } btParser.setSym1(n); break; } // // Rule 45: Comments ::= Comment // case 45: { Object comment = comment(btParser.getToken(1)); btParser.setSym1(comment); break; } // // Rule 46: Comments ::= Comments Comment // case 46: { btParser.setSym1(btParser.getSym(2)); break; } // // Rule 47: ImportDeclarations ::= ImportDeclaration // case 47: { List l = new TypedList(new LinkedList(), Import.class, false); Import a = (Import) btParser.getSym(1); l.add(a); btParser.setSym1(l); break; } // // Rule 48: ImportDeclarations ::= ImportDeclarations ImportDeclaration // case 48: { List l = (TypedList) btParser.getSym(1); Import b = (Import) btParser.getSym(2); if (b != null) l.add(b); //btParser.setSym1(l); break; } // // Rule 49: TypeDeclarations ::= Commentsopt TypeDeclaration // case 49: { Object comment = btParser.getSym(1); List l = new TypedList(new LinkedList(), TopLevelDecl.class, false); TopLevelDecl a = (TopLevelDecl) btParser.getSym(2); if (a != null) l.add(a); if (comment != null) { a.setComment(comment.toString()); } btParser.setSym1(l); break; } // // Rule 50: TypeDeclarations ::= TypeDeclarations TypeDeclaration // case 50: { List l = (TypedList) btParser.getSym(1); TopLevelDecl b = (TopLevelDecl) btParser.getSym(2); if (b != null) l.add(b); //btParser.setSym1(l); break; } // // Rule 51: PackageDeclaration ::= package PackageName SEMICOLON // case 51: {//vj assert(btParser.getSym(1) == null); // generic not yet supported Name a = (Name) btParser.getSym(2); btParser.setSym1(a.toPackage()); break; } // // Rule 52: ImportDeclaration ::= SingleTypeImportDeclaration // case 52: break; // // Rule 53: ImportDeclaration ::= TypeImportOnDemandDeclaration // case 53: break; // // Rule 54: ImportDeclaration ::= SingleStaticImportDeclaration // case 54: break; // // Rule 55: ImportDeclaration ::= StaticImportOnDemandDeclaration // case 55: break; // // Rule 56: SingleTypeImportDeclaration ::= import TypeName SEMICOLON // case 56: { Name a = (Name) btParser.getSym(2); btParser.setSym1(nf.Import(pos(btParser.getFirstToken(), btParser.getLastToken()), Import.CLASS, a.toString())); break; } // // Rule 57: TypeImportOnDemandDeclaration ::= import PackageOrTypeName DOT MULTIPLY SEMICOLON // case 57: { Name a = (Name) btParser.getSym(2); btParser.setSym1(nf.Import(pos(btParser.getFirstToken(), btParser.getLastToken()), Import.PACKAGE, a.toString())); break; } // // Rule 58: SingleStaticImportDeclaration ::= import static TypeName DOT identifier SEMICOLON // case 58: bad_rule = 58; break; // // Rule 59: StaticImportOnDemandDeclaration ::= import static TypeName DOT MULTIPLY SEMICOLON // case 59: bad_rule = 59; break; // // Rule 60: TypeDeclaration ::= ClassDeclaration // case 60: break; // // Rule 61: TypeDeclaration ::= InterfaceDeclaration // case 61: break; // // Rule 62: TypeDeclaration ::= SEMICOLON // case 62: { btParser.setSym1(null); break; } // // Rule 63: ClassDeclaration ::= NormalClassDeclaration // case 63: break; // // Rule 64: NormalClassDeclaration ::= Commentsopt ClassModifiersopt class identifier Superopt Interfacesopt ClassBody // case 64: { Object comment = btParser.getSym(1); Flags a = (Flags) btParser.getSym(2); polyglot.lex.Identifier b = id(btParser.getToken(4));//vj assert(btParser.getSym(4) == null); TypeNode c = (TypeNode) btParser.getSym(5); // by default extend x10.lang.Object if (c == null) { c= new Name(nf, ts, pos(), "x10.lang.Object").toType(); } List d = (List) btParser.getSym(6); ClassBody e = (ClassBody) btParser.getSym(7); Node n = a.isValue() ? nf.ValueClassDecl(pos(btParser.getFirstToken(), btParser.getLastToken()), a, b.getIdentifier(), c, d, e) : nf.ClassDecl(pos(btParser.getFirstToken(), btParser.getLastToken()), a, b.getIdentifier(), c, d, e); if (comment != null) n.setComment(comment.toString()); btParser.setSym1(n); break; } // // Rule 65: ClassModifiers ::= ClassModifier // case 65: break; // // Rule 66: ClassModifiers ::= ClassModifiers ClassModifier // case 66: { Flags a = (Flags) btParser.getSym(1), b = (Flags) btParser.getSym(2); btParser.setSym1(a.set(b)); break; } // // Rule 67: ClassModifier ::= public // case 67: { btParser.setSym1(Flags.PUBLIC); break; } // // Rule 68: ClassModifier ::= protected // case 68: { btParser.setSym1(Flags.PROTECTED); break; } // // Rule 69: ClassModifier ::= private // case 69: { btParser.setSym1(Flags.PRIVATE); break; } // // Rule 70: ClassModifier ::= abstract // case 70: { btParser.setSym1(Flags.ABSTRACT); break; } // // Rule 71: ClassModifier ::= static // case 71: { btParser.setSym1(Flags.STATIC); break; } // // Rule 72: ClassModifier ::= final // case 72: { btParser.setSym1(Flags.FINAL); break; } // // Rule 73: ClassModifier ::= strictfp // case 73: { btParser.setSym1(Flags.STRICTFP); break; } // // Rule 74: TypeParameters ::= LESS TypeParameterList GREATER // case 74: bad_rule = 74; break; // // Rule 75: TypeParameterList ::= TypeParameter // case 75: bad_rule = 75; break; // // Rule 76: TypeParameterList ::= TypeParameterList COMMA TypeParameter // case 76: bad_rule = 76; break; // // Rule 77: Super ::= extends ClassType // case 77: { btParser.setSym1(btParser.getSym(2)); break; } // // Rule 78: Interfaces ::= implements InterfaceTypeList // case 78: { btParser.setSym1(btParser.getSym(2)); break; } // // Rule 79: InterfaceTypeList ::= InterfaceType // case 79: { List l = new TypedList(new LinkedList(), TypeNode.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 80: InterfaceTypeList ::= InterfaceTypeList COMMA InterfaceType // case 80: { List l = (TypedList) btParser.getSym(1); l.add(btParser.getSym(2)); btParser.setSym1(l); break; } // // Rule 81: ClassBody ::= LBRACE ClassBodyDeclarationsopt RBRACE // case 81: { btParser.setSym1(nf.ClassBody(pos(btParser.getFirstToken(), btParser.getLastToken()), (List) btParser.getSym(2))); break; } // // Rule 82: ClassBodyDeclarations ::= ClassBodyDeclaration // case 82: break; // // Rule 83: ClassBodyDeclarations ::= ClassBodyDeclarations ClassBodyDeclaration // case 83: { List a = (List) btParser.getSym(1), b = (List) btParser.getSym(2); a.addAll(b); // btParser.setSym1(a); break; } // // Rule 84: ClassBodyDeclaration ::= ClassMemberDeclaration // case 84: break; // // Rule 85: ClassBodyDeclaration ::= InstanceInitializer // case 85: { List l = new TypedList(new LinkedList(), ClassMember.class, false); Block a = (Block) btParser.getSym(1); l.add(nf.Initializer(pos(), Flags.NONE, a)); btParser.setSym1(l); break; } // // Rule 86: ClassBodyDeclaration ::= StaticInitializer // case 86: { List l = new TypedList(new LinkedList(), ClassMember.class, false); Block a = (Block) btParser.getSym(1); l.add(nf.Initializer(pos(), Flags.STATIC, a)); btParser.setSym1(l); break; } // // Rule 87: ClassBodyDeclaration ::= ConstructorDeclaration // case 87: { List l = new TypedList(new LinkedList(), ClassMember.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 88: ClassMemberDeclaration ::= FieldDeclaration // case 88: break; // // Rule 89: ClassMemberDeclaration ::= MethodDeclaration // case 89: { List l = new TypedList(new LinkedList(), ClassMember.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 90: ClassMemberDeclaration ::= ClassDeclaration // case 90: { List l = new TypedList(new LinkedList(), ClassMember.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 91: ClassMemberDeclaration ::= InterfaceDeclaration // case 91: { List l = new TypedList(new LinkedList(), ClassMember.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 92: ClassMemberDeclaration ::= SEMICOLON // case 92: { List l = new TypedList(new LinkedList(), ClassMember.class, false); btParser.setSym1(l); break; } // // Rule 93: FieldDeclaration ::= Commentsopt FieldModifiersopt Type VariableDeclarators SEMICOLON // case 93: { Object comment = btParser.getSym(1); List l = new TypedList(new LinkedList(), ClassMember.class, false); Flags a = (Flags) btParser.getSym(2); TypeNode b = (TypeNode) btParser.getSym(3); List c = (List) btParser.getSym(4); for (Iterator i = c.iterator(); i.hasNext();) { VarDeclarator d = (VarDeclarator) i.next(); l.add(nf.FieldDecl(pos(btParser.getFirstToken(2), btParser.getLastToken()), a, array(b, pos(btParser.getFirstToken(2), btParser.getLastToken(2)), d.dims), d.name, d.init)); } if (comment != null) ((Node) l.get(0)).setComment(comment.toString()); btParser.setSym1(l); break; } // // Rule 94: VariableDeclarators ::= VariableDeclarator // case 94: { List l = new TypedList(new LinkedList(), VarDeclarator.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 95: VariableDeclarators ::= VariableDeclarators COMMA VariableDeclarator // case 95: { List l = (List) btParser.getSym(1); l.add(btParser.getSym(3)); // btParser.setSym1(l); break; } // // Rule 96: VariableDeclarator ::= VariableDeclaratorId // case 96: break; // // Rule 97: VariableDeclarator ::= VariableDeclaratorId EQUAL VariableInitializer // case 97: { VarDeclarator a = (VarDeclarator) btParser.getSym(1); Expr b = (Expr) btParser.getSym(3); a.init = b; // btParser.setSym1(a); break; } // // Rule 98: VariableDeclaratorId ::= identifier // case 98: { polyglot.lex.Identifier a = id(btParser.getToken(1)); btParser.setSym1(new VarDeclarator(pos(), a.getIdentifier())); break; } // // Rule 99: VariableDeclaratorId ::= VariableDeclaratorId LBRACKET RBRACKET // case 99: { VarDeclarator a = (VarDeclarator) btParser.getSym(1); a.dims++; // btParser.setSym1(a); break; } // // Rule 100: VariableInitializer ::= Expression // case 100: break; // // Rule 101: VariableInitializer ::= ArrayInitializer // case 101: break; // // Rule 102: FieldModifiers ::= FieldModifier // case 102: break; // // Rule 103: FieldModifiers ::= FieldModifiers FieldModifier // case 103: { Flags a = (Flags) btParser.getSym(1), b = (Flags) btParser.getSym(2); btParser.setSym1(a.set(b)); break; } // // Rule 104: FieldModifier ::= public // case 104: { btParser.setSym1(Flags.PUBLIC); break; } // // Rule 105: FieldModifier ::= protected // case 105: { btParser.setSym1(Flags.PROTECTED); break; } // // Rule 106: FieldModifier ::= private // case 106: { btParser.setSym1(Flags.PRIVATE); break; } // // Rule 107: FieldModifier ::= static // case 107: { btParser.setSym1(Flags.STATIC); break; } // // Rule 108: FieldModifier ::= final // case 108: { btParser.setSym1(Flags.FINAL); break; } // // Rule 109: FieldModifier ::= transient // case 109: { btParser.setSym1(Flags.TRANSIENT); break; } // // Rule 110: FieldModifier ::= volatile // case 110: { btParser.setSym1(Flags.VOLATILE); break; } // // Rule 111: MethodDeclaration ::= Commentsopt MethodHeader MethodBody // case 111: { Object comment = btParser.getSym(1); MethodDecl a = (MethodDecl) btParser.getSym(2); Block b = (Block) btParser.getSym(3); if (comment != null) a.setComment(comment.toString()); btParser.setSym1(a.body(b)); break; } // // Rule 112: MethodHeader ::= MethodModifiersopt ResultType MethodDeclarator Throwsopt // case 112: { Flags a = (Flags) btParser.getSym(1);//vj assert(btParser.getSym(2) == null); TypeNode b = (TypeNode) btParser.getSym(2); Object[] o = (Object []) btParser.getSym(3); Name c = (Name) o[0]; List d = (List) o[1]; Integer e = (Integer) o[2]; List f = (List) btParser.getSym(4); if (b.type() == ts.Void() && e.intValue() > 0) { // TODO: error!!! } btParser.setSym1(nf.MethodDecl(pos(btParser.getFirstToken(2), btParser.getLastToken(3)), a, array((TypeNode) b, pos(btParser.getFirstToken(2), btParser.getLastToken(2)), e.intValue()), c.toString(), d, f, null)); break; } // // Rule 113: ResultType ::= Type // case 113: break; // // Rule 114: ResultType ::= void // case 114: { btParser.setSym1(nf.CanonicalTypeNode(pos(), ts.Void())); break; } // // Rule 115: MethodDeclarator ::= identifier LPAREN FormalParameterListopt RPAREN // case 115: { Object[] a = new Object[3]; a[0] = new Name(nf, ts, pos(), id(btParser.getToken(1)).getIdentifier()); a[1] = btParser.getSym(3); a[2] = new Integer(0); btParser.setSym1(a); break; } // // Rule 116: MethodDeclarator ::= MethodDeclarator LBRACKET RBRACKET // case 116: { Object[] a = (Object []) btParser.getSym(1); a[2] = new Integer(((Integer) a[2]).intValue() + 1); // btParser.setSym1(a); break; } // // Rule 117: FormalParameterList ::= LastFormalParameter // case 117: { List l = new TypedList(new LinkedList(), Formal.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 118: FormalParameterList ::= FormalParameters COMMA LastFormalParameter // case 118: { List l = (List) btParser.getSym(1); l.add(btParser.getSym(3)); // btParser.setSym1(l); break; } // // Rule 119: FormalParameters ::= FormalParameter // case 119: { List l = new TypedList(new LinkedList(), Formal.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 120: FormalParameters ::= FormalParameters COMMA FormalParameter // case 120: { List l = (List) btParser.getSym(1); l.add(btParser.getSym(3)); // btParser.setSym1(l); break; } // // Rule 121: FormalParameter ::= VariableModifiersopt Type VariableDeclaratorId // case 121: { Flags f = (Flags) btParser.getSym(1); TypeNode a = (TypeNode) btParser.getSym(2); VarDeclarator b = (VarDeclarator) btParser.getSym(3); btParser.setSym1(nf.Formal(pos(), f, array(a, pos(btParser.getFirstToken(2), btParser.getLastToken(2)), b.dims), b.name)); break; } // // Rule 123: VariableModifiers ::= VariableModifiers VariableModifier // case 123: { Flags a = (Flags) btParser.getSym(1), b = (Flags) btParser.getSym(2); btParser.setSym1(a.set(b)); break; } // // Rule 124: VariableModifier ::= final // case 124: { btParser.setSym1(Flags.FINAL); break; } // // Rule 125: LastFormalParameter ::= VariableModifiersopt Type ...opt VariableDeclaratorId // case 125: { Flags f = (Flags) btParser.getSym(1); TypeNode a = (TypeNode) btParser.getSym(2); assert(btParser.getSym(3) == null); VarDeclarator b = (VarDeclarator) btParser.getSym(4); btParser.setSym1(nf.Formal(pos(), f, array(a, pos(btParser.getFirstToken(2), btParser.getLastToken(2)), b.dims), b.name)); break; } // // Rule 126: MethodModifiers ::= MethodModifier // case 126: break; // // Rule 127: MethodModifiers ::= MethodModifiers MethodModifier // case 127: { Flags a = (Flags) btParser.getSym(1), b = (Flags) btParser.getSym(2); btParser.setSym1(a.set(b)); break; } // // Rule 128: MethodModifier ::= public // case 128: { btParser.setSym1(Flags.PUBLIC); break; } // // Rule 129: MethodModifier ::= protected // case 129: { btParser.setSym1(Flags.PROTECTED); break; } // // Rule 130: MethodModifier ::= private // case 130: { btParser.setSym1(Flags.PRIVATE); break; } // // Rule 131: MethodModifier ::= abstract // case 131: { btParser.setSym1(Flags.ABSTRACT); break; } // // Rule 132: MethodModifier ::= static // case 132: { btParser.setSym1(Flags.STATIC); break; } // // Rule 133: MethodModifier ::= final // case 133: { btParser.setSym1(Flags.FINAL); break; } // // Rule 134: MethodModifier ::= synchronized // case 134: { btParser.setSym1(Flags.SYNCHRONIZED); break; } // // Rule 135: MethodModifier ::= native // case 135: { btParser.setSym1(Flags.NATIVE); break; } // // Rule 136: MethodModifier ::= strictfp // case 136: { btParser.setSym1(Flags.STRICTFP); break; } // // Rule 137: Throws ::= throws ExceptionTypeList // case 137: { btParser.setSym1(btParser.getSym(2)); break; } // // Rule 138: ExceptionTypeList ::= ExceptionType // case 138: { List l = new TypedList(new LinkedList(), TypeNode.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 139: ExceptionTypeList ::= ExceptionTypeList COMMA ExceptionType // case 139: { List l = (List) btParser.getSym(1); l.add(btParser.getSym(3)); // btParser.setSym1(l); break; } // // Rule 140: ExceptionType ::= ClassType // case 140: break; // // Rule 141: ExceptionType ::= TypeVariable // case 141: break; // // Rule 142: MethodBody ::= Block // case 142: break; // // Rule 143: MethodBody ::= SEMICOLON // case 143: btParser.setSym1(null); break; // // Rule 144: InstanceInitializer ::= Block // case 144: break; // // Rule 145: StaticInitializer ::= static Block // case 145: { btParser.setSym1(btParser.getSym(2)); break; } // // Rule 146: ConstructorDeclaration ::= ConstructorModifiersopt ConstructorDeclarator Throwsopt ConstructorBody // case 146: { Flags m = (Flags) btParser.getSym(1); Object[] o = (Object []) btParser.getSym(2); Name a = (Name) o[1]; List b = (List) o[2]; List c = (List) btParser.getSym(3); Block d = (Block) btParser.getSym(4); btParser.setSym1(nf.ConstructorDecl(pos(), m, a.toString(), b, c, d)); break; } // // Rule 147: ConstructorDeclarator ::= SimpleTypeName LPAREN FormalParameterListopt RPAREN // case 147: {//vj assert(btParser.getSym(1) == null); Object[] a = new Object[3];//vj a[0] = btParser.getSym(1); a[1] = btParser.getSym(1); a[2] = btParser.getSym(3); btParser.setSym1(a); break; } // // Rule 148: SimpleTypeName ::= identifier // case 148: { polyglot.lex.Identifier a = id(btParser.getToken(1)); btParser.setSym1(new Name(nf, ts, pos(), a.getIdentifier())); break; } // // Rule 149: ConstructorModifiers ::= ConstructorModifier // case 149: break; // // Rule 150: ConstructorModifiers ::= ConstructorModifiers ConstructorModifier // case 150: { Flags a = (Flags) btParser.getSym(1), b = (Flags) btParser.getSym(2); btParser.setSym1(a.set(b)); break; } // // Rule 151: ConstructorModifier ::= public // case 151: { btParser.setSym1(Flags.PUBLIC); break; } // // Rule 152: ConstructorModifier ::= protected // case 152: { btParser.setSym1(Flags.PROTECTED); break; } // // Rule 153: ConstructorModifier ::= private // case 153: { btParser.setSym1(Flags.PRIVATE); break; } // // Rule 154: ConstructorBody ::= LBRACE ExplicitConstructorInvocationopt BlockStatementsopt RBRACE // case 154: { Stmt a = (Stmt) btParser.getSym(2); List l; if (a == null) l = (List) btParser.getSym(3); else { l = new TypedList(new LinkedList(), Stmt.class, false); List l2 = (List) btParser.getSym(3); l.add(a); l.addAll(l2); } btParser.setSym1(nf.Block(pos(), l)); break; } // // Rule 155: ExplicitConstructorInvocation ::= this LPAREN ArgumentListopt RPAREN SEMICOLON // case 155: {//vj assert(btParser.getSym(1) == null); List b = (List) btParser.getSym(3); btParser.setSym1(nf.ThisCall(pos(), b)); break; } // // Rule 156: ExplicitConstructorInvocation ::= super LPAREN ArgumentListopt RPAREN SEMICOLON // case 156: {//vj assert(btParser.getSym(1) == null); List b = (List) btParser.getSym(3); btParser.setSym1(nf.SuperCall(pos(), b)); break; } // // Rule 157: ExplicitConstructorInvocation ::= Primary DOT this LPAREN ArgumentListopt RPAREN SEMICOLON // case 157: { Expr a = (Expr) btParser.getSym(1);//vj assert(btParser.getSym(2) == null); List b = (List) btParser.getSym(5); btParser.setSym1(nf.ThisCall(pos(), a, b)); break; } // // Rule 158: ExplicitConstructorInvocation ::= Primary DOT super LPAREN ArgumentListopt RPAREN SEMICOLON // case 158: { Expr a = (Expr) btParser.getSym(1);//vj assert(btParser.getSym(2) == null); List b = (List) btParser.getSym(5); btParser.setSym1(nf.SuperCall(pos(), a, b)); break; } // // Rule 159: EnumDeclaration ::= ClassModifiersopt enum identifier Interfacesopt EnumBody // case 159: bad_rule = 159; break; // // Rule 160: EnumBody ::= LBRACE EnumConstantsopt ,opt EnumBodyDeclarationsopt RBRACE // case 160: bad_rule = 160; break; // // Rule 161: EnumConstants ::= EnumConstant // case 161: bad_rule = 161; break; // // Rule 162: EnumConstants ::= EnumConstants COMMA EnumConstant // case 162: bad_rule = 162; break; // // Rule 163: EnumConstant ::= identifier Argumentsopt ClassBodyopt // case 163: bad_rule = 163; break; // // Rule 164: Arguments ::= LPAREN ArgumentListopt RPAREN // case 164: { btParser.setSym1(btParser.getSym(2)); break; } // // Rule 165: EnumBodyDeclarations ::= SEMICOLON ClassBodyDeclarationsopt // case 165: bad_rule = 165; break; // // Rule 166: InterfaceDeclaration ::= NormalInterfaceDeclaration // case 166: break; // // Rule 167: NormalInterfaceDeclaration ::= Commentsopt InterfaceModifiersopt interface identifier ExtendsInterfacesopt InterfaceBody // case 167: { Object comment = btParser.getSym(1); Flags a = (Flags) btParser.getSym(2); polyglot.lex.Identifier b = id(btParser.getToken(4));//vj assert(btParser.getSym(4) == null); List c = (List) btParser.getSym(5); ClassBody d = (ClassBody) btParser.getSym(6); Node n = nf.ClassDecl(pos(), a.Interface(), b.getIdentifier(), null, c, d); if (comment != null) n.setComment( comment.toString() ); btParser.setSym1(n); break; } // // Rule 168: InterfaceModifiers ::= InterfaceModifier // case 168: break; // // Rule 169: InterfaceModifiers ::= InterfaceModifiers InterfaceModifier // case 169: { Flags a = (Flags) btParser.getSym(1), b = (Flags) btParser.getSym(2); btParser.setSym1(a.set(b)); break; } // // Rule 170: InterfaceModifier ::= public // case 170: { btParser.setSym1(Flags.PUBLIC); break; } // // Rule 171: InterfaceModifier ::= protected // case 171: { btParser.setSym1(Flags.PROTECTED); break; } // // Rule 172: InterfaceModifier ::= private // case 172: { btParser.setSym1(Flags.PRIVATE); break; } // // Rule 173: InterfaceModifier ::= abstract // case 173: { btParser.setSym1(Flags.ABSTRACT); break; } // // Rule 174: InterfaceModifier ::= static // case 174: { btParser.setSym1(Flags.STATIC); break; } // // Rule 175: InterfaceModifier ::= strictfp // case 175: { btParser.setSym1(Flags.STRICTFP); break; } // // Rule 176: ExtendsInterfaces ::= extends InterfaceType // case 176: { List l = new TypedList(new LinkedList(), TypeNode.class, false); l.add(btParser.getSym(2)); btParser.setSym1(l); break; } // // Rule 177: ExtendsInterfaces ::= ExtendsInterfaces COMMA InterfaceType // case 177: { List l = (List) btParser.getSym(1); l.add(btParser.getSym(3)); // btParser.setSym1(l); break; } // // Rule 178: InterfaceBody ::= LBRACE InterfaceMemberDeclarationsopt RBRACE // case 178: { List a = (List)btParser.getSym(2); btParser.setSym1(nf.ClassBody(pos(), a)); break; } // // Rule 179: InterfaceMemberDeclarations ::= InterfaceMemberDeclaration // case 179: break; // // Rule 180: InterfaceMemberDeclarations ::= InterfaceMemberDeclarations InterfaceMemberDeclaration // case 180: { List l = (List) btParser.getSym(1), l2 = (List) btParser.getSym(2); l.addAll(l2); // btParser.setSym1(l); break; } // // Rule 181: InterfaceMemberDeclaration ::= ConstantDeclaration // case 181: break; // // Rule 182: InterfaceMemberDeclaration ::= AbstractMethodDeclaration // case 182: { List l = new TypedList(new LinkedList(), ClassMember.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 183: InterfaceMemberDeclaration ::= ClassDeclaration // case 183: { List l = new TypedList(new LinkedList(), ClassMember.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 184: InterfaceMemberDeclaration ::= InterfaceDeclaration // case 184: { List l = new TypedList(new LinkedList(), ClassMember.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 185: InterfaceMemberDeclaration ::= SEMICOLON // case 185: { btParser.setSym1(Collections.EMPTY_LIST); break; } // // Rule 186: ConstantDeclaration ::= ConstantModifiersopt Type VariableDeclarators // case 186: { List l = new TypedList(new LinkedList(), ClassMember.class, false); Flags a = (Flags) btParser.getSym(1); TypeNode b = (TypeNode) btParser.getSym(2); List c = (List) btParser.getSym(3); for (Iterator i = c.iterator(); i.hasNext();) { VarDeclarator d = (VarDeclarator) i.next(); l.add(nf.FieldDecl(pos(btParser.getFirstToken(2), btParser.getLastToken()), a, array(b, pos(btParser.getFirstToken(2), btParser.getLastToken(2)), d.dims), d.name, d.init)); } btParser.setSym1(l); break; } // // Rule 187: ConstantModifiers ::= ConstantModifier // case 187: break; // // Rule 188: ConstantModifiers ::= ConstantModifiers ConstantModifier // case 188: { Flags a = (Flags) btParser.getSym(1), b = (Flags) btParser.getSym(2); btParser.setSym1(a.set(b)); break; } // // Rule 189: ConstantModifier ::= public // case 189: { btParser.setSym1(Flags.PUBLIC); break; } // // Rule 190: ConstantModifier ::= static // case 190: { btParser.setSym1(Flags.STATIC); break; } // // Rule 191: ConstantModifier ::= final // case 191: { btParser.setSym1(Flags.FINAL); break; } // // Rule 192: AbstractMethodDeclaration ::= AbstractMethodModifiersopt ResultType MethodDeclarator Throwsopt SEMICOLON // case 192: { Flags a = (Flags) btParser.getSym(1);//vj assert(btParser.getSym(2) == null); TypeNode b = (TypeNode) btParser.getSym(2); Object[] o = (Object []) btParser.getSym(3); Name c = (Name) o[0]; List d = (List) o[1]; Integer e = (Integer) o[2]; List f = (List) btParser.getSym(4); if (b.type() == ts.Void() && e.intValue() > 0) { // TODO: error!!! } btParser.setSym1(nf.MethodDecl(pos(btParser.getFirstToken(2), btParser.getLastToken(3)), a, array((TypeNode) b, pos(btParser.getFirstToken(2), btParser.getLastToken(2)), e.intValue()), c.toString(), d, f, null)); break; } // // Rule 193: AbstractMethodModifiers ::= AbstractMethodModifier // case 193: break; // // Rule 194: AbstractMethodModifiers ::= AbstractMethodModifiers AbstractMethodModifier // case 194: { Flags a = (Flags) btParser.getSym(1), b = (Flags) btParser.getSym(2); btParser.setSym1(a.set(b)); break; } // // Rule 195: AbstractMethodModifier ::= public // case 195: { btParser.setSym1(Flags.PUBLIC); break; } // // Rule 196: AbstractMethodModifier ::= abstract // case 196: { btParser.setSym1(Flags.ABSTRACT); break; } // // Rule 197: AnnotationTypeDeclaration ::= InterfaceModifiersopt AT interface identifier AnnotationTypeBody // case 197: bad_rule = 197; break; // // Rule 198: AnnotationTypeBody ::= LBRACE AnnotationTypeElementDeclarationsopt RBRACE // case 198: bad_rule = 198; break; // // Rule 199: AnnotationTypeElementDeclarations ::= AnnotationTypeElementDeclaration // case 199: bad_rule = 199; break; // // Rule 200: AnnotationTypeElementDeclarations ::= AnnotationTypeElementDeclarations AnnotationTypeElementDeclaration // case 200: bad_rule = 200; break; // // Rule 201: AnnotationTypeElementDeclaration ::= AbstractMethodModifiersopt Type identifier LPAREN RPAREN DefaultValueopt SEMICOLON // case 201: bad_rule = 201; break; // // Rule 202: AnnotationTypeElementDeclaration ::= ConstantDeclaration // case 202: bad_rule = 202; break; // // Rule 203: AnnotationTypeElementDeclaration ::= ClassDeclaration // case 203: bad_rule = 203; break; // // Rule 204: AnnotationTypeElementDeclaration ::= InterfaceDeclaration // case 204: bad_rule = 204; break; // // Rule 205: AnnotationTypeElementDeclaration ::= EnumDeclaration // case 205: bad_rule = 205; break; // // Rule 206: AnnotationTypeElementDeclaration ::= AnnotationTypeDeclaration // case 206: bad_rule = 206; break; // // Rule 207: AnnotationTypeElementDeclaration ::= SEMICOLON // case 207: bad_rule = 207; break; // // Rule 208: DefaultValue ::= default ElementValue // case 208: bad_rule = 208; break; // // Rule 209: Annotations ::= Annotation // case 209: bad_rule = 209; break; // // Rule 210: Annotations ::= Annotations Annotation // case 210: bad_rule = 210; break; // // Rule 211: Annotation ::= NormalAnnotation // case 211: bad_rule = 211; break; // // Rule 212: Annotation ::= MarkerAnnotation // case 212: bad_rule = 212; break; // // Rule 213: Annotation ::= SingleElementAnnotation // case 213: bad_rule = 213; break; // // Rule 214: NormalAnnotation ::= AT TypeName LPAREN ElementValuePairsopt RPAREN // case 214: bad_rule = 214; break; // // Rule 215: ElementValuePairs ::= ElementValuePair // case 215: bad_rule = 215; break; // // Rule 216: ElementValuePairs ::= ElementValuePairs COMMA ElementValuePair // case 216: bad_rule = 216; break; // // Rule 217: ElementValuePair ::= SimpleName EQUAL ElementValue // case 217: bad_rule = 217; break; // // Rule 218: SimpleName ::= identifier // case 218: { polyglot.lex.Identifier a = id(btParser.getToken(1)); btParser.setSym1(new Name(nf, ts, pos(), a.getIdentifier())); break; } // // Rule 219: ElementValue ::= ConditionalExpression // case 219: bad_rule = 219; break; // // Rule 220: ElementValue ::= Annotation // case 220: bad_rule = 220; break; // // Rule 221: ElementValue ::= ElementValueArrayInitializer // case 221: bad_rule = 221; break; // // Rule 222: ElementValueArrayInitializer ::= LBRACE ElementValuesopt ,opt RBRACE // case 222: bad_rule = 222; break; // // Rule 223: ElementValues ::= ElementValue // case 223: bad_rule = 223; break; // // Rule 224: ElementValues ::= ElementValues COMMA ElementValue // case 224: bad_rule = 224; break; // // Rule 225: MarkerAnnotation ::= AT TypeName // case 225: bad_rule = 225; break; // // Rule 226: SingleElementAnnotation ::= AT TypeName LPAREN ElementValue RPAREN // case 226: bad_rule = 226; break; // // Rule 227: ArrayInitializer ::= LBRACE VariableInitializersopt ,opt RBRACE // case 227: { List a = (List) btParser.getSym(2); if (a == null) btParser.setSym1(nf.ArrayInit(pos())); else btParser.setSym1(nf.ArrayInit(pos(), a)); break; } // // Rule 228: VariableInitializers ::= VariableInitializer // case 228: { List l = new TypedList(new LinkedList(), Expr.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 229: VariableInitializers ::= VariableInitializers COMMA VariableInitializer // case 229: { List l = (List) btParser.getSym(1); l.add(btParser.getSym(3)); //btParser.setSym1(l); break; } // // Rule 230: Block ::= LBRACE BlockStatementsopt RBRACE // case 230: { List l = (List) btParser.getSym(2); btParser.setSym1(nf.Block(pos(), l)); break; } // // Rule 231: BlockStatements ::= BlockStatement // case 231: { List l = new TypedList(new LinkedList(), Stmt.class, false), l2 = (List) btParser.getSym(1); l.addAll(l2); btParser.setSym1(l); break; } // // Rule 232: BlockStatements ::= BlockStatements BlockStatement // case 232: { List l = (List) btParser.getSym(1), l2 = (List) btParser.getSym(2); l.addAll(l2); //btParser.setSym1(l); break; } // // Rule 233: BlockStatement ::= LocalVariableDeclarationStatement // case 233: break; // // Rule 234: BlockStatement ::= ClassDeclaration // case 234: { ClassDecl a = (ClassDecl) btParser.getSym(1); List l = new TypedList(new LinkedList(), Stmt.class, false); l.add(nf.LocalClassDecl(pos(), a)); btParser.setSym1(l); break; } // // Rule 235: BlockStatement ::= Statement // case 235: { List l = new TypedList(new LinkedList(), Stmt.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 236: LocalVariableDeclarationStatement ::= LocalVariableDeclaration SEMICOLON // case 236: break; // // Rule 237: LocalVariableDeclaration ::= VariableModifiersopt Type VariableDeclarators // case 237: { Flags flags = (Flags) btParser.getSym(1); TypeNode a = (TypeNode) btParser.getSym(2); List b = (List) btParser.getSym(3); List l = new TypedList(new LinkedList(), LocalDecl.class, false); for (Iterator i = b.iterator(); i.hasNext(); ) { VarDeclarator d = (VarDeclarator) i.next(); l.add(nf.LocalDecl(pos(d), flags, array(a, pos(d), d.dims), d.name, d.init)); } btParser.setSym1(l); break; } // // Rule 238: Statement ::= StatementWithoutTrailingSubstatement // case 238: break; // // Rule 239: Statement ::= LabeledStatement // case 239: break; // // Rule 240: Statement ::= IfThenStatement // case 240: break; // // Rule 241: Statement ::= IfThenElseStatement // case 241: break; // // Rule 242: Statement ::= WhileStatement // case 242: break; // // Rule 243: Statement ::= ForStatement // case 243: break; // // Rule 244: StatementWithoutTrailingSubstatement ::= Block // case 244: break; // // Rule 245: StatementWithoutTrailingSubstatement ::= EmptyStatement // case 245: break; // // Rule 246: StatementWithoutTrailingSubstatement ::= ExpressionStatement // case 246: break; // // Rule 247: StatementWithoutTrailingSubstatement ::= AssertStatement // case 247: break; // // Rule 248: StatementWithoutTrailingSubstatement ::= SwitchStatement // case 248: break; // // Rule 249: StatementWithoutTrailingSubstatement ::= DoStatement // case 249: break; // // Rule 250: StatementWithoutTrailingSubstatement ::= BreakStatement // case 250: break; // // Rule 251: StatementWithoutTrailingSubstatement ::= ContinueStatement // case 251: break; // // Rule 252: StatementWithoutTrailingSubstatement ::= ReturnStatement // case 252: break; // // Rule 253: StatementWithoutTrailingSubstatement ::= SynchronizedStatement // case 253: break; // // Rule 254: StatementWithoutTrailingSubstatement ::= ThrowStatement // case 254: break; // // Rule 255: StatementWithoutTrailingSubstatement ::= TryStatement // case 255: break; // // Rule 256: StatementNoShortIf ::= StatementWithoutTrailingSubstatement // case 256: break; // // Rule 257: StatementNoShortIf ::= LabeledStatementNoShortIf // case 257: break; // // Rule 258: StatementNoShortIf ::= IfThenElseStatementNoShortIf // case 258: break; // // Rule 259: StatementNoShortIf ::= WhileStatementNoShortIf // case 259: break; // // Rule 260: StatementNoShortIf ::= ForStatementNoShortIf // case 260: break; // // Rule 261: IfThenStatement ::= if LPAREN Expression RPAREN Statement // case 261: { Expr a = (Expr) btParser.getSym(3); Stmt b = (Stmt) btParser.getSym(5); btParser.setSym1(nf.If(pos(), a, b)); break; } // // Rule 262: IfThenElseStatement ::= if LPAREN Expression RPAREN StatementNoShortIf else Statement // case 262: { Expr a = (Expr) btParser.getSym(3); Stmt b = (Stmt) btParser.getSym(5); Stmt c = (Stmt) btParser.getSym(7); btParser.setSym1(nf.If(pos(), a, b, c)); break; } // // Rule 263: IfThenElseStatementNoShortIf ::= if LPAREN Expression RPAREN StatementNoShortIf else StatementNoShortIf // case 263: { Expr a = (Expr) btParser.getSym(3); Stmt b = (Stmt) btParser.getSym(5); Stmt c = (Stmt) btParser.getSym(7); btParser.setSym1(nf.If(pos(), a, b, c)); break; } // // Rule 264: EmptyStatement ::= SEMICOLON // case 264: { btParser.setSym1(nf.Empty(pos())); break; } // // Rule 265: LabeledStatement ::= identifier COLON Statement // case 265: { polyglot.lex.Identifier a = id(btParser.getToken(1)); Stmt b = (Stmt) btParser.getSym(3); btParser.setSym1(nf.Labeled(pos(), a.getIdentifier(), b)); break; } // // Rule 266: LabeledStatementNoShortIf ::= identifier COLON StatementNoShortIf // case 266: { polyglot.lex.Identifier a = id(btParser.getToken(1)); Stmt b = (Stmt) btParser.getSym(3); btParser.setSym1(nf.Labeled(pos(), a.getIdentifier(), b)); break; } // // Rule 267: ExpressionStatement ::= StatementExpression SEMICOLON // case 267: { Expr a = (Expr) btParser.getSym(1); btParser.setSym1(nf.Eval(pos(), a)); break; } // // Rule 268: StatementExpression ::= Assignment // case 268: break; // // Rule 269: StatementExpression ::= PreIncrementExpression // case 269: break; // // Rule 270: StatementExpression ::= PreDecrementExpression // case 270: break; // // Rule 271: StatementExpression ::= PostIncrementExpression // case 271: break; // // Rule 272: StatementExpression ::= PostDecrementExpression // case 272: break; // // Rule 273: StatementExpression ::= MethodInvocation // case 273: break; // // Rule 274: StatementExpression ::= ClassInstanceCreationExpression // case 274: break; // // Rule 275: AssertStatement ::= assert Expression SEMICOLON // case 275: { Expr a = (Expr) btParser.getSym(2); btParser.setSym1(nf.Assert(pos(), a)); break; } // // Rule 276: AssertStatement ::= assert Expression COLON Expression SEMICOLON // case 276: { Expr a = (Expr) btParser.getSym(2), b = (Expr) btParser.getSym(4); btParser.setSym1(nf.Assert(pos(), a, b)); break; } // // Rule 277: SwitchStatement ::= switch LPAREN Expression RPAREN SwitchBlock // case 277: { Expr a = (Expr) btParser.getSym(3); List b = (List) btParser.getSym(5); btParser.setSym1(nf.Switch(pos(), a, b)); break; } // // Rule 278: SwitchBlock ::= LBRACE SwitchBlockStatementGroupsopt SwitchLabelsopt RBRACE // case 278: { List l = (List) btParser.getSym(2), l2 = (List) btParser.getSym(3); l.addAll(l2); // btParser.setSym1(l); break; } // // Rule 279: SwitchBlockStatementGroups ::= SwitchBlockStatementGroup // case 279: break; // // Rule 280: SwitchBlockStatementGroups ::= SwitchBlockStatementGroups SwitchBlockStatementGroup // case 280: { List l = (List) btParser.getSym(1), l2 = (List) btParser.getSym(2); l.addAll(l2); // btParser.setSym1(l); break; } // // Rule 281: SwitchBlockStatementGroup ::= SwitchLabels BlockStatements // case 281: { List l = new TypedList(new LinkedList(), SwitchElement.class, false); List l1 = (List) btParser.getSym(1), l2 = (List) btParser.getSym(2); l.addAll(l1); l.add(nf.SwitchBlock(pos(), l2)); btParser.setSym1(l); break; } // // Rule 282: SwitchLabels ::= SwitchLabel // case 282: { List l = new TypedList(new LinkedList(), Case.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 283: SwitchLabels ::= SwitchLabels SwitchLabel // case 283: { List l = (List) btParser.getSym(1); l.add(btParser.getSym(2)); //btParser.setSym1(l); break; } // // Rule 284: SwitchLabel ::= case ConstantExpression COLON // case 284: { Expr a = (Expr) btParser.getSym(2); btParser.setSym1(nf.Case(pos(), a)); break; } // // Rule 285: SwitchLabel ::= case EnumConstant COLON // case 285: bad_rule = 285; break; // // Rule 286: SwitchLabel ::= default COLON // case 286: { btParser.setSym1(nf.Default(pos())); break; } // // Rule 287: EnumConstant ::= identifier // case 287: bad_rule = 287; break; // // Rule 288: WhileStatement ::= while LPAREN Expression RPAREN Statement // case 288: { Expr a = (Expr) btParser.getSym(3); Stmt b = (Stmt) btParser.getSym(5); btParser.setSym1(nf.While(pos(), a, b)); break; } // // Rule 289: WhileStatementNoShortIf ::= while LPAREN Expression RPAREN StatementNoShortIf // case 289: { Expr a = (Expr) btParser.getSym(3); Stmt b = (Stmt) btParser.getSym(5); btParser.setSym1(nf.While(pos(), a, b)); break; } // // Rule 290: DoStatement ::= do Statement while LPAREN Expression RPAREN SEMICOLON // case 290: { Stmt a = (Stmt) btParser.getSym(2); Expr b = (Expr) btParser.getSym(5); btParser.setSym1(nf.Do(pos(), a, b)); break; } // // Rule 291: ForStatement ::= BasicForStatement // case 291: break; // // Rule 292: ForStatement ::= EnhancedForStatement // case 292: break; // // Rule 293: BasicForStatement ::= for LPAREN ForInitopt SEMICOLON Expressionopt SEMICOLON ForUpdateopt RPAREN Statement // case 293: { List a = (List) btParser.getSym(3); Expr b = (Expr) btParser.getSym(5); List c = (List) btParser.getSym(7); Stmt d = (Stmt) btParser.getSym(9); btParser.setSym1(nf.For(pos(), a, b, c, d)); break; } // // Rule 294: ForStatementNoShortIf ::= for LPAREN ForInitopt SEMICOLON Expressionopt SEMICOLON ForUpdateopt RPAREN StatementNoShortIf // case 294: { List a = (List) btParser.getSym(3); Expr b = (Expr) btParser.getSym(5); List c = (List) btParser.getSym(7); Stmt d = (Stmt) btParser.getSym(9); btParser.setSym1(nf.For(pos(), a, b, c, d)); break; } // // Rule 295: ForInit ::= StatementExpressionList // case 295: break; // // Rule 296: ForInit ::= LocalVariableDeclaration // case 296: { List l = new TypedList(new LinkedList(), ForInit.class, false), l2 = (List) btParser.getSym(1); l.addAll(l2); //btParser.setSym1(l); break; } // // Rule 297: ForUpdate ::= StatementExpressionList // case 297: break; // // Rule 298: StatementExpressionList ::= StatementExpression // case 298: { List l = new TypedList(new LinkedList(), Eval.class, false); Expr a = (Expr) btParser.getSym(1); l.add(nf.Eval(pos(), a)); btParser.setSym1(l); break; } // // Rule 299: StatementExpressionList ::= StatementExpressionList COMMA StatementExpression // case 299: { List l = (List) btParser.getSym(1); Expr a = (Expr) btParser.getSym(3); l.add(nf.Eval(pos(), a)); //btParser.setSym1(l); break; } // // Rule 300: BreakStatement ::= break identifieropt SEMICOLON // case 300: { Name a = (Name) btParser.getSym(2); if (a == null) btParser.setSym1(nf.Break(pos())); else btParser.setSym1(nf.Break(pos(), a.toString())); break; } // // Rule 301: ContinueStatement ::= continue identifieropt SEMICOLON // case 301: { Name a = (Name) btParser.getSym(2); if (a == null) btParser.setSym1(nf.Continue(pos())); else btParser.setSym1(nf.Continue(pos(), a.toString())); break; } // // Rule 302: ReturnStatement ::= return Expressionopt SEMICOLON // case 302: { Expr a = (Expr) btParser.getSym(2); btParser.setSym1(nf.Return(pos(), a)); break; } // // Rule 303: ThrowStatement ::= throw Expression SEMICOLON // case 303: { Expr a = (Expr) btParser.getSym(2); btParser.setSym1(nf.Throw(pos(), a)); break; } // // Rule 304: SynchronizedStatement ::= synchronized LPAREN Expression RPAREN Block // case 304: { Expr a = (Expr) btParser.getSym(3); Block b = (Block) btParser.getSym(5); btParser.setSym1(nf.Synchronized(pos(), a, b)); break; } // // Rule 305: TryStatement ::= try Block Catches // case 305: { Block a = (Block) btParser.getSym(2); List b = (List) btParser.getSym(3); btParser.setSym1(nf.Try(pos(), a, b)); break; } // // Rule 306: TryStatement ::= try Block Catchesopt Finally // case 306: { Block a = (Block) btParser.getSym(2); List b = (List) btParser.getSym(3); Block c = (Block) btParser.getSym(4); btParser.setSym1(nf.Try(pos(), a, b, c)); break; } // // Rule 307: Catches ::= CatchClause // case 307: { List l = new TypedList(new LinkedList(), Catch.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 308: Catches ::= Catches CatchClause // case 308: { List l = (List) btParser.getSym(1); l.add(btParser.getSym(2)); //btParser.setSym1(l); break; } // // Rule 309: CatchClause ::= catch LPAREN FormalParameter RPAREN Block // case 309: { Formal a = (Formal) btParser.getSym(3); Block b = (Block) btParser.getSym(5); btParser.setSym1(nf.Catch(pos(), a, b)); break; } // // Rule 310: Finally ::= finally Block // case 310: { btParser.setSym1(btParser.getSym(2)); break; } // // Rule 311: Primary ::= PrimaryNoNewArray // case 311: break; // // Rule 312: Primary ::= ArrayCreationExpression // case 312: break; // // Rule 313: PrimaryNoNewArray ::= Literal // case 313: break; // // Rule 314: PrimaryNoNewArray ::= Type DOT class // case 314: { Object o = btParser.getSym(1); if (o instanceof Name) { Name a = (Name) o; btParser.setSym1(nf.ClassLit(pos(), a.toType())); } else if (o instanceof TypeNode) { TypeNode a = (TypeNode) o; btParser.setSym1(nf.ClassLit(pos(), a)); } else if (o instanceof CanonicalTypeNode) { CanonicalTypeNode a = (CanonicalTypeNode) o; btParser.setSym1(nf.ClassLit(pos(), a)); } else assert(false); break; } // // Rule 315: PrimaryNoNewArray ::= void DOT class // case 315: { btParser.setSym1(nf.ClassLit(pos(), nf.CanonicalTypeNode(pos(btParser.getToken(1)), ts.Void()))); break; } // // Rule 316: PrimaryNoNewArray ::= this // case 316: { btParser.setSym1(nf.This(pos())); break; } // // Rule 317: PrimaryNoNewArray ::= ClassName DOT this // case 317: { Name a = (Name) btParser.getSym(1); btParser.setSym1(nf.This(pos(), a.toType())); break; } // // Rule 318: PrimaryNoNewArray ::= LPAREN Expression RPAREN // case 318: { btParser.setSym1(btParser.getSym(2)); break; } // // Rule 319: PrimaryNoNewArray ::= ClassInstanceCreationExpression // case 319: break; // // Rule 320: PrimaryNoNewArray ::= FieldAccess // case 320: break; // // Rule 321: PrimaryNoNewArray ::= MethodInvocation // case 321: break; // // Rule 322: PrimaryNoNewArray ::= ArrayAccess // case 322: break; // // Rule 323: Literal ::= IntegerLiteral // case 323: { // TODO: remove any prefix (such as 0x) polyglot.lex.IntegerLiteral a = int_lit(btParser.getToken(1), 10); btParser.setSym1(nf.IntLit(pos(), IntLit.INT, a.getValue().intValue())); break; } // // Rule 324: Literal ::= LongLiteral // case 324: { // TODO: remove any suffix (such as L) or prefix (such as 0x) polyglot.lex.LongLiteral a = long_lit(btParser.getToken(1), 10); btParser.setSym1(nf.IntLit(pos(), IntLit.LONG, a.getValue().longValue())); break; } // // Rule 325: Literal ::= FloatingPointLiteral // case 325: { // TODO: remove any suffix (such as F) polyglot.lex.FloatLiteral a = float_lit(btParser.getToken(1)); btParser.setSym1(nf.FloatLit(pos(), FloatLit.FLOAT, a.getValue().floatValue())); break; } // // Rule 326: Literal ::= DoubleLiteral // case 326: { // TODO: remove any suffix (such as D) polyglot.lex.DoubleLiteral a = double_lit(btParser.getToken(1)); btParser.setSym1(nf.FloatLit(pos(), FloatLit.DOUBLE, a.getValue().doubleValue())); break; } // // Rule 327: Literal ::= BooleanLiteral // case 327: { polyglot.lex.BooleanLiteral a = boolean_lit(btParser.getToken(1)); btParser.setSym1(nf.BooleanLit(pos(), a.getValue().booleanValue())); break; } // // Rule 328: Literal ::= CharacterLiteral // case 328: { polyglot.lex.CharacterLiteral a = char_lit(btParser.getToken(1)); btParser.setSym1(nf.CharLit(pos(), a.getValue().charValue())); break; } // // Rule 329: Literal ::= StringLiteral // case 329: { String s = prsStream.getName(btParser.getToken(1)); btParser.setSym1(nf.StringLit(pos(), s.substring(1, s.length() - 2))); break; } // // Rule 330: Literal ::= null // case 330: { btParser.setSym1(nf.NullLit(pos())); break; } // // Rule 331: BooleanLiteral ::= true // case 331: break; // // Rule 332: BooleanLiteral ::= false // case 332: break; // // Rule 333: ClassInstanceCreationExpression ::= new ClassOrInterfaceType LPAREN ArgumentListopt RPAREN ClassBodyopt // case 333: {//vj assert(btParser.getSym(2) == null); TypeNode a = (TypeNode) btParser.getSym(2);//vj assert(btParser.getSym(4) == null); List b = (List) btParser.getSym(4); ClassBody c = (ClassBody) btParser.getSym(6); if (c == null) btParser.setSym1(nf.New(pos(), a, b)); else btParser.setSym1(nf.New(pos(), a, b, c)); break; } // // Rule 334: ClassInstanceCreationExpression ::= Primary DOT new identifier LPAREN ArgumentListopt RPAREN ClassBodyopt // case 334: { Expr a = (Expr) btParser.getSym(1);//vj assert(btParser.getSym(2) == null); Name b = new Name(nf, ts, pos(), id(btParser.getToken(4)).getIdentifier());//vj assert(btParser.getSym(4) == null); List c = (List) btParser.getSym(6); ClassBody d = (ClassBody) btParser.getSym(8); if (d == null) btParser.setSym1(nf.New(pos(), a, b.toType(), c)); else btParser.setSym1(nf.New(pos(), a, b.toType(), c, d)); break; } // // Rule 335: ClassInstanceCreationExpression ::= AmbiguousName DOT new identifier LPAREN ArgumentListopt RPAREN ClassBodyopt // case 335: { Name a = (Name) btParser.getSym(1);//vj assert(btParser.getSym(4) == null); Name b = new Name(nf, ts, pos(), id(btParser.getToken(4)).getIdentifier());//vj assert(btParser.getSym(6) == null); List c = (List) btParser.getSym(6); ClassBody d = (ClassBody) btParser.getSym(8); if (d == null) btParser.setSym1(nf.New(pos(), a.toExpr(), b.toType(), c)); else btParser.setSym1(nf.New(pos(), a.toExpr(), b.toType(), c, d)); break; } // // Rule 336: ArgumentList ::= Expression // case 336: { List l = new TypedList(new LinkedList(), Expr.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 337: ArgumentList ::= ArgumentList COMMA Expression // case 337: { List l = (List) btParser.getSym(1); l.add(btParser.getSym(3)); //btParser.setSym1(l); break; } // // Rule 338: DimExprs ::= DimExpr // case 338: { List l = new TypedList(new LinkedList(), Expr.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 339: DimExprs ::= DimExprs DimExpr // case 339: { List l = (List) btParser.getSym(1); l.add(btParser.getSym(2)); //btParser.setSym1(l); break; } // // Rule 340: DimExpr ::= LBRACKET Expression RBRACKET // case 340: { Expr a = (Expr) btParser.getSym(2); btParser.setSym1(a.position(pos())); break; } // // Rule 341: Dims ::= LBRACKET RBRACKET // case 341: { btParser.setSym1(new Integer(1)); break; } // // Rule 342: Dims ::= Dims LBRACKET RBRACKET // case 342: { Integer a = (Integer) btParser.getSym(1); btParser.setSym1(new Integer(a.intValue() + 1)); break; } // // Rule 343: FieldAccess ::= Primary DOT identifier // case 343: { Expr a = (Expr) btParser.getSym(1); polyglot.lex.Identifier b = id(btParser.getToken(3)); btParser.setSym1(nf.Field(pos(), a, b.getIdentifier())); break; } // // Rule 344: FieldAccess ::= super DOT identifier // case 344: { polyglot.lex.Identifier a = id(btParser.getToken(3)); btParser.setSym1(nf.Field(pos(btParser.getLastToken()), nf.Super(pos(btParser.getFirstToken())), a.getIdentifier())); break; } // // Rule 345: FieldAccess ::= ClassName DOT super DOT identifier // case 345: { Name a = (Name) btParser.getSym(1); polyglot.lex.Identifier b = id(btParser.getToken(3)); btParser.setSym1(nf.Field(pos(btParser.getLastToken()), nf.Super(pos(btParser.getFirstToken(3)), a.toType()), b.getIdentifier())); break; } // // Rule 346: MethodInvocation ::= MethodName LPAREN ArgumentListopt RPAREN // case 346: { Name a = (Name) btParser.getSym(1); List b = (List) btParser.getSym(3); btParser.setSym1(nf.Call(pos(), a.prefix == null ? null : a.prefix.toReceiver(), a.name, b)); break; } // // Rule 347: MethodInvocation ::= Primary DOT identifier LPAREN ArgumentListopt RPAREN // case 347: { Expr a = (Expr) btParser.getSym(1);//vj assert(btParser.getSym(3) == null); polyglot.lex.Identifier b = id(btParser.getToken(3)); List c = (List) btParser.getSym(5); btParser.setSym1(nf.Call(pos(), a, b.getIdentifier(), c)); break; } // // Rule 348: MethodInvocation ::= super DOT identifier LPAREN ArgumentListopt RPAREN // case 348: {//vj assert(btParser.getSym(3) == null); polyglot.lex.Identifier b = id(btParser.getToken(3)); List c = (List) btParser.getSym(5); btParser.setSym1(nf.Call(pos(), nf.Super(pos(btParser.getFirstToken())), b.getIdentifier(), c)); break; } // // Rule 349: MethodInvocation ::= ClassName DOT super DOT identifier LPAREN ArgumentListopt RPAREN // case 349: { Name a = (Name) btParser.getSym(1);//vj assert(btParser.getSym(5) == null); polyglot.lex.Identifier b = id(btParser.getToken(5)); List c = (List) btParser.getSym(7); btParser.setSym1(nf.Call(pos(), nf.Super(pos(btParser.getFirstToken(3)), a.toType()), b.getIdentifier(), c)); break; } // // Rule 350: PostfixExpression ::= Primary // case 350: break; // // Rule 351: PostfixExpression ::= ExpressionName // case 351: { Name a = (Name) btParser.getSym(1); btParser.setSym1(a.toExpr()); break; } // // Rule 352: PostfixExpression ::= PostIncrementExpression // case 352: break; // // Rule 353: PostfixExpression ::= PostDecrementExpression // case 353: break; // // Rule 354: PostIncrementExpression ::= PostfixExpression PLUS_PLUS // case 354: { Expr a = (Expr) btParser.getSym(1); btParser.setSym1(nf.Unary(pos(), a, Unary.POST_INC)); break; } // // Rule 355: PostDecrementExpression ::= PostfixExpression MINUS_MINUS // case 355: { Expr a = (Expr) btParser.getSym(1); btParser.setSym1(nf.Unary(pos(), a, Unary.POST_DEC)); break; } // // Rule 356: UnaryExpression ::= PreIncrementExpression // case 356: break; // // Rule 357: UnaryExpression ::= PreDecrementExpression // case 357: break; // // Rule 358: UnaryExpression ::= PLUS UnaryExpression // case 358: { Expr a = (Expr) btParser.getSym(2); btParser.setSym1(nf.Unary(pos(), Unary.POS, a)); break; } // // Rule 359: UnaryExpression ::= MINUS UnaryExpression // case 359: { Expr a = (Expr) btParser.getSym(2); btParser.setSym1(nf.Unary(pos(), Unary.NEG, a)); break; } // // Rule 361: PreIncrementExpression ::= PLUS_PLUS UnaryExpression // case 361: { Expr a = (Expr) btParser.getSym(2); btParser.setSym1(nf.Unary(pos(), Unary.PRE_INC, a)); break; } // // Rule 362: PreDecrementExpression ::= MINUS_MINUS UnaryExpression // case 362: { Expr a = (Expr) btParser.getSym(2); btParser.setSym1(nf.Unary(pos(), Unary.PRE_DEC, a)); break; } // // Rule 363: UnaryExpressionNotPlusMinus ::= PostfixExpression // case 363: break; // // Rule 364: UnaryExpressionNotPlusMinus ::= TWIDDLE UnaryExpression // case 364: { Expr a = (Expr) btParser.getSym(2); btParser.setSym1(nf.Unary(pos(), Unary.BIT_NOT, a)); break; } // // Rule 365: UnaryExpressionNotPlusMinus ::= NOT UnaryExpression // case 365: { Expr a = (Expr) btParser.getSym(2); btParser.setSym1(nf.Unary(pos(), Unary.NOT, a)); break; } // // Rule 367: MultiplicativeExpression ::= UnaryExpression // case 367: break; // // Rule 368: MultiplicativeExpression ::= MultiplicativeExpression MULTIPLY UnaryExpression // case 368: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.MUL, b)); break; } // // Rule 369: MultiplicativeExpression ::= MultiplicativeExpression DIVIDE UnaryExpression // case 369: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.DIV, b)); break; } // // Rule 370: MultiplicativeExpression ::= MultiplicativeExpression REMAINDER UnaryExpression // case 370: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.MOD, b)); break; } // // Rule 371: AdditiveExpression ::= MultiplicativeExpression // case 371: break; // // Rule 372: AdditiveExpression ::= AdditiveExpression PLUS MultiplicativeExpression // case 372: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.ADD, b)); break; } // // Rule 373: AdditiveExpression ::= AdditiveExpression MINUS MultiplicativeExpression // case 373: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.SUB, b)); break; } // // Rule 374: ShiftExpression ::= AdditiveExpression // case 374: break; // // Rule 375: ShiftExpression ::= ShiftExpression LEFT_SHIFT AdditiveExpression // case 375: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.SHL, b)); break; } // // Rule 376: ShiftExpression ::= ShiftExpression GREATER GREATER AdditiveExpression // case 376: { // TODO: make sure that there is no space between the ">" signs Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(4); btParser.setSym1(nf.Binary(pos(), a, Binary.SHR, b)); break; } // // Rule 377: ShiftExpression ::= ShiftExpression GREATER GREATER GREATER AdditiveExpression // case 377: { // TODO: make sure that there is no space between the ">" signs Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(5); btParser.setSym1(nf.Binary(pos(), a, Binary.USHR, b)); break; } // // Rule 378: RelationalExpression ::= ShiftExpression // case 378: break; // // Rule 379: RelationalExpression ::= RelationalExpression LESS ShiftExpression // case 379: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.LT, b)); break; } // // Rule 380: RelationalExpression ::= RelationalExpression GREATER ShiftExpression // case 380: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.GT, b)); break; } // // Rule 381: RelationalExpression ::= RelationalExpression LESS_EQUAL ShiftExpression // case 381: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.LE, b)); break; } // // Rule 382: RelationalExpression ::= RelationalExpression GREATER EQUAL ShiftExpression // case 382: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(4); btParser.setSym1(nf.Binary(pos(), a, Binary.GE, b)); break; } // // Rule 383: EqualityExpression ::= RelationalExpression // case 383: break; // // Rule 384: EqualityExpression ::= EqualityExpression EQUAL_EQUAL RelationalExpression // case 384: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.EQ, b)); break; } // // Rule 385: EqualityExpression ::= EqualityExpression NOT_EQUAL RelationalExpression // case 385: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.NE, b)); break; } // // Rule 386: AndExpression ::= EqualityExpression // case 386: break; // // Rule 387: AndExpression ::= AndExpression AND EqualityExpression // case 387: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.BIT_AND, b)); break; } // // Rule 388: ExclusiveOrExpression ::= AndExpression // case 388: break; // // Rule 389: ExclusiveOrExpression ::= ExclusiveOrExpression XOR AndExpression // case 389: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.BIT_XOR, b)); break; } // // Rule 390: InclusiveOrExpression ::= ExclusiveOrExpression // case 390: break; // // Rule 391: InclusiveOrExpression ::= InclusiveOrExpression OR ExclusiveOrExpression // case 391: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.BIT_OR, b)); break; } // // Rule 392: ConditionalAndExpression ::= InclusiveOrExpression // case 392: break; // // Rule 393: ConditionalAndExpression ::= ConditionalAndExpression AND_AND InclusiveOrExpression // case 393: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.COND_AND, b)); break; } // // Rule 394: ConditionalOrExpression ::= ConditionalAndExpression // case 394: break; // // Rule 395: ConditionalOrExpression ::= ConditionalOrExpression OR_OR ConditionalAndExpression // case 395: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.COND_OR, b)); break; } // // Rule 396: ConditionalExpression ::= ConditionalOrExpression // case 396: break; // // Rule 397: ConditionalExpression ::= ConditionalOrExpression QUESTION Expression COLON ConditionalExpression // case 397: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3), c = (Expr) btParser.getSym(5); btParser.setSym1(nf.Conditional(pos(), a, b, c)); break; } // // Rule 398: AssignmentExpression ::= ConditionalExpression // case 398: break; // // Rule 399: AssignmentExpression ::= Assignment // case 399: break; // // Rule 400: Assignment ::= LeftHandSide AssignmentOperator AssignmentExpression // case 400: { Expr a = (Expr) btParser.getSym(1); Assign.Operator b = (Assign.Operator) btParser.getSym(2); Expr c = (Expr) btParser.getSym(3); btParser.setSym1(nf.Assign(pos(), a, b, c)); break; } // // Rule 401: LeftHandSide ::= ExpressionName // case 401: { Name a = (Name) btParser.getSym(1); btParser.setSym1(a.toExpr()); break; } // // Rule 402: LeftHandSide ::= FieldAccess // case 402: break; // // Rule 403: LeftHandSide ::= ArrayAccess // case 403: break; // // Rule 404: AssignmentOperator ::= EQUAL // case 404: { btParser.setSym1(Assign.ASSIGN); break; } // // Rule 405: AssignmentOperator ::= MULTIPLY_EQUAL // case 405: { btParser.setSym1(Assign.MUL_ASSIGN); break; } // // Rule 406: AssignmentOperator ::= DIVIDE_EQUAL // case 406: { btParser.setSym1(Assign.DIV_ASSIGN); break; } // // Rule 407: AssignmentOperator ::= REMAINDER_EQUAL // case 407: { btParser.setSym1(Assign.MOD_ASSIGN); break; } // // Rule 408: AssignmentOperator ::= PLUS_EQUAL // case 408: { btParser.setSym1(Assign.ADD_ASSIGN); break; } // // Rule 409: AssignmentOperator ::= MINUS_EQUAL // case 409: { btParser.setSym1(Assign.SUB_ASSIGN); break; } // // Rule 410: AssignmentOperator ::= LEFT_SHIFT_EQUAL // case 410: { btParser.setSym1(Assign.SHL_ASSIGN); break; } // // Rule 411: AssignmentOperator ::= GREATER GREATER EQUAL // case 411: { // TODO: make sure that there is no space between the ">" signs btParser.setSym1(Assign.SHR_ASSIGN); break; } // // Rule 412: AssignmentOperator ::= GREATER GREATER GREATER EQUAL // case 412: { // TODO: make sure that there is no space between the ">" signs btParser.setSym1(Assign.USHR_ASSIGN); break; } // // Rule 413: AssignmentOperator ::= AND_EQUAL // case 413: { btParser.setSym1(Assign.BIT_AND_ASSIGN); break; } // // Rule 414: AssignmentOperator ::= XOR_EQUAL // case 414: { btParser.setSym1(Assign.BIT_XOR_ASSIGN); break; } // // Rule 415: AssignmentOperator ::= OR_EQUAL // case 415: { btParser.setSym1(Assign.BIT_OR_ASSIGN); break; } // // Rule 416: Expression ::= AssignmentExpression // case 416: break; // // Rule 417: ConstantExpression ::= Expression // case 417: break; // // Rule 418: Dimsopt ::= // case 418: { btParser.setSym1(new Integer(0)); break; } // // Rule 419: Dimsopt ::= Dims // case 419: break; // // Rule 420: Catchesopt ::= // case 420: { btParser.setSym1(new TypedList(new LinkedList(), Catch.class, false)); break; } // // Rule 421: Catchesopt ::= Catches // case 421: break; // // Rule 422: identifieropt ::= // case 422: btParser.setSym1(null); break; // // Rule 423: identifieropt ::= identifier // case 423: { polyglot.lex.Identifier a = id(btParser.getToken(1)); btParser.setSym1(new Name(nf, ts, pos(), a.getIdentifier())); break; } // // Rule 424: ForUpdateopt ::= // case 424: { btParser.setSym1(new TypedList(new LinkedList(), ForUpdate.class, false)); break; } // // Rule 425: ForUpdateopt ::= ForUpdate // case 425: break; // // Rule 426: Expressionopt ::= // case 426: btParser.setSym1(null); break; // // Rule 427: Expressionopt ::= Expression // case 427: break; // // Rule 428: ForInitopt ::= // case 428: { btParser.setSym1(new TypedList(new LinkedList(), ForInit.class, false)); break; } // // Rule 429: ForInitopt ::= ForInit // case 429: break; // // Rule 430: SwitchLabelsopt ::= // case 430: { btParser.setSym1(new TypedList(new LinkedList(), Case.class, false)); break; } // // Rule 431: SwitchLabelsopt ::= SwitchLabels // case 431: break; // // Rule 432: SwitchBlockStatementGroupsopt ::= // case 432: { btParser.setSym1(new TypedList(new LinkedList(), SwitchElement.class, false)); break; } // // Rule 433: SwitchBlockStatementGroupsopt ::= SwitchBlockStatementGroups // case 433: break; // // Rule 434: VariableModifiersopt ::= // case 434: { btParser.setSym1(Flags.NONE); break; } // // Rule 435: VariableModifiersopt ::= VariableModifiers // case 435: break; // // Rule 436: VariableInitializersopt ::= // case 436: btParser.setSym1(null); break; // // Rule 437: VariableInitializersopt ::= VariableInitializers // case 437: break; // // Rule 438: ElementValuesopt ::= // case 438: btParser.setSym1(null); break; // // Rule 439: ElementValuesopt ::= ElementValues // case 439: bad_rule = 439; break; // // Rule 440: ElementValuePairsopt ::= // case 440: btParser.setSym1(null); break; // // Rule 441: ElementValuePairsopt ::= ElementValuePairs // case 441: bad_rule = 441; break; // // Rule 442: DefaultValueopt ::= // case 442: btParser.setSym1(null); break; // // Rule 443: DefaultValueopt ::= DefaultValue // case 443: break; // // Rule 444: AnnotationTypeElementDeclarationsopt ::= // case 444: btParser.setSym1(null); break; // // Rule 445: AnnotationTypeElementDeclarationsopt ::= AnnotationTypeElementDeclarations // case 445: bad_rule = 445; break; // // Rule 446: AbstractMethodModifiersopt ::= // case 446: { btParser.setSym1(Flags.NONE); break; } // // Rule 447: AbstractMethodModifiersopt ::= AbstractMethodModifiers // case 447: break; // // Rule 448: ConstantModifiersopt ::= // case 448: { btParser.setSym1(Flags.NONE); break; } // // Rule 449: ConstantModifiersopt ::= ConstantModifiers // case 449: break; // // Rule 450: InterfaceMemberDeclarationsopt ::= // case 450: { btParser.setSym1(new TypedList(new LinkedList(), ClassMember.class, false)); break; } // // Rule 451: InterfaceMemberDeclarationsopt ::= InterfaceMemberDeclarations // case 451: break; // // Rule 452: ExtendsInterfacesopt ::= // case 452: { btParser.setSym1(new TypedList(new LinkedList(), TypeNode.class, false)); break; } // // Rule 453: ExtendsInterfacesopt ::= ExtendsInterfaces // case 453: break; // // Rule 454: InterfaceModifiersopt ::= // case 454: { btParser.setSym1(Flags.NONE); break; } // // Rule 455: InterfaceModifiersopt ::= InterfaceModifiers // case 455: break; // // Rule 456: ClassBodyopt ::= // case 456: btParser.setSym1(null); break; // // Rule 457: ClassBodyopt ::= ClassBody // case 457: break; // // Rule 458: Argumentsopt ::= // case 458: btParser.setSym1(null); break; // // Rule 459: Argumentsopt ::= Arguments // case 459: bad_rule = 459; break; // // Rule 460: EnumBodyDeclarationsopt ::= // case 460: btParser.setSym1(null); break; // // Rule 461: EnumBodyDeclarationsopt ::= EnumBodyDeclarations // case 461: bad_rule = 461; break; // // Rule 462: ,opt ::= // case 462: btParser.setSym1(null); break; // // Rule 463: ,opt ::= COMMA // case 463: break; // // Rule 464: EnumConstantsopt ::= // case 464: btParser.setSym1(null); break; // // Rule 465: EnumConstantsopt ::= EnumConstants // case 465: bad_rule = 465; break; // // Rule 466: ArgumentListopt ::= // case 466: { btParser.setSym1(new TypedList(new LinkedList(), Catch.class, false)); break; } // // Rule 467: ArgumentListopt ::= ArgumentList // case 467: break; // // Rule 468: BlockStatementsopt ::= // case 468: { btParser.setSym1(new TypedList(new LinkedList(), Stmt.class, false)); break; } // // Rule 469: BlockStatementsopt ::= BlockStatements // case 469: break; // // Rule 470: ExplicitConstructorInvocationopt ::= // case 470: btParser.setSym1(null); break; // // Rule 471: ExplicitConstructorInvocationopt ::= ExplicitConstructorInvocation // case 471: break; // // Rule 472: ConstructorModifiersopt ::= // case 472: { btParser.setSym1(Flags.NONE); break; } // // Rule 473: ConstructorModifiersopt ::= ConstructorModifiers // case 473: break; // // Rule 474: ...opt ::= // case 474: btParser.setSym1(null); break; // // Rule 475: ...opt ::= ELLIPSIS // case 475: break; // // Rule 476: FormalParameterListopt ::= // case 476: { btParser.setSym1(new TypedList(new LinkedList(), Formal.class, false)); break; } // // Rule 477: FormalParameterListopt ::= FormalParameterList // case 477: break; // // Rule 478: Throwsopt ::= // case 478: { btParser.setSym1(new TypedList(new LinkedList(), TypeNode.class, false)); break; } // // Rule 479: Throwsopt ::= Throws // case 479: break; // // Rule 480: MethodModifiersopt ::= // case 480: { btParser.setSym1(Flags.NONE); break; } // // Rule 481: MethodModifiersopt ::= MethodModifiers // case 481: break; // // Rule 482: FieldModifiersopt ::= // case 482: { btParser.setSym1(Flags.NONE); break; } // // Rule 483: FieldModifiersopt ::= FieldModifiers // case 483: break; // // Rule 484: ClassBodyDeclarationsopt ::= // case 484: { btParser.setSym1(new TypedList(new LinkedList(), ClassMember.class, false)); break; } // // Rule 485: ClassBodyDeclarationsopt ::= ClassBodyDeclarations // case 485: break; // // Rule 486: Interfacesopt ::= // case 486: { btParser.setSym1(new TypedList(new LinkedList(), TypeNode.class, false)); break; } // // Rule 487: Interfacesopt ::= Interfaces // case 487: break; // // Rule 488: Superopt ::= // case 488: btParser.setSym1(null); break; // // Rule 489: Superopt ::= Super // case 489: break; // // Rule 490: TypeParametersopt ::= // case 490: btParser.setSym1(null); break; // // Rule 491: TypeParametersopt ::= TypeParameters // case 491: break; // // Rule 492: ClassModifiersopt ::= // case 492: { btParser.setSym1(Flags.NONE); break; } // // Rule 493: ClassModifiersopt ::= ClassModifiers // case 493: break; // // Rule 494: Annotationsopt ::= // case 494: btParser.setSym1(null); break; // // Rule 495: Annotationsopt ::= Annotations // case 495: bad_rule = 495; break; // // Rule 496: TypeDeclarationsopt ::= // case 496: { btParser.setSym1(new TypedList(new LinkedList(), TopLevelDecl.class, false)); break; } // // Rule 497: TypeDeclarationsopt ::= TypeDeclarations // case 497: break; // // Rule 498: ImportDeclarationsopt ::= // case 498: { btParser.setSym1(new TypedList(new LinkedList(), Import.class, false)); break; } // // Rule 499: ImportDeclarationsopt ::= ImportDeclarations // case 499: break; // // Rule 500: PackageDeclarationopt ::= // case 500: btParser.setSym1(null); break; // // Rule 501: PackageDeclarationopt ::= PackageDeclaration // case 501: break; // // Rule 502: WildcardBoundsOpt ::= // case 502: btParser.setSym1(null); break; // // Rule 503: WildcardBoundsOpt ::= WildcardBounds // case 503: bad_rule = 503; break; // // Rule 504: AdditionalBoundListopt ::= // case 504: btParser.setSym1(null); break; // // Rule 505: AdditionalBoundListopt ::= AdditionalBoundList // case 505: bad_rule = 505; break; // // Rule 506: TypeBoundopt ::= // case 506: btParser.setSym1(null); break; // // Rule 507: TypeBoundopt ::= TypeBound // case 507: bad_rule = 507; break; // // Rule 508: TypeArgumentsopt ::= // case 508: btParser.setSym1(null); break; // // Rule 509: TypeArgumentsopt ::= TypeArguments // case 509: bad_rule = 509; break; // // Rule 510: Commentsopt ::= // case 510: btParser.setSym1(null); break; // // Rule 511: Commentsopt ::= Comments // case 511: break; // // Rule 512: Type ::= DataType PlaceTypeSpecifieropt // case 512: { assert(btParser.getSym(2) == null); //btParser.setSym1(); break; } // // Rule 513: Type ::= nullable LESS Type GREATER // case 513: { TypeNode a = (TypeNode) btParser.getSym(3); btParser.setSym1(nf.Nullable(pos(), a)); break; } // // Rule 514: Type ::= future LESS Type GREATER // case 514: { TypeNode a = (TypeNode) btParser.getSym(3); btParser.setSym1(nf.Future(pos(), a)); break; } // // Rule 515: Type ::= boxed LESS Type GREATER // case 515: bad_rule = 515; break; // // Rule 516: Type ::= fun LESS Type COMMA Type GREATER // case 516: bad_rule = 516; break; // // Rule 517: DataType ::= PrimitiveType // case 517: break; // // Rule 518: DataType ::= ClassOrInterfaceType // case 518: break; // // Rule 519: DataType ::= ArrayType // case 519: break; // // Rule 520: PlaceTypeSpecifier ::= AT PlaceType // case 520: bad_rule = 520; break; // // Rule 521: PlaceType ::= place // case 521: break; // // Rule 522: PlaceType ::= activity // case 522: break; // // Rule 523: PlaceType ::= method // case 523: break; // // Rule 524: PlaceType ::= current // case 524: break; // // Rule 525: PlaceType ::= PlaceExpression // case 525: break; // // Rule 526: ClassOrInterfaceType ::= TypeName DepParametersopt // case 526: { Name a = (Name) btParser.getSym(1); TypeNode t = a.toType(); DepParameterExpr b = (DepParameterExpr) btParser.getSym(2); btParser.setSym1(nf.ParametricTypeNode(pos(), t, b)); break; } // // Rule 527: DepParameters ::= LPAREN DepParameterExpr RPAREN // case 527: break; // // Rule 528: DepParameterExpr ::= ArgumentList WhereClauseopt // case 528: { List a = (List) btParser.getSym(1); Expr b = (Expr) btParser.getSym(2); btParser.setSym1(nf.DepParameterExpr(pos(),a,b)); break; } // // Rule 529: DepParameterExpr ::= WhereClause // case 529: { Expr b = (Expr) btParser.getSym(1); btParser.setSym1(nf.DepParameterExpr(pos(), null, b)); break; } // // Rule 530: WhereClause ::= COLON Expression // case 530: break; // // Rule 532: X10ArrayType ::= Type LBRACKET DOT RBRACKET // case 532: { TypeNode a = (TypeNode) btParser.getSym(1); TypeNode t = nf.X10ArrayTypeNode(pos(), a, false, null); btParser.setSym1(t); break; } // // Rule 533: X10ArrayType ::= Type reference LBRACKET DOT RBRACKET // case 533: { TypeNode a = (TypeNode) btParser.getSym(1); btParser.setSym1(nf.X10ArrayTypeNode(pos(), a, false, null)); break; } // // Rule 534: X10ArrayType ::= Type value LBRACKET DOT RBRACKET // case 534: { TypeNode a = (TypeNode) btParser.getSym(1); btParser.setSym1(nf.X10ArrayTypeNode(pos(), a, true, null)); break; } // // Rule 535: X10ArrayType ::= Type LBRACKET DepParameterExpr RBRACKET // case 535: { TypeNode a = (TypeNode) btParser.getSym(1); DepParameterExpr b = (DepParameterExpr) btParser.getSym(2); btParser.setSym1(nf.X10ArrayTypeNode(pos(), a, false, b)); break; } // // Rule 536: X10ArrayType ::= Type reference LBRACKET DepParameterExpr RBRACKET // case 536: { TypeNode a = (TypeNode) btParser.getSym(1); DepParameterExpr b = (DepParameterExpr) btParser.getSym(2); btParser.setSym1(nf.X10ArrayTypeNode(pos(), a, false, b)); break; } // // Rule 537: X10ArrayType ::= Type value LBRACKET DepParameterExpr RBRACKET // case 537: { TypeNode a = (TypeNode) btParser.getSym(1); DepParameterExpr b = (DepParameterExpr) btParser.getSym(2); btParser.setSym1(nf.X10ArrayTypeNode(pos(), a, true, b)); break; } // // Rule 538: ObjectKind ::= value // case 538: bad_rule = 538; break; // // Rule 539: ObjectKind ::= reference // case 539: bad_rule = 539; break; // // Rule 540: MethodModifier ::= atomic // case 540: { btParser.setSym1(Flags.ATOMIC); break; } // // Rule 541: MethodModifier ::= extern // case 541: { btParser.setSym1(Flags.NATIVE); break; } // // Rule 542: ClassDeclaration ::= ValueClassDeclaration // case 542: break; // // Rule 543: ValueClassDeclaration ::= ClassModifiersopt value identifier Superopt Interfacesopt ClassBody // case 543: { Flags a = (Flags) btParser.getSym(1); polyglot.lex.Identifier b = id(btParser.getToken(3)); TypeNode c = (TypeNode) btParser.getSym(4); List d = (List) btParser.getSym(5); ClassBody e = (ClassBody) btParser.getSym(6); btParser.setSym1(nf.ValueClassDecl(pos(btParser.getFirstToken(), btParser.getLastToken()), a, b.getIdentifier(), c, d, e)); break; } // // Rule 544: ValueClassDeclaration ::= ClassModifiersopt value class identifier Superopt Interfacesopt ClassBody // case 544: { Flags a = (Flags) btParser.getSym(1); polyglot.lex.Identifier b = id(btParser.getToken(4)); TypeNode c = (TypeNode) btParser.getSym(5); List d = (List) btParser.getSym(6); ClassBody e = (ClassBody) btParser.getSym(7); btParser.setSym1(nf.ValueClassDecl(pos(btParser.getFirstToken(), btParser.getLastToken()), a, b.getIdentifier(), c, d, e)); break; } // // Rule 545: ArrayCreationExpression ::= new ArrayBaseType Unsafeopt LBRACKET RBRACKET ArrayInitializer // case 545: { TypeNode a = (TypeNode) btParser.getSym(2); ArrayInit d = (ArrayInit) btParser.getSym(6); // btParser.setSym1(nf.ArrayConstructor(pos(), a, false, null, d)); btParser.setSym1(nf.NewArray(pos(), a, 1, d)); break; } // // Rule 546: ArrayCreationExpression ::= new ArrayBaseType Unsafeopt LBRACKET Expression RBRACKET // case 546: { TypeNode a = (TypeNode) btParser.getSym(2); boolean unsafe = (btParser.getSym(3) != null); Expr c = (Expr) btParser.getSym(5); btParser.setSym1(nf.ArrayConstructor(pos(), a, unsafe, false, c, null)); break; } // // Rule 547: ArrayCreationExpression ::= new ArrayBaseType Unsafeopt LBRACKET Expression RBRACKET Expression // case 547: { TypeNode a = (TypeNode) btParser.getSym(2); boolean unsafe = (btParser.getSym(3) != null); Expr c = (Expr) btParser.getSym(5); Expr d = (Expr) btParser.getSym(7); btParser.setSym1(nf.ArrayConstructor(pos(), a, unsafe, false, c, d)); break; } // // Rule 548: ArrayCreationExpression ::= new ArrayBaseType value Unsafeopt LBRACKET Expression RBRACKET // case 548: { TypeNode a = (TypeNode) btParser.getSym(2); boolean unsafe = (btParser.getSym(3) != null); Expr c = (Expr) btParser.getSym(5); btParser.setSym1(nf.ArrayConstructor(pos(), a, unsafe, true, c, null)); break; } // // Rule 549: ArrayCreationExpression ::= new ArrayBaseType value Unsafeopt LBRACKET Expression RBRACKET Expression // case 549: { TypeNode a = (TypeNode) btParser.getSym(2); boolean unsafe = (btParser.getSym(3) != null); Expr c = (Expr) btParser.getSym(5); Expr d = (Expr) btParser.getSym(7); btParser.setSym1(nf.ArrayConstructor(pos(), a, unsafe, true, c, d)); break; } // // Rule 550: ArrayBaseType ::= PrimitiveType // case 550: break; // // Rule 551: ArrayBaseType ::= ClassOrInterfaceType // case 551: break; // // Rule 552: ArrayAccess ::= ExpressionName LBRACKET ArgumentList RBRACKET // case 552: { Name e = (Name) btParser.getSym(1); List b = (List) btParser.getSym(3); if (b.size() == 1) btParser.setSym1(nf.X10ArrayAccess1(pos(), e.toExpr(), (Expr) b.get(0))); else btParser.setSym1(nf.X10ArrayAccess(pos(), e.toExpr(), b)); break; } // // Rule 553: ArrayAccess ::= PrimaryNoNewArray LBRACKET ArgumentList RBRACKET // case 553: { Expr a = (Expr) btParser.getSym(1); List b = (List) btParser.getSym(3); if (b.size() == 1) btParser.setSym1(nf.X10ArrayAccess1(pos(), a, (Expr) b.get(0))); else btParser.setSym1(nf.X10ArrayAccess(pos(), a, b)); break; } // // Rule 554: Statement ::= NowStatement // case 554: break; // // Rule 555: Statement ::= ClockedStatement // case 555: break; // // Rule 556: Statement ::= AsyncStatement // case 556: break; // // Rule 557: Statement ::= AtomicStatement // case 557: break; // // Rule 558: Statement ::= WhenStatement // case 558: break; // // Rule 559: Statement ::= ForEachStatement // case 559: break; // // Rule 560: Statement ::= AtEachStatement // case 560: break; // // Rule 561: Statement ::= FinishStatement // case 561: break; // // Rule 562: StatementWithoutTrailingSubstatement ::= NextStatement // case 562: break; // // Rule 563: StatementWithoutTrailingSubstatement ::= AwaitStatement // case 563: break; // // Rule 564: StatementNoShortIf ::= NowStatementNoShortIf // case 564: break; // // Rule 565: StatementNoShortIf ::= ClockedStatementNoShortIf // case 565: break; // // Rule 566: StatementNoShortIf ::= AsyncStatementNoShortIf // case 566: break; // // Rule 567: StatementNoShortIf ::= AtomicStatementNoShortIf // case 567: break; // // Rule 568: StatementNoShortIf ::= WhenStatementNoShortIf // case 568: break; // // Rule 569: StatementNoShortIf ::= ForEachStatementNoShortIf // case 569: break; // // Rule 570: StatementNoShortIf ::= AtEachStatementNoShortIf // case 570: break; // // Rule 571: StatementNoShortIf ::= FinishStatementNoShortIf // case 571: break; // // Rule 572: NowStatement ::= now LPAREN Clock RPAREN Statement // case 572: { Name a = (Name) btParser.getSym(3); Stmt b = (Stmt) btParser.getSym(5); btParser.setSym1(nf.Now(pos(), a.toExpr(), b)); break; } // // Rule 573: ClockedStatement ::= clocked LPAREN ClockList RPAREN Statement // case 573: { List a = (List) btParser.getSym(3); Block b = (Block) btParser.getSym(5); btParser.setSym1(nf.Clocked(pos(), a, b)); break; } // // Rule 574: AsyncStatement ::= async PlaceExpressionSingleListopt Statement // case 574: { Expr e = (Expr) btParser.getSym(2); Stmt b = (Stmt) btParser.getSym(3); btParser.setSym1(nf.Async(pos(), (e == null ? nf.Here(pos(btParser.getFirstToken())) : e), b)); break; } // // Rule 575: AsyncStatement ::= async LPAREN here RPAREN Statement // case 575: { Stmt b = (Stmt) btParser.getSym(5); btParser.setSym1(nf.Async(pos(), nf.Here(pos(btParser.getFirstToken())), b)); break; } // // Rule 576: AtomicStatement ::= atomic PlaceExpressionSingleListopt Statement // case 576: { Expr e = (Expr) btParser.getSym(2); Stmt b = (Stmt) btParser.getSym(3); btParser.setSym1(nf.Atomic(pos(), (e == null ? nf.Here(pos(btParser.getFirstToken())) : e), b)); break; } // // Rule 577: AtomicStatement ::= atomic LPAREN here RPAREN Statement // case 577: { Stmt b = (Stmt) btParser.getSym(5); btParser.setSym1(nf.Atomic(pos(), nf.Here(pos(btParser.getFirstToken())), b)); break; } // // Rule 578: WhenStatement ::= when LPAREN Expression RPAREN Statement // case 578: { Expr e = (Expr) btParser.getSym(3); Stmt s = (Stmt) btParser.getSym(5); btParser.setSym1(nf.When(pos(), e,s)); break; } // // Rule 579: WhenStatement ::= WhenStatement or LPAREN Expression RPAREN Statement // case 579: { When w = (When) btParser.getSym(1); Expr e = (Expr) btParser.getSym(4); Stmt s = (Stmt) btParser.getSym(6); w.add(new When_c.Branch_c(e,s)); btParser.setSym1(w); break; } // // Rule 580: ForEachStatement ::= foreach LPAREN FormalParameter COLON Expression RPAREN Statement // case 580: { Formal f = (Formal) btParser.getSym(3); Expr e = (Expr) btParser.getSym(5); Stmt s = (Stmt) btParser.getSym(7); X10Loop x = nf.ForEach(pos(), f, e, s); btParser.setSym1(x); break; } // // Rule 581: AtEachStatement ::= ateach LPAREN FormalParameter COLON Expression RPAREN Statement // case 581: { Formal f = (Formal) btParser.getSym(3); Expr e = (Expr) btParser.getSym(5); Stmt s = (Stmt) btParser.getSym(7); X10Loop x = nf.AtEach(pos(), f, e, s); btParser.setSym1(x); break; } // // Rule 582: EnhancedForStatement ::= for LPAREN FormalParameter COLON Expression RPAREN Statement // case 582: { Formal f = (Formal) btParser.getSym(3); Expr e = (Expr) btParser.getSym(5); Stmt s = (Stmt) btParser.getSym(7); X10Loop x = nf.ForLoop(pos(), f, e, s); btParser.setSym1(x); break; } // // Rule 583: FinishStatement ::= finish Statement // case 583: { Stmt b = (Stmt) btParser.getSym(2); btParser.setSym1(nf.Finish(pos(), b)); break; } // // Rule 584: NowStatementNoShortIf ::= now LPAREN Clock RPAREN StatementNoShortIf // case 584: { Name a = (Name) btParser.getSym(3); Stmt b = (Stmt) btParser.getSym(5); btParser.setSym1(nf.Now(pos(), a.toExpr(), b)); break; } // // Rule 585: ClockedStatementNoShortIf ::= clocked LPAREN ClockList RPAREN StatementNoShortIf // case 585: { List a = (List) btParser.getSym(3); Stmt b = (Stmt) btParser.getSym(5); btParser.setSym1(nf.Clocked(pos(), a, b)); break; } // // Rule 586: AsyncStatementNoShortIf ::= async PlaceExpressionSingleListopt StatementNoShortIf // case 586: { Expr e = (Expr) btParser.getSym(2); Stmt b = (Stmt) btParser.getSym(3); btParser.setSym1(nf.Async(pos(), (e == null ? nf.Here(pos(btParser.getFirstToken())) : e), b)); break; } // // Rule 587: AsyncStatementNoShortIf ::= async LPAREN here RPAREN StatementNoShortIf // case 587: { Stmt b = (Stmt) btParser.getSym(5); btParser.setSym1(nf.Async(pos(), nf.Here(pos(btParser.getFirstToken())), b)); break; } // // Rule 588: AtomicStatementNoShortIf ::= atomic StatementNoShortIf // case 588: { Expr e = (Expr) btParser.getSym(2); Stmt b = (Stmt) btParser.getSym(3); btParser.setSym1(nf.Atomic(pos(), (e == null ? nf.Here(pos(btParser.getFirstToken())) : e), b)); break; } // // Rule 589: AtomicStatementNoShortIf ::= atomic LPAREN here RPAREN StatementNoShortIf // case 589: { Stmt b = (Stmt) btParser.getSym(5); btParser.setSym1(nf.Atomic(pos(), nf.Here(pos(btParser.getFirstToken())), b)); break; } // // Rule 590: WhenStatementNoShortIf ::= when LPAREN Expression RPAREN StatementNoShortIf // case 590: { Expr e = (Expr) btParser.getSym(3); Stmt s = (Stmt) btParser.getSym(5); btParser.setSym1(nf.When(pos(), e,s)); break; } // // Rule 591: WhenStatementNoShortIf ::= WhenStatement or LPAREN Expression RPAREN StatementNoShortIf // case 591: { When w = (When) btParser.getSym(1); Expr e = (Expr) btParser.getSym(4); Stmt s = (Stmt) btParser.getSym(6); w.add(new When_c.Branch_c(e,s)); btParser.setSym1(w); break; } // // Rule 592: ForEachStatementNoShortIf ::= foreach LPAREN FormalParameter COLON Expression RPAREN StatementNoShortIf // case 592: { Formal f = (Formal) btParser.getSym(3); Expr e = (Expr) btParser.getSym(5); Stmt s = (Stmt) btParser.getSym(7); X10Loop x = nf.ForEach(pos(), f, e, s); btParser.setSym1(x); break; } // // Rule 593: AtEachStatementNoShortIf ::= ateach LPAREN FormalParameter COLON Expression RPAREN StatementNoShortIf // case 593: { Formal f = (Formal) btParser.getSym(3); Expr e = (Expr) btParser.getSym(5); Stmt s = (Stmt) btParser.getSym(7); X10Loop x = nf.AtEach(pos(), f, e, s); btParser.setSym1(x); break; } // // Rule 594: FinishStatementNoShortIf ::= finish StatementNoShortIf // case 594: { Stmt b = (Stmt) btParser.getSym(2); btParser.setSym1(nf.Finish(pos(), b)); break; } // // Rule 595: PlaceExpressionSingleList ::= LPAREN PlaceExpression RPAREN // case 595: { btParser.setSym1(btParser.getSym(2)); break; } // // Rule 596: PlaceExpression ::= here // case 596: { btParser.setSym1(nf.Here(pos(btParser.getFirstToken()))); break; } // // Rule 597: PlaceExpression ::= this // case 597: { btParser.setSym1(nf.Field(pos(btParser.getFirstToken()), nf.This(pos(btParser.getFirstToken())), "place")); break; } // // Rule 598: PlaceExpression ::= Expression // case 598: break; // // Rule 599: PlaceExpression ::= ArrayAccess // case 599: bad_rule = 599; break; // // Rule 600: NextStatement ::= next SEMICOLON // case 600: { btParser.setSym1(nf.Next(pos())); break; } // // Rule 601: AwaitStatement ::= await Expression SEMICOLON // case 601: { Expr e = (Expr) btParser.getSym(2); btParser.setSym1(nf.Await(pos(), e)); break; } // // Rule 602: ClockList ::= Clock // case 602: { Name c = (Name) btParser.getSym(1); List l = new TypedList(new LinkedList(), Expr.class, false); l.add(c.toExpr()); btParser.setSym1(l); break; } // // Rule 603: ClockList ::= ClockList COMMA Clock // case 603: { List l = (List) btParser.getSym(1); Name c = (Name) btParser.getSym(3); l.add(c.toExpr()); // btParser.setSym1(l); break; } // // Rule 604: Clock ::= identifier // case 604: { polyglot.lex.Identifier a = id(btParser.getToken(1)); btParser.setSym1(new Name(nf, ts, pos(), a.getIdentifier())); break; } // // Rule 605: CastExpression ::= LPAREN Type RPAREN UnaryExpressionNotPlusMinus // case 605: { TypeNode a = (TypeNode) btParser.getSym(2); Expr b = (Expr) btParser.getSym(4); btParser.setSym1(nf.Cast(pos(), a, b)); break; } // // Rule 606: MethodInvocation ::= Primary ARROW identifier LPAREN ArgumentListopt RPAREN // case 606: { Expr a = (Expr) btParser.getSym(1); polyglot.lex.Identifier b = id(btParser.getToken(3)); List c = (List) btParser.getSym(5); btParser.setSym1(nf.RemoteCall(pos(), a, b.getIdentifier(), c)); break; } // // Rule 607: RelationalExpression ::= RelationalExpression instanceof Type // case 607: { Expr a = (Expr) btParser.getSym(1); TypeNode b = (TypeNode) btParser.getSym(3); btParser.setSym1(nf.Instanceof(pos(), a, b)); break; } // // Rule 608: ExpressionName ::= here // case 608: { btParser.setSym1(new Name(nf, ts, pos(), "here"){ public Expr toExpr() { return nf.Here(pos); } }); break; } // // Rule 609: Primary ::= FutureExpression // case 609: break; // // Rule 610: FutureExpression ::= future PlaceExpressionSingleListopt LBRACE Expression RBRACE // case 610: { Expr e1 = (Expr) btParser.getSym(2), e2 = (Expr) btParser.getSym(4); btParser.setSym1(nf.Future(pos(), (e1 == null ? nf.Here(pos(btParser.getFirstToken())) : e1), e2)); break; } // // Rule 611: FutureExpression ::= future LPAREN here RPAREN LBRACE Expression RBRACE // case 611: { Expr e2 = (Expr) btParser.getSym(6); btParser.setSym1(nf.Future(pos(), nf.Here(pos(btParser.getFirstToken(3))), e2)); break; } // // Rule 612: FunExpression ::= fun Type LPAREN FormalParameterListopt RPAREN LBRACE Expression RBRACE // case 612: bad_rule = 612; break; // // Rule 613: MethodInvocation ::= MethodName LPAREN ArgumentListopt RPAREN LPAREN ArgumentListopt RPAREN // case 613: bad_rule = 613; break; // // Rule 614: MethodInvocation ::= Primary DOT identifier LPAREN ArgumentListopt RPAREN LPAREN ArgumentListopt RPAREN // case 614: bad_rule = 614; break; // // Rule 615: MethodInvocation ::= super DOT identifier LPAREN ArgumentListopt RPAREN LPAREN ArgumentListopt RPAREN // case 615: bad_rule = 615; break; // // Rule 616: MethodInvocation ::= ClassName DOT super DOT identifier LPAREN ArgumentListopt RPAREN LPAREN ArgumentListopt RPAREN // case 616: bad_rule = 616; break; // // Rule 617: MethodInvocation ::= TypeName DOT identifier LPAREN ArgumentListopt RPAREN LPAREN ArgumentListopt RPAREN // case 617: bad_rule = 617; break; // // Rule 618: ClassInstanceCreationExpression ::= new ClassOrInterfaceType LPAREN ArgumentListopt RPAREN LPAREN ArgumentListopt RPAREN ClassBodyopt // case 618: bad_rule = 618; break; // // Rule 619: ClassInstanceCreationExpression ::= Primary DOT new identifier LPAREN ArgumentListopt RPAREN LPAREN ArgumentListopt RPAREN ClassBodyopt // case 619: bad_rule = 619; break; // // Rule 620: ClassInstanceCreationExpression ::= AmbiguousName DOT new identifier LPAREN ArgumentListopt RPAREN LPAREN ArgumentListopt RPAREN ClassBodyopt // case 620: bad_rule = 620; break; // // Rule 621: PlaceTypeSpecifieropt ::= // case 621: btParser.setSym1(null); break; // // Rule 622: PlaceTypeSpecifieropt ::= PlaceTypeSpecifier // case 622: break; // // Rule 623: DepParametersopt ::= // case 623: btParser.setSym1(null); break; // // Rule 624: DepParametersopt ::= DepParameters // case 624: break; // // Rule 625: WhereClauseopt ::= // case 625: btParser.setSym1(null); break; // // Rule 626: WhereClauseopt ::= WhereClause // case 626: break; // // Rule 627: ObjectKindopt ::= // case 627: btParser.setSym1(null); break; // // Rule 628: ObjectKindopt ::= ObjectKind // case 628: break; // // Rule 629: ArrayInitializeropt ::= // case 629: btParser.setSym1(null); break; // // Rule 630: ArrayInitializeropt ::= ArrayInitializer // case 630: break; // // Rule 631: ConcreteDistributionopt ::= // case 631: btParser.setSym1(null); break; // // Rule 632: ConcreteDistributionopt ::= ConcreteDistribution // case 632: break; // // Rule 633: PlaceExpressionSingleListopt ::= // case 633: btParser.setSym1(null); break; // // Rule 634: PlaceExpressionSingleListopt ::= PlaceExpressionSingleList // case 634: break; // // Rule 635: ArgumentListopt ::= // case 635: btParser.setSym1(null); break; // // Rule 636: ArgumentListopt ::= ArgumentList // case 636: break; // // Rule 637: DepParametersopt ::= // case 637: btParser.setSym1(null); break; // // Rule 638: DepParametersopt ::= DepParameters // case 638: break; // // Rule 639: Unsafeopt ::= // case 639: btParser.setSym1(null); break; // // Rule 640: Unsafeopt ::= unsafe // case 640: { btParser.setSym1(nf.Here(pos(btParser.getFirstToken(1)))); break; } default: break; } return; } | 1832 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1832/a0ef25c366453f5aff64a3c99c145987b17c8f23/X10Parser.java/buggy/x10.compiler/src/x10/parser/X10Parser.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1720,
1803,
12,
474,
1720,
1854,
13,
565,
288,
3639,
309,
261,
8759,
67,
5345,
480,
374,
13,
5411,
327,
31,
3639,
1620,
261,
5345,
1854,
13,
3639,
288,
2398,
368,
5411,
368,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1720,
1803,
12,
474,
1720,
1854,
13,
565,
288,
3639,
309,
261,
8759,
67,
5345,
480,
374,
13,
5411,
327,
31,
3639,
1620,
261,
5345,
1854,
13,
3639,
288,
2398,
368,
5411,
368,
... | ||
validateExtensibleAPI(); | validateEclipsePlatformFilter(); | public void validateContent(IProgressMonitor monitor) { super.validateContent(monitor); if (fHeaders == null || getErrorCount() > 0) { return; } readBundleManifestVersion(); fHasFragment_Xml = fProject.getFile("fragment.xml").exists(); //$NON-NLS-1$ fModel = PDECore.getDefault().getModelManager() .findModel(fProject); if (fModel != null) { fHasExtensions = fModel.getPluginBase().getExtensionPoints().length > 0 || fModel.getPluginBase().getExtensions().length > 0; } // sets fPluginId if (!validateBundleSymbolicName()) { return; } validateBundleName(); validateTranslatableHeaders(); validateBundleVersion(); // sets fExtensibleApi validateExtensibleAPI(); // sets fHostBundleId validateFragmentHost(); validateBundleClasspath(); validateRequireBundle(monitor); // sets fCompatibility // sets fCompatibilityActivator validateBundleActivator(); validatePluginClass(); validateExportPackage(monitor); validateProvidePackage(monitor); validateImportPackage(monitor); validateEclipsePlatformFilter(); validateAutoStart(); validateLazyStart(); // validateNativeCode(); } | 14404 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/14404/cd1b28d402b53578beeecb1f642784dc5e14eac5/BundleErrorReporter.java/clean/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/BundleErrorReporter.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1954,
1350,
12,
45,
5491,
7187,
6438,
13,
288,
202,
202,
9565,
18,
5662,
1350,
12,
10259,
1769,
202,
202,
430,
261,
74,
3121,
422,
446,
747,
7926,
1380,
1435,
405,
374,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1954,
1350,
12,
45,
5491,
7187,
6438,
13,
288,
202,
202,
9565,
18,
5662,
1350,
12,
10259,
1769,
202,
202,
430,
261,
74,
3121,
422,
446,
747,
7926,
1380,
1435,
405,
374,
... |
DatabaseSearchReplyMessage msg = new DatabaseSearchReplyMessage(_context); msg.setFromHash(_context.router().getRouterInfo().getIdentity().getHash()); | DatabaseSearchReplyMessage msg = new DatabaseSearchReplyMessage(getContext()); msg.setFromHash(getContext().router().getRouterInfo().getIdentity().getHash()); | private void sendClosest(Hash key, Set routerInfoSet, Hash toPeer, TunnelId replyTunnel) { if (_log.shouldLog(Log.DEBUG)) _log.debug("Sending closest routers to key " + key.toBase64() + ": # peers = " + routerInfoSet.size() + " tunnel " + replyTunnel); DatabaseSearchReplyMessage msg = new DatabaseSearchReplyMessage(_context); msg.setFromHash(_context.router().getRouterInfo().getIdentity().getHash()); msg.setSearchKey(key); if (routerInfoSet.size() <= 0) { // always include something, so lets toss ourselves in there routerInfoSet.add(_context.router().getRouterInfo()); } msg.addReplies(routerInfoSet); _context.statManager().addRateData("netDb.lookupsHandled", 1, 0); sendMessage(msg, toPeer, replyTunnel); // should this go via garlic messages instead? } | 27433 /local/tlutelli/issta_data/temp/all_java2context/java/2006_temp/2006/27433/e737e5c9507ed0d463dc9e45a8f63657f466b177/HandleDatabaseLookupMessageJob.java/clean/router/java/src/net/i2p/router/networkdb/HandleDatabaseLookupMessageJob.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
1366,
4082,
7781,
12,
2310,
498,
16,
1000,
4633,
966,
694,
16,
2474,
358,
6813,
16,
399,
8564,
548,
4332,
20329,
13,
288,
3639,
309,
261,
67,
1330,
18,
13139,
1343,
12,
1343,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
1366,
4082,
7781,
12,
2310,
498,
16,
1000,
4633,
966,
694,
16,
2474,
358,
6813,
16,
399,
8564,
548,
4332,
20329,
13,
288,
3639,
309,
261,
67,
1330,
18,
13139,
1343,
12,
1343,... |
(PsiCodeBlock) PsiTreeUtil.getParentOfType(variable, PsiCodeBlock.class); | PsiTreeUtil.getParentOfType(variable, PsiCodeBlock.class); | private static boolean isImmediatelyAssigned(PsiVariable variable) { final PsiCodeBlock containingScope = (PsiCodeBlock) PsiTreeUtil.getParentOfType(variable, PsiCodeBlock.class); if (containingScope == null) { return false; } final PsiDeclarationStatement declarationStatement = (PsiDeclarationStatement) PsiTreeUtil.getParentOfType(variable, PsiDeclarationStatement.class); if (declarationStatement == null) { return false; } PsiStatement nextStatement = null; int followingStatementNumber = 0; final PsiStatement[] statements = containingScope.getStatements(); for (int i = 0; i < statements.length - 1; i++) { if (statements[i].equals(declarationStatement)) { nextStatement = statements[i + 1]; followingStatementNumber = i + 2; } } if (nextStatement == null) { return false; } if (!(nextStatement instanceof PsiExpressionStatement)) { return false; } final PsiExpressionStatement expressionStatement = (PsiExpressionStatement) nextStatement; final PsiExpression expression = expressionStatement.getExpression(); if (expression == null) { return false; } if (!(expression instanceof PsiAssignmentExpression)) { return false; } final PsiExpression rhs = ((PsiAssignmentExpression) expression).getRExpression(); if (rhs == null) { return false; } if (!(rhs instanceof PsiReferenceExpression)) { return false; } final PsiElement referent = ((PsiReference) rhs).resolve(); if (referent == null || !referent.equals(variable)) { return false; } for (int i = followingStatementNumber; i < statements.length; i++) { if (variableIsUsedInStatement(statements[i], variable)) { return false; } } return true; } | 56627 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56627/2d46d291193579a7564649b4881c7ea8e02eda5b/UnnecessaryLocalVariableInspection.java/buggy/plugins/InspectionGadgets/src/com/siyeh/ig/verbose/UnnecessaryLocalVariableInspection.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
760,
1250,
353,
1170,
7101,
20363,
12,
52,
7722,
3092,
2190,
13,
288,
3639,
727,
453,
7722,
1085,
1768,
4191,
3876,
273,
7734,
453,
7722,
2471,
1304,
18,
588,
3054,
18859,
12,
6105,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
760,
1250,
353,
1170,
7101,
20363,
12,
52,
7722,
3092,
2190,
13,
288,
3639,
727,
453,
7722,
1085,
1768,
4191,
3876,
273,
7734,
453,
7722,
2471,
1304,
18,
588,
3054,
18859,
12,
6105,... |
public boolean isSelected(File basedir, String filename, File file) { String teststr = null; BufferedReader in = null; // throw BuildException on error validate(); if (file.isDirectory()) { return true; } if (myRegExp == null) { myRegExp = new RegularExpression(); myRegExp.setPattern(userProvidedExpression); myExpression = myRegExp.getRegexp(getProject()); } try { in = new BufferedReader(new InputStreamReader( new FileInputStream(file))); teststr = in.readLine(); while (teststr != null) { if (myExpression.matches(teststr) == true) { return true; } teststr = in.readLine(); } return false; } catch (IOException ioe) { throw new BuildException("Could not read file " + filename); } finally { try { in.close(); } catch (Exception e) { throw new BuildException("Could not close file " + filename); } } } | 639 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/639/f83f5c68c975f31a384cc24e94be4e5ebfa2da4d/ContainsRegexpSelector.java/clean/src/main/org/apache/tools/ant/types/selectors/ContainsRegexpSelector.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1250,
20956,
12,
812,
15573,
16,
514,
1544,
16,
1387,
585,
13,
288,
3639,
514,
1842,
701,
273,
446,
31,
3639,
10633,
316,
273,
446,
31,
7734,
368,
604,
18463,
603,
555,
7734,
1954... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1250,
20956,
12,
812,
15573,
16,
514,
1544,
16,
1387,
585,
13,
288,
3639,
514,
1842,
701,
273,
446,
31,
3639,
10633,
316,
273,
446,
31,
7734,
368,
604,
18463,
603,
555,
7734,
1954... | ||
break; | continue Loop; | static Object interpret(Context cx, Scriptable scope, Scriptable thisObj, Object[] args, double[] argsDbl, int argShift, int argCount, NativeFunction fnOrScript, InterpreterData idata) throws JavaScriptException { if (cx.interpreterSecurityDomain != idata.securityDomain) { if (argsDbl != null) { args = getArgsArray(args, argsDbl, argShift, argCount); } SecurityController sc = idata.securityController; Object savedDomain = cx.interpreterSecurityDomain; cx.interpreterSecurityDomain = idata.securityDomain; try { return sc.callWithDomain(idata.securityDomain, cx, fnOrScript, scope, thisObj, args); } finally { cx.interpreterSecurityDomain = savedDomain; } } final Object DBL_MRK = Interpreter.DBL_MRK; final Scriptable undefined = Undefined.instance; final int VAR_SHFT = 0; final int maxVars = idata.itsMaxVars; final int LOCAL_SHFT = VAR_SHFT + maxVars; final int STACK_SHFT = LOCAL_SHFT + idata.itsMaxLocals;// stack[VAR_SHFT <= i < LOCAL_SHFT]: variables// stack[LOCAL_SHFT <= i < TRY_STACK_SHFT]: used for newtemp/usetemp// stack[STACK_SHFT <= i < STACK_SHFT + idata.itsMaxStack]: stack data// sDbl[i]: if stack[i] is DBL_MRK, sDbl[i] holds the number value int maxFrameArray = idata.itsMaxFrameArray; if (maxFrameArray != STACK_SHFT + idata.itsMaxStack) Kit.codeBug(); Object[] stack = new Object[maxFrameArray]; double[] sDbl = new double[maxFrameArray]; int stackTop = STACK_SHFT - 1; int withDepth = 0; int definedArgs = fnOrScript.argCount; if (definedArgs > argCount) { definedArgs = argCount; } for (int i = 0; i != definedArgs; ++i) { Object arg = args[argShift + i]; stack[VAR_SHFT + i] = arg; if (arg == DBL_MRK) { sDbl[VAR_SHFT + i] = argsDbl[argShift + i]; } } for (int i = definedArgs; i != maxVars; ++i) { stack[VAR_SHFT + i] = undefined; } DebugFrame debuggerFrame = null; if (cx.debugger != null) { debuggerFrame = cx.debugger.getFrame(cx, idata); } if (idata.itsFunctionType != 0) { InterpretedFunction f = (InterpretedFunction)fnOrScript; if (!idata.useDynamicScope) { scope = fnOrScript.getParentScope(); } if (idata.itsCheckThis) { thisObj = ScriptRuntime.getThis(thisObj); } if (idata.itsNeedsActivation) { if (argsDbl != null) { args = getArgsArray(args, argsDbl, argShift, argCount); argShift = 0; argsDbl = null; } scope = ScriptRuntime.initVarObj(cx, scope, fnOrScript, thisObj, args); } } else { ScriptRuntime.initScript(cx, scope, fnOrScript, thisObj, idata.itsFromEvalCode); } if (idata.itsNestedFunctions != null) { if (idata.itsFunctionType != 0 && !idata.itsNeedsActivation) Kit.codeBug(); for (int i = 0; i < idata.itsNestedFunctions.length; i++) { InterpreterData fdata = idata.itsNestedFunctions[i]; if (fdata.itsFunctionType == FunctionNode.FUNCTION_STATEMENT) { createFunction(cx, scope, fdata, idata.itsFromEvalCode); } } } // Wrapped regexps for functions are stored in InterpretedFunction // but for script which should not contain references to scope // the regexps re-wrapped during each script execution Scriptable[] scriptRegExps = null; boolean useActivationVars = false; if (debuggerFrame != null) { if (argsDbl != null) { args = getArgsArray(args, argsDbl, argShift, argCount); argShift = 0; argsDbl = null; } if (idata.itsFunctionType != 0 && !idata.itsNeedsActivation) { useActivationVars = true; scope = ScriptRuntime.initVarObj(cx, scope, fnOrScript, thisObj, args); } debuggerFrame.onEnter(cx, scope, thisObj, args); } InterpreterData savedData = cx.interpreterData; cx.interpreterData = idata; Object result = undefined; // If javaException != null on exit, it will be throw instead of // normal return Throwable javaException = null; int exceptionPC = -1; byte[] iCode = idata.itsICode; String[] strings = idata.itsStringTable; int pc = 0; int pcPrevBranch = pc; final int instructionThreshold = cx.instructionThreshold; // During function call this will be set to -1 so catch can properly // adjust it int instructionCount = cx.instructionCount; // arbitrary number to add to instructionCount when calling // other functions final int INVOCATION_COST = 100; Loop: for (;;) { try { int op = 0xFF & iCode[pc++]; switch (op) { // Back indent to ease imlementation reading case Icode_CATCH: { // The following code should be executed inside try/catch inside main // loop, not in the loop catch block itself to deal with exceptions // from observeInstructionCount. A special bytecode is used only to // simplify logic. if (javaException == null) Kit.codeBug(); int pcNew = -1; boolean doCatch = false; int handlerOffset = getExceptionHandler(idata.itsExceptionTable, exceptionPC); if (handlerOffset >= 0) { final int SCRIPT_CAN_CATCH = 0, ONLY_FINALLY = 1, OTHER = 2; int exType; if (javaException instanceof JavaScriptException) { exType = SCRIPT_CAN_CATCH; } else if (javaException instanceof EcmaError) { // an offical ECMA error object, exType = SCRIPT_CAN_CATCH; } else if (javaException instanceof EvaluatorException) { exType = SCRIPT_CAN_CATCH; } else if (javaException instanceof RuntimeException) { exType = ONLY_FINALLY; } else { // Error instance exType = OTHER; } if (exType != OTHER) { // Do not allow for JS to interfere with Error instances // (exType == OTHER), as they can be used to terminate // long running script if (exType == SCRIPT_CAN_CATCH) { // Allow JS to catch only JavaScriptException and // EcmaError pcNew = idata.itsExceptionTable[handlerOffset + EXCEPTION_CATCH_SLOT]; if (pcNew >= 0) { // Has catch block doCatch = true; } } if (pcNew < 0) { pcNew = idata.itsExceptionTable[handlerOffset + EXCEPTION_FINALLY_SLOT]; } } } if (debuggerFrame != null && !(javaException instanceof Error)) { debuggerFrame.onExceptionThrown(cx, javaException); } if (pcNew < 0) { break Loop; } // We caught an exception // restore scope at try point int tryWithDepth = idata.itsExceptionTable[ handlerOffset + EXCEPTION_WITH_DEPTH_SLOT]; while (tryWithDepth != withDepth) { if (scope == null) Kit.codeBug(); scope = ScriptRuntime.leaveWith(scope); --withDepth; } if (doCatch) { stackTop = STACK_SHFT - 1; int exLocal = idata.itsExceptionTable[ handlerOffset + EXCEPTION_LOCAL_SLOT]; stack[LOCAL_SHFT + exLocal] = ScriptRuntime.getCatchObject( cx, scope, javaException); } else { stackTop = STACK_SHFT; // Call finally handler with javaException on stack top to // distinguish from normal invocation through GOSUB // which would contain DBL_MRK on the stack stack[stackTop] = javaException; } // clear exception javaException = null; // Notify instruction observer if necessary // and point pc and pcPrevBranch to start of catch/finally block if (instructionThreshold != 0) { if (instructionCount > instructionThreshold) { // Note: this can throw Error cx.observeInstructionCount(instructionCount); instructionCount = 0; } } pcPrevBranch = pc = pcNew; continue Loop; } case Token.THROW: { Object value = stack[stackTop]; if (value == DBL_MRK) value = doubleWrap(sDbl[stackTop]); --stackTop; int sourceLine = getShort(iCode, pc); javaException = new JavaScriptException(value, idata.itsSourceFile, sourceLine); exceptionPC = pc - 1; if (instructionThreshold != 0) { instructionCount += pc - pcPrevBranch; if (instructionCount > instructionThreshold) { cx.observeInstructionCount(instructionCount); instructionCount = 0; } } pcPrevBranch = pc = getJavaCatchPC(iCode); continue Loop; } case Token.GE : { --stackTop; Object rhs = stack[stackTop + 1]; Object lhs = stack[stackTop]; boolean valBln; if (rhs == DBL_MRK || lhs == DBL_MRK) { double rDbl = stack_double(stack, sDbl, stackTop + 1); double lDbl = stack_double(stack, sDbl, stackTop); valBln = (rDbl <= lDbl); } else { valBln = ScriptRuntime.cmp_LE(rhs, lhs); } stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; } case Token.LE : { --stackTop; Object rhs = stack[stackTop + 1]; Object lhs = stack[stackTop]; boolean valBln; if (rhs == DBL_MRK || lhs == DBL_MRK) { double rDbl = stack_double(stack, sDbl, stackTop + 1); double lDbl = stack_double(stack, sDbl, stackTop); valBln = (lDbl <= rDbl); } else { valBln = ScriptRuntime.cmp_LE(lhs, rhs); } stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; } case Token.GT : { --stackTop; Object rhs = stack[stackTop + 1]; Object lhs = stack[stackTop]; boolean valBln; if (rhs == DBL_MRK || lhs == DBL_MRK) { double rDbl = stack_double(stack, sDbl, stackTop + 1); double lDbl = stack_double(stack, sDbl, stackTop); valBln = (rDbl < lDbl); } else { valBln = ScriptRuntime.cmp_LT(rhs, lhs); } stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; } case Token.LT : { --stackTop; Object rhs = stack[stackTop + 1]; Object lhs = stack[stackTop]; boolean valBln; if (rhs == DBL_MRK || lhs == DBL_MRK) { double rDbl = stack_double(stack, sDbl, stackTop + 1); double lDbl = stack_double(stack, sDbl, stackTop); valBln = (lDbl < rDbl); } else { valBln = ScriptRuntime.cmp_LT(lhs, rhs); } stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; } case Token.IN : { Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); boolean valBln = ScriptRuntime.in(lhs, rhs, scope); stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; } case Token.INSTANCEOF : { Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); boolean valBln = ScriptRuntime.instanceOf(lhs, rhs, scope); stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; } case Token.EQ : { --stackTop; boolean valBln = do_eq(stack, sDbl, stackTop); stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; } case Token.NE : { --stackTop; boolean valBln = !do_eq(stack, sDbl, stackTop); stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; } case Token.SHEQ : { --stackTop; boolean valBln = do_sheq(stack, sDbl, stackTop); stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; } case Token.SHNE : { --stackTop; boolean valBln = !do_sheq(stack, sDbl, stackTop); stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; } case Token.IFNE : { boolean valBln = stack_boolean(stack, sDbl, stackTop); --stackTop; if (!valBln) { if (instructionThreshold != 0) { instructionCount += pc + 2 - pcPrevBranch; if (instructionCount > instructionThreshold) { cx.observeInstructionCount(instructionCount); instructionCount = 0; } } pcPrevBranch = pc = getTarget(iCode, pc); continue Loop; } pc += 2; break; } case Token.IFEQ : { boolean valBln = stack_boolean(stack, sDbl, stackTop); --stackTop; if (valBln) { if (instructionThreshold != 0) { instructionCount += pc + 2 - pcPrevBranch; if (instructionCount > instructionThreshold) { cx.observeInstructionCount(instructionCount); instructionCount = 0; } } pcPrevBranch = pc = getTarget(iCode, pc); continue Loop; } pc += 2; break; } case Icode_IFEQ_POP : { boolean valBln = stack_boolean(stack, sDbl, stackTop); --stackTop; if (valBln) { if (instructionThreshold != 0) { instructionCount += pc + 2 - pcPrevBranch; if (instructionCount > instructionThreshold) { cx.observeInstructionCount(instructionCount); instructionCount = 0; } } pcPrevBranch = pc = getTarget(iCode, pc); stack[stackTop--] = null; continue Loop; } pc += 2; break; } case Token.GOTO : if (instructionThreshold != 0) { instructionCount += pc + 2 - pcPrevBranch; if (instructionCount > instructionThreshold) { cx.observeInstructionCount(instructionCount); instructionCount = 0; } } pcPrevBranch = pc = getTarget(iCode, pc); continue Loop; case Icode_GOSUB : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = pc + 2; if (instructionThreshold != 0) { instructionCount += pc + 2 - pcPrevBranch; if (instructionCount > instructionThreshold) { cx.observeInstructionCount(instructionCount); instructionCount = 0; } } pcPrevBranch = pc = getTarget(iCode, pc); continue Loop; case Icode_RETSUB : { int slot = (iCode[pc] & 0xFF); if (instructionThreshold != 0) { instructionCount += pc + 1 - pcPrevBranch; if (instructionCount > instructionThreshold) { cx.observeInstructionCount(instructionCount); instructionCount = 0; } } int newPC; Object value = stack[LOCAL_SHFT + slot]; if (value != DBL_MRK) { // Invocation from exception handler, restore object to rethrow javaException = (Throwable)value; exceptionPC = pc - 1; newPC = getJavaCatchPC(iCode); } else { // Normal return from GOSUB newPC = (int)sDbl[LOCAL_SHFT + slot]; } pcPrevBranch = pc = newPC; continue Loop; } case Token.POP : stack[stackTop] = null; stackTop--; break; case Icode_DUP : stack[stackTop + 1] = stack[stackTop]; sDbl[stackTop + 1] = sDbl[stackTop]; stackTop++; break; case Icode_DUPSECOND : { stack[stackTop + 1] = stack[stackTop - 1]; sDbl[stackTop + 1] = sDbl[stackTop - 1]; stackTop++; break; } case Icode_SWAP : { Object o = stack[stackTop]; stack[stackTop] = stack[stackTop - 1]; stack[stackTop - 1] = o; double d = sDbl[stackTop]; sDbl[stackTop] = sDbl[stackTop - 1]; sDbl[stackTop - 1] = d; break; } case Token.POPV : result = stack[stackTop]; if (result == DBL_MRK) result = doubleWrap(sDbl[stackTop]); stack[stackTop] = null; --stackTop; break; case Token.RETURN : result = stack[stackTop]; if (result == DBL_MRK) result = doubleWrap(sDbl[stackTop]); --stackTop; break Loop; case Token.RETURN_POPV : break Loop; case Icode_RETUNDEF : result = undefined; break Loop; case Token.BITNOT : { int rIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = ~rIntValue; break; } case Token.BITAND : { int rIntValue = stack_int32(stack, sDbl, stackTop); --stackTop; int lIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lIntValue & rIntValue; break; } case Token.BITOR : { int rIntValue = stack_int32(stack, sDbl, stackTop); --stackTop; int lIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lIntValue | rIntValue; break; } case Token.BITXOR : { int rIntValue = stack_int32(stack, sDbl, stackTop); --stackTop; int lIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lIntValue ^ rIntValue; break; } case Token.LSH : { int rIntValue = stack_int32(stack, sDbl, stackTop); --stackTop; int lIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lIntValue << rIntValue; break; } case Token.RSH : { int rIntValue = stack_int32(stack, sDbl, stackTop); --stackTop; int lIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lIntValue >> rIntValue; break; } case Token.URSH : { int rIntValue = stack_int32(stack, sDbl, stackTop) & 0x1F; --stackTop; double lDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = ScriptRuntime.toUint32(lDbl) >>> rIntValue; break; } case Token.ADD : --stackTop; do_add(stack, sDbl, stackTop); break; case Token.SUB : { double rDbl = stack_double(stack, sDbl, stackTop); --stackTop; double lDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lDbl - rDbl; break; } case Token.NEG : { double rDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = -rDbl; break; } case Token.POS : { double rDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = rDbl; break; } case Token.MUL : { double rDbl = stack_double(stack, sDbl, stackTop); --stackTop; double lDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lDbl * rDbl; break; } case Token.DIV : { double rDbl = stack_double(stack, sDbl, stackTop); --stackTop; double lDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; // Detect the divide by zero or let Java do it ? sDbl[stackTop] = lDbl / rDbl; break; } case Token.MOD : { double rDbl = stack_double(stack, sDbl, stackTop); --stackTop; double lDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lDbl % rDbl; break; } case Token.NOT : { stack[stackTop] = stack_boolean(stack, sDbl, stackTop) ? Boolean.FALSE : Boolean.TRUE; break; } case Token.BINDNAME : { String name = strings[getIndex(iCode, pc)]; stack[++stackTop] = ScriptRuntime.bind(scope, name); pc += 2; break; } case Token.SETNAME : { String name = strings[getIndex(iCode, pc)]; Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Scriptable lhs = (Scriptable)stack[stackTop]; stack[stackTop] = ScriptRuntime.setName(lhs, rhs, scope, name); pc += 2; break; } case Token.DELPROP : { Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.delete(cx, scope, lhs, rhs); break; } case Token.GETPROP : { String name = (String)stack[stackTop]; --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.getProp(lhs, name, scope); break; } case Token.SETPROP : { Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; String name = (String)stack[stackTop]; --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.setProp(lhs, name, rhs, scope); break; } case Token.GETELEM : do_getElem(cx, stack, sDbl, stackTop, scope); --stackTop; break; case Token.SETELEM : do_setElem(cx, stack, sDbl, stackTop, scope); stackTop -= 2; break; case Icode_PROPINC : case Icode_PROPDEC : { String name = (String)stack[stackTop]; --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.postIncrDecr(lhs, name, scope, op == Icode_PROPINC); break; } case Icode_ELEMINC : case Icode_ELEMDEC : { Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.postIncrDecrElem(lhs, rhs, scope, op == Icode_ELEMINC); break; } case Token.LOCAL_SAVE : { int slot = (iCode[pc] & 0xFF); stack[LOCAL_SHFT + slot] = stack[stackTop]; sDbl[LOCAL_SHFT + slot] = sDbl[stackTop]; --stackTop; ++pc; break; } case Token.LOCAL_LOAD : { int slot = (iCode[pc] & 0xFF); ++stackTop; stack[stackTop] = stack[LOCAL_SHFT + slot]; sDbl[stackTop] = sDbl[LOCAL_SHFT + slot]; ++pc; break; } case Icode_CALLSPECIAL : { if (instructionThreshold != 0) { instructionCount += INVOCATION_COST; cx.instructionCount = instructionCount; instructionCount = -1; } int callType = iCode[pc] & 0xFF; boolean isNew = (iCode[pc + 1] != 0); int sourceLine = getShort(iCode, pc + 2); int count = getIndex(iCode, pc + 4); stackTop -= count; Object[] outArgs = getArgsArray(stack, sDbl, stackTop + 1, count); Object functionThis; if (isNew) { functionThis = null; } else { functionThis = stack[stackTop]; if (functionThis == DBL_MRK) { functionThis = doubleWrap(sDbl[stackTop]); } --stackTop; } Object function = stack[stackTop]; if (function == DBL_MRK) function = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.callSpecial( cx, function, isNew, functionThis, outArgs, scope, thisObj, callType, idata.itsSourceFile, sourceLine); instructionCount = cx.instructionCount; pc += 6; break; } case Token.CALL : { if (instructionThreshold != 0) { instructionCount += INVOCATION_COST; cx.instructionCount = instructionCount; instructionCount = -1; } int count = getIndex(iCode, pc + 2); stackTop -= count; int calleeArgShft = stackTop + 1; Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Object lhs = stack[stackTop]; Scriptable calleeScope = scope; if (idata.itsNeedsActivation) { calleeScope = ScriptableObject.getTopLevelScope(scope); } Scriptable calleeThis; if (rhs instanceof Scriptable || rhs == null) { calleeThis = (Scriptable)rhs; } else { calleeThis = ScriptRuntime.toObject(cx, calleeScope, rhs); } if (lhs instanceof InterpretedFunction) { // Inlining of InterpretedFunction.call not to create // argument array InterpretedFunction f = (InterpretedFunction)lhs; stack[stackTop] = interpret(cx, calleeScope, calleeThis, stack, sDbl, calleeArgShft, count, f, f.itsData); } else if (lhs instanceof Function) { Function f = (Function)lhs; Object[] outArgs = getArgsArray(stack, sDbl, calleeArgShft, count); stack[stackTop] = f.call(cx, calleeScope, calleeThis, outArgs); } else { if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); else if (lhs == undefined) { // special code for better error message for call // to undefined lhs = strings[getIndex(iCode, pc)]; if (lhs == null) lhs = undefined; } throw ScriptRuntime.typeError1("msg.isnt.function", ScriptRuntime.toString(lhs)); } instructionCount = cx.instructionCount; pc += 4; break; } case Token.NEW : { if (instructionThreshold != 0) { instructionCount += INVOCATION_COST; cx.instructionCount = instructionCount; instructionCount = -1; } int count = getIndex(iCode, pc + 2); stackTop -= count; int calleeArgShft = stackTop + 1; Object lhs = stack[stackTop]; if (lhs instanceof InterpretedFunction) { // Inlining of InterpretedFunction.construct not to create // argument array InterpretedFunction f = (InterpretedFunction)lhs; Scriptable newInstance = f.createObject(cx, scope); Object callResult = interpret(cx, scope, newInstance, stack, sDbl, calleeArgShft, count, f, f.itsData); if (callResult instanceof Scriptable && callResult != undefined) { stack[stackTop] = callResult; } else { stack[stackTop] = newInstance; } } else if (lhs instanceof Function) { Function f = (Function)lhs; Object[] outArgs = getArgsArray(stack, sDbl, calleeArgShft, count); stack[stackTop] = f.construct(cx, scope, outArgs); } else { if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); else if (lhs == undefined) { // special code for better error message for call // to undefined lhs = strings[getIndex(iCode, pc)]; if (lhs == null) lhs = undefined; } throw ScriptRuntime.typeError1("msg.isnt.function", ScriptRuntime.toString(lhs)); } instructionCount = cx.instructionCount; pc += 4; break; } case Token.TYPEOF : { Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.typeof(lhs); break; } case Icode_TYPEOFNAME : { String name = strings[getIndex(iCode, pc)]; stack[++stackTop] = ScriptRuntime.typeofName(scope, name); pc += 2; break; } case Icode_NAME_AND_THIS : { String name = strings[getIndex(iCode, pc)]; boolean skipGetThis = (0 != iCode[pc + 2]); stackTop = do_nameAndThis(stack, stackTop, scope, name, skipGetThis); pc += 3; break; } case Token.STRING : stack[++stackTop] = strings[getIndex(iCode, pc)]; pc += 2; break; case Icode_SHORTNUMBER : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = getShort(iCode, pc); pc += 2; break; case Icode_INTNUMBER : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = getInt(iCode, pc); pc += 4; break; case Token.NUMBER : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = idata.itsDoubleTable[getIndex(iCode, pc)]; pc += 2; break; case Token.NAME : { String name = strings[getIndex(iCode, pc)]; stack[++stackTop] = ScriptRuntime.name(scope, name); pc += 2; break; } case Icode_NAMEINC : case Icode_NAMEDEC : { String name = strings[getIndex(iCode, pc)]; stack[++stackTop] = ScriptRuntime.postIncrDecr(scope, name, op == Icode_NAMEINC); pc += 2; break; } case Token.SETVAR : { int slot = (iCode[pc] & 0xFF); if (!useActivationVars) { stack[VAR_SHFT + slot] = stack[stackTop]; sDbl[VAR_SHFT + slot] = sDbl[stackTop]; } else { Object val = stack[stackTop]; if (val == DBL_MRK) val = doubleWrap(sDbl[stackTop]); activationPut(fnOrScript, scope, slot, val); } ++pc; break; } case Token.GETVAR : { int slot = (iCode[pc] & 0xFF); ++stackTop; if (!useActivationVars) { stack[stackTop] = stack[VAR_SHFT + slot]; sDbl[stackTop] = sDbl[VAR_SHFT + slot]; } else { stack[stackTop] = activationGet(fnOrScript, scope, slot); } ++pc; break; } case Icode_VARINC : case Icode_VARDEC : { int slot = (iCode[pc] & 0xFF); ++stackTop; if (!useActivationVars) { Object val = stack[VAR_SHFT + slot]; stack[stackTop] = val; double d; if (val == DBL_MRK) { d = sDbl[VAR_SHFT + slot]; sDbl[stackTop] = d; } else { d = ScriptRuntime.toNumber(val); } stack[VAR_SHFT + slot] = DBL_MRK; sDbl[VAR_SHFT + slot] = (op == Icode_VARINC) ? d + 1.0 : d - 1.0; } else { Object val = activationGet(fnOrScript, scope, slot); stack[stackTop] = val; double d = ScriptRuntime.toNumber(val); val = doubleWrap((op == Icode_VARINC) ? d + 1.0 : d - 1.0); activationPut(fnOrScript, scope, slot, val); } ++pc; break; } case Token.ZERO : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = 0; break; case Token.ONE : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = 1; break; case Token.NULL : stack[++stackTop] = null; break; case Token.THIS : stack[++stackTop] = thisObj; break; case Token.THISFN : stack[++stackTop] = fnOrScript; break; case Token.FALSE : stack[++stackTop] = Boolean.FALSE; break; case Token.TRUE : stack[++stackTop] = Boolean.TRUE; break; case Token.UNDEFINED : stack[++stackTop] = Undefined.instance; break; case Token.ENTERWITH : { Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); --stackTop; scope = ScriptRuntime.enterWith(lhs, scope); ++withDepth; break; } case Token.LEAVEWITH : scope = ScriptRuntime.leaveWith(scope); --withDepth; break; case Token.CATCH_SCOPE : { String name = strings[getIndex(iCode, pc)]; stack[stackTop] = ScriptRuntime.newCatchScope(name, stack[stackTop]); pc += 2; break; } case Token.ENUM_INIT : { int slot = (iCode[pc] & 0xFF); Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); --stackTop; stack[LOCAL_SHFT + slot] = ScriptRuntime.enumInit(lhs, scope); ++pc; break; } case Token.ENUM_NEXT : case Token.ENUM_ID : { int slot = (iCode[pc] & 0xFF); Object val = stack[LOCAL_SHFT + slot]; ++stackTop; stack[stackTop] = (op == Token.ENUM_NEXT) ? (Object)ScriptRuntime.enumNext(val) : (Object)ScriptRuntime.enumId(val); ++pc; break; } case Icode_PUSH_PARENT : { Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[++stackTop] = ScriptRuntime.getParent(lhs); break; } case Icode_GETPROTO : case Icode_GETSCOPEPARENT : { Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); Object val; if (op == Icode_GETPROTO) { val = ScriptRuntime.getProto(lhs, scope); } else { val = ScriptRuntime.getParent(lhs, scope); } stack[stackTop] = val; break; } case Icode_SETPROTO : case Icode_SETPARENT : { Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); Object val; if (op == Icode_SETPROTO) { val = ScriptRuntime.setProto(lhs, rhs, scope); } else { val = ScriptRuntime.setParent(lhs, rhs, scope); } stack[stackTop] = val; break; } case Icode_SCOPE : stack[++stackTop] = scope; break; case Icode_CLOSURE : { int i = getIndex(iCode, pc); InterpreterData closureData = idata.itsNestedFunctions[i]; stack[++stackTop] = createFunction(cx, scope, closureData, idata.itsFromEvalCode); pc += 2; break; } case Token.REGEXP : { int i = getIndex(iCode, pc); Scriptable regexp; if (idata.itsFunctionType != 0) { regexp = ((InterpretedFunction)fnOrScript).itsRegExps[i]; } else { if (scriptRegExps == null) { scriptRegExps = wrapRegExps(cx, scope, idata); } regexp = scriptRegExps[i]; } stack[++stackTop] = regexp; pc += 2; break; } case Icode_LITERAL_NEW : { int i = getInt(iCode, pc); ++stackTop; stack[stackTop] = new Object[i]; sDbl[stackTop] = 0; pc += 4; break; } case Icode_LITERAL_SET : { Object value = stack[stackTop]; if (value == DBL_MRK) value = doubleWrap(sDbl[stackTop]); --stackTop; int i = (int)sDbl[stackTop]; ((Object[])stack[stackTop])[i] = value; sDbl[stackTop] = i + 1; break; } case Token.ARRAYLIT : case Token.OBJECTLIT : { int offset = getInt(iCode, pc); Object[] data = (Object[])stack[stackTop]; Object val; if (op == Token.ARRAYLIT) { int[] skipIndexces = null; if (offset >= 0) { skipIndexces = (int[])idata.literalIds[offset]; } val = ScriptRuntime.newArrayLiteral(data, skipIndexces, cx, scope); } else { Object[] ids = (Object[])idata.literalIds[offset]; val = ScriptRuntime.newObjectLiteral(ids, data, cx, scope); } stack[stackTop] = val; pc += 4; break; } case Icode_LINE : { cx.interpreterLineIndex = pc; if (debuggerFrame != null) { int line = getShort(iCode, pc); debuggerFrame.onLineChange(cx, line); } pc += 2; break; } default : { dumpICode(idata); throw new RuntimeException("Unknown icode : "+op+" @ pc : "+(pc-1)); } // end of interpreter switch } } catch (Throwable ex) { if (instructionThreshold != 0) { if (instructionCount < 0) { // throw during function call instructionCount = cx.instructionCount; } else { // throw during any other operation instructionCount += pc - pcPrevBranch; cx.instructionCount = instructionCount; } } javaException = ex; exceptionPC = pc; pc = getJavaCatchPC(iCode); continue Loop; } } cx.interpreterData = savedData; if (debuggerFrame != null) { if (javaException != null) { debuggerFrame.onExit(cx, true, javaException); } else { debuggerFrame.onExit(cx, false, result); } } if (idata.itsNeedsActivation || debuggerFrame != null) { ScriptRuntime.popActivation(cx); } if (instructionThreshold != 0) { if (instructionCount > instructionThreshold) { cx.observeInstructionCount(instructionCount); instructionCount = 0; } cx.instructionCount = instructionCount; } if (javaException != null) { if (javaException instanceof JavaScriptException) { throw (JavaScriptException)javaException; } else if (javaException instanceof RuntimeException) { throw (RuntimeException)javaException; } else { // Must be instance of Error or code bug throw (Error)javaException; } } return result; } | 12904 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12904/43cae3f59850b2e1bf3e15bda6d9eac95ae4284c/Interpreter.java/buggy/js/rhino/src/org/mozilla/javascript/Interpreter.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
760,
1033,
10634,
12,
1042,
9494,
16,
22780,
2146,
16,
22780,
15261,
16,
18701,
1033,
8526,
833,
16,
1645,
8526,
833,
40,
3083,
16,
18701,
509,
1501,
10544,
16,
509,
1501,
1380,
16,
18701... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
760,
1033,
10634,
12,
1042,
9494,
16,
22780,
2146,
16,
22780,
15261,
16,
18701,
1033,
8526,
833,
16,
1645,
8526,
833,
40,
3083,
16,
18701,
509,
1501,
10544,
16,
509,
1501,
1380,
16,
18701... |
AST tmp1037_AST_in = (AST)_t; | AST tmp1036_AST_in = (AST)_t; | public final void disconnectstate(AST _t) throws RecognitionException { AST disconnectstate_AST_in = (_t == ASTNULL) ? null : (AST)_t; AST __t1279 = _t; AST tmp1036_AST_in = (AST)_t; match(_t,DISCONNECT); _t = _t.getFirstChild(); filenameorvalue(_t); _t = _retTree; { if (_t==null) _t=ASTNULL; switch ( _t.getType()) { case NOERROR_KW: { AST tmp1037_AST_in = (AST)_t; match(_t,NOERROR_KW); _t = _t.getNextSibling(); break; } case EOF: case PERIOD: { break; } default: { throw new NoViableAltException(_t); } } } state_end(_t); _t = _retTree; _t = __t1279; _t = _t.getNextSibling(); _retTree = _t; } | 13952 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/13952/daa15e07422d3491bbbb4d0060450c81983332a4/TreeParser03.java/clean/trunk/org.prorefactor.core/src/org/prorefactor/treeparser03/TreeParser03.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
727,
918,
9479,
2019,
12,
9053,
389,
88,
13,
1216,
9539,
288,
9506,
202,
9053,
9479,
2019,
67,
9053,
67,
267,
273,
261,
67,
88,
422,
9183,
8560,
13,
692,
446,
294,
261,
9053... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
727,
918,
9479,
2019,
12,
9053,
389,
88,
13,
1216,
9539,
288,
9506,
202,
9053,
9479,
2019,
67,
9053,
67,
267,
273,
261,
67,
88,
422,
9183,
8560,
13,
692,
446,
294,
261,
9053... |
{ if( sdw.getTypeSpecifier() instanceof IASTSimpleTypeSpecifier ) ((IASTSimpleTypeSpecifier)sdw.getTypeSpecifier()).releaseReferences( ); | { | protected IASTDeclaration simpleDeclaration( SimpleDeclarationStrategy strategy, IASTScope scope, IASTTemplate ownerTemplate, CompletionKind overideKind, boolean fromCatchHandler, KeywordSetKey overrideKey) throws BacktrackException, EndOfFileException { IToken firstToken = LA(1); int firstOffset = firstToken.getOffset(); int firstLine = firstToken.getLineNumber(); char [] fn = firstToken.getFilename(); if( firstToken.getType() == IToken.tLBRACE ) throwBacktrack(firstToken.getOffset(), firstToken.getEndOffset(), firstToken.getLineNumber(), firstToken.getFilename()); DeclarationWrapper sdw = new DeclarationWrapper(scope, firstToken.getOffset(), firstToken.getLineNumber(), ownerTemplate, fn); firstToken = null; // necessary for scalability CompletionKind completionKindForDeclaration = getCompletionKindForDeclaration(scope, overideKind); setCompletionValues( scope, completionKindForDeclaration, KeywordSetKey.DECL_SPECIFIER_SEQUENCE ); declSpecifierSeq(sdw, false, strategy == SimpleDeclarationStrategy.TRY_CONSTRUCTOR, completionKindForDeclaration, overrideKey ); IASTSimpleTypeSpecifier simpleTypeSpecifier = null; if (sdw.getTypeSpecifier() == null && sdw.getSimpleType() != IASTSimpleTypeSpecifier.Type.UNSPECIFIED ) try { simpleTypeSpecifier = astFactory.createSimpleTypeSpecifier( scope, sdw.getSimpleType(), sdw.getName(), sdw.isShort(), sdw.isLong(), sdw.isSigned(), sdw.isUnsigned(), sdw.isTypeNamed(), sdw.isComplex(), sdw.isImaginary(), sdw.isGloballyQualified(), sdw.getExtensionParameters()); sdw.setTypeSpecifier( simpleTypeSpecifier); sdw.setTypeName( null ); } catch (Exception e1) { int endOffset = ( lastToken != null ) ? lastToken.getEndOffset() : 0 ; logException( "simpleDeclaration:createSimpleTypeSpecifier", e1 ); //$NON-NLS-1$ if( e1 instanceof ASTSemanticException && ((ASTSemanticException)e1).getProblem() != null ) throwBacktrack(((ASTSemanticException)e1).getProblem()); else throwBacktrack(firstOffset, endOffset, firstLine, fn); } try { Declarator declarator = null; if (LT(1) != IToken.tSEMI) { declarator = initDeclarator(sdw, strategy, completionKindForDeclaration, constructInitializersInDeclarations ); while (LT(1) == IToken.tCOMMA) { consume(); initDeclarator(sdw, strategy, completionKindForDeclaration, constructInitializersInDeclarations ); } } boolean hasFunctionBody = false; boolean hasFunctionTryBlock = false; boolean consumedSemi = false; switch (LT(1)) { case IToken.tSEMI : consume(IToken.tSEMI); consumedSemi = true; break; case IToken.t_try : consume( IToken.t_try ); if( LT(1) == IToken.tCOLON ) ctorInitializer( declarator ); hasFunctionTryBlock = true; declarator.setFunctionTryBlock( true ); break; case IToken.tCOLON : ctorInitializer(declarator); break; case IToken.tLBRACE: break; case IToken.tRPAREN: if( ! fromCatchHandler ) throwBacktrack(firstOffset, LA(1).getEndOffset(), LA(1).getLineNumber(), fn); break; default: throwBacktrack(firstOffset, LA(1).getEndOffset(), LA(1).getLineNumber(), fn); } if( ! consumedSemi ) { if( LT(1) == IToken.tLBRACE ) { declarator.setHasFunctionBody(true); hasFunctionBody = true; } if( hasFunctionTryBlock && ! hasFunctionBody ) throwBacktrack(firstOffset, LA(1).getEndOffset(), LA(1).getLineNumber(), fn); } int endOffset = ( lastToken != null ) ? lastToken.getEndOffset() : 0 ; List l = null; try { l = sdw.createASTNodes(astFactory); } catch (ASTSemanticException e) { if( e.getProblem() == null ) { IProblem p = problemFactory.createProblem( IProblem.SYNTAX_ERROR, sdw.getStartingOffset(), lastToken != null ? lastToken.getEndOffset() : 0, sdw.getStartingLine(), fn, EMPTY_STRING, false, true ); throwBacktrack( p ); } else { throwBacktrack(e.getProblem()); } } catch( Exception e ) { logException( "simpleDecl", e ); //$NON-NLS-1$ throwBacktrack(firstOffset, endOffset, firstLine, fn); } if (hasFunctionBody && l.size() != 1) { throwBacktrack(firstOffset, endOffset, firstLine, fn); //TODO Should be an IProblem } if (!l.isEmpty()) // no need to do this unless we have a declarator { if (!hasFunctionBody || fromCatchHandler) { IASTDeclaration declaration = null; for( int i = 0; i < l.size(); ++i ) { declaration = (IASTDeclaration)l.get(i); ((IASTOffsetableElement)declaration).setEndingOffsetAndLineNumber( lastToken.getEndOffset(), lastToken.getLineNumber()); declaration.acceptElement( requestor ); if( sdw.getTypeSpecifier() instanceof IASTSimpleTypeSpecifier ) ((IASTSimpleTypeSpecifier)sdw.getTypeSpecifier()).releaseReferences( ); } return declaration; } IASTDeclaration declaration = (IASTDeclaration)l.get(0); endDeclaration( declaration ); declaration.enterScope( requestor ); try { if( sdw.getTypeSpecifier() instanceof IASTSimpleTypeSpecifier ) ((IASTSimpleTypeSpecifier)sdw.getTypeSpecifier()).releaseReferences( ); if ( !( declaration instanceof IASTScope ) ) throwBacktrack(firstOffset, endOffset, firstLine, fn); handleFunctionBody((IASTScope)declaration ); ((IASTOffsetableElement)declaration).setEndingOffsetAndLineNumber( lastToken.getEndOffset(), lastToken.getLineNumber()); } finally { declaration.exitScope( requestor ); } if( hasFunctionTryBlock ) catchHandlerSequence( scope ); return declaration; } try { if( sdw.getTypeSpecifier() != null ) { IASTAbstractTypeSpecifierDeclaration declaration = astFactory.createTypeSpecDeclaration( sdw.getScope(), sdw.getTypeSpecifier(), ownerTemplate, sdw.getStartingOffset(), sdw.getStartingLine(), lastToken.getEndOffset(), lastToken.getLineNumber(), sdw.isFriend(), lastToken.getFilename()); declaration.acceptElement(requestor); return declaration; } } catch (Exception e1) { logException( "simpleDeclaration:createTypeSpecDeclaration", e1 ); //$NON-NLS-1$ throwBacktrack(firstOffset, endOffset, firstLine, fn); } return null; } catch( BacktrackException be ) { if( simpleTypeSpecifier != null ) simpleTypeSpecifier.releaseReferences(); throwBacktrack(be); return null; } catch( EndOfFileException eof ) { if( simpleTypeSpecifier != null ) simpleTypeSpecifier.releaseReferences(); throw eof; } } | 6192 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6192/bea93881a346f0fa7a7630bbec250f39d402f250/Parser.java/buggy/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
467,
9053,
6094,
4143,
6094,
12,
3639,
4477,
6094,
4525,
6252,
16,
3639,
467,
9053,
3876,
2146,
16,
3639,
467,
9053,
2283,
3410,
2283,
16,
20735,
5677,
1879,
831,
5677,
16,
1250,
62... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
467,
9053,
6094,
4143,
6094,
12,
3639,
4477,
6094,
4525,
6252,
16,
3639,
467,
9053,
3876,
2146,
16,
3639,
467,
9053,
2283,
3410,
2283,
16,
20735,
5677,
1879,
831,
5677,
16,
1250,
62... |
public InserterContext(InserterContext ctx, SimpleEventProducer producer) { this.persistentFileTracker = ctx.persistentFileTracker; this.uskManager = ctx.uskManager; this.bf = ctx.bf; this.persistentBucketFactory = ctx.persistentBucketFactory; this.random = ctx.random; this.dontCompress = ctx.dontCompress; this.splitfileAlgorithm = ctx.splitfileAlgorithm; this.consecutiveRNFsCountAsSuccess = ctx.consecutiveRNFsCountAsSuccess; this.maxInsertRetries = ctx.maxInsertRetries; this.maxSplitInsertThreads = ctx.maxSplitInsertThreads; this.eventProducer = producer; this.splitfileSegmentDataBlocks = ctx.splitfileSegmentDataBlocks; this.splitfileSegmentCheckBlocks = ctx.splitfileSegmentCheckBlocks; this.cacheLocalRequests = ctx.cacheLocalRequests; | public InserterContext(BucketFactory bf, BucketFactory persistentBF, PersistentFileTracker tracker, RandomSource random, int maxRetries, int rnfsToSuccess, int maxThreads, int splitfileSegmentDataBlocks, int splitfileSegmentCheckBlocks, ClientEventProducer eventProducer, boolean cacheLocalRequests, USKManager uskManager) { this.bf = bf; this.persistentFileTracker = tracker; this.persistentBucketFactory = persistentBF; this.uskManager = uskManager; this.random = random; dontCompress = false; splitfileAlgorithm = Metadata.SPLITFILE_ONION_STANDARD; this.consecutiveRNFsCountAsSuccess = rnfsToSuccess; this.maxInsertRetries = maxRetries; this.maxSplitInsertThreads = maxThreads; this.eventProducer = eventProducer; this.splitfileSegmentDataBlocks = splitfileSegmentDataBlocks; this.splitfileSegmentCheckBlocks = splitfileSegmentCheckBlocks; this.cacheLocalRequests = cacheLocalRequests; | public InserterContext(InserterContext ctx, SimpleEventProducer producer) { this.persistentFileTracker = ctx.persistentFileTracker; this.uskManager = ctx.uskManager; this.bf = ctx.bf; this.persistentBucketFactory = ctx.persistentBucketFactory; this.random = ctx.random; this.dontCompress = ctx.dontCompress; this.splitfileAlgorithm = ctx.splitfileAlgorithm; this.consecutiveRNFsCountAsSuccess = ctx.consecutiveRNFsCountAsSuccess; this.maxInsertRetries = ctx.maxInsertRetries; this.maxSplitInsertThreads = ctx.maxSplitInsertThreads; this.eventProducer = producer; this.splitfileSegmentDataBlocks = ctx.splitfileSegmentDataBlocks; this.splitfileSegmentCheckBlocks = ctx.splitfileSegmentCheckBlocks; this.cacheLocalRequests = ctx.cacheLocalRequests; } | 50493 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50493/463e1c2814ef80eab9cbef79e58a1594fa8ec102/InserterContext.java/buggy/src/freenet/client/InserterContext.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
657,
550,
387,
1042,
12,
382,
550,
387,
1042,
1103,
16,
4477,
1133,
12140,
12608,
13,
288,
202,
202,
2211,
18,
19393,
812,
8135,
273,
1103,
18,
19393,
812,
8135,
31,
202,
202,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
657,
550,
387,
1042,
12,
382,
550,
387,
1042,
1103,
16,
4477,
1133,
12140,
12608,
13,
288,
202,
202,
2211,
18,
19393,
812,
8135,
273,
1103,
18,
19393,
812,
8135,
31,
202,
202,... |
List formals = nn.formals(); | List<Formal> formals = nn.formals(); | public Node typeCheckOverride(Node parent, TypeChecker tc) throws SemanticException { MethodDecl nn = this; MethodDecl old = nn; // Step I. Typecheck the formal arguments. TypeChecker childtc = (TypeChecker) tc.enter(parent, nn); nn = nn.formals(nn.visitList(nn.formals(),childtc)); // Now build the new formal arg list. // TODO: Add a marker to the TypeChecker which records // whether in fact it changed the type of any formal. if (tc.hasErrors()) throw new SemanticException(); if (nn != old) { List formals = nn.formals(); //List newFormals = new ArrayList(formals.size()); List formalTypes = new ArrayList(formals.size()); Iterator it = formals.iterator(); while (it.hasNext()) { Formal n = (Formal) it.next(); Type newType = n.type().type(); //LocalInstance li = n.localInstance().type(newType); //newFormals.add(n.localInstance(li)); formalTypes.add(newType); } //nn = nn.formals(newFormals); nn.methodInstance().setFormalTypes(formalTypes); // Report.report(1, "X10MethodDecl_c: typeoverride mi= " + nn.methodInstance()); } // Step II. Check the return tpe. // Now visit the returntype to ensure that its depclause, if any is processed. // Visit the formals so that they get added to the scope .. the return type // may reference them. //TypeChecker tc1 = (TypeChecker) tc.copy(); // childtc will have a "wrong" mi pushed in, but that doesnt matter. // we simply need to push in a non-null mi here. TypeChecker childtc1 = (TypeChecker) tc.enter(parent, nn); // Add the formals to the context. nn.visitList(nn.formals(),childtc1); nn = nn.returnType((TypeNode) nn.visitChild(nn.returnType(), childtc1)); if (childtc1.hasErrors()) throw new SemanticException(); if (! nn.returnType().type().isCanonical()) { return nn; } // Update the methodInstance with the depclause-enriched returnType. nn.methodInstance().setReturnType(nn.returnType().type()); // Report.report(1, "X10MethodDecl_c: typeoverride mi= " + nn.methodInstance()); // Step III. Check the body. // We must do it with the correct mi -- the return type will be // checked by return e; statements in the body. TypeChecker childtc2 = (TypeChecker) tc.enter(parent, nn); // Add the formals to the context. nn.visitList(nn.formals(),childtc2); //Report.report(1, "X10MethodDecl_c: after visiting formals " + childtc2.context()); // Now process the body. nn = (MethodDecl) nn.body((Block) nn.visitChild(nn.body(), childtc2)); if (childtc2.hasErrors()) throw new SemanticException(); nn = (MethodDecl) childtc2.leave(parent, old, nn, childtc2); return nn; } | 1832 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1832/f8e1720cd66996a6339b992bf154aa0d019240a3/X10MethodDecl_c.java/clean/x10.compiler/src/polyglot/ext/x10/ast/X10MethodDecl_c.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
540,
1071,
2029,
618,
1564,
6618,
12,
907,
982,
16,
1412,
8847,
1715,
13,
1216,
24747,
503,
288,
540,
202,
1305,
3456,
7761,
273,
333,
31,
5411,
2985,
3456,
1592,
273,
7761,
31,
13491,
368,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
540,
1071,
2029,
618,
1564,
6618,
12,
907,
982,
16,
1412,
8847,
1715,
13,
1216,
24747,
503,
288,
540,
202,
1305,
3456,
7761,
273,
333,
31,
5411,
2985,
3456,
1592,
273,
7761,
31,
13491,
368,
... |
CellDesign cell = row.getCell( j ); ColumnDesign column = table.getColumn( cell.getColumn( ) ); if ( column.getSuppressDuplicate( ) ) | RowDesign row = detail.getRow( i ); for ( int j = 0; j < row.getCellCount( ); j++ ) | public void visitTable( TableHandle handle ) { // Create Table Item TableItemDesign table = new TableItemDesign( ); table.setRepeatHeader( handle.repeatHeader( ) ); setupListingItem( table, handle ); // Handle table caption String caption = handle.getCaption( ); String captionKey = handle.getCaptionKey( ); if ( caption != null || captionKey != null ) { table.setCaption( captionKey, caption ); } // Handle table Columns SlotHandle columnSlot = handle.getColumns( ); for ( int i = 0; i < columnSlot.getCount( ); i++ ) { ColumnHandle columnHandle = (ColumnHandle) columnSlot.get( i ); apply( columnHandle ); if ( currentElement != null ) { ColumnDesign columnDesign = (ColumnDesign) currentElement; for ( int j = 0; j < columnHandle.getRepeatCount( ); j++ ) { table.addColumn( columnDesign ); } } } // Handle Table Header SlotHandle headerSlot = handle.getHeader( ); TableBandDesign header = createTableBand( headerSlot ); header.setBandType( TableBandDesign.BAND_HEADER ); table.setHeader( header ); // Handle grouping in table SlotHandle groupSlot = handle.getGroups( ); for ( int i = 0; i < groupSlot.getCount( ); i++ ) { apply( groupSlot.get( i ) ); if ( currentElement != null ) { GroupDesign group = (GroupDesign) currentElement; group.setGroupLevel( i ); table.addGroup( group ); } } // Handle detail section SlotHandle detailSlot = handle.getDetail( ); TableBandDesign detail = createTableBand( detailSlot ); detail.setBandType( TableBandDesign.BAND_DETAIL ); table.setDetail( detail ); // Handle table footer SlotHandle footerSlot = handle.getFooter( ); TableBandDesign footer = createTableBand( footerSlot ); footer.setBandType( TableBandDesign.BAND_FOOTER ); table.setFooter( footer ); new TableItemDesignLayout( ).layout( table ); //setup the supressDuplicate property of the data items in the //detail band detail = (TableBandDesign) table.getDetail( ); for ( int i = 0; i < detail.getRowCount( ); i++ ) { RowDesign row = detail.getRow(i); for (int j = 0; j < row.getCellCount( ); j++) { CellDesign cell = row.getCell( j ); ColumnDesign column = table.getColumn( cell.getColumn( ) ); if ( column.getSuppressDuplicate( ) ) { for ( int k = 0; k < cell.getContentCount( ); k++ ) { ReportItemDesign item = cell.getContent( k ); if ( item instanceof DataItemDesign ) { DataItemDesign dataItem = ( DataItemDesign )item; dataItem.setSuppressDuplicate( true ); } } } if ( !column.hasDataItemsInDetail( ) ) { for ( int k = 0; k < cell.getContentCount( ); k++ ) { ReportItemDesign item = cell.getContent( k ); if ( item instanceof DataItemDesign ) { column.setHasDataItemsInDetail( true ); break; } } } } } currentElement = table; } | 15160 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/15160/aae2e17b3a4d3ea45b489ef2f0c59ab5e9576e76/EngineIRVisitor.java/buggy/engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/parser/EngineIRVisitor.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
3757,
1388,
12,
3555,
3259,
1640,
262,
202,
95,
202,
202,
759,
1788,
3555,
4342,
202,
202,
1388,
1180,
15478,
1014,
273,
394,
3555,
1180,
15478,
12,
11272,
202,
202,
2121,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
3757,
1388,
12,
3555,
3259,
1640,
262,
202,
95,
202,
202,
759,
1788,
3555,
4342,
202,
202,
1388,
1180,
15478,
1014,
273,
394,
3555,
1180,
15478,
12,
11272,
202,
202,
2121,
... |
BugzillaQueryHit hit1Twin = new BugzillaQueryHit(taskList, "description", "P1", repositoryURL, "1", null, "status"); | BugzillaQueryHit hit1Twin = new BugzillaQueryHit(taskList, "description", "P1", repositoryURL, "1", null, "status"); | public void testUniqueTaskObjects() { init222(); String repositoryURL = "repositoryURL"; BugzillaQueryHit hit1 = new BugzillaQueryHit(taskList, "description", "P1", repositoryURL, "1", null, "status"); ITask task1 = hit1.getOrCreateCorrespondingTask(); assertNotNull(task1); // taskList.renameTask(task1, "testing"); // task1.setDescription("testing"); BugzillaQueryHit hit1Twin = new BugzillaQueryHit(taskList, "description", "P1", repositoryURL, "1", null, "status"); ITask task2 = hit1Twin.getOrCreateCorrespondingTask(); assertEquals(task1.getDescription(), task2.getDescription()); } | 51151 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51151/d0f62a17a841dde9896a777d14139cf82ac5bb4d/BugzillaRepositoryConnectorTest.java/clean/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1842,
6303,
2174,
4710,
1435,
288,
202,
202,
2738,
28855,
5621,
202,
202,
780,
3352,
1785,
273,
315,
9071,
1785,
14432,
202,
202,
19865,
15990,
1138,
13616,
6800,
21,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1842,
6303,
2174,
4710,
1435,
288,
202,
202,
2738,
28855,
5621,
202,
202,
780,
3352,
1785,
273,
315,
9071,
1785,
14432,
202,
202,
19865,
15990,
1138,
13616,
6800,
21,
273,
... |
intf = request.getParameter("intf"); if (nodeIdString == null) { throw new MissingParameterException("intf", requiredParameters); | if (intf == null) { throw new MissingParameterException("intf", requiredParameters); | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String graphType = request.getParameter("type"); if (graphType == null) { throw new MissingParameterException("type", new String[] { "type" } ); } GraphResults graphResults = new GraphResults(); String[] reports; int nodeId; String intf; GraphModel model; String view; if ("performance".equals(graphType)) { model = m_performanceModel; view = "/performance/results.jsp"; String[] requiredParameters = new String[] { "reports", "node" }; // required parameter reports reports = request.getParameterValues("reports"); if (reports == null) { throw new MissingParameterException("reports", requiredParameters); } // required parameter node String nodeIdString = request.getParameter("node"); if (nodeIdString == null) { throw new MissingParameterException("node", requiredParameters); } try { nodeId = Integer.parseInt(nodeIdString); } catch (NumberFormatException e) { throw new ServletException("Could not parse node parameter " + "into an integer", e); } // optional parameter intf intf = request.getParameter("intf"); } else if ("response".equals(graphType)) { model = m_responseTimeModel; view = "/response/results.jsp"; String[] requiredParameters = new String[] { "reports", "node", "intf" }; // required parameter reports reports = request.getParameterValues("reports"); if (reports == null) { throw new MissingParameterException("reports", requiredParameters); } // required parameter node String nodeIdString = request.getParameter("node"); if (nodeIdString == null) { throw new MissingParameterException("node", requiredParameters); } try { nodeId = Integer.parseInt(nodeIdString); } catch (NumberFormatException e) { throw new ServletException("Could not parse node parameter " + "into an integer", e); } // required parameter intf intf = request.getParameter("intf"); if (nodeIdString == null) { throw new MissingParameterException("intf", requiredParameters); } } else { throw new ServletException("Unsupported graph type \"" + graphType + "\""); } // see if the start and end time were explicitly set as params String start = request.getParameter("start"); String end = request.getParameter("end"); String relativeTime = request.getParameter("relativetime"); if ((start == null || end == null) && relativeTime != null) { // default to the first time period RelativeTimePeriod period = m_periods[0]; for (int i = 0; i < m_periods.length; i++) { if (relativeTime.equals(m_periods[i].getId())) { period = m_periods[i]; break; } } Calendar cal = new GregorianCalendar(); end = Long.toString(cal.getTime().getTime()); cal.add(period.getOffsetField(), period.getOffsetAmount()); start = Long.toString(cal.getTime().getTime()); } if (start == null || end == null) { String startMonth = request.getParameter("startMonth"); String startDate = request.getParameter("startDate"); String startYear = request.getParameter("startYear"); String startHour = request.getParameter("startHour"); String endMonth = request.getParameter("endMonth"); String endDate = request.getParameter("endDate"); String endYear = request.getParameter("endYear"); String endHour = request.getParameter("endHour"); if (startMonth == null || startDate == null || startYear == null || startHour == null || endMonth == null || endDate == null || endYear == null || endHour == null ) { throw new MissingParameterException("startMonth", new String[] { "startMonth", "startDate", "startYear", "startHour", "endMonth", "endDate", "endYear", "endHour" } ); } Calendar startCal = Calendar.getInstance(); startCal.set( Calendar.MONTH, Integer.parseInt( startMonth )); startCal.set( Calendar.DATE, Integer.parseInt( startDate )); startCal.set( Calendar.YEAR, Integer.parseInt( startYear )); startCal.set( Calendar.HOUR_OF_DAY, Integer.parseInt( startHour )); startCal.set( Calendar.MINUTE, 0 ); startCal.set( Calendar.SECOND, 0 ); startCal.set( Calendar.MILLISECOND, 0 ); Calendar endCal = Calendar.getInstance(); endCal.set( Calendar.MONTH, Integer.parseInt( endMonth )); endCal.set( Calendar.DATE, Integer.parseInt( endDate )); endCal.set( Calendar.YEAR, Integer.parseInt( endYear )); endCal.set( Calendar.HOUR_OF_DAY, Integer.parseInt( endHour )); endCal.set( Calendar.MINUTE, 0 ); endCal.set( Calendar.SECOND, 0 ); endCal.set( Calendar.MILLISECOND, 0 ); start = Long.toString(startCal.getTime().getTime()); end = Long.toString(endCal.getTime().getTime()); } // gather information for displaying around the image Date startDate = new Date(Long.parseLong(start)); Date endDate = new Date(Long.parseLong(end)); graphResults.setModel(model); graphResults.setNodeId(nodeId); graphResults.setIntf(intf); graphResults.setReports(reports); graphResults.setStart(startDate); graphResults.setEnd(endDate); graphResults.setRelativeTime(relativeTime); graphResults.setRelativeTimePeriods(m_periods); graphResults.initializeGraphs(); request.setAttribute("results", graphResults); // forward the request for proper display RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(view); dispatcher.forward(request, response); } | 48885 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/48885/20cfe0c634effd449d70c2d4bd7addbd21c11319/GraphResultsServlet.java/buggy/src/web/src/org/opennms/web/graph/GraphResultsServlet.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
23611,
12,
2940,
18572,
590,
16,
15604,
12446,
766,
13,
5411,
1216,
16517,
16,
1860,
288,
3639,
514,
2667,
559,
273,
590,
18,
588,
1662,
2932,
723,
8863,
3639,
309,
261,
4660,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
23611,
12,
2940,
18572,
590,
16,
15604,
12446,
766,
13,
5411,
1216,
16517,
16,
1860,
288,
3639,
514,
2667,
559,
273,
590,
18,
588,
1662,
2932,
723,
8863,
3639,
309,
261,
4660,
... |
state.result.min = min; state.result.max = max; /* QUANT, <min>, <max>, <parencount>, <parenindex>, <next> ... <ENDCHILD> */ state.progLength += 12; | /* balance '{' */ | parseTerm(CompilerState state) { char[] src = state.cpbegin; char c = src[state.cp++]; int nDigits = 2; int parenBaseCount = state.parenCount; int num, tmp; RENode term; int termStart; int ocp = state.cp; switch (c) { /* assertions and atoms */ case '^': state.result = new RENode(REOP_BOL); state.progLength++; return true; case '$': state.result = new RENode(REOP_EOL); state.progLength++; return true; case '\\': if (state.cp < state.cpend) { c = src[state.cp++]; switch (c) { /* assertion escapes */ case 'b' : state.result = new RENode(REOP_WBDRY); state.progLength++; return true; case 'B': state.result = new RENode(REOP_WNONBDRY); state.progLength++; return true; /* Decimal escape */ case '0':/* * Under 'strict' ECMA 3, we interpret \0 as NUL and don't accept octal. * However, (XXX and since Rhino doesn't have a 'strict' mode) we'll just * behave the old way for compatibility reasons. * (see http://bugzilla.mozilla.org/show_bug.cgi?id=141078) * */ /* octal escape */ num = 0; while (state.cp < state.cpend) { c = src[state.cp]; if ((c >= '0') && (c <= '7')) { state.cp++; tmp = 8 * num + (c - '0'); if (tmp > 0377) break; num = tmp; } else break; } c = (char)(num); doFlat(state, c); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': termStart = state.cp - 1; num = getDecimalValue(c, state); /* * n > 9 and > count of parentheses, * then treat as octal instead. */ if ((num > 9) && (num > state.parenCount)) { state.cp = termStart; num = 0; while (state.cp < state.cpend) { c = src[state.cp]; if ((c >= '0') && (c <= '7')) { state.cp++; tmp = 8 * num + (c - '0'); if (tmp > 0377) break; num = tmp; } else break; } c = (char)(num); doFlat(state, c); break; } /* otherwise, it's a back-reference */ state.result = new RENode(REOP_BACKREF); state.result.parenIndex = num - 1; state.progLength += 3; break; /* Control escape */ case 'f': c = 0xC; doFlat(state, c); break; case 'n': c = 0xA; doFlat(state, c); break; case 'r': c = 0xD; doFlat(state, c); break; case 't': c = 0x9; doFlat(state, c); break; case 'v': c = 0xB; doFlat(state, c); break; /* Control letter */ case 'c': if (((state.cp + 1) < state.cpend) && Character.isLetter(src[state.cp + 1])) c = (char)(src[state.cp++] & 0x1F); else { /* back off to accepting the original '\' as a literal */ --state.cp; c = '\\'; } doFlat(state, c); break; /* UnicodeEscapeSequence */ case 'u': nDigits += 2; // fall thru... /* HexEscapeSequence */ case 'x': { int n = 0; int i; for (i = 0; (i < nDigits) && (state.cp < state.cpend); i++) { int digit; c = src[state.cp++]; if (!isHex(c)) { /* * back off to accepting the original * 'u' or 'x' as a literal */ state.cp -= (i + 2); n = src[state.cp++]; break; } n = (n << 4) | unHex(c); } c = (char)(n); } doFlat(state, c); break; /* Character class escapes */ case 'd': state.result = new RENode(REOP_DIGIT); state.progLength++; break; case 'D': state.result = new RENode(REOP_NONDIGIT); state.progLength++; break; case 's': state.result = new RENode(REOP_SPACE); state.progLength++; break; case 'S': state.result = new RENode(REOP_NONSPACE); state.progLength++; break; case 'w': state.result = new RENode(REOP_ALNUM); state.progLength++; break; case 'W': state.result = new RENode(REOP_NONALNUM); state.progLength++; break; /* IdentityEscape */ default: state.result = new RENode(REOP_FLAT); state.result.chr = c; state.result.length = 1; state.result.flatIndex = state.cp - 1; state.progLength += 3; break; } break; } else { /* a trailing '\' is an error */ reportError("msg.trail.backslash", ""); return false; } case '(': { RENode result = null; termStart = state.cp; if (state.cp + 1 < state.cpend && src[state.cp] == '?' && ((c = src[state.cp + 1]) == '=' || c == '!' || c == ':')) { state.cp += 2; if (c == '=') { result = new RENode(REOP_ASSERT); /* ASSERT, <next>, ... ASSERTTEST */ state.progLength += 4; } else if (c == '!') { result = new RENode(REOP_ASSERT_NOT); /* ASSERTNOT, <next>, ... ASSERTNOTTEST */ state.progLength += 4; } } else { result = new RENode(REOP_LPAREN); /* LPAREN, <index>, ... RPAREN, <index> */ state.progLength += 6; result.parenIndex = state.parenCount++; } ++state.parenNesting; if (!parseDisjunction(state)) return false; if (state.cp == state.cpend || src[state.cp] != ')') { reportError("msg.unterm.paren", ""); return false; } ++state.cp; --state.parenNesting; if (result != null) { result.kid = state.result; state.result = result; } break; } case ')': reportError("msg.re.unmatched.right.paren", ""); return false; case '[': state.result = new RENode(REOP_CLASS); termStart = state.cp; state.result.startIndex = termStart; while (true) { if (state.cp == state.cpend) { reportError("msg.unterm.class", ""); return false; } if (src[state.cp] == '\\') state.cp++; else { if (src[state.cp] == ']') { state.result.kidlen = state.cp - termStart; break; } } state.cp++; } state.result.index = state.classCount++; /* * Call calculateBitmapSize now as we want any errors it finds * to be reported during the parse phase, not at execution. */ if (!calculateBitmapSize(state, state.result, src, termStart, state.cp++)) return false; state.progLength += 3; /* CLASS, <index> */ break; case '.': state.result = new RENode(REOP_DOT); state.progLength++; break; case '*': case '+': case '?': reportError("msg.bad.quant", String.valueOf(src[state.cp - 1])); return false; case '{': /* Treat left-curly in a non-quantifier context as an error only * if it's followed immediately by a decimal digit. * This is an Perl extension. */ if ((state.cp != state.cpend) && isDigit(src[state.cp])) { reportError("msg.bad.quant", String.valueOf(src[state.cp - 1])); return false; } // fall thru... default: state.result = new RENode(REOP_FLAT); state.result.chr = c; state.result.length = 1; state.result.flatIndex = state.cp - 1; state.progLength += 3; break; } term = state.result; boolean hasQ = false; if (state.cp < state.cpend) { switch (src[state.cp]) { case '+': state.result = new RENode(REOP_QUANT); state.result.min = 1; state.result.max = -1; /* <PLUS>, <parencount>, <parenindex>, <next> ... <ENDCHILD> */ state.progLength += 8; hasQ = true; break; case '*': state.result = new RENode(REOP_QUANT); state.result.min = 0; state.result.max = -1; /* <STAR>, <parencount>, <parenindex>, <next> ... <ENDCHILD> */ state.progLength += 8; hasQ = true; break; case '?': state.result = new RENode(REOP_QUANT); state.result.min = 0; state.result.max = 1; /* <OPT>, <parencount>, <parenindex>, <next> ... <ENDCHILD> */ state.progLength += 8; hasQ = true; break; case '{': { int min = 0; int max = -1; int errIndex = state.cp++; c = src[state.cp]; if (isDigit(c)) { ++state.cp; min = getDecimalValue(c, state); c = src[state.cp]; } else { /* For Perl etc. compatibility, if a curly is not * followed by a proper digit, back off from it * being a quantifier, and chew it up as a literal * atom next time instead. */ --state.cp; return true; } state.result = new RENode(REOP_QUANT); if ((min >> 16) != 0) { reportError("msg.overlarge.max", String.valueOf(src[state.cp])); return false; } if (c == ',') { c = src[++state.cp]; if (isDigit(c)) { ++state.cp; max = getDecimalValue(c, state); c = src[state.cp]; if ((max >> 16) != 0) { reportError("msg.overlarge.max", String.valueOf(src[state.cp])); return false; } if (min > max) { reportError("msg.max.lt.min", String.valueOf(src[state.cp])); return false; } } if (max == 0) { reportError("msg.zero.quant", String.valueOf(src[state.cp])); return false; } } else { max = min; } state.result.min = min; state.result.max = max; /* QUANT, <min>, <max>, <parencount>, <parenindex>, <next> ... <ENDCHILD> */ state.progLength += 12; if (c == '}') { hasQ = true; break; } else { reportError("msg.unterm.quant", String.valueOf(src[state.cp])); return false; } } } } if (!hasQ) return true; ++state.cp; state.result.kid = term; state.result.parenIndex = parenBaseCount; state.result.parenCount = state.parenCount - parenBaseCount; if ((state.cp < state.cpend) && (src[state.cp] == '?')) { ++state.cp; state.result.greedy = false; } else state.result.greedy = true; return true; } | 12376 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12376/497a0f766cc99c8e45495dadad51256e065545d1/NativeRegExp.java/buggy/js/rhino/src/org/mozilla/javascript/regexp/NativeRegExp.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1109,
4065,
12,
9213,
1119,
919,
13,
565,
288,
3639,
1149,
8526,
1705,
273,
919,
18,
4057,
10086,
31,
3639,
1149,
276,
273,
1705,
63,
2019,
18,
4057,
9904,
15533,
3639,
509,
290,
9537,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1109,
4065,
12,
9213,
1119,
919,
13,
565,
288,
3639,
1149,
8526,
1705,
273,
919,
18,
4057,
10086,
31,
3639,
1149,
276,
273,
1705,
63,
2019,
18,
4057,
9904,
15533,
3639,
509,
290,
9537,
... |
public static RubyClass createRegexpClass(Ruby runtime) { RubyClass regexpClass = new RegexpDefinition(runtime).getType(); | public static RubyClass createRegexpClass(Ruby ruby) { RubyClass regexpClass = ruby.defineClass("Regexp", ruby.getClasses().getObjectClass()); CallbackFactory callbackFactory = ruby.callbackFactory(); regexpClass.defineConstant("IGNORECASE", RubyFixnum.newFixnum(ruby, RE_OPTION_IGNORECASE)); regexpClass.defineConstant("EXTENDED", RubyFixnum.newFixnum(ruby, RE_OPTION_EXTENDED)); regexpClass.defineConstant("MULTILINE", RubyFixnum.newFixnum(ruby, RE_OPTION_MULTILINE)); | public static RubyClass createRegexpClass(Ruby runtime) { RubyClass regexpClass = new RegexpDefinition(runtime).getType(); regexpClass.defineConstant("IGNORECASE", RubyFixnum.newFixnum(runtime, RE_OPTION_IGNORECASE)); regexpClass.defineConstant("EXTENDED", RubyFixnum.newFixnum(runtime, RE_OPTION_EXTENDED)); regexpClass.defineConstant("MULTILINE", RubyFixnum.newFixnum(runtime, RE_OPTION_MULTILINE)); return regexpClass; } | 47273 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47273/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyRegexp.java/buggy/src/org/jruby/RubyRegexp.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
19817,
797,
752,
14621,
797,
12,
54,
10340,
3099,
13,
288,
3639,
19817,
797,
7195,
797,
273,
394,
17011,
1852,
12,
9448,
2934,
588,
559,
5621,
3639,
7195,
797,
18,
11255,
6902,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
19817,
797,
752,
14621,
797,
12,
54,
10340,
3099,
13,
288,
3639,
19817,
797,
7195,
797,
273,
394,
17011,
1852,
12,
9448,
2934,
588,
559,
5621,
3639,
7195,
797,
18,
11255,
6902,... |
return js_NaN_date_str; | return jsFunction_NaN_date_str; | public String jsFunction_toUTCString() { if (this.date != this.date) return js_NaN_date_str; StringBuffer result = new StringBuffer(60); String dateStr = Integer.toString(DateFromTime(this.date)); String hourStr = Integer.toString(HourFromTime(this.date)); String minStr = Integer.toString(MinFromTime(this.date)); String secStr = Integer.toString(SecFromTime(this.date)); int year = YearFromTime(this.date); String yearStr = Integer.toString(year > 0 ? year : -year); result.append(days[WeekDay(this.date)]); result.append(", "); if (dateStr.length() == 1) result.append("0"); result.append(dateStr); result.append(" "); result.append(months[MonthFromTime(this.date)]); if (year < 0) result.append(" -"); else result.append(" "); int i; for (i = yearStr.length(); i < 4; i++) result.append("0"); result.append(yearStr); if (hourStr.length() == 1) result.append(" 0"); else result.append(" "); result.append(hourStr); if (minStr.length() == 1) result.append(":0"); else result.append(":"); result.append(minStr); if (secStr.length() == 1) result.append(":0"); else result.append(":"); result.append(secStr); result.append(" GMT"); return result.toString(); } | 19000 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/19000/5af1999afa2517f3fdd455bd42c304be785b5b59/NativeDate.java/buggy/src/org/mozilla/javascript/NativeDate.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
514,
3828,
2083,
67,
869,
11471,
780,
1435,
288,
3639,
309,
261,
2211,
18,
712,
480,
333,
18,
712,
13,
5411,
327,
3828,
2083,
67,
21172,
67,
712,
67,
701,
31,
3639,
6674,
563,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
514,
3828,
2083,
67,
869,
11471,
780,
1435,
288,
3639,
309,
261,
2211,
18,
712,
480,
333,
18,
712,
13,
5411,
327,
3828,
2083,
67,
21172,
67,
712,
67,
701,
31,
3639,
6674,
563,
2... |
public static URL getResource(String resourceName, Class callingClass) { | public static URL getResource(final String resourceName, final Class callingClass) { | public static URL getResource(String resourceName, Class callingClass) { URL url = null; url = Thread.currentThread().getContextClassLoader().getResource(resourceName); if (url == null) { url = ClassHelper.class.getClassLoader().getResource(resourceName); } if (url == null) { url = callingClass.getClassLoader().getResource(resourceName); } return url; } | 2370 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2370/474b57065fd42f121b8743a207c223c19f72c625/ClassHelper.java/clean/mule/src/java/org/mule/util/ClassHelper.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
1976,
5070,
12,
780,
9546,
16,
1659,
4440,
797,
13,
565,
288,
3639,
1976,
880,
273,
446,
31,
3639,
880,
273,
4884,
18,
2972,
3830,
7675,
29120,
7805,
7675,
588,
1420,
12,
314... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
1976,
5070,
12,
780,
9546,
16,
1659,
4440,
797,
13,
565,
288,
3639,
1976,
880,
273,
446,
31,
3639,
880,
273,
4884,
18,
2972,
3830,
7675,
29120,
7805,
7675,
588,
1420,
12,
314... |
stringBuffer.append(TEXT_399); | stringBuffer.append(TEXT_341); | public String generate(Object argument) { final StringBuffer stringBuffer = new StringBuffer(); final GenCommonBase genElement = (GenCommonBase) ((Object[]) argument)[0];final GenChildLabelNode genChildNode = (GenChildLabelNode)genElement;GenNode genHost = genChildNode;GenNode genNode = genChildNode; /*var used by componentEditPolicy.javajetinc*/GenClass underlyingMetaClass = genHost.getDomainMetaClass();GenDiagram genDiagram = genChildNode.getDiagram();final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];LabelModelFacet labelModelFacet = genChildNode.getLabelModelFacet();final boolean isReadOnly = genChildNode.isLabelReadOnly(); stringBuffer.append(TEXT_1); String copyrightText = genDiagram.getEditorGen().getCopyrightText();if (copyrightText != null && copyrightText.trim().length() > 0) { stringBuffer.append(TEXT_2); stringBuffer.append(copyrightText.replaceAll("\n", "\n * ")); stringBuffer.append(TEXT_3); } stringBuffer.append(TEXT_4); stringBuffer.append(TEXT_5); class FeatureGetAccessorHelper { /** * @param containerName the name of the container * @param feature the feature whose value is in interest * @param containerMetaClass the <code>GenClass</code> of the container, or <code>null</code>, if the container is declared as an <code>EObject</code>. * @param needsCastToResultType whether the cast to the result type is required (this parameter is only used if the <code>EClass</code> this feature belongs to is an external interface). */ public void appendFeatureValueGetter(String containerName, GenFeature feature, GenClass containerMetaClass, boolean needsCastToResultType) { if (feature.getGenClass().isExternalInterface()) { boolean needsCastToEObject = containerMetaClass != null && containerMetaClass.isExternalInterface(); if (needsCastToResultType) { stringBuffer.append(TEXT_6); stringBuffer.append(importManager.getImportedName(feature.isListType() ? "java.util.Collection" : feature.getTypeGenClass().getQualifiedInterfaceName())); stringBuffer.append(TEXT_7); } if (needsCastToEObject) { stringBuffer.append(TEXT_8); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_9); } stringBuffer.append(containerName); if (needsCastToEObject) { stringBuffer.append(TEXT_10); } stringBuffer.append(TEXT_11); stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_12); stringBuffer.append(feature.getFeatureAccessorName()); stringBuffer.append(TEXT_13); if (needsCastToResultType) { stringBuffer.append(TEXT_14); } } else { boolean needsCastToFeatureGenType = containerMetaClass == null || containerMetaClass.isExternalInterface(); if (needsCastToFeatureGenType) { stringBuffer.append(TEXT_15); stringBuffer.append(importManager.getImportedName(feature.getGenClass().getQualifiedInterfaceName())); stringBuffer.append(TEXT_16); } stringBuffer.append(containerName); if (needsCastToFeatureGenType) { stringBuffer.append(TEXT_17); } stringBuffer.append(TEXT_18); stringBuffer.append(feature.getGetAccessor()); stringBuffer.append(TEXT_19); } }}final FeatureGetAccessorHelper myFeatureGetAccessorHelper = new FeatureGetAccessorHelper(); stringBuffer.append(TEXT_20); importManager.emitPackageStatement(stringBuffer);importManager.registerInnerClass("TreeEditPartAdapter");importManager.addImport("org.eclipse.gef.EditPolicy");importManager.addImport("org.eclipse.gef.Request");importManager.addImport("org.eclipse.gmf.runtime.notation.View");importManager.addImport("org.eclipse.gmf.runtime.notation.NotationPackage");importManager.addImport("java.util.List");importManager.markImportLocation(stringBuffer); stringBuffer.append(TEXT_21); stringBuffer.append(genChildNode.getEditPartClassName()); stringBuffer.append(TEXT_22); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.AbstractGraphicalEditPart")); stringBuffer.append(TEXT_23); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart")); stringBuffer.append(TEXT_24); {GenCommonBase genCommonBase = genChildNode; stringBuffer.append(TEXT_25); stringBuffer.append(TEXT_26); stringBuffer.append(genCommonBase.getVisualID()); stringBuffer.append(TEXT_27); } stringBuffer.append(TEXT_28); stringBuffer.append(TEXT_29); if (!isReadOnly) { stringBuffer.append(TEXT_30); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); stringBuffer.append(TEXT_31); } stringBuffer.append(TEXT_32); stringBuffer.append(genChildNode.getEditPartClassName()); stringBuffer.append(TEXT_33); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); stringBuffer.append(TEXT_34); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); stringBuffer.append(TEXT_35); stringBuffer.append(TEXT_36); stringBuffer.append(TEXT_37); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_38); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_39); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_40); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_41); String resolvedSemanticElement = "(" + importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName()) + ") getDiagramNode().getElement()"; final String primaryView = "getDiagramNode()"; if (!isReadOnly) { String editPatternCode = "EDIT_PATTERN"; //declared in labelText.javajetinc, used in directEditCommand.jetinc. stringBuffer.append(TEXT_42); stringBuffer.append(TEXT_43); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); stringBuffer.append(TEXT_44); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.DirectEditPolicy")); stringBuffer.append(TEXT_45); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); stringBuffer.append(TEXT_46); stringBuffer.append(TEXT_47); stringBuffer.append(TEXT_48); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); stringBuffer.append(TEXT_49); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); stringBuffer.append(TEXT_50); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); stringBuffer.append(TEXT_51); stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); stringBuffer.append(TEXT_52); stringBuffer.append(editPatternCode); stringBuffer.append(TEXT_53); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); stringBuffer.append(TEXT_54); stringBuffer.append(importManager.getImportedName("java.text.ParseException")); stringBuffer.append(TEXT_55); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); stringBuffer.append(TEXT_56); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_57); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); stringBuffer.append(TEXT_58); stringBuffer.append(primaryView); stringBuffer.append(TEXT_59); if (labelModelFacet instanceof FeatureLabelModelFacet) { GenFeature featureToSet = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); EStructuralFeature ecoreFeature = featureToSet.getEcoreFeature(); stringBuffer.append(TEXT_60); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); stringBuffer.append(TEXT_61); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); stringBuffer.append(TEXT_62); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")); stringBuffer.append(TEXT_63); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); stringBuffer.append(TEXT_64); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_65); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); stringBuffer.append(TEXT_66); stringBuffer.append(resolvedSemanticElement); stringBuffer.append(TEXT_67); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); stringBuffer.append(TEXT_68); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); stringBuffer.append(TEXT_69); stringBuffer.append(importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_70); stringBuffer.append(featureToSet.getFeatureAccessorName()); stringBuffer.append(TEXT_71); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.ParserUtil")); stringBuffer.append(TEXT_72); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); stringBuffer.append(TEXT_73); if (ecoreFeature.isMany()) { stringBuffer.append(TEXT_74); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_75); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_76); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); stringBuffer.append(TEXT_77); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); stringBuffer.append(TEXT_78); stringBuffer.append(featureToSet.getAccessorName()); stringBuffer.append(TEXT_79); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); stringBuffer.append(TEXT_80); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); stringBuffer.append(TEXT_81); } else { stringBuffer.append(TEXT_82); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); stringBuffer.append(TEXT_83); } stringBuffer.append(TEXT_84); } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; List metaFeatures = compositeFeatureLabelModelFacet.getMetaFeatures(); stringBuffer.append(TEXT_85); stringBuffer.append(metaFeatures.size()); stringBuffer.append(TEXT_86); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); stringBuffer.append(TEXT_87); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); stringBuffer.append(TEXT_88); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")); stringBuffer.append(TEXT_89); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); stringBuffer.append(TEXT_90); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_91); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); stringBuffer.append(TEXT_92); stringBuffer.append(resolvedSemanticElement); stringBuffer.append(TEXT_93); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_94); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_95); boolean haveDeclaredValues = false; for(int i = 0; i < metaFeatures.size(); i++) { GenFeature nextFeatureToSet = (GenFeature) metaFeatures.get(i); EStructuralFeature nextEcoreFeature = nextFeatureToSet.getEcoreFeature(); stringBuffer.append(TEXT_96); if (i == 0) { stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); stringBuffer.append(TEXT_97); } stringBuffer.append(TEXT_98); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); stringBuffer.append(TEXT_99); stringBuffer.append(importManager.getImportedName(nextFeatureToSet.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_100); stringBuffer.append(nextFeatureToSet.getFeatureAccessorName()); stringBuffer.append(TEXT_101); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.ParserUtil")); stringBuffer.append(TEXT_102); stringBuffer.append(i); stringBuffer.append(TEXT_103); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); stringBuffer.append(TEXT_104); if (nextEcoreFeature.isMany()) { stringBuffer.append(TEXT_105); if (!haveDeclaredValues) { haveDeclaredValues = true; stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); stringBuffer.append(TEXT_106); } stringBuffer.append(TEXT_107); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); stringBuffer.append(TEXT_108); stringBuffer.append(nextFeatureToSet.getAccessorName()); stringBuffer.append(TEXT_109); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); stringBuffer.append(TEXT_110); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); stringBuffer.append(TEXT_111); } else { stringBuffer.append(TEXT_112); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); stringBuffer.append(TEXT_113); } } stringBuffer.append(TEXT_114); } stringBuffer.append(TEXT_115); } stringBuffer.append(TEXT_116); stringBuffer.append(TEXT_117); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); stringBuffer.append(TEXT_118); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy")); stringBuffer.append(TEXT_119); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); stringBuffer.append(TEXT_120); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest")); stringBuffer.append(TEXT_121); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_122); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); stringBuffer.append(TEXT_123); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_124); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_125); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); stringBuffer.append(TEXT_126); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")); stringBuffer.append(TEXT_127); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_128); {TypeModelFacet facet = genNode.getModelFacet();GenFeature childFeature = facet.getChildMetaFeature();GenFeature containmentFeature = facet.getContainmentMetaFeature();if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) { stringBuffer.append(TEXT_129); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_130); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_131); if (containmentFeature.getEcoreFeature().isMany()) { stringBuffer.append(TEXT_132); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); stringBuffer.append(TEXT_133); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_134); stringBuffer.append(containmentFeature.getFeatureAccessorName()); stringBuffer.append(TEXT_135); } else { stringBuffer.append(TEXT_136); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); stringBuffer.append(TEXT_137); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_138); stringBuffer.append(containmentFeature.getFeatureAccessorName()); stringBuffer.append(TEXT_139); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); stringBuffer.append(TEXT_140); } if (childFeature.getEcoreFeature().isMany()) { stringBuffer.append(TEXT_141); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); stringBuffer.append(TEXT_142); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_143); stringBuffer.append(childFeature.getFeatureAccessorName()); stringBuffer.append(TEXT_144); } else { stringBuffer.append(TEXT_145); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); stringBuffer.append(TEXT_146); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_147); stringBuffer.append(childFeature.getFeatureAccessorName()); stringBuffer.append(TEXT_148); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); stringBuffer.append(TEXT_149); } stringBuffer.append(TEXT_150); } else { if (containmentFeature.getEcoreFeature().isMany()) { stringBuffer.append(TEXT_151); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); stringBuffer.append(TEXT_152); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_153); stringBuffer.append(containmentFeature.getFeatureAccessorName()); stringBuffer.append(TEXT_154); } else { stringBuffer.append(TEXT_155); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); stringBuffer.append(TEXT_156); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_157); stringBuffer.append(containmentFeature.getFeatureAccessorName()); stringBuffer.append(TEXT_158); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); stringBuffer.append(TEXT_159); }} stringBuffer.append(TEXT_160); } /*restrict local vars used in component edit policy*/ stringBuffer.append(TEXT_161); if (!isReadOnly) { stringBuffer.append(TEXT_162); stringBuffer.append(TEXT_163); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); stringBuffer.append(TEXT_164); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); stringBuffer.append(TEXT_165); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); stringBuffer.append(TEXT_166); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); stringBuffer.append(TEXT_167); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TextCellEditor")); stringBuffer.append(TEXT_168); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.CellEditorLocator")); stringBuffer.append(TEXT_169); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.CellEditor")); stringBuffer.append(TEXT_170); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); stringBuffer.append(TEXT_171); } stringBuffer.append(TEXT_172); stringBuffer.append(TEXT_173); /*genFeature.getObjectType() throws NPE on primitive types. This is a workaround. */HashMap primitiveTypeToWrapperClassName = new HashMap();primitiveTypeToWrapperClassName.put(Boolean.TYPE, "Boolean");primitiveTypeToWrapperClassName.put(Byte.TYPE, "Byte");primitiveTypeToWrapperClassName.put(Character.TYPE, "Character");primitiveTypeToWrapperClassName.put(Double.TYPE, "Double");primitiveTypeToWrapperClassName.put(Float.TYPE, "Float");primitiveTypeToWrapperClassName.put(Integer.TYPE, "Integer");primitiveTypeToWrapperClassName.put(Long.TYPE, "Long");primitiveTypeToWrapperClassName.put(Short.TYPE, "Short");String viewPattern = null;String editPattern = null;if (labelModelFacet instanceof FeatureLabelModelFacet) { FeatureLabelModelFacet featureLabelModelFacet = (FeatureLabelModelFacet) labelModelFacet; viewPattern = featureLabelModelFacet.getViewPattern(); if (viewPattern == null || viewPattern.length() == 0) { viewPattern = "{0}"; } editPattern = featureLabelModelFacet.getEditPattern(); if (editPattern == null || editPattern.length() == 0) { editPattern = "{0}"; }} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; viewPattern = compositeFeatureLabelModelFacet.getViewPattern(); if (viewPattern == null || viewPattern.length() == 0) { StringBuffer patternBuffer = new StringBuffer(); for(int i = 0; i < compositeFeatureLabelModelFacet.getMetaFeatures().size(); i++) { patternBuffer.append("{").append(i).append("} "); } viewPattern = patternBuffer.toString().trim(); } editPattern = compositeFeatureLabelModelFacet.getEditPattern(); if (editPattern == null || editPattern.length() == 0) { StringBuffer patternBuffer = new StringBuffer(); for(int i = 0; i < compositeFeatureLabelModelFacet.getMetaFeatures().size(); i++) { patternBuffer.append("{").append(i).append("} "); } editPattern = patternBuffer.toString().trim(); }} stringBuffer.append(TEXT_174); stringBuffer.append(viewPattern); stringBuffer.append(TEXT_175); stringBuffer.append(editPattern); stringBuffer.append(TEXT_176); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); stringBuffer.append(TEXT_177); stringBuffer.append(resolvedSemanticElement); stringBuffer.append(TEXT_178); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); stringBuffer.append(TEXT_179); stringBuffer.append(resolvedSemanticElement); stringBuffer.append(TEXT_180); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); stringBuffer.append(TEXT_181); if (labelModelFacet instanceof FeatureLabelModelFacet) { FeatureLabelModelFacet featureLabelModelFacet = (FeatureLabelModelFacet) labelModelFacet; GenFeature feature = featureLabelModelFacet.getMetaFeature(); if (!feature.isPrimitiveType()) { stringBuffer.append(TEXT_182); myFeatureGetAccessorHelper.appendFeatureValueGetter("element", feature, underlyingMetaClass, false); stringBuffer.append(TEXT_183); } stringBuffer.append(TEXT_184); stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); stringBuffer.append(TEXT_185); if (feature.isPrimitiveType()) { stringBuffer.append(TEXT_186); stringBuffer.append(primitiveTypeToWrapperClassName.get(feature.getTypeGenClassifier().getEcoreClassifier().getInstanceClass())); stringBuffer.append(TEXT_187); } myFeatureGetAccessorHelper.appendFeatureValueGetter("element", feature, underlyingMetaClass, false); if (feature.isPrimitiveType()) { stringBuffer.append(TEXT_188); } stringBuffer.append(TEXT_189); } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; stringBuffer.append(TEXT_190); stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); stringBuffer.append(TEXT_191); for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) { GenFeature next = (GenFeature) it.next(); if (next.isPrimitiveType()) { stringBuffer.append(TEXT_192); stringBuffer.append(primitiveTypeToWrapperClassName.get(next.getTypeGenClassifier().getEcoreClassifier().getInstanceClass())); stringBuffer.append(TEXT_193); } myFeatureGetAccessorHelper.appendFeatureValueGetter("element", next, underlyingMetaClass, false); if (next.isPrimitiveType()) { stringBuffer.append(TEXT_194); } if (it.hasNext()) { stringBuffer.append(TEXT_195); } } stringBuffer.append(TEXT_196); } else { stringBuffer.append(TEXT_197); } stringBuffer.append(TEXT_198); stringBuffer.append(TEXT_199); boolean isFixedFontSetInFigure;{ StyleAttributes styleAttributes = (genElement.getViewmap() == null) ? null : (StyleAttributes)genElement.getViewmap().find(StyleAttributes.class); isFixedFontSetInFigure = styleAttributes != null && styleAttributes.isFixedFont();} stringBuffer.append(TEXT_200); if (!isFixedFontSetInFigure) { stringBuffer.append(TEXT_201); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); stringBuffer.append(TEXT_202); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); stringBuffer.append(TEXT_203); stringBuffer.append(primaryView); stringBuffer.append(TEXT_204); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_205); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); stringBuffer.append(TEXT_206); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_207); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_208); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_209); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); stringBuffer.append(TEXT_210); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData")); stringBuffer.append(TEXT_211); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); stringBuffer.append(TEXT_212); } stringBuffer.append(TEXT_213); if (!isFixedFontSetInFigure) { stringBuffer.append(TEXT_214); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); stringBuffer.append(TEXT_215); } stringBuffer.append(TEXT_216); stringBuffer.append(TEXT_217); stringBuffer.append(TEXT_218); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); stringBuffer.append(TEXT_219); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); stringBuffer.append(TEXT_220); stringBuffer.append(primaryView); stringBuffer.append(TEXT_221); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_222); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_223); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_224); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_225); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_226); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Image")); stringBuffer.append(TEXT_227); if (genChildNode.isLabelElementIcon()) { stringBuffer.append(TEXT_228); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.resource.ImageDescriptor")); stringBuffer.append(TEXT_229); stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())); stringBuffer.append(TEXT_230); } stringBuffer.append(TEXT_231); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.TreeEditPart")); stringBuffer.append(TEXT_232); /*@ include file="adapters/propertySource.javajetinc"*/ stringBuffer.append(TEXT_233); stringBuffer.append(TEXT_234); stringBuffer.append(TEXT_235); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.RefreshAdapter")); stringBuffer.append(TEXT_236); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.RefreshAdapter")); stringBuffer.append(TEXT_237); stringBuffer.append(TEXT_238); stringBuffer.append(TEXT_239); stringBuffer.append(importManager.getImportedName("java.util.HashMap")); stringBuffer.append(TEXT_240); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); stringBuffer.append(TEXT_241); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); stringBuffer.append(TEXT_242); stringBuffer.append(TEXT_243); stringBuffer.append(TEXT_244); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_245); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_246); stringBuffer.append(TEXT_247); stringBuffer.append(TEXT_248); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_249); if (labelModelFacet instanceof FeatureLabelModelFacet) { FeatureLabelModelFacet compositeFeatureLabelModelFacet = (FeatureLabelModelFacet) labelModelFacet; for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) { GenFeature next = (GenFeature) it.next(); stringBuffer.append(TEXT_250); stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_251); stringBuffer.append(next.getFeatureAccessorName()); stringBuffer.append(TEXT_252); }} stringBuffer.append(TEXT_253); stringBuffer.append(TEXT_254); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_255); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_256); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_257); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_258); stringBuffer.append(TEXT_259); stringBuffer.append(TEXT_260); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_261); final Viewmap viewmap = genChildNode.getViewmap(); stringBuffer.append(TEXT_262); final String figureQualifiedClassName;if (viewmap instanceof ParentAssignedViewmap) { ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap; figureQualifiedClassName = parentAssignedViewmap.getFigureQualifiedClassName() == null ? "org.eclipse.draw2d.IFigure" : parentAssignedViewmap.getFigureQualifiedClassName();} else if (viewmap instanceof FigureViewmap) { String figureQualifiedClassNameCandidate = ((FigureViewmap) viewmap).getFigureQualifiedClassName(); if (figureQualifiedClassNameCandidate == null || figureQualifiedClassNameCandidate.trim().length() == 0) { figureQualifiedClassName = "org.eclipse.draw2d.Label"; } else { figureQualifiedClassName = figureQualifiedClassNameCandidate; }} else if (viewmap instanceof SnippetViewmap) { figureQualifiedClassName = "org.eclipse.draw2d.IFigure";} else if (viewmap instanceof InnerClassViewmap) { figureQualifiedClassName = ((InnerClassViewmap) viewmap).getClassName();} else { figureQualifiedClassName = "org.eclipse.draw2d.IFigure";}final String figureImportedName;if (viewmap instanceof InnerClassViewmap) { figureImportedName = figureQualifiedClassName; //do not import inner class} else { figureImportedName = importManager.getImportedName(figureQualifiedClassName);}if (viewmap instanceof ParentAssignedViewmap) { final ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap; stringBuffer.append(TEXT_263); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); stringBuffer.append(TEXT_264); stringBuffer.append((parentAssignedViewmap.getSetterName() == null ? "setLabel" : parentAssignedViewmap.getSetterName())); stringBuffer.append(TEXT_265); } else { stringBuffer.append(TEXT_266); stringBuffer.append(figureImportedName); stringBuffer.append(TEXT_267); if (viewmap instanceof FigureViewmap) { stringBuffer.append(TEXT_268); stringBuffer.append(figureImportedName); stringBuffer.append(TEXT_269); } // instanceof FigureViewmap else if (viewmap instanceof SnippetViewmap) { stringBuffer.append(TEXT_270); stringBuffer.append(((SnippetViewmap) viewmap).getBody()); stringBuffer.append(TEXT_271); } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter else if (viewmap instanceof InnerClassViewmap) { stringBuffer.append(TEXT_272); stringBuffer.append(figureImportedName); stringBuffer.append(TEXT_273); } stringBuffer.append(TEXT_274); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); stringBuffer.append(TEXT_275); stringBuffer.append(figureImportedName); stringBuffer.append(TEXT_276); if ("org.eclipse.draw2d.Label".equals(figureQualifiedClassName) || viewmap instanceof InnerClassViewmap) { stringBuffer.append(TEXT_277); } else { stringBuffer.append(TEXT_278); } stringBuffer.append(TEXT_279); } /*not parent-assigned*/ stringBuffer.append(TEXT_280); if (!"org.eclipse.draw2d.Label".equals(figureQualifiedClassName) && viewmap instanceof InnerClassViewmap==false) { stringBuffer.append(TEXT_281); } stringBuffer.append(TEXT_282); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); stringBuffer.append(TEXT_283); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); stringBuffer.append(TEXT_284); String labelSetterName = "setLabel"; // same assumption in NodeEditPartString labelFigureClassName = "org.eclipse.draw2d.IFigure";if (viewmap instanceof ParentAssignedViewmap) { ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap; if (parentAssignedViewmap.getSetterName() != null) { labelSetterName = parentAssignedViewmap.getSetterName(); } if (parentAssignedViewmap.getFigureQualifiedClassName() != null) { labelFigureClassName = parentAssignedViewmap.getFigureQualifiedClassName(); }} // FIXME perhaps, there's no sense to have setLabel for any other viewmap than ParentAssigned? stringBuffer.append(TEXT_285); stringBuffer.append(labelSetterName); stringBuffer.append(TEXT_286); stringBuffer.append(importManager.getImportedName(labelFigureClassName)); stringBuffer.append(TEXT_287); if ("org.eclipse.draw2d.Label".equals(labelFigureClassName)) { stringBuffer.append(TEXT_288); } else { stringBuffer.append(TEXT_289); } stringBuffer.append(TEXT_290); if (viewmap instanceof InnerClassViewmap) { String classBody = ((InnerClassViewmap) viewmap).getClassBody(); stringBuffer.append(TEXT_291); stringBuffer.append(classBody); stringBuffer.append(TEXT_292); if (classBody.indexOf("DPtoLP") != -1) { stringBuffer.append(TEXT_293); } } stringBuffer.append(TEXT_294); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.tree.BaseTreeEditPart")); stringBuffer.append(TEXT_295); stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())); stringBuffer.append(TEXT_296); stringBuffer.append(TEXT_297); stringBuffer.append(TEXT_298); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); stringBuffer.append(TEXT_299); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy")); stringBuffer.append(TEXT_300); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); stringBuffer.append(TEXT_301); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest")); stringBuffer.append(TEXT_302); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_303); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); stringBuffer.append(TEXT_304); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_305); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_306); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); stringBuffer.append(TEXT_307); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")); stringBuffer.append(TEXT_308); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_309); {TypeModelFacet facet = genNode.getModelFacet();GenFeature childFeature = facet.getChildMetaFeature();GenFeature containmentFeature = facet.getContainmentMetaFeature();if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) { stringBuffer.append(TEXT_310); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_311); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_312); if (containmentFeature.getEcoreFeature().isMany()) { stringBuffer.append(TEXT_313); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); stringBuffer.append(TEXT_314); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_315); stringBuffer.append(containmentFeature.getFeatureAccessorName()); stringBuffer.append(TEXT_316); } else { stringBuffer.append(TEXT_317); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); stringBuffer.append(TEXT_318); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_319); stringBuffer.append(containmentFeature.getFeatureAccessorName()); stringBuffer.append(TEXT_320); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); stringBuffer.append(TEXT_321); } if (childFeature.getEcoreFeature().isMany()) { stringBuffer.append(TEXT_322); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); stringBuffer.append(TEXT_323); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_324); stringBuffer.append(childFeature.getFeatureAccessorName()); stringBuffer.append(TEXT_325); } else { stringBuffer.append(TEXT_326); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); stringBuffer.append(TEXT_327); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_328); stringBuffer.append(childFeature.getFeatureAccessorName()); stringBuffer.append(TEXT_329); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); stringBuffer.append(TEXT_330); } stringBuffer.append(TEXT_331); } else { if (containmentFeature.getEcoreFeature().isMany()) { stringBuffer.append(TEXT_332); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); stringBuffer.append(TEXT_333); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_334); stringBuffer.append(containmentFeature.getFeatureAccessorName()); stringBuffer.append(TEXT_335); } else { stringBuffer.append(TEXT_336); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); stringBuffer.append(TEXT_337); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_338); stringBuffer.append(containmentFeature.getFeatureAccessorName()); stringBuffer.append(TEXT_339); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); stringBuffer.append(TEXT_340); }} stringBuffer.append(TEXT_341); } /*restrict local vars used in component edit policy*/ if (!isReadOnly) { String editPatternCode = "EDIT_PATTERN"; //declared in labelText.javajetinc, used in directEditCommand.jetinc. stringBuffer.append(TEXT_342); stringBuffer.append(TEXT_343); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); stringBuffer.append(TEXT_344); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.DirectEditPolicy")); stringBuffer.append(TEXT_345); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); stringBuffer.append(TEXT_346); stringBuffer.append(TEXT_347); stringBuffer.append(TEXT_348); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); stringBuffer.append(TEXT_349); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); stringBuffer.append(TEXT_350); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); stringBuffer.append(TEXT_351); stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); stringBuffer.append(TEXT_352); stringBuffer.append(editPatternCode); stringBuffer.append(TEXT_353); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); stringBuffer.append(TEXT_354); stringBuffer.append(importManager.getImportedName("java.text.ParseException")); stringBuffer.append(TEXT_355); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); stringBuffer.append(TEXT_356); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_357); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); stringBuffer.append(TEXT_358); stringBuffer.append(primaryView); stringBuffer.append(TEXT_359); if (labelModelFacet instanceof FeatureLabelModelFacet) { GenFeature featureToSet = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); EStructuralFeature ecoreFeature = featureToSet.getEcoreFeature(); stringBuffer.append(TEXT_360); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); stringBuffer.append(TEXT_361); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); stringBuffer.append(TEXT_362); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")); stringBuffer.append(TEXT_363); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); stringBuffer.append(TEXT_364); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_365); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); stringBuffer.append(TEXT_366); stringBuffer.append(resolvedSemanticElement); stringBuffer.append(TEXT_367); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); stringBuffer.append(TEXT_368); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); stringBuffer.append(TEXT_369); stringBuffer.append(importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_370); stringBuffer.append(featureToSet.getFeatureAccessorName()); stringBuffer.append(TEXT_371); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.ParserUtil")); stringBuffer.append(TEXT_372); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); stringBuffer.append(TEXT_373); if (ecoreFeature.isMany()) { stringBuffer.append(TEXT_374); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_375); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_376); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); stringBuffer.append(TEXT_377); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); stringBuffer.append(TEXT_378); stringBuffer.append(featureToSet.getAccessorName()); stringBuffer.append(TEXT_379); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); stringBuffer.append(TEXT_380); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); stringBuffer.append(TEXT_381); } else { stringBuffer.append(TEXT_382); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); stringBuffer.append(TEXT_383); } stringBuffer.append(TEXT_384); } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; List metaFeatures = compositeFeatureLabelModelFacet.getMetaFeatures(); stringBuffer.append(TEXT_385); stringBuffer.append(metaFeatures.size()); stringBuffer.append(TEXT_386); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); stringBuffer.append(TEXT_387); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); stringBuffer.append(TEXT_388); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")); stringBuffer.append(TEXT_389); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); stringBuffer.append(TEXT_390); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_391); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); stringBuffer.append(TEXT_392); stringBuffer.append(resolvedSemanticElement); stringBuffer.append(TEXT_393); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_394); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_395); boolean haveDeclaredValues = false; for(int i = 0; i < metaFeatures.size(); i++) { GenFeature nextFeatureToSet = (GenFeature) metaFeatures.get(i); EStructuralFeature nextEcoreFeature = nextFeatureToSet.getEcoreFeature(); stringBuffer.append(TEXT_396); if (i == 0) { stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); stringBuffer.append(TEXT_397); } stringBuffer.append(TEXT_398); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); stringBuffer.append(TEXT_399); stringBuffer.append(importManager.getImportedName(nextFeatureToSet.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_400); stringBuffer.append(nextFeatureToSet.getFeatureAccessorName()); stringBuffer.append(TEXT_401); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.ParserUtil")); stringBuffer.append(TEXT_402); stringBuffer.append(i); stringBuffer.append(TEXT_403); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); stringBuffer.append(TEXT_404); if (nextEcoreFeature.isMany()) { stringBuffer.append(TEXT_405); if (!haveDeclaredValues) { haveDeclaredValues = true; stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); stringBuffer.append(TEXT_406); } stringBuffer.append(TEXT_407); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); stringBuffer.append(TEXT_408); stringBuffer.append(nextFeatureToSet.getAccessorName()); stringBuffer.append(TEXT_409); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); stringBuffer.append(TEXT_410); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); stringBuffer.append(TEXT_411); } else { stringBuffer.append(TEXT_412); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); stringBuffer.append(TEXT_413); } } stringBuffer.append(TEXT_414); } stringBuffer.append(TEXT_415); } stringBuffer.append(TEXT_416); stringBuffer.append(TEXT_417); stringBuffer.append(TEXT_418); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.TreeDirectEditManager")); stringBuffer.append(TEXT_419); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); stringBuffer.append(TEXT_420); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); stringBuffer.append(TEXT_421); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.TreeDirectEditManager")); stringBuffer.append(TEXT_422); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.TreeDirectEditManager")); stringBuffer.append(TEXT_423); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TextCellEditor")); stringBuffer.append(TEXT_424); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.CellEditorLocator")); stringBuffer.append(TEXT_425); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.CellEditor")); stringBuffer.append(TEXT_426); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.TreeItem")); stringBuffer.append(TEXT_427); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.TreeItem")); stringBuffer.append(TEXT_428); stringBuffer.append(TEXT_429); stringBuffer.append(TEXT_430); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.RefreshAdapter")); stringBuffer.append(TEXT_431); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.RefreshAdapter")); stringBuffer.append(TEXT_432); if (labelModelFacet instanceof FeatureLabelModelFacet) { FeatureLabelModelFacet compositeFeatureLabelModelFacet = (FeatureLabelModelFacet) labelModelFacet; for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) { GenFeature next = (GenFeature) it.next(); stringBuffer.append(TEXT_433); stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_434); stringBuffer.append(next.getFeatureAccessorName()); stringBuffer.append(TEXT_435); }} stringBuffer.append(TEXT_436); stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_437); stringBuffer.append(importManager.getImportedName("java.util.Collections")); stringBuffer.append(TEXT_438); importManager.emitSortedImports(); stringBuffer.append(TEXT_439); return stringBuffer.toString(); } | 7409 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7409/de70953cec74fbba0ed0cfbed37c36c0b594b3db/ChildNodeEditPartGenerator.java/clean/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/ChildNodeEditPartGenerator.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
514,
2103,
12,
921,
1237,
13,
225,
288,
565,
727,
6674,
533,
1892,
273,
394,
6674,
5621,
565,
727,
10938,
6517,
2171,
3157,
1046,
273,
261,
7642,
6517,
2171,
13,
14015,
921,
63,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
514,
2103,
12,
921,
1237,
13,
225,
288,
565,
727,
6674,
533,
1892,
273,
394,
6674,
5621,
565,
727,
10938,
6517,
2171,
3157,
1046,
273,
261,
7642,
6517,
2171,
13,
14015,
921,
63,
5... |
if (explosionESet) result.append(explosion); else result.append("<unset>"); | if (explosionESet) result.append(explosion); else result.append("<unset>"); | public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (explosion: "); if (explosionESet) result.append(explosion); else result.append("<unset>"); result.append(", titlePosition: "); if (titlePositionESet) result.append(titlePosition); else result.append("<unset>"); result.append(", leaderLineStyle: "); if (leaderLineStyleESet) result.append(leaderLineStyle); else result.append("<unset>"); result.append(", leaderLineLength: "); if (leaderLineLengthESet) result.append(leaderLineLength); else result.append("<unset>"); result.append(')'); return result.toString(); } | 46013 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46013/e5c78f0e8317166d02fa384e14c3dd7aa1796f2c/PieSeriesImpl.java/buggy/chart/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/model/type/impl/PieSeriesImpl.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
514,
1762,
1435,
565,
288,
3639,
309,
261,
73,
2520,
3886,
10756,
327,
2240,
18,
10492,
5621,
3639,
6674,
563,
273,
394,
6674,
12,
9565,
18,
10492,
10663,
3639,
563,
18,
6923,
2932,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
514,
1762,
1435,
565,
288,
3639,
309,
261,
73,
2520,
3886,
10756,
327,
2240,
18,
10492,
5621,
3639,
6674,
563,
273,
394,
6674,
12,
9565,
18,
10492,
10663,
3639,
563,
18,
6923,
2932,... |
return new OutboundVariable("var " + varName + " = null;", varName); | return new OutboundVariable("var " + varName + "=null;", varName); | public OutboundVariable convertOutbound(Object object, OutboundContext converted) throws ConversionException { if (object == null) { String varName = converted.getNextVariableName(); return new OutboundVariable("var " + varName + " = null;", varName); //$NON-NLS-1$ //$NON-NLS-2$ } // Check to see if we have done this one already OutboundVariable ov = converted.get(object); if (ov != null) { // So the object as been converted already, we just need to refer to it. return new OutboundVariable("", ov.getAssignCode()); //$NON-NLS-1$ } // So we will have to create one for ourselves ov = new OutboundVariable(); String varName = converted.getNextVariableName(); ov.setAssignCode(varName); // Save this for another time so we don't recurse into it converted.put(object, ov); Converter converter = getConverter(object); if (converter == null) { log.error(Messages.getString("DefaultConverterManager.MissingConverter", object.getClass().getName())); //$NON-NLS-1$ return new OutboundVariable("var " + varName + " = null;", varName); //$NON-NLS-1$ //$NON-NLS-2$ } ov.setInitCode(converter.convertOutbound(object, ov.getAssignCode(), converted)); return ov; } | 45384 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45384/769a5807f342d8541951d74937d724ab38fcafe0/DefaultConverterManager.java/buggy/java/uk/ltd/getahead/dwr/impl/DefaultConverterManager.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
2976,
3653,
3092,
1765,
17873,
12,
921,
733,
16,
2976,
3653,
1042,
5970,
13,
1216,
16401,
503,
565,
288,
3639,
309,
261,
1612,
422,
446,
13,
3639,
288,
5411,
514,
13722,
273,
5970,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
2976,
3653,
3092,
1765,
17873,
12,
921,
733,
16,
2976,
3653,
1042,
5970,
13,
1216,
16401,
503,
565,
288,
3639,
309,
261,
1612,
422,
446,
13,
3639,
288,
5411,
514,
13722,
273,
5970,
... |
if(gcp1.bitMapX == 0) gcp1.bitMapX = 1; if(gcp1.bitMapY == 0) gcp1.bitMapY = 1; | public boolean importMap(){ Extractor ext; String rawFileName = new String(); FileChooser fc = new FileChooser(FileChooser.DIRECTORY_SELECT, File.getProgramDirectory()); fc.addMask("*.png"); fc.setTitle((String)lr.get(4100,"Select Directory:")); if(fc.execute() != fc.IDCANCEL){ File inDir = fc.getChosenFile(); File dir = new File(mapsPath); File mapFile; if (!dir.exists()) { dir.createDir(); } try{ //User selected a map, but maybe there are more png(s) //copy all of them! //at the same time try to find associated .map files! //These are georeference files targeted for OziExplorer. //So lets check if we have more than 1 png file: String[] files; String line = new String(); InputStream in; OutputStream out; FileReader inMap; byte[] buf; int len; String[] parts; files = inDir.list("*.png", File.LIST_FILES_ONLY); InfoBox inf = new InfoBox("Info", (String)lr.get(4109,"Loading maps...")); inf.show(); Vm.showWait(true); for(int i = 0; i<files.length;i++){ inf.setInfo((String)lr.get(4110,"Loading:")+ " " + files[i]); //Copy the file //Vm.debug("Copy: " + inDir.getFullPath() + "/" +files[i]); //Vm.debug("to: " + mapsPath + files[i]); in = new FileInputStream(inDir.getFullPath() + "/" +files[i]); out = new FileOutputStream(mapsPath + files[i]); buf = new byte[1024]; while ((len = in.read(buf)) > 0) { out.write(buf, 0, len); } in.close(); out.close(); //Check for a .map file ext = new Extractor(files[i], "", ".", 0, true); rawFileName = ext.findNext(); mapFile = new File(inDir.getFullPath() + "/" + rawFileName + ".map"); if(mapFile.exists()){ GCPoint gcp1 = new GCPoint(); GCPoint gcp2 = new GCPoint(); GCPoint gcp3 = new GCPoint(); GCPoint gcp4 = new GCPoint(); GCPoint gcpG = new GCPoint(); //Vm.debug("Found file: " + inDir.getFullPath() + "/" + rawFileName + ".map"); inMap = new FileReader(inDir.getFullPath() + "/" + rawFileName + ".map"); while((line = inMap.readLine()) != null){ if(line.equals("MMPNUM,4")){ line = inMap.readLine(); parts = mString.split(line, ','); gcp1.bitMapX = Convert.toInt(parts[2]); gcp1.bitMapY = Convert.toInt(parts[3]); line = inMap.readLine(); parts = mString.split(line, ','); gcp2.bitMapX = Convert.toInt(parts[2]); gcp2.bitMapY = Convert.toInt(parts[3]); line = inMap.readLine(); parts = mString.split(line, ','); gcp3.bitMapX = Convert.toInt(parts[2]); gcp3.bitMapY = Convert.toInt(parts[3]); imageWidth = gcp3.bitMapX; imageHeight = gcp3.bitMapY; line = inMap.readLine(); parts = mString.split(line, ','); gcp4.bitMapX = Convert.toInt(parts[2]); gcp4.bitMapY = Convert.toInt(parts[3]); line = inMap.readLine(); parts = mString.split(line, ','); gcpG = new GCPoint(Convert.toDouble(parts[2]), Convert.toDouble(parts[3])); gcpG.bitMapX = gcp1.bitMapX; gcpG.bitMapY = gcp1.bitMapY; addGCP(gcpG); line = inMap.readLine(); parts = mString.split(line, ','); gcpG = new GCPoint(Convert.toDouble(parts[2]), Convert.toDouble(parts[3])); gcpG.bitMapX = gcp2.bitMapX; gcpG.bitMapY = gcp2.bitMapY; addGCP(gcpG); line = inMap.readLine(); parts = mString.split(line, ','); gcpG = new GCPoint(Convert.toDouble(parts[2]), Convert.toDouble(parts[3])); gcpG.bitMapX = gcp3.bitMapX; gcpG.bitMapY = gcp3.bitMapY; addGCP(gcpG); line = inMap.readLine(); parts = mString.split(line, ','); gcpG = new GCPoint(Convert.toDouble(parts[2]), Convert.toDouble(parts[3])); gcpG.bitMapX = gcp4.bitMapX; gcpG.bitMapY = gcp4.bitMapY; addGCP(gcpG); evalGCP(); //Vm.debug("Saving .map file to: " + mapsPath + "/" + rawFileName + ".wfl"); saveWFL(mapsPath + "/" + rawFileName + ".wfl"); } } inMap.close(); } } inf.close(0); Vm.showWait(false); return true; }catch(Exception ex){ Vm.debug("Error:" + ex.toString()); } } return false; } | 51026 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51026/39c46900ebba19c68621cdca63912a2190b0f811/Map.java/buggy/src/CacheWolf/Map.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
430,
12,
75,
4057,
21,
18,
3682,
863,
60,
422,
374,
13,
314,
4057,
21,
18,
3682,
863,
60,
273,
404,
31,
309,
12,
75,
4057,
21,
18,
3682,
863,
61,
422,
374,
13,
314,
4057... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
430,
12,
75,
4057,
21,
18,
3682,
863,
60,
422,
374,
13,
314,
4057,
21,
18,
3682,
863,
60,
273,
404,
31,
309,
12,
75,
4057,
21,
18,
3682,
863,
61,
422,
374,
13,
314,
4057... | |
null, "setOnblur"); | null, "setOnblurExpr"); | public PropertyDescriptor[] getPropertyDescriptors() { PropertyDescriptor[] result = new PropertyDescriptor[31]; try { result[0] = new PropertyDescriptor("accesskey", ELPasswordTag.class, null, "setAccesskey"); result[1] = new PropertyDescriptor("alt", ELPasswordTag.class, null, "setAlt"); result[2] = new PropertyDescriptor("altKey", ELPasswordTag.class, null, "setAltKey"); // This attribute has a non-standard mapping. result[3] = new PropertyDescriptor("disabled", ELPasswordTag.class, null, "setDisabledExpr"); // This attribute has a non-standard mapping. result[4] = new PropertyDescriptor("indexed", ELPasswordTag.class, null, "setIndexedExpr"); result[5] = new PropertyDescriptor("maxlength", ELPasswordTag.class, null, "setMaxlength"); result[6] = new PropertyDescriptor("name", ELPasswordTag.class, null, "setName"); result[7] = new PropertyDescriptor("onblur", ELPasswordTag.class, null, "setOnblur"); result[8] = new PropertyDescriptor("onchange", ELPasswordTag.class, null, "setOnchange"); result[9] = new PropertyDescriptor("onclick", ELPasswordTag.class, null, "setOnclick"); result[10] = new PropertyDescriptor("ondblclick", ELPasswordTag.class, null, "setOndblclick"); result[11] = new PropertyDescriptor("onfocus", ELPasswordTag.class, null, "setOnfocus"); result[12] = new PropertyDescriptor("onkeydown", ELPasswordTag.class, null, "setOnkeydown"); result[13] = new PropertyDescriptor("onkeypress", ELPasswordTag.class, null, "setOnkeypress"); result[14] = new PropertyDescriptor("onkeyup", ELPasswordTag.class, null, "setOnkeyup"); result[15] = new PropertyDescriptor("onmousedown", ELPasswordTag.class, null, "setOnmousedown"); result[16] = new PropertyDescriptor("onmousemove", ELPasswordTag.class, null, "setOnmousemove"); result[17] = new PropertyDescriptor("onmouseout", ELPasswordTag.class, null, "setOnmouseout"); result[18] = new PropertyDescriptor("onmouseover", ELPasswordTag.class, null, "setOnmouseover"); result[19] = new PropertyDescriptor("onmouseup", ELPasswordTag.class, null, "setOnmouseup"); result[20] = new PropertyDescriptor("property", ELPasswordTag.class, null, "setProperty"); result[21] = new PropertyDescriptor("readonly", ELPasswordTag.class, null, "setReadonlyExpr"); result[22] = new PropertyDescriptor("redisplay", ELPasswordTag.class, null, "setRedisplayExpr"); result[23] = new PropertyDescriptor("style", ELPasswordTag.class, null, "setStyle"); result[24] = new PropertyDescriptor("styleClass", ELPasswordTag.class, null, "setStyleClass"); result[25] = new PropertyDescriptor("styleId", ELPasswordTag.class, null, "setStyleId"); result[26] = new PropertyDescriptor("size", ELPasswordTag.class, null, "setSize"); result[27] = new PropertyDescriptor("tabindex", ELPasswordTag.class, null, "setTabindex"); result[28] = new PropertyDescriptor("title", ELPasswordTag.class, null, "setTitle"); result[29] = new PropertyDescriptor("titleKey", ELPasswordTag.class, null, "setTitleKey"); result[30] = new PropertyDescriptor("value", ELPasswordTag.class, null, "setValue"); } catch (IntrospectionException ex) { ex.printStackTrace(); } return (result); } | 2722 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2722/db064e19656421b94aaf753550935d95f44bd5f9/ELPasswordTagBeanInfo.java/clean/contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELPasswordTagBeanInfo.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
225,
26761,
8526,
3911,
12705,
1435,
565,
288,
3639,
26761,
8526,
225,
563,
282,
273,
394,
26761,
63,
6938,
15533,
3639,
775,
288,
5411,
563,
63,
20,
65,
273,
394,
26761,
2932,
3860... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
225,
26761,
8526,
3911,
12705,
1435,
565,
288,
3639,
26761,
8526,
225,
563,
282,
273,
394,
26761,
63,
6938,
15533,
3639,
775,
288,
5411,
563,
63,
20,
65,
273,
394,
26761,
2932,
3860... |
public void setPatchName (IPatch p, String name) { | public void setPatchName (Patch p, String name) { | public void setPatchName (IPatch p, String name) { byte[] namebytes; int address = Byte.parseByte(parameter_base_address, 16); address = (address << 16) | 0x007000; int offset=YamahaMotifSysexUtility.findBaseAddressOffset(((Patch)p).sysex, address); try { namebytes=name.getBytes ("US-ASCII"); for (int i = 0; i < 10; i++) { if (i >= namebytes.length) ((Patch)p).sysex[offset + i + YamahaMotifSysexUtility.DATA_OFFSET] =(byte)' '; else ((Patch)p).sysex[offset+ i+ YamahaMotifSysexUtility.DATA_OFFSET]=namebytes[i]; } YamahaMotifSysexUtility.checksum(((Patch)p).sysex, offset); } catch (UnsupportedEncodingException e) { return; } } | 7591 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7591/8de9e9d107eb8c0487bbadf2f24d3a5cc9bc1add/YamahaMotifSingleDriver.java/buggy/JSynthLib/synthdrivers/YamahaMotif/YamahaMotifSingleDriver.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
444,
7332,
461,
261,
7332,
293,
16,
514,
508,
13,
288,
565,
1160,
8526,
508,
3890,
31,
565,
509,
1758,
273,
3506,
18,
2670,
3216,
12,
6775,
67,
1969,
67,
2867,
16,
2872,
17... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
444,
7332,
461,
261,
7332,
293,
16,
514,
508,
13,
288,
565,
1160,
8526,
508,
3890,
31,
565,
509,
1758,
273,
3506,
18,
2670,
3216,
12,
6775,
67,
1969,
67,
2867,
16,
2872,
17... |
attribute( obj, OdaDataSet.EXTENSION_ID_PROP, OdaDataSet.EXTENSION_ID_PROP ); | attribute( obj, IOdaExtendableElementModel.EXTENSION_ID_PROP, IOdaExtendableElementModel.EXTENSION_ID_PROP ); | public void visitOdaDataSet( OdaDataSet obj ) { writer.startElement( DesignSchemaConstants.ODA_DATA_SET_TAG ); attribute( obj, OdaDataSet.EXTENSION_ID_PROP, OdaDataSet.EXTENSION_ID_PROP ); super.visitOdaDataSet( obj ); writeStructureList( obj, DataSet.PARAMETERS_PROP ); writeStructureList( obj, DataSet.RESULT_SET_PROP ); if ( (String) obj.getLocalProperty( getModule( ), OdaDataSet.QUERY_TEXT_PROP ) != null ) { property( obj, OdaDataSet.QUERY_TEXT_PROP ); } property( obj, OdaDataSet.RESULT_SET_NAME_PROP ); writeOdaDesignerState( obj, OdaDataSet.DESIGNER_STATE_PROP ); propertyCDATA( obj, OdaDataSet.DESIGNER_VALUES_PROP ); List properties = (List) obj.getLocalProperty( getModule( ), OdaDataSet.PRIVATE_DRIVER_PROPERTIES_PROP ); writeExtendedProperties( properties, OdaDataSet.PRIVATE_DRIVER_PROPERTIES_PROP ); writeOdaExtensionProperties( obj, OdaDataSet.EXTENSION_ID_PROP ); writer.endElement( ); } | 15160 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/15160/d802c33711e0d111551ae23575895cd060f085b6/ModuleWriter.java/clean/model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/writer/ModuleWriter.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
3757,
51,
2414,
13676,
12,
531,
2414,
13676,
1081,
262,
202,
95,
202,
202,
6299,
18,
1937,
1046,
12,
29703,
3078,
2918,
18,
1212,
37,
67,
4883,
67,
4043,
67,
7927,
11272,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
3757,
51,
2414,
13676,
12,
531,
2414,
13676,
1081,
262,
202,
95,
202,
202,
6299,
18,
1937,
1046,
12,
29703,
3078,
2918,
18,
1212,
37,
67,
4883,
67,
4043,
67,
7927,
11272,... |
case ( LineStyle.DOTTED ) : | case ( LineStyle.DOTTED ) : | private final void renderBorder( GC gc, Label la, int iLabelLocation, Location lo ) throws ChartException { // RENDER THE OUTLINE/BORDER final LineAttributes lia = la.getOutline( ); if ( lia != null && lia.isVisible( ) && lia.isSetStyle( ) && lia.isSetThickness( ) && lia.getColor( ) != null ) { RotatedRectangle rr = null; try { rr = Methods.computePolygon( _sxs, iLabelLocation, la, lo.getX( ), lo.getY( ) ); } catch ( IllegalArgumentException uiex ) { throw new ChartException( ChartDeviceSwtActivator.ID, ChartException.RENDERING, uiex ); } final int iOldLineStyle = gc.getLineStyle( ); final int iOldLineWidth = gc.getLineWidth( ); final Color cFG = (Color) _sxs.getColor( lia.getColor( ) ); gc.setForeground( cFG ); R31Enhance.setAlpha( gc, lia.getColor( ) ); int iLineStyle = SWT.LINE_SOLID; switch ( lia.getStyle( ).getValue( ) ) { case ( LineStyle.DOTTED ) : iLineStyle = SWT.LINE_DOT; break; case ( LineStyle.DASH_DOTTED ) : iLineStyle = SWT.LINE_DASHDOT; break; case ( LineStyle.DASHED ) : iLineStyle = SWT.LINE_DASH; break; } gc.setLineStyle( iLineStyle ); gc.setLineWidth( lia.getThickness( ) ); gc.drawPolygon( rr.getSwtPoints( ) ); gc.setLineStyle( iOldLineStyle ); gc.setLineWidth( iOldLineWidth ); cFG.dispose( ); } } | 46013 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46013/2b0d1a560c1bc75e00cd69bad4d0bb2a7109bc8c/SwtTextRenderer.java/clean/chart/org.eclipse.birt.chart.device.swt/src/org/eclipse/birt/chart/device/swt/SwtTextRenderer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
727,
918,
1743,
8107,
12,
15085,
8859,
16,
5287,
7125,
16,
509,
277,
2224,
2735,
16,
1082,
202,
2735,
437,
262,
1216,
14804,
503,
202,
95,
202,
202,
759,
28332,
12786,
8210,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
727,
918,
1743,
8107,
12,
15085,
8859,
16,
5287,
7125,
16,
509,
277,
2224,
2735,
16,
1082,
202,
2735,
437,
262,
1216,
14804,
503,
202,
95,
202,
202,
759,
28332,
12786,
8210,
... |
if ( i==-1 || !(i!=-1 && attValue.substring(0, i).indexOf("/")!=-1) ) | if ( i==-1 || (i!=-1 && attValue.substring(0, i).indexOf("/")!=-1) ) | protected final void fixURL(String elementName, String attName, String qName, Attributes atts, AttributesImpl attsImpl) { if (qName.equalsIgnoreCase(elementName)) { String attValue = atts.getValue(attName); if (attValue != null) { // Assume that if attribute value exists and doesn't contain a // semicolon, or if the URL contains a semicolon and there's a // backslash before the semicolon, then it is a relative URL // (http://<something> and mailto:<something> are both valid, // absolute URLs) int i = attValue.indexOf(":"); if ( i==-1 || !(i!=-1 && attValue.substring(0, i).indexOf("/")!=-1) ) { if (attValue.startsWith("/")) { // Prepend the scheme and the host to the attribute value (HTTP) i = baseUrl.indexOf("://"); if (i != -1) attValue = baseUrl.substring(0, baseUrl.indexOf("/", i+3)).concat(attValue); } else if (attValue.trim().equals("")) attValue = baseUrl; else attValue = baseUrl.substring(0, baseUrl.lastIndexOf("/")+1).concat(attValue); if (attValue.indexOf("/../") != -1) attValue = removeUpDirs(attValue); } int index = atts.getIndex(attName); attsImpl.setAttribute(index, atts.getURI(index), atts.getLocalName(index), attName, atts.getType(index), attValue); } } } | 24959 /local/tlutelli/issta_data/temp/all_java2context/java/2006_temp/2006/24959/89ccef19988fe9c70911314d5e95976346ef6709/AbsoluteURLFilter.java/clean/source/org/jasig/portal/utils/AbsoluteURLFilter.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
4750,
727,
918,
2917,
1785,
12,
780,
14453,
16,
514,
2403,
461,
16,
514,
22914,
16,
9055,
15687,
16,
9055,
2828,
15687,
2828,
13,
282,
288,
565,
309,
261,
85,
461,
18,
14963,
5556,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
4750,
727,
918,
2917,
1785,
12,
780,
14453,
16,
514,
2403,
461,
16,
514,
22914,
16,
9055,
15687,
16,
9055,
2828,
15687,
2828,
13,
282,
288,
565,
309,
261,
85,
461,
18,
14963,
5556,
12,
... |
return swapInterval.fixedInterval; | return BlockTransmitter.getHardBandwidthLimit(); | public int get() { return swapInterval.fixedInterval; } | 50493 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50493/0e73e63698410905555b43e69172b80870e39ae5/Node.java/buggy/src/freenet/node/Node.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4405,
202,
482,
509,
336,
1435,
288,
25083,
202,
2463,
7720,
4006,
18,
12429,
4006,
31,
6862,
202,
97,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4405,
202,
482,
509,
336,
1435,
288,
25083,
202,
2463,
7720,
4006,
18,
12429,
4006,
31,
6862,
202,
97,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
if (taskString == null) { | if (taskString == null || taskString.length() == 0) { | void refresh() { if (isDisposed()) { return; } progressLabel.setText(getMainTitle()); int percentDone = getPercentDone(); JobInfo[] infos = getJobInfos(); if (isRunning()) { if (progressBar == null) { if (percentDone == IProgressMonitor.UNKNOWN) { // Only do it if there is an indeterminate task // There may be no task so we don't want to create it // until we know for sure for (int i = 0; i < infos.length; i++) { if (infos[i].hasTaskInfo() && infos[i].getTaskInfo().totalWork == IProgressMonitor.UNKNOWN) { createProgressBar(SWT.INDETERMINATE); break; } } } else { createProgressBar(SWT.NONE); progressBar.setMinimum(0); progressBar.setMaximum(100); } } // Protect against bad counters if (percentDone >= 0 && percentDone <= 100 && percentDone != progressBar.getSelection()) { progressBar.setSelection(percentDone); } } else if (isCompleted()) { if (progressBar != null) { progressBar.dispose(); progressBar = null; } setLayoutsForNoProgress(); } for (int i = 0; i < infos.length; i++) { JobInfo jobInfo = infos[i]; if (jobInfo.hasTaskInfo()) { String taskString = jobInfo.getTaskInfo().getTaskName(); String subTaskString = null; Object[] jobChildren = jobInfo.getChildren(); if (jobChildren.length > 0) { subTaskString = ((JobTreeElement) jobChildren[0]) .getDisplayString(); } if (subTaskString != null) { if (taskString == null) { taskString = subTaskString; } else { taskString = NLS.bind( ProgressMessages.JobInfo_DoneNoProgressMessage, taskString, subTaskString); } } if (taskString != null) { setLinkText(infos[i].getJob(), taskString, i); } } else {// Check for the finished job state Job job = jobInfo.getJob(); if (job.getResult() != null) { IStatus result = job.getResult(); String message = EMPTY_STRING; if (result != null) { message = result.getMessage(); } setLinkText(job, message, i); } } setColor(currentIndex); } // Remove completed tasks if (infos.length < taskEntries.size()) { for (int i = infos.length; i < taskEntries.size(); i++) { ((Link) taskEntries.get(i)).dispose(); } if (infos.length > 1) taskEntries = taskEntries.subList(0, infos.length - 1); else taskEntries.clear(); } updateToolBarValues(); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/d03b613a4bb62259b67d5c2f3892fe47417858c5/ProgressInfoItem.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
6459,
4460,
1435,
288,
202,
202,
430,
261,
291,
1669,
7423,
10756,
288,
1082,
202,
2463,
31,
202,
202,
97,
202,
202,
8298,
2224,
18,
542,
1528,
12,
588,
6376,
4247,
10663,
202,
202... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
6459,
4460,
1435,
288,
202,
202,
430,
261,
291,
1669,
7423,
10756,
288,
1082,
202,
2463,
31,
202,
202,
97,
202,
202,
8298,
2224,
18,
542,
1528,
12,
588,
6376,
4247,
10663,
202,
202... |
protected GridBagConstraints buildConstraints(Element current) { GridBagConstraints constraints = new GridBagConstraints(); CustomInsets inset = new CustomInsets(current.getAttribute("insets")); constraints.weightx = parseWeightConstant(current.getAttribute("weightx")); constraints.weighty = parseWeightConstant(current.getAttribute("weighty")); // fill constraints.fill = parseFillConstant(current.getAttribute("fill")); constraints.gridwidth = parseGridConstant(current.getAttribute("gridwidth")); constraints.gridheight = parseGridConstant(current.getAttribute("gridheight")); constraints.insets = inset; return constraints; } | 13991 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/13991/3cd6e9d81112e3ab17a910eaef36b9e56b2a8b6a/XMLPageBuilder.java/clean/grendel/sources/grendel/ui/XMLPageBuilder.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
4750,
13075,
1361,
4878,
12,
1046,
783,
13,
288,
565,
13075,
6237,
273,
394,
13075,
5621,
565,
6082,
382,
4424,
316,
542,
273,
4202,
394,
6082,
382,
4424,
12,
2972,
18,
588,
1499,
2932,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
4750,
13075,
1361,
4878,
12,
1046,
783,
13,
288,
565,
13075,
6237,
273,
394,
13075,
5621,
565,
6082,
382,
4424,
316,
542,
273,
4202,
394,
6082,
382,
4424,
12,
2972,
18,
588,
1499,
2932,
... | ||
public org.quickfix.field.AllocQty getAllocQty() throws FieldNotFound { org.quickfix.field.AllocQty value = new org.quickfix.field.AllocQty(); | public quickfix.field.AllocQty getAllocQty() throws FieldNotFound { quickfix.field.AllocQty value = new quickfix.field.AllocQty(); | public org.quickfix.field.AllocQty getAllocQty() throws FieldNotFound { org.quickfix.field.AllocQty value = new org.quickfix.field.AllocQty(); getField(value); return value; } | 8803 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8803/fecc27f98261270772ff182a1d4dfd94b5daa73d/NewOrderMultileg.java/buggy/src/java/src/quickfix/fix43/NewOrderMultileg.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
2358,
18,
19525,
904,
18,
1518,
18,
8763,
53,
4098,
336,
8763,
53,
4098,
1435,
1216,
2286,
2768,
225,
288,
2358,
18,
19525,
904,
18,
1518,
18,
8763,
53,
4098,
460,
273,
394,
2358,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
2358,
18,
19525,
904,
18,
1518,
18,
8763,
53,
4098,
336,
8763,
53,
4098,
1435,
1216,
2286,
2768,
225,
288,
2358,
18,
19525,
904,
18,
1518,
18,
8763,
53,
4098,
460,
273,
394,
2358,... |
XMLUtils.stringToSAX((String) value, "", state.saxStore, false); | XMLUtils.stringToSAX((String) value, "", state.saxStore, false, false); | public ProcessorOutput createOutput(String name) { ProcessorOutput output = new ProcessorImpl.DigestTransformerOutputImpl(getClass(), name) { public void readImpl(PipelineContext pipelineContext, final ContentHandler contentHandler) { try { State state = (State) getFilledOutState(pipelineContext); state.saxStore.replay(contentHandler); } catch (SAXException e) { throw new OXFException(e); } } protected byte[] computeDigest(PipelineContext pipelineContext, DigestState digestState) { if (digestState.digest == null) { fillOutState(pipelineContext, digestState); } return digestState.digest; } protected boolean fillOutState(PipelineContext pipelineContext, DigestState digestState) { try { State state = (State) digestState; if (state.saxStore == null) { ContextConfig config = readConfig(pipelineContext); // Get value from context ExternalContext externalContext = (ExternalContext) pipelineContext.getAttribute(PipelineContext.EXTERNAL_CONTEXT); if (externalContext == null) throw new OXFException("Missing external context"); Object value = config.getContextType() == ScopeProcessorBase.REQUEST_CONTEXT ? externalContext.getRequest().getAttributesMap().get(config.getKey()) : config.getContextType() == ScopeProcessorBase.SESSION_CONTEXT ? externalContext.getSession(true).getAttributesMap().get(config.getKey()) : config.getContextType() == ScopeProcessorBase.APPLICATION_CONTEXT ? externalContext.getAttributesMap().get(config.getKey()) : null; if (value != null) { if (value instanceof ScopeStore) { // Case 1: use the stored key/validity as internal key/validity ScopeStore contextStore = (ScopeStore) value; state.saxStore = contextStore.getSaxStore(); if (!config.isTestIgnoreStoredKeyValidity()) { // Regular case state.key = contextStore.getKey(); state.validity = contextStore.getValidity(); } else { // Special test mode (will use digest) state.key = null; state.validity = null; } } else { // Case 2: "generate the validity from object" (similar to what is done in the BeanGenerator) if (value instanceof SAXStore) { state.saxStore = (SAXStore) value; } else { // Write "foreign" object to new SAX store state.saxStore = new SAXStore(); if (value instanceof org.dom4j.Document) { // dom4j document LocationSAXWriter saxWriter = new LocationSAXWriter(); saxWriter.setContentHandler(state.saxStore); saxWriter.write((org.dom4j.Document) value); } else if (value instanceof org.w3c.dom.Document) { // W3C DOM document Transformer identity = TransformerUtils.getIdentityTransformer(); identity.transform(new DOMSource((org.w3c.dom.Document) value), new SAXResult(state.saxStore)); } else if (value instanceof String) { // Consider the String containing a document to parse XMLUtils.stringToSAX((String) value, "", state.saxStore, false); } else { // Consider the object a JavaBean Mapping mapping; if (getConnectedInputs().get(INPUT_MAPPING) == null) { mapping = new Mapping(); mapping.loadMapping(new InputSource(new StringReader("<mapping/>"))); } else mapping = readMapping(pipelineContext); readBean(value, mapping, state.saxStore);// throw new OXFException("Session object " + config.getKey()// + " is of unknown type: " + value.getClass().getName()); } } } } else { // Store empty document if (nullDocumentSAXStore == null) { nullDocumentSAXStore = new SAXStore(); Transformer identity = TransformerUtils.getIdentityTransformer(); identity.transform(new DocumentSource(Dom4jUtils.NULL_DOCUMENT), new SAXResult(nullDocumentSAXStore)); } state.saxStore = nullDocumentSAXStore; } // Compute digest of the SAX Store XMLUtils.DigestContentHandler digestContentHandler = new XMLUtils.DigestContentHandler("MD5"); state.saxStore.replay(digestContentHandler); state.digest = digestContentHandler.getResult(); } return true; } catch (Exception e) { throw new OXFException(e); } } }; addOutput(OUTPUT_DATA, output); return output; } | 52783 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52783/c92faea3770d68e915964a3102a4873b3279f0cd/ScopeGenerator.java/clean/src/java/org/orbeon/oxf/processor/scope/ScopeGenerator.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
15476,
1447,
752,
1447,
12,
780,
508,
13,
288,
3639,
15476,
1447,
876,
273,
394,
15476,
2828,
18,
9568,
8319,
1447,
2828,
12,
588,
797,
9334,
508,
13,
288,
5411,
1071,
918,
855,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
15476,
1447,
752,
1447,
12,
780,
508,
13,
288,
3639,
15476,
1447,
876,
273,
394,
15476,
2828,
18,
9568,
8319,
1447,
2828,
12,
588,
797,
9334,
508,
13,
288,
5411,
1071,
918,
855,
2... |
private boolean xorExpressionIsPointless(PsiExpression lhs, PsiExpression rhs, PsiType expressionType) { return isZero(lhs, expressionType) || isZero(rhs, expressionType) || isAllOnes(lhs, expressionType) || isAllOnes(rhs, expressionType); | private boolean xorExpressionIsPointless(PsiExpression lhs, PsiExpression rhs, PsiType expressionType){ return isZero(lhs, expressionType) || isZero(rhs, expressionType) || isAllOnes(lhs, expressionType) || isAllOnes(rhs, expressionType); | private boolean xorExpressionIsPointless(PsiExpression lhs, PsiExpression rhs, PsiType expressionType) { return isZero(lhs, expressionType) || isZero(rhs, expressionType) || isAllOnes(lhs, expressionType) || isAllOnes(rhs, expressionType); } | 56598 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56598/e4dba42c27333ff3aa3a021da7c8754469f669b6/PointlessBitwiseExpressionInspection.java/buggy/plugins/InspectionGadgets/src/com/siyeh/ig/bitwise/PointlessBitwiseExpressionInspection.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
225,
1250,
17586,
2300,
2520,
2148,
2656,
12,
52,
7722,
2300,
8499,
16,
453,
7722,
2300,
7711,
16,
453,
7722,
559,
2652,
559,
13,
288,
3639,
327,
353,
7170,
12,
80,
4487,
16,
2652... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
225,
1250,
17586,
2300,
2520,
2148,
2656,
12,
52,
7722,
2300,
8499,
16,
453,
7722,
2300,
7711,
16,
453,
7722,
559,
2652,
559,
13,
288,
3639,
327,
353,
7170,
12,
80,
4487,
16,
2652... |
saveLine(currentLine, previousLine, c, box, minimumLineHeight, | saveLine(currentLine, previousLine, c, box, minimumLineHeight, | public static void layoutContent(LayoutContext c, Box box, List contentList) { int maxAvailableWidth = c.getExtents().width; int remainingWidth = maxAvailableWidth; int minimumLineHeight = (int)c.getCurrentStyle().getLineHeight(c); LineBox currentLine = newLine(c, null, box); LineBox previousLine = null; InlineBox currentIB = null; InlineBox previousIB = null; List elementStack = new ArrayList(); if (box instanceof AnonymousBlockBox) { List pending = ((BlockBox)box.getParent()).getPendingInlineElements(); if (pending != null) { currentIB = addNestedInlineBoxes(currentLine, pending, maxAvailableWidth); elementStack = pending; } } CalculatedStyle parentStyle = c.getCurrentStyle(); int indent = (int)parentStyle.getFloatPropertyProportionalWidth(CSSName.TEXT_INDENT, maxAvailableWidth, c); remainingWidth -= indent; currentLine.x = indent; if (! box.getStyle().isCleared()) { remainingWidth -= c.getBlockFormattingContext().getFloatDistance( c, currentLine, remainingWidth); } List pendingFloats = new ArrayList(); int pendingLeftMBP = 0; int pendingRightMBP = 0; int start = pushPseudoClasses(c, contentList); if (c.getFirstLinesTracker().hasStyles()) { c.getFirstLinesTracker().pushStyles(c); } for (int i = start; i < contentList.size(); i++) { Object o = contentList.get(i); if (o instanceof StylePush) { StylePush sp = (StylePush) o; CascadedStyle cascaded = sp.getStyle(c); c.pushStyle(cascaded); CalculatedStyle style = c.getCurrentStyle(); previousIB = currentIB; currentIB = new InlineBox(sp.getElement(), style, maxAvailableWidth); currentIB.calculateHeight(c); elementStack.add(new InlineBoxInfo(cascaded, currentIB)); if (previousIB == null) { currentLine.addChild(currentIB); } else { previousIB.addInlineChild(currentIB); } //To break the line well, assume we don't just want to paint padding on next line pendingLeftMBP += style.getLeftMarginBorderPadding(c, maxAvailableWidth); pendingRightMBP += style.getRightMarginBorderPadding(c, maxAvailableWidth); continue; } if (o instanceof StylePop) { CalculatedStyle style = c.getCurrentStyle(); int rightMBP = style.getRightMarginBorderPadding(c, maxAvailableWidth); pendingRightMBP -= rightMBP; remainingWidth -= rightMBP; elementStack.remove(elementStack.size()-1); currentIB.setEndsHere(true); previousIB = currentIB; currentIB = currentIB.getParent() instanceof LineBox ? null : (InlineBox)currentIB.getParent(); c.popStyle(); continue; } Content content = (Content) o; if (mustBeTakenOutOfFlow(content)) { processOutOfFlowContent(c, content, currentLine, remainingWidth, pendingFloats); } else if (isInlineBlock(content)) { Box inlineBlock = Boxing.layout(c, content); if (inlineBlock.getWidth() > remainingWidth && currentLine.isContainsContent()) { saveLine(currentLine, previousLine, c, box, minimumLineHeight, maxAvailableWidth, elementStack, pendingFloats); inlineBlock = Boxing.layout(c, content); previousLine = currentLine; currentLine = newLine(c, previousLine, box); currentIB = addNestedInlineBoxes(currentLine, elementStack, maxAvailableWidth); previousIB = currentIB.getParent() instanceof LineBox ? null : (InlineBox)currentIB.getParent(); remainingWidth = maxAvailableWidth; if (!box.getStyle().isCleared()) { remainingWidth -= c.getBlockFormattingContext().getFloatDistance( c, currentLine, remainingWidth); } } if (currentIB == null) { currentLine.addChild(inlineBlock); } else { currentIB.addInlineChild(inlineBlock); } currentLine.setContainsContent(true); remainingWidth -= inlineBlock.getWidth(); } else { TextContent text = (TextContent)content; LineBreakContext lbContext = new LineBreakContext(); lbContext.setMaster(TextUtil.transformText(text.getText(), c.getCurrentStyle())); do { lbContext.reset(); int fit = 0; if (lbContext.getStart() == 0) { fit += pendingLeftMBP; } if (hasTrimmableLeadingSpace(currentLine, c.getCurrentStyle(), lbContext)) { lbContext.setStart(lbContext.getStart() + 1); } InlineText inlineText = layoutText(c, remainingWidth - fit, lbContext); if (! lbContext.isUnbreakable() || (lbContext.isUnbreakable() && currentLine.isContainsContent())) { currentIB.addInlineChild(inlineText); currentLine.setContainsContent(true); lbContext.setStart(lbContext.getEnd()); remainingWidth -= inlineText.getWidth(); } if (lbContext.isNeedsNewLine()) { saveLine(currentLine, previousLine, c, box, minimumLineHeight, maxAvailableWidth, elementStack, pendingFloats); previousLine = currentLine; currentLine = newLine(c, previousLine, box); currentIB = addNestedInlineBoxes(currentLine, elementStack, maxAvailableWidth); previousIB = currentIB.getParent() instanceof LineBox ? null : (InlineBox)currentIB.getParent(); remainingWidth = maxAvailableWidth; if (!box.getStyle().isCleared()) { remainingWidth -= c.getBlockFormattingContext().getFloatDistance( c, currentLine, remainingWidth); } } } while (! lbContext.isFinished()); } } saveLine(currentLine, previousLine, c, box, minimumLineHeight, maxAvailableWidth, elementStack, pendingFloats); if (box instanceof AnonymousBlockBox) { ((BlockBox)box.getParent()).setPendingInlineElements( elementStack.size() == 0 ? null : elementStack); } // XXX what does this do? if (!c.shrinkWrap()) box.contentWidth = maxAvailableWidth; box.setHeight(currentLine.y + currentLine.getHeight()); } | 52947 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52947/ceb21dee5f070c3ac63d70ae7b6eb22a7c0b4641/InlineBoxing.java/buggy/src/java/org/xhtmlrenderer/layout/InlineBoxing.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
918,
3511,
1350,
12,
3744,
1042,
276,
16,
8549,
3919,
16,
987,
913,
682,
13,
288,
3639,
509,
943,
5268,
2384,
273,
276,
18,
588,
2482,
4877,
7675,
2819,
31,
3639,
509,
4463,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
918,
3511,
1350,
12,
3744,
1042,
276,
16,
8549,
3919,
16,
987,
913,
682,
13,
288,
3639,
509,
943,
5268,
2384,
273,
276,
18,
588,
2482,
4877,
7675,
2819,
31,
3639,
509,
4463,
... |
if (!(dm instanceof MGeneralizableElement)) return NO_PROBLEM; MGeneralizableElement ge = (MGeneralizableElement) dm; VectorSet reach = (new VectorSet(ge)).reachable(new SuperclassGen()); if (reach.contains(ge)) return PROBLEM_FOUND; return NO_PROBLEM; | boolean problem = NO_PROBLEM; if (ModelFacade.isAGeneralizableElement(dm)) { try { CoreHelper.getHelper().getChildren(dm); } catch (IllegalStateException ex) { problem = PROBLEM_FOUND; } } return problem; | public boolean predicate2(Object dm, Designer dsgr) { if (!(dm instanceof MGeneralizableElement)) return NO_PROBLEM; MGeneralizableElement ge = (MGeneralizableElement) dm; VectorSet reach = (new VectorSet(ge)).reachable(new SuperclassGen()); if (reach.contains(ge)) return PROBLEM_FOUND; return NO_PROBLEM; } | 7166 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7166/9bc2a8103355ff0c2b14c61a3df3f0113b43409d/CrCircularInheritance.java/clean/src_new/org/argouml/uml/cognitive/critics/CrCircularInheritance.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
1250,
5641,
22,
12,
921,
9113,
16,
29703,
264,
302,
1055,
86,
13,
288,
565,
309,
16051,
12,
10956,
1276,
490,
12580,
6934,
1046,
3719,
327,
3741,
67,
3373,
38,
26817,
31,
565,
490... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
1250,
5641,
22,
12,
921,
9113,
16,
29703,
264,
302,
1055,
86,
13,
288,
565,
309,
16051,
12,
10956,
1276,
490,
12580,
6934,
1046,
3719,
327,
3741,
67,
3373,
38,
26817,
31,
565,
490... |
return new DataDefinitionComposite(parent, SWT.NONE, query, null, builder, oContext); | return new DataDefinitionComposite(parent, SWT.NONE, query, seriesdefinition, builder, oContext); | public Composite getSeriesDataSheet(Composite parent, Series series, IExpressionBuilder builder, Object oContext) { Query query = null; if (series.getDataDefinition().size() > 0) { query = ((Query) series.getDataDefinition().get(0)); } else { query = QueryImpl.create(""); series.getDataDefinition().add(query); } return new DataDefinitionComposite(parent, SWT.NONE, query, null, builder, oContext); } | 5230 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5230/258bad0d502f0759055374875005f9978172c4d7/LineSeriesUIProvider.java/clean/chart/org.eclipse.birt.chart.ui.extension/src/org/eclipse/birt/chart/ui/swt/series/LineSeriesUIProvider.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
14728,
336,
6485,
751,
8229,
12,
9400,
982,
16,
9225,
4166,
16,
467,
2300,
1263,
2089,
16,
1033,
320,
1042,
13,
565,
288,
3639,
2770,
843,
273,
446,
31,
3639,
309,
261,
10222,
18,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
14728,
336,
6485,
751,
8229,
12,
9400,
982,
16,
9225,
4166,
16,
467,
2300,
1263,
2089,
16,
1033,
320,
1042,
13,
565,
288,
3639,
2770,
843,
273,
446,
31,
3639,
309,
261,
10222,
18,... |
if (selected != null) | if (selected != null && selected.buffer != buffer) | public void setSelected() { Window selected = getSelected(); if (selected != null) selected.unselect(); frame.selectedWindow = this; Frame.selectedFrame = frame; buffer.curPosition = getCaret(); if (buffer.pointMarker.index >= 0) buffer.content.freePosition(buffer.pointMarker.index); buffer.pointMarker.index = Marker.POINT_POSITION_INDEX; Buffer.setCurrent(buffer); } | 40769 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/40769/df6aca8c3709a8f7148d160b9bb49b44389ec103/Window.java/clean/gnu/jemacs/buffer/Window.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
23006,
1435,
225,
288,
565,
6076,
3170,
273,
16625,
5621,
565,
309,
261,
8109,
480,
446,
597,
3170,
18,
4106,
480,
1613,
13,
1377,
3170,
18,
318,
4025,
5621,
565,
2623,
18,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
23006,
1435,
225,
288,
565,
6076,
3170,
273,
16625,
5621,
565,
309,
261,
8109,
480,
446,
597,
3170,
18,
4106,
480,
1613,
13,
1377,
3170,
18,
318,
4025,
5621,
565,
2623,
18,
8... |
public void activate_object_with_id(byte[] an_Object_Id, Servant a_servant, boolean use_forwarding) throws ServantAlreadyActive, ObjectAlreadyActive, WrongPolicy | public void activate_object_with_id(byte[] an_Object_Id, Servant a_servant) throws ServantAlreadyActive, ObjectAlreadyActive, WrongPolicy | public void activate_object_with_id(byte[] an_Object_Id, Servant a_servant, boolean use_forwarding) throws ServantAlreadyActive, ObjectAlreadyActive, WrongPolicy { checkDiscarding(); required(ServantRetentionPolicyValue.RETAIN); // If the UNIQUE_ID applies, the servant being passed must not be // already active. if (applies(IdUniquenessPolicyValue.UNIQUE_ID)) { AOM.Obj sx = aom.findServant(a_servant, false); if (sx != null) throw new ServantAlreadyActive(); } AOM.Obj exists = aom.get(an_Object_Id); if (exists != null) { if (exists.servant == null) { locateServant(an_Object_Id, a_servant, exists, use_forwarding); exists.setDeactivated(false); } else if (exists.isDeactiveted()) { exists.setDeactivated(false); incarnate(exists, an_Object_Id, a_servant, use_forwarding); } else throw new ObjectAlreadyActive(); } else { ServantDelegateImpl delegate = new ServantDelegateImpl(a_servant, this, an_Object_Id); create_and_connect(an_Object_Id, a_servant._all_interfaces(this, an_Object_Id)[0], delegate); } } | 50763 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50763/b53ee23d2db4d673b2dea5fee94b6bff00d241bf/gnuPOA.java/clean/core/src/classpath/gnu/gnu/CORBA/Poa/gnuPOA.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
10235,
67,
1612,
67,
1918,
67,
350,
12,
7229,
8526,
392,
67,
921,
67,
548,
16,
1275,
7445,
279,
67,
550,
7445,
16,
565,
1250,
999,
67,
11565,
310,
13,
565,
1216,
1275,
7445... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
10235,
67,
1612,
67,
1918,
67,
350,
12,
7229,
8526,
392,
67,
921,
67,
548,
16,
1275,
7445,
279,
67,
550,
7445,
16,
565,
1250,
999,
67,
11565,
310,
13,
565,
1216,
1275,
7445... |
} result = true; | public boolean lookingAtValidChar(boolean skipPastChar) throws Exception { int b0 = fMostRecentByte; if (b0 < 0x80) { // 0xxxxxxx if (b0 >= 0x20 || b0 == 0x09) { if (skipPastChar) { fCharacterCounter++; if (USE_OUT_OF_LINE_LOAD_NEXT_BYTE) { loadNextByte(); } else { fCurrentOffset++; if (USE_TRY_CATCH_FOR_LOAD_NEXT_BYTE) { fCurrentIndex++; try { fMostRecentByte = fMostRecentData[fCurrentIndex] & 0xFF; } catch (ArrayIndexOutOfBoundsException ex) { slowLoadNextByte(); } } else { if (++fCurrentIndex == UTF8DataChunk.CHUNK_SIZE) slowLoadNextByte(); else fMostRecentByte = fMostRecentData[fCurrentIndex] & 0xFF; } } } return true; } if (b0 == 0x0A) { if (skipPastChar) { fLinefeedCounter++; fCharacterCounter = 1; if (USE_OUT_OF_LINE_LOAD_NEXT_BYTE) { loadNextByte(); } else { fCurrentOffset++; if (USE_TRY_CATCH_FOR_LOAD_NEXT_BYTE) { fCurrentIndex++; try { fMostRecentByte = fMostRecentData[fCurrentIndex] & 0xFF; } catch (ArrayIndexOutOfBoundsException ex) { slowLoadNextByte(); } } else { if (++fCurrentIndex == UTF8DataChunk.CHUNK_SIZE) slowLoadNextByte(); else fMostRecentByte = fMostRecentData[fCurrentIndex] & 0xFF; } } } return true; } if (b0 == 0x0D) { if (skipPastChar) { fCarriageReturnCounter++; fCharacterCounter = 1; if (USE_OUT_OF_LINE_LOAD_NEXT_BYTE) { b0 = loadNextByte(); } else { fCurrentOffset++; if (USE_TRY_CATCH_FOR_LOAD_NEXT_BYTE) { fCurrentIndex++; try { fMostRecentByte = fMostRecentData[fCurrentIndex] & 0xFF; b0 = fMostRecentByte; } catch (ArrayIndexOutOfBoundsException ex) { b0 = slowLoadNextByte(); } } else { if (++fCurrentIndex == UTF8DataChunk.CHUNK_SIZE) b0 = slowLoadNextByte(); else b0 = (fMostRecentByte = fMostRecentData[fCurrentIndex] & 0xFF); } } if (b0 == 0x0A) { fLinefeedCounter++; if (USE_OUT_OF_LINE_LOAD_NEXT_BYTE) { loadNextByte(); } else { fCurrentOffset++; if (USE_TRY_CATCH_FOR_LOAD_NEXT_BYTE) { fCurrentIndex++; try { fMostRecentByte = fMostRecentData[fCurrentIndex] & 0xFF; } catch (ArrayIndexOutOfBoundsException ex) { slowLoadNextByte(); } } else { if (++fCurrentIndex == UTF8DataChunk.CHUNK_SIZE) slowLoadNextByte(); else fMostRecentByte = fMostRecentData[fCurrentIndex] & 0xFF; } } } } return true; } if (b0 == 0) { if (atEOF(fCurrentOffset + 1)) { return changeReaders().lookingAtValidChar(skipPastChar); } } return false; } // // REVISIT - optimize this with in-buffer lookahead. // UTF8DataChunk saveChunk = fCurrentChunk; int saveIndex = fCurrentIndex; int saveOffset = fCurrentOffset; int b1 = loadNextByte(); if ((0xe0 & b0) == 0xc0) { // 110yyyyy 10xxxxxx (0x80 to 0x7ff) if (skipPastChar) { fCharacterCounter++; loadNextByte(); } else { fCurrentChunk = saveChunk; fCurrentIndex = saveIndex; fCurrentOffset = saveOffset; fMostRecentData = saveChunk.toByteArray(); fMostRecentByte = b0; } return true; // [#x20-#xD7FF] } int b2 = loadNextByte(); if ((0xf0 & b0) == 0xe0) { // 1110zzzz 10yyyyyy 10xxxxxx // ch = ((0x0f & b0)<<12) + ((0x3f & b1)<<6) + (0x3f & b2); // zzzz yyyy yyxx xxxx (0x800 to 0xffff) // if (!((ch >= 0xD800 && ch <= 0xDFFF) || ch >= 0xFFFE)) // if ((ch <= 0xD7FF) || (ch >= 0xE000 && ch <= 0xFFFD)) boolean result = false; if (!((b0 == 0xED && b1 >= 0xA0) || (b0 == 0xEF && b1 == 0xBF && b2 >= 0xBE))) { // [#x20-#xD7FF] | [#xE000-#xFFFD] if (skipPastChar) { fCharacterCounter++; loadNextByte(); return true; } result = true; } fCurrentChunk = saveChunk; fCurrentIndex = saveIndex; fCurrentOffset = saveOffset; fMostRecentData = saveChunk.toByteArray(); fMostRecentByte = b0; return result; } int b3 = loadNextByte(); // 11110uuu 10uuzzzz 10yyyyyy 10xxxxxx // ch = ((0x0f & b0)<<18) + ((0x3f & b1)<<12) + ((0x3f & b2)<<6) + (0x3f & b3); // u uuuu zzzz yyyy yyxx xxxx (0x10000 to 0x1ffff) // if (ch >= 0x110000) boolean result = false; if (( 0xf8 & b0 ) == 0xf0 ) { if (!(b0 > 0xF4 || (b0 == 0xF4 && b1 >= 0x90))) { // [#x10000-#x10FFFF] if (skipPastChar) { fCharacterCounter++; loadNextByte(); return true; } result = true; } fCurrentChunk = saveChunk; fCurrentIndex = saveIndex; fCurrentOffset = saveOffset; fMostRecentData = saveChunk.toByteArray(); fMostRecentByte = b0; return result; } else{ fCurrentChunk = saveChunk; fCurrentIndex = saveIndex; fCurrentOffset = saveOffset; fMostRecentData = saveChunk.toByteArray(); fMostRecentByte = b0; return result; } } | 6373 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6373/ee1fcf74a2e0d8b4bd99619469e50d4aa75a377f/UTF8Reader.java/clean/src/org/apache/xerces/readers/UTF8Reader.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1250,
7849,
861,
1556,
2156,
12,
6494,
2488,
52,
689,
2156,
13,
1216,
1185,
288,
3639,
509,
324,
20,
273,
284,
18714,
17076,
3216,
31,
3639,
309,
261,
70,
20,
411,
374,
92,
3672,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1250,
7849,
861,
1556,
2156,
12,
6494,
2488,
52,
689,
2156,
13,
1216,
1185,
288,
3639,
509,
324,
20,
273,
284,
18714,
17076,
3216,
31,
3639,
309,
261,
70,
20,
411,
374,
92,
3672,
... | |
page.put(PdfName.USERUNIT, new PdfNumber(writer.getUserunit())); } | page.put(PdfName.USERUNIT, new PdfNumber(writer.getUserunit())); } | public boolean newPage() throws DocumentException { lastElementType = -1; //add by Jin-Hsia Yang isNewpage = true; //end add by Jin-Hsia Yang if (writer.getDirectContent().size() == 0 && writer.getDirectContentUnder().size() == 0 && (pageEmpty || (writer != null && writer.isPaused()))) { return false; } PdfPageEvent pageEvent = writer.getPageEvent(); if (pageEvent != null) pageEvent.onEndPage(writer, this); //Added to inform any listeners that we are moving to a new page (added by David Freels) super.newPage(); // the following 2 lines were added by Pelikan Stephan imageIndentLeft = 0; imageIndentRight = 0; // we flush the arraylist with recently written lines flushLines(); // we assemble the resources of this pages pageResources.addDefaultColorDiff(writer.getDefaultColorspace()); PdfDictionary resources = pageResources.getResources(); // we make a new page and add it to the document if (writer.getPDFXConformance() != PdfWriter.PDFXNONE) { if (thisBoxSize.containsKey("art") && thisBoxSize.containsKey("trim")) throw new PdfXConformanceException("Only one of ArtBox or TrimBox can exist in the page."); if (!thisBoxSize.containsKey("art") && !thisBoxSize.containsKey("trim")) { if (thisBoxSize.containsKey("crop")) thisBoxSize.put("trim", thisBoxSize.get("crop")); else thisBoxSize.put("trim", new PdfRectangle(pageSize, pageSize.getRotation())); } } PdfPage page; int rotation = pageSize.getRotation(); page = new PdfPage(new PdfRectangle(pageSize, rotation), thisBoxSize, resources, rotation); if (writer.isTagged()) page.put(PdfName.STRUCTPARENTS, new PdfNumber(writer.getCurrentPageNumber() - 1)); // we add the transitions if (this.transition!=null) { page.put(PdfName.TRANS, this.transition.getTransitionDictionary()); transition = null; } if (this.duration>0) { page.put(PdfName.DUR,new PdfNumber(this.duration)); duration = 0; } // we add the page object additional actions if (pageAA != null) { try { page.put(PdfName.AA, writer.addToBody(pageAA).getIndirectReference()); } catch (IOException ioe) { throw new ExceptionConverter(ioe); } pageAA = null; } // we check if the userunit is defined if (writer.getUserunit() > 0f) { page.put(PdfName.USERUNIT, new PdfNumber(writer.getUserunit())); } // we add the annotations if (annotations.size() > 0) { PdfArray array = rotateAnnotations(); if (array.size() != 0) page.put(PdfName.ANNOTS, array); } // we add the thumbs if (thumb != null) { page.put(PdfName.THUMB, thumb); thumb = null; } if (!open || close) { throw new PdfException("The document isn't open."); } if (text.size() > textEmptySize) text.endText(); else text = null; writer.add(page, new PdfContents(writer.getDirectContentUnder(), graphics, text, writer.getDirectContent(), pageSize)); // we initialize the new page initPage(); //add by Jin-Hsia Yang isNewpage = false; //end add by Jin-Hsia Yang return true; } | 6653 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6653/aae864e08892bcaa996e6e0837e49ba48452dad0/PdfDocument.java/clean/src/com/lowagie/text/pdf/PdfDocument.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1250,
394,
1964,
1435,
1216,
4319,
503,
288,
3639,
1142,
17481,
273,
300,
21,
31,
3639,
368,
1289,
635,
804,
267,
17,
44,
87,
1155,
1624,
539,
3639,
10783,
2433,
273,
638,
31,
363... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1250,
394,
1964,
1435,
1216,
4319,
503,
288,
3639,
1142,
17481,
273,
300,
21,
31,
3639,
368,
1289,
635,
804,
267,
17,
44,
87,
1155,
1624,
539,
3639,
10783,
2433,
273,
638,
31,
363... |
tokenConsumption: while( true ){ switch( token.getType() ){ case IToken.tCOMMA : list.addLast( param.toCharArray() ); param = new String(""); break; case IToken.tLPAREN : break; case IToken.tRPAREN : list.addLast( param.toCharArray() ); break tokenConsumption; case IToken.tSTAR: case IToken.tQUESTION: lastTokenWasWild = true; param += token.getImage(); break; default: if( !lastTokenWasWild && param.length() > 0 ) param += " "; param += token.getImage(); break; } token = scanner.nextToken(); | if( declarations == null || ! declarations.hasNext() ) return null; IASTFunction function = (IASTFunction) declarations.next(); Iterator parameters = function.getParameters(); char [] param = null; while( parameters.hasNext() ){ param = getParamString( (IASTParameterDeclaration)parameters.next() ); list.add( param ); | private static LinkedList scanForParameters(IScanner scanner) { LinkedList list = new LinkedList(); String param = new String(""); boolean lastTokenWasWild = false; try{ IToken token = scanner.nextToken(); tokenConsumption: while( true ){ switch( token.getType() ){ case IToken.tCOMMA : list.addLast( param.toCharArray() ); param = new String(""); break; case IToken.tLPAREN : break; case IToken.tRPAREN : list.addLast( param.toCharArray() ); break tokenConsumption; case IToken.tSTAR: case IToken.tQUESTION: lastTokenWasWild = true; param += token.getImage(); break; default: if( !lastTokenWasWild && param.length() > 0 ) param += " "; param += token.getImage(); break; } token = scanner.nextToken(); } } catch ( EndOfFile e ){ list.addLast( param.toCharArray() ); } catch( ScannerException e ){ } return list; } | 6192 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6192/ceee55836e1155fe2a56b45dafd602f35bf19ce6/CSearchPattern.java/clean/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
760,
10688,
4135,
1290,
2402,
12,
45,
11338,
7683,
13,
288,
202,
202,
13174,
682,
666,
273,
394,
10688,
5621,
9506,
202,
780,
579,
273,
394,
514,
2932,
8863,
9506,
202,
6494,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
760,
10688,
4135,
1290,
2402,
12,
45,
11338,
7683,
13,
288,
202,
202,
13174,
682,
666,
273,
394,
10688,
5621,
9506,
202,
780,
579,
273,
394,
514,
2932,
8863,
9506,
202,
6494,
... |
System.out.println("\tcertain = " + certain); | public static void main(String[] args) throws FormatException, IOException { File file = args.length < 1 ? new File(System.getProperty("user.dir")).listFiles()[0] : new File(args[0]); System.out.println("File = " + file.getAbsoluteFile()); String pat = FilePattern.findPattern(file); if (pat == null) System.out.println("No pattern found."); else { System.out.println("Pattern = " + pat); FilePattern fp = new FilePattern(pat); if (fp.isValid()) { System.out.println("Pattern is valid."); String id = fp.getFiles()[0]; if (!new File(id).exists()) { System.out.println("File '" + id + "' does not exist."); } else { // read dimensional information from first file System.out.print("Reading first file "); ImageReader reader = new ImageReader(); String dimOrder = reader.getDimensionOrder(id); int sizeZ = reader.getSizeZ(id); int sizeT = reader.getSizeT(id); int sizeC = reader.getSizeC(id); boolean certain = reader.isOrderCertain(id); reader.close(); System.out.println("[done]"); System.out.println("\tdimOrder = " + dimOrder); System.out.println("\tsizeZ = " + sizeZ); System.out.println("\tsizeT = " + sizeT); System.out.println("\tsizeC = " + sizeC); System.out.println("\tcertain = " + certain); // guess axes AxisGuesser ag = new AxisGuesser(fp, dimOrder, sizeZ, sizeT, sizeC, certain); // output results String[] blocks = fp.getBlocks(); String[] prefixes = fp.getPrefixes(); int[] axes = ag.getAxisTypes(); String newOrder = ag.getAdjustedOrder(); System.out.println("Axis types:"); for (int i=0; i<blocks.length; i++) { String axis; switch (axes[i]) { case Z_AXIS: axis = "Z"; break; case T_AXIS: axis = "T"; break; case C_AXIS: axis = "C"; break; default: axis = "?"; } System.out.println("\t" + blocks[i] + "\t" + axis + " (prefix = " + prefixes[i] + ")"); } System.out.println("Adjusted dimension order = " + newOrder); } } else System.out.println("Pattern is invalid: " + fp.getErrorMessage()); } } | 46826 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46826/58efc920cd77357b1781520801c62cc4edad94cc/AxisGuesser.java/clean/loci/formats/AxisGuesser.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
760,
918,
2774,
12,
780,
8526,
833,
13,
1216,
4077,
503,
16,
1860,
288,
565,
1387,
585,
273,
833,
18,
2469,
411,
404,
692,
1377,
394,
1387,
12,
3163,
18,
588,
1396,
2932,
1355,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
760,
918,
2774,
12,
780,
8526,
833,
13,
1216,
4077,
503,
16,
1860,
288,
565,
1387,
585,
273,
833,
18,
2469,
411,
404,
692,
1377,
394,
1387,
12,
3163,
18,
588,
1396,
2932,
1355,
... | |
(FrontEnd.PROP_SAMPLE_RATE, 16000); | (propertyPrefix + "sampleRate", 16000); | public void setProperties(SphinxProperties props) { int sampleRate = props.getInt (FrontEnd.PROP_SAMPLE_RATE, 16000); float windowSizeInMs = getSphinxProperties().getFloat (FrontEnd.PROP_WINDOW_SIZE_MS, 25.625F); float windowShiftInMs = getSphinxProperties().getFloat (FrontEnd.PROP_WINDOW_SHIFT_MS, 10.0F); windowSize = Util.getSamplesPerWindow(sampleRate, windowSizeInMs); windowShift = Util.getSamplesPerShift(sampleRate, windowShiftInMs); } | 52185 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52185/9c35c918eb75ae0459cd4469c20599988ba60200/Windower.java/buggy/edu/cmu/sphinx/frontend/Windower.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
23126,
12,
55,
15922,
2297,
3458,
13,
288,
3639,
509,
27505,
273,
3458,
18,
588,
1702,
202,
565,
261,
4468,
2244,
397,
315,
6358,
4727,
3113,
2872,
3784,
1769,
3639,
1431,
2706... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
23126,
12,
55,
15922,
2297,
3458,
13,
288,
3639,
509,
27505,
273,
3458,
18,
588,
1702,
202,
565,
261,
4468,
2244,
397,
315,
6358,
4727,
3113,
2872,
3784,
1769,
3639,
1431,
2706... |
imcode.server.user.User user ; | imcode.server.user.UserDomainObject user ; | public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { String host = req.getHeader("Host") ; IMCServiceInterface imcref = IMCServiceRMI.getIMCServiceInterface(req) ; String start_url = imcref.getStartUrl() ; String image_url = imcref.getImageUrl() ; File image_path = Utility.getDomainPrefPath( "image_path",host ) ; imcode.server.user.User user ; String htmlStr = "" ; int meta_id ; int img_no ; res.setContentType("text/html"); PrintWriter out = res.getWriter(); String tmp = (req.getParameter("img_no") != null)?req.getParameter("img_no"):req.getParameter("img") ; img_no = Integer.parseInt(tmp) ; tmp = req.getParameter("meta_id") ; meta_id = Integer.parseInt(tmp) ; String label = req.getParameter("label") ; if (label == null) { label = "" ; } // Check if ChangeImage is invoked by ImageBrowse, hence containing // an image filename as option value (M. Wallin) String img_preset = (req.getParameter("imglist") == null)?"":java.net.URLDecoder.decode(req.getParameter("imglist")); // Get the session HttpSession session = req.getSession(true); // Does the session indicate this user already logged in? Object done = session.getAttribute("logon.isDone"); // marker object user = (imcode.server.user.User)done ; if (done == null) { // No logon.isDone means he hasn't logged in. // Save the request URL as the true target and redirect to the login page. String scheme = req.getScheme(); String serverName = req.getServerName(); int p = req.getServerPort(); String port = (p == 80) ? "" : ":" + p; res.sendRedirect(scheme + "://" + serverName + port + start_url) ; return ; } // Check if user has write rights if ( !imcref.checkDocAdminRights( meta_id, user) ) { log("User "+user.getUserId()+" was denied access to meta_id "+meta_id+" and was sent to "+start_url) ; String scheme = req.getScheme() ; String serverName = req.getServerName() ; int p = req.getServerPort() ; String port = ( p == 80 ) ? "" : ":" + p ; res.sendRedirect( scheme + "://" + serverName + port + start_url ) ; return ; } //*lets get the root_dir_name that we need later on String root_dir_name = image_path.getName(); //*lets get the dirlist, and add the rootdir to it List imageFolders = GetImages.getImageFolders(image_path, true) ; imageFolders.add(0,image_path); //ok we have the list, now lets setup the option list to send to browser StringBuffer folderOptions = new StringBuffer(); Iterator iter = imageFolders.iterator(); while (iter.hasNext()){ File fileObj = (File) iter.next(); String optionValue, optionName; //OBS! we only allowe on directory down from imageRoot, //so the current "directory" or the "parent" must be equal to root_dir_name //lets start and see if the parent is root_dir if ( root_dir_name.equals(fileObj.getParentFile().getName()) ){ optionValue = HTMLConv.toHTML("\\"+fileObj.getName()); optionName = HTMLConv.toHTML(" \\"+fileObj.getName()); }else if( root_dir_name.equals(fileObj.getName()) ){ optionValue = ""; optionName = HTMLConv.toHTML(fileObj.getName()); }else{ continue; } folderOptions.append("<option value=\"" + optionValue + "\">" + optionName + "</option>\r\n"); }//end while loop session.setAttribute("imageFolderOptionList",folderOptions.toString()); String sqlStr = "select image_name,imgurl,width,height,border,v_space,h_space,target,target_name,align,alt_text,low_scr,linkurl from images where meta_id = "+meta_id+" and name = "+img_no ; String[] sql = imcref.sqlQuery(sqlStr) ; Vector vec = new Vector () ; String imageName = ("".equals(img_preset)&&sql.length>0?sql[1]:img_preset); // selected OPTION or "" //**************************************************************** ImageFileMetaData image = new ImageFileMetaData(new File(image_path,imageName)) ; int width = image.getWidth() ; int height = image.getHeight() ; //**************************************************************** imageName = imageName ; if ( sql.length > 0 ) { int current_width = 0 ; try { current_width = Integer.parseInt(img_preset.equals("")?sql[2]:"" + width) ; } catch ( NumberFormatException ex ) { } int current_height = 0 ; try { current_height = Integer.parseInt(img_preset.equals("")?sql[3]:"" + height) ; } catch ( NumberFormatException ex ) { } int aspect = 0 ; if (current_width * current_height != 0) { aspect = 100 * current_width / current_height ; } String keepAspect = "checked" ; if (width * height != 0 && aspect != (100 * width / height)) { keepAspect = "" ; } vec.add("#imgName#") ; vec.add(sql[0]) ; vec.add("#imgRef#") ; vec.add(imageName); vec.add("#imgWidth#") ; vec.add(current_width!=0?""+current_width:""+width); vec.add("#origW#"); // original imageWidth vec.add("" + width); vec.add("#imgHeight#") ; vec.add(current_height!=0?""+current_height:""+height); vec.add("#origH#"); vec.add("" + height); // original imageHeight vec.add("#keep_aspect#") ; vec.add(keepAspect) ; vec.add("#imgBorder#") ; vec.add(sql[4]) ; vec.add("#imgVerticalSpace#") ; vec.add(sql[5]) ; vec.add("#imgHorizontalSpace#") ; vec.add(sql[6]) ; if ( "_top".equals(sql[7]) ) { vec.add("#target_name#") ; vec.add("") ; vec.add("#top_checked#") ; } else if ( "_self".equals(sql[7]) ) { vec.add("#target_name#") ; vec.add("") ; vec.add("#self_checked#") ; } else if ( "_blank".equals(sql[7]) ) { vec.add("#target_name#") ; vec.add("") ; vec.add("#blank_checked#") ; } else if ( "_parent".equals(sql[7]) ) { vec.add("#target_name#") ; vec.add("") ; vec.add("#blank_checked#") ; } else { vec.add("#target_name#") ; vec.add(sql[8]) ; vec.add("#other_checked#") ; } vec.add("selected") ; if ( "baseline".equals(sql[9]) ) { vec.add("#baseline_selected#") ; } else if ( "top".equals(sql[9]) ) { vec.add("#top_selected#") ; } else if ( "middle".equals(sql[9]) ) { vec.add("#middle_selected#") ; } else if ( "bottom".equals(sql[9]) ) { vec.add("#bottom_selected#") ; } else if ( "texttop".equals(sql[9]) ) { vec.add("#texttop_selected#") ; } else if ( "absmiddle".equals(sql[9]) ) { vec.add("#absmiddle_selected#") ; } else if ( "absbottom".equals(sql[9]) ) { vec.add("#absbottom_selected#") ; } else if ( "left".equals(sql[9]) ) { vec.add("#left_selected#") ; } else if ( "right".equals(sql[9]) ) { vec.add("#right_selected#") ; } else { vec.add("#none_selected#") ; } vec.add("selected") ; vec.add("#imgAltText#") ; vec.add(sql[10]) ; vec.add("#imgLowScr#") ; vec.add(sql[11]) ; vec.add("#imgRefLink#") ; vec.add(sql[12]) ; } else { vec.add("#imgName#") ; vec.add("") ; vec.add("#imgRef#") ; vec.add(imageName); vec.add("#imgWidth#") ; vec.add("" + width) ; vec.add("#imgHeight#") ; vec.add("" + height) ; vec.add("#origW#"); vec.add("" + width); vec.add("#origH#"); vec.add("" + height); vec.add("#imgBorder#") ; vec.add("0") ; vec.add("#imgVerticalSpace#") ; vec.add("0") ; vec.add("#imgHorizontalSpace#") ; vec.add("0") ; vec.add("#target_name#") ; vec.add("") ; vec.add("#self_checked#") ; vec.add("selected") ; vec.add("#top_selected#") ; vec.add("selected") ; vec.add("#imgAltText#") ; vec.add("") ; vec.add("#imgLowScr#") ; vec.add("") ; vec.add("#imgRefLink#") ; vec.add("") ; } vec.add("#imgUrl#") ; vec.add(image_url) ; vec.add("#getMetaId#") ; vec.add(String.valueOf(meta_id)) ; vec.add("#img_no#") ; vec.add(String.valueOf(img_no)) ; vec.add("#folders#"); vec.add(folderOptions.toString()); vec.add("#label#") ; vec.add(label) ; String lang_prefix = user.getLangPrefix() ; htmlStr = imcref.parseDoc(vec,"change_img.html", lang_prefix) ; out.print(htmlStr) ; } | 8781 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8781/aac0c3f1fbded79e44eeb9b126b31959f0f22c1d/ChangeImage.java/clean/servlets/ChangeImage.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
23611,
12,
2940,
18572,
1111,
16,
12446,
400,
13,
1216,
16517,
16,
1860,
288,
202,
780,
1479,
1082,
202,
33,
1111,
18,
588,
1864,
2932,
2594,
7923,
274,
202,
3445,
39,
18348,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
23611,
12,
2940,
18572,
1111,
16,
12446,
400,
13,
1216,
16517,
16,
1860,
288,
202,
780,
1479,
1082,
202,
33,
1111,
18,
588,
1864,
2932,
2594,
7923,
274,
202,
3445,
39,
18348,
... |
done=false; retval=doExecute(timeout); if(retval == false && log.isTraceEnabled()) log.trace("call did not execute correctly, request is " + toString()); done=true; return retval; | try { done=false; boolean retval=doExecute(timeout); if(retval == false && log.isTraceEnabled()) log.trace("call did not execute correctly, request is " + this.toString()); return retval; } finally { done=true; } | public boolean execute() { boolean retval; if(corr == null && transport == null) { if(log.isErrorEnabled()) log.error("both corr and transport are null, cannot send group request"); return false; } done=false; retval=doExecute(timeout); if(retval == false && log.isTraceEnabled()) log.trace("call did not execute correctly, request is " + toString()); done=true; return retval; } | 51463 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51463/f7da463d4c6a37b84dbe0d60aea3bd86713917a3/GroupRequest.java/clean/src/org/jgroups/blocks/GroupRequest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1250,
1836,
1435,
288,
3639,
1250,
5221,
31,
3639,
309,
12,
17515,
422,
446,
597,
4736,
422,
446,
13,
288,
5411,
309,
12,
1330,
18,
291,
668,
1526,
10756,
613,
18,
1636,
2932,
182... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1250,
1836,
1435,
288,
3639,
1250,
5221,
31,
3639,
309,
12,
17515,
422,
446,
597,
4736,
422,
446,
13,
288,
5411,
309,
12,
1330,
18,
291,
668,
1526,
10756,
613,
18,
1636,
2932,
182... |
List taRecords = getSectionTeachingAssistants(sectionUuid); for(Iterator iter = taRecords.iterator(); iter.hasNext();) { ParticipationRecord record = (ParticipationRecord)iter.next(); if(record.getUser().getUserUuid().equals(userId)) { if(log.isDebugEnabled()) log.debug("Not adding a TA record for " + userId + "... already a TA in section " + sectionUuid); } } | public Object doInHibernate(Session session) throws HibernateException { CourseSection section = getSection(sectionUuid, session); User user = userDirectory.getUser(userId); // TODO Make sure they are not already a TA in this section TeachingAssistantRecordImpl ta = new TeachingAssistantRecordImpl(section, user); ta.setUuid(uuidManager.createUuid()); session.save(ta); return ta; } | 2021 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2021/12db0efcf0f25da06b44df28af8d1e5d1728f40c/SectionManagerHibernateImpl.java/buggy/sections/sections-app/src/java/org/sakaiproject/tool/section/manager/SectionManagerHibernateImpl.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
987,
13561,
6499,
273,
22103,
56,
13798,
310,
2610,
376,
4388,
12,
3464,
5897,
1769,
364,
12,
3198,
1400,
273,
13561,
6499,
18,
9838,
5621,
1400,
18,
5332,
2134,
5621,
13,
288,
6393,
24629,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
987,
13561,
6499,
273,
22103,
56,
13798,
310,
2610,
376,
4388,
12,
3464,
5897,
1769,
364,
12,
3198,
1400,
273,
13561,
6499,
18,
9838,
5621,
1400,
18,
5332,
2134,
5621,
13,
288,
6393,
24629,
36... | |
if (paramValue != null && paramValue.trim().length() <= 0 && !parameter.allowBlank() && parameter.getDataType().equalsIgnoreCase( DesignChoiceConstants.PARAM_TYPE_STRING)) { | if ( paramValue != null && paramValue.trim( ).length( ) <= 0 && !parameter.allowBlank( ) && parameter.getDataType( ).equalsIgnoreCase( DesignChoiceConstants.PARAM_TYPE_STRING ) ) { | public boolean isMissingParameter() { boolean missingParameter = false; ModuleHandle model = SessionHandleAdapter.getInstance() .getReportDesignHandle(); HashMap params = (HashMap) this.getConfigVars(); List parameters = model.getFlattenParameters(); if (parameters != null) { for (int i = 0; i < parameters.size(); i++) { if (parameters.get(i) instanceof ScalarParameterHandle) { ScalarParameterHandle parameter = ((ScalarParameterHandle) parameters .get(i)); if (parameter.isHidden()) { continue; } String paramValue = null; if (params != null && params.containsKey(parameter.getName())) { Object curVal = params.get(parameter.getName()); if (curVal != null) paramValue = curVal.toString(); } else { paramValue = parameter.getDefaultValue(); } if (paramValue == null && !parameter.allowNull()) { missingParameter = true; break; } if (paramValue != null && paramValue.trim().length() <= 0 && !parameter.allowBlank() && parameter.getDataType().equalsIgnoreCase( DesignChoiceConstants.PARAM_TYPE_STRING)) { missingParameter = true; break; } } } } return missingParameter; } | 46013 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46013/e1379dc44d22afdeafb3e66d4b2a9adc8b7f4f7a/ReportPreviewFormPage.java/clean/UI/org.eclipse.birt.report.designer.ui.preview/src/org/eclipse/birt/report/designer/ui/preview/editors/ReportPreviewFormPage.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
1250,
353,
4841,
1662,
1435,
288,
202,
202,
6494,
3315,
1662,
273,
629,
31,
202,
202,
3120,
3259,
938,
273,
3877,
3259,
4216,
18,
588,
1442,
1435,
9506,
202,
18,
588,
4820,
15... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
1250,
353,
4841,
1662,
1435,
288,
202,
202,
6494,
3315,
1662,
273,
629,
31,
202,
202,
3120,
3259,
938,
273,
3877,
3259,
4216,
18,
588,
1442,
1435,
9506,
202,
18,
588,
4820,
15... |
new FreeCallInvalidEv(cause, this).dispatch(); this.getListenerMgr().removeAll(); GenericProvider prov = this.getGenProvider(); prov.getRaw().releaseCallId(this.getCallID()); prov.getCallMgr().removeCall(this); | this.getGenProvider().dispatch(new FreeCallInvalidEv(cause, this)); | void toInvalid(int cause) { // unHook any connections Iterator conns = this.connections.values().iterator(); while (conns.hasNext()) { ((FreeConnection)conns.next()).toDisconnected(cause); } // set state this.setState(Call.INVALID); // notify any listeners right away without the GenericProvider's dispatcher // so that we won't run into race conditions where the Listener set is being // iterated over while removeAll() is being performed on it (throwing // a ConcurrentModificationException). // Thanks to Ulf Licht for finding this. new FreeCallInvalidEv(cause, this).dispatch(); // unregister any remaining listeners this.getListenerMgr().removeAll(); // tell the raw TelephonyProvider that it may now recycle the CallId GenericProvider prov = this.getGenProvider(); prov.getRaw().releaseCallId(this.getCallID()); // remove from framework prov.getCallMgr().removeCall(this);} | 49033 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49033/693c8dc36a5e4ebd07a639f0ff68a53194e94c27/FreeCall.java/clean/src/src/net/sourceforge/gjtapi/FreeCall.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
918,
358,
1941,
12,
474,
4620,
13,
288,
202,
759,
640,
5394,
1281,
5921,
202,
3198,
18976,
273,
333,
18,
13313,
18,
2372,
7675,
9838,
5621,
202,
17523,
261,
591,
2387,
18,
5332,
2134,
10756,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
918,
358,
1941,
12,
474,
4620,
13,
288,
202,
759,
640,
5394,
1281,
5921,
202,
3198,
18976,
273,
333,
18,
13313,
18,
2372,
7675,
9838,
5621,
202,
17523,
261,
591,
2387,
18,
5332,
2134,
10756,
... |
m.setup((FigNode) _content, _content.getOwner(), bx, by, reverse); | m.setup((FigNode) getContent(), getContent().getOwner(), bx, by, reverse); | public void dragHandle(int mX, int mY, int anX, int anY, Handle hand) { if (hand.index < 10) { setPaintButtons(false); super.dragHandle(mX, mY, anX, anY, hand); return; } int cx = _content.getX(), cy = _content.getY(); int cw = _content.getWidth(), ch = _content.getHeight(); int newX = cx, newY = cy, newW = cw, newH = ch; Dimension minSize = _content.getMinimumSize(); int minWidth = minSize.width, minHeight = minSize.height; Object edgeType = null; Object nodeType = Model.getMetaTypes().getUMLClass(); int bx = mX, by = mY; boolean reverse = false; switch (hand.index) { case 10: //add superclass edgeType = Model.getMetaTypes().getGeneralization(); by = cy; bx = cx + cw / 2; break; case 11: //add subclass edgeType = Model.getMetaTypes().getGeneralization(); reverse = true; by = cy + ch; bx = cx + cw / 2; break; case 12: //add assoc edgeType = Model.getMetaTypes().getAssociation(); by = cy + ch / 2; bx = cx + cw; break; case 13: // add assoc edgeType = Model.getMetaTypes().getAssociation(); reverse = true; by = cy + ch / 2; bx = cx; break; case 14: // selfassociation // do not want to drag this break; default: LOG.warn("invalid handle number"); break; } if (edgeType != null && nodeType != null) { Editor ce = Globals.curEditor(); ModeCreateEdgeAndNode m = new ModeCreateEdgeAndNode(ce, edgeType, nodeType, useComposite); m.setup((FigNode) _content, _content.getOwner(), bx, by, reverse); ce.pushMode(m); } } | 7166 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7166/55b1a2bf9e5a1ff91e4f97c63ed8d76eb2a68f27/SelectionClass.java/clean/src_new/org/argouml/uml/diagram/static_structure/ui/SelectionClass.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
8823,
3259,
12,
474,
312,
60,
16,
509,
312,
61,
16,
509,
392,
60,
16,
509,
392,
61,
16,
5004,
948,
13,
288,
3639,
309,
261,
2349,
18,
1615,
411,
1728,
13,
288,
5411,
444,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
8823,
3259,
12,
474,
312,
60,
16,
509,
312,
61,
16,
509,
392,
60,
16,
509,
392,
61,
16,
5004,
948,
13,
288,
3639,
309,
261,
2349,
18,
1615,
411,
1728,
13,
288,
5411,
444,... |
if (v != null) { sb.append(eng.getPropertyName(i)); sb.append(": "); sb.append(v); if (isImportant(i)) { sb.append(" !important"); } sb.append(";\n"); } | if (v == null) continue; sb.append(eng.getPropertyName(i)); sb.append(": "); sb.append(v); if (isImportant(i)) sb.append(" !important"); sb.append(";\n"); | public String toString(CSSEngine eng) { StringBuffer sb = new StringBuffer(); for (int i = 0; i < values.length; i++) { Value v = values[i]; if (v != null) { sb.append(eng.getPropertyName(i)); sb.append(": "); sb.append(v); if (isImportant(i)) { sb.append(" !important"); } sb.append(";\n"); } } return sb.toString(); } | 45946 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45946/1400bf64fd115d900b6f146057cbff15e0cf8380/StyleMap.java/clean/sources/org/apache/batik/css/engine/StyleMap.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
514,
1762,
12,
10276,
4410,
24691,
13,
288,
3639,
6674,
2393,
273,
394,
6674,
5621,
3639,
364,
261,
474,
277,
273,
374,
31,
277,
411,
924,
18,
2469,
31,
277,
27245,
288,
5411,
144... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
514,
1762,
12,
10276,
4410,
24691,
13,
288,
3639,
6674,
2393,
273,
394,
6674,
5621,
3639,
364,
261,
474,
277,
273,
374,
31,
277,
411,
924,
18,
2469,
31,
277,
27245,
288,
5411,
144... |
} } | protected void scan(final FJTask waitingFor) { FJTask task = null; // to delay lowering priority until first failure to steal boolean lowered = false; /* Circularly traverse from a random start index. This differs slightly from cilk version that uses a random index for each attempted steal. Exhaustive scanning might impede analytic tractablity of the scheduling policy, but makes it much easier to deal with startup and shutdown. */ FJTaskRunner[] ts = group.getArray(); int idx = victimRNG.nextInt(ts.length); for (int i = 0; i < ts.length; ++i) { FJTaskRunner t = ts[idx]; if (++idx >= ts.length) idx = 0; // circularly traverse if (t != null && t != this) { if (waitingFor != null && waitingFor.isDone()) { break; } else { if (COLLECT_STATS) ++scans; task = t.take(); if (task != null) { if (COLLECT_STATS) ++steals; break; } else if (isInterrupted()) { break; } else if (!lowered) { // if this is first fail, lower priority lowered = true; setPriority(scanPriority); } else { // otherwise we are at low priority; just yield yield(); } } } } if (task == null) { if (COLLECT_STATS) ++scans; task = group.pollEntryQueue(); if (COLLECT_STATS) if (task != null) ++steals; } if (lowered) setPriority(runPriority); if (task != null && !task.isDone()) { if (COLLECT_STATS) ++runs; task.run(); task.setDone(); } } | 4082 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4082/a6a25004fd5e24a1bc5f053aa539d01dc2553fbf/FJTaskRunner.java/clean/src/java/org/logicalcobwebs/concurrent/FJTaskRunner.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
4750,
918,
4135,
12,
6385,
478,
46,
2174,
7336,
1290,
13,
288,
565,
478,
46,
2174,
1562,
273,
446,
31,
565,
368,
358,
4624,
2612,
310,
4394,
3180,
1122,
5166,
358,
18654,
287,
565,
1250... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
4750,
918,
4135,
12,
6385,
478,
46,
2174,
7336,
1290,
13,
288,
565,
478,
46,
2174,
1562,
273,
446,
31,
565,
368,
358,
4624,
2612,
310,
4394,
3180,
1122,
5166,
358,
18654,
287,
565,
1250... | |
public RdpBookmark(Bookmark parent) { setId(parent.getId()); setName(parent.getName()); setApplicationName(parent.getApplicationName()); setTarget(parent.getTarget()); | public RdpBookmark(){ super(); setTarget(""); | public RdpBookmark(Bookmark parent) { setId(parent.getId()); setName(parent.getName()); setApplicationName(parent.getApplicationName()); setTarget(parent.getTarget()); } | 49954 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49954/9a94495fca812f32ad8e7fc204cb50b733da206a/RdpBookmark.java/buggy/tran/portal/main/com/metavize/tran/portal/rdp/RdpBookmark.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
534,
9295,
22966,
12,
22966,
982,
13,
565,
288,
3639,
10446,
12,
2938,
18,
26321,
10663,
3639,
6788,
12,
2938,
18,
17994,
10663,
3639,
444,
3208,
461,
12,
2938,
18,
588,
3208,
461,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
534,
9295,
22966,
12,
22966,
982,
13,
565,
288,
3639,
10446,
12,
2938,
18,
26321,
10663,
3639,
6788,
12,
2938,
18,
17994,
10663,
3639,
444,
3208,
461,
12,
2938,
18,
588,
3208,
461,
... |
if (accessibleContext == null) accessibleContext = new AccessibleBox(); | public AccessibleContext getAccessibleContext() { // if (accessibleContext == null) // accessibleContext = new AccessibleBox(); return accessibleContext; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/045a5b41cdfa747889101d3993040acf89788bc4/Box.java/buggy/core/src/classpath/javax/javax/swing/Box.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
309,
261,
26037,
1042,
422,
446,
13,
12718,
1042,
273,
394,
5016,
1523,
3514,
5621,
1071,
5016,
1523,
1042,
336,
10451,
1042,
1435,
430,
261,
26037,
1042,
422,
446,
13,
12718,
1042,
273,
394,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
309,
261,
26037,
1042,
422,
446,
13,
12718,
1042,
273,
394,
5016,
1523,
3514,
5621,
1071,
5016,
1523,
1042,
336,
10451,
1042,
1435,
430,
261,
26037,
1042,
422,
446,
13,
12718,
1042,
273,
394,
... | |
String owner = cr.readClass( off, buf); | String o = cr.readClass( off, buf); | protected Attribute read (ClassReader cr, int off, int len, char[] buf, int codeOff, Label[] labels) { // CONSTANT_Class_info String owner = cr.readClass( off, buf); // CONSTANT_NameAndType_info (skip CONSTANT_NameAndType tag) int index = cr.getItem(cr.readUnsignedShort(off + 2)); String name = cr.readUTF8(index, buf); String desc = cr.readUTF8(index + 2, buf); return new EnclosingMethodAttribute( owner, name, desc); } | 2697 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2697/ef0669610899566ad370003b23451c29a594fbf9/EnclosingMethodAttribute.java/clean/asm/src/org/objectweb/asm/attrs/EnclosingMethodAttribute.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
4750,
3601,
855,
261,
797,
2514,
4422,
16,
509,
3397,
16,
18701,
509,
562,
16,
1149,
8526,
1681,
16,
509,
981,
7210,
16,
5287,
8526,
3249,
13,
288,
565,
368,
24023,
67,
797,
67,
1376,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
4750,
3601,
855,
261,
797,
2514,
4422,
16,
509,
3397,
16,
18701,
509,
562,
16,
1149,
8526,
1681,
16,
509,
981,
7210,
16,
5287,
8526,
3249,
13,
288,
565,
368,
24023,
67,
797,
67,
1376,
... |
} catch (InterruptedException ex) { | } catch(InterruptedException ex) { | private void startProcessingThreads() { m_upProcessingThread = new Thread(new Runnable() { public void run() { Event event = null; while (true) { try { event = (Event) m_upQueue.take(); m_upLatch.passThrough(); handleUp(event); } catch (InterruptedException ex) { //this is ok. } } } }); m_upProcessingThread.setName("MessageDispatcher up processing thread"); m_upProcessingThread.setDaemon(true); m_upProcessingThread.start(); } | 51463 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51463/595c1743692efa6e4226a77afcc832561ea81eb9/MessageDispatcher.java/buggy/src/org/jgroups/blocks/MessageDispatcher.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
540,
3238,
918,
787,
7798,
13233,
1435,
288,
5411,
312,
67,
416,
7798,
3830,
273,
394,
4884,
12,
2704,
10254,
1435,
288,
7734,
1071,
918,
1086,
1435,
288,
10792,
2587,
871,
273,
446,
31,
10792... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
540,
3238,
918,
787,
7798,
13233,
1435,
288,
5411,
312,
67,
416,
7798,
3830,
273,
394,
4884,
12,
2704,
10254,
1435,
288,
7734,
1071,
918,
1086,
1435,
288,
10792,
2587,
871,
273,
446,
31,
10792... |
myResult = Formatter.getInstance().createSpaceProperty(0, 0, lf, mySettings.KEEP_LINE_BREAKS, mySettings.KEEP_BLANK_LINES_IN_DECLARATIONS); | myResult = Formatter.getInstance() .createSpaceProperty(0, 0, lf, mySettings.KEEP_LINE_BREAKS, mySettings.KEEP_BLANK_LINES_IN_DECLARATIONS); | public void visitFile(PsiFile file) { if (myRole1 == ChildRole.PACKAGE_STATEMENT) { int lf = mySettings.BLANK_LINES_AFTER_PACKAGE + 1; myResult = Formatter.getInstance().createSpaceProperty(0, 0, lf, mySettings.KEEP_LINE_BREAKS, mySettings.KEEP_BLANK_LINES_IN_DECLARATIONS); } else if (myRole2 == ChildRole.PACKAGE_STATEMENT) { int lf = mySettings.BLANK_LINES_BEFORE_PACKAGE + 1; myResult = Formatter.getInstance().createSpaceProperty(0, 0, lf, mySettings.KEEP_LINE_BREAKS, mySettings.KEEP_BLANK_LINES_IN_DECLARATIONS); } else if (myRole1 == ChildRole.IMPORT_LIST) { int lf = mySettings.BLANK_LINES_AFTER_IMPORTS + 1; myResult = Formatter.getInstance().createSpaceProperty(0, 0, lf, mySettings.KEEP_LINE_BREAKS, mySettings.KEEP_BLANK_LINES_IN_DECLARATIONS); } else if (myRole2 == ChildRole.IMPORT_LIST) { int lf = mySettings.BLANK_LINES_BEFORE_IMPORTS + 1; myResult = Formatter.getInstance().createSpaceProperty(0, 0, lf, mySettings.KEEP_LINE_BREAKS, mySettings.KEEP_BLANK_LINES_IN_DECLARATIONS); } else if (myRole2 == ChildRole.CLASS) { int lf = mySettings.BLANK_LINES_AROUND_CLASS + 1; myResult = Formatter.getInstance().createSpaceProperty(0, 0, lf, mySettings.KEEP_LINE_BREAKS, mySettings.KEEP_BLANK_LINES_IN_DECLARATIONS); } } | 56598 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56598/1533398430214d8ae562ff3d8dcc5898351f8c45/JavaSpacePropertyProcessor.java/buggy/source/com/intellij/psi/formatter/java/JavaSpacePropertyProcessor.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
3757,
812,
12,
52,
7722,
812,
585,
13,
288,
565,
309,
261,
4811,
2996,
21,
422,
7451,
2996,
18,
19077,
67,
28411,
13,
288,
1377,
509,
18594,
273,
3399,
2628,
18,
38,
24307,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
3757,
812,
12,
52,
7722,
812,
585,
13,
288,
565,
309,
261,
4811,
2996,
21,
422,
7451,
2996,
18,
19077,
67,
28411,
13,
288,
1377,
509,
18594,
273,
3399,
2628,
18,
38,
24307,
... |
putString(BUILD_TARGET_AUTO, target); | putString(IMakeBuilderInfo.BUILD_TARGET_AUTO, null); putString(BuildInfoFactory.BUILD_TARGET_AUTO, target); | public void setAutoBuildTarget(String target) throws CoreException { putString(BUILD_TARGET_AUTO, target); } | 6192 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6192/ddbea8806c78a43cddb9312e08767dfa65e795c4/BuildInfoFactory.java/clean/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/BuildInfoFactory.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3196,
202,
482,
918,
21780,
3116,
2326,
12,
780,
1018,
13,
1216,
30015,
288,
1082,
202,
458,
780,
12,
20215,
67,
16374,
67,
18909,
16,
1018,
1769,
202,
202,
97,
2,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3196,
202,
482,
918,
21780,
3116,
2326,
12,
780,
1018,
13,
1216,
30015,
288,
1082,
202,
458,
780,
12,
20215,
67,
16374,
67,
18909,
16,
1018,
1769,
202,
202,
97,
2,
-100,
-100,
-100,
-100,
-1... |
IASTExpression.Kind.UNARY_PLUS_CASTEXPRESSION, consume()); | IASTExpression.Kind.UNARY_PLUS_CASTEXPRESSION); | protected IASTExpression unaryExpression( IASTScope scope ) throws Backtrack { switch (LT(1)) { case IToken.tSTAR : return unaryOperatorCastExpression(scope, IASTExpression.Kind.UNARY_STAR_CASTEXPRESSION, consume()); case IToken.tAMPER : return unaryOperatorCastExpression(scope, IASTExpression.Kind.UNARY_AMPSND_CASTEXPRESSION, consume()); case IToken.tPLUS : return unaryOperatorCastExpression(scope, IASTExpression.Kind.UNARY_PLUS_CASTEXPRESSION, consume()); case IToken.tMINUS : return unaryOperatorCastExpression(scope, IASTExpression.Kind.UNARY_MINUS_CASTEXPRESSION, consume()); case IToken.tNOT : return unaryOperatorCastExpression(scope, IASTExpression.Kind.UNARY_NOT_CASTEXPRESSION, consume()); case IToken.tCOMPL : return unaryOperatorCastExpression(scope, IASTExpression.Kind.UNARY_TILDE_CASTEXPRESSION, consume()); case IToken.tINCR : return unaryOperatorCastExpression(scope, IASTExpression.Kind.UNARY_INCREMENT, consume()); case IToken.tDECR : return unaryOperatorCastExpression(scope, IASTExpression.Kind.UNARY_DECREMENT, consume()); case IToken.t_sizeof : consume(IToken.t_sizeof); IToken mark = LA(1); ITokenDuple d = null; IASTExpression unaryExpression = null; if (LT(1) == IToken.tLPAREN) { try { consume(IToken.tLPAREN); d = typeId(); consume(IToken.tRPAREN); } catch (Backtrack bt) { backup(mark); unaryExpression = unaryExpression(scope); } } else { unaryExpression = unaryExpression(scope); } if (d != null & unaryExpression == null) try { return astFactory.createExpression( scope, IASTExpression.Kind.UNARY_SIZEOF_TYPEID, null, null, null, d, "", null); } catch (ASTSemanticException e) { failParse(); throw backtrack; } else if (unaryExpression != null && d == null) try { return astFactory.createExpression( scope, IASTExpression.Kind.UNARY_SIZEOF_UNARYEXPRESSION, unaryExpression, null, null, null, "", null); } catch (ASTSemanticException e1) { failParse(); throw backtrack; } else throw backtrack; case IToken.t_new : return newExpression(scope); case IToken.t_delete : return deleteExpression(scope); case IToken.tCOLONCOLON : switch (LT(2)) { case IToken.t_new : return newExpression(scope); case IToken.t_delete : return deleteExpression(scope); default : return postfixExpression(scope); } default : return postfixExpression(scope); } } | 6192 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6192/61976f1b510d44f0e8c9463f6618a68c2fee60fe/Parser.java/clean/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
467,
9053,
2300,
19017,
2300,
12,
467,
9053,
3876,
2146,
262,
3639,
1216,
4297,
4101,
565,
288,
3639,
1620,
261,
12050,
12,
21,
3719,
3639,
288,
5411,
648,
467,
1345,
18,
88,
20943,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
467,
9053,
2300,
19017,
2300,
12,
467,
9053,
3876,
2146,
262,
3639,
1216,
4297,
4101,
565,
288,
3639,
1620,
261,
12050,
12,
21,
3719,
3639,
288,
5411,
648,
467,
1345,
18,
88,
20943,... |
if (cause instanceof MethodInvocationException) | if (cause instanceof MethodInvocationException) | protected void error(HttpServletRequest request, HttpServletResponse response, Exception e) throws ServletException { try { // get a velocity context Context ctx = createContext(request, response); Throwable cause = e; // if it's an MIE, i want the real cause and stack trace! if (cause instanceof MethodInvocationException) { // put the invocation exception in the context ctx.put(KEY_ERROR_INVOCATION_EXCEPTION, e); // get the real cause cause = ((MethodInvocationException)e).getWrappedThrowable(); } // add the cause to the context ctx.put(KEY_ERROR_CAUSE, cause); // grab the cause's stack trace and put it in the context StringWriter sw = new StringWriter(); cause.printStackTrace(new java.io.PrintWriter(sw)); ctx.put(KEY_ERROR_STACKTRACE, sw.toString()); // retrieve and render the error template Template et = getTemplate(errorTemplate); mergeTemplate(et, ctx, response); } catch (Exception e2) { // d'oh! log this velocity.error("VelocityLayoutServlet: " + " Error during error template rendering - " + e2); // then punt the original to a higher authority super.error(request, response, e); } } | 52538 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52538/b42c23a0eb3b4663a69304b938b98019a6cff8be/VelocityLayoutServlet.java/buggy/src/java/org/apache/velocity/tools/view/servlet/VelocityLayoutServlet.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
918,
555,
12,
2940,
18572,
590,
16,
12900,
12446,
766,
16,
12900,
1185,
425,
13,
3639,
1216,
16517,
377,
288,
3639,
775,
540,
288,
5411,
368,
336,
279,
14767,
819,
5411,
1772,
1103,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
918,
555,
12,
2940,
18572,
590,
16,
12900,
12446,
766,
16,
12900,
1185,
425,
13,
3639,
1216,
16517,
377,
288,
3639,
775,
540,
288,
5411,
368,
336,
279,
14767,
819,
5411,
1772,
1103,... |
public Property(ProvidedService ps, PropertyMetadata pm) { | public Property(ProvidedService ps, String name, String field, String type, String value, Element manipulation) { | public Property(ProvidedService ps, PropertyMetadata pm) { m_providedService = ps; m_metadata = pm; // Fix the type of the property if null if (pm.getType() == null) { // If the type is not found, it is a dynamic property Element manipulation = m_providedService.getComponentManager().getComponentMetatada().getMetadata().getElements("Manipulation")[0]; String type = null; String field = m_metadata.getField(); for (int i = 0; i < manipulation.getElements("Field").length; i++) { if (field.equals(manipulation.getElements("Field")[i].getAttribute("name"))) { type = manipulation.getElements("Field")[i].getAttribute("type"); break; } } pm.setType(type); } if (pm.getValue() != null) { setValue(pm.getValue()); } } | 45948 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45948/d229001e440fb0347d56e6cc3a6e65308dcdb431/Property.java/buggy/ipojo/src/main/java/org/apache/felix/ipojo/handlers/providedservice/Property.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
4276,
12,
19254,
1179,
4250,
16,
514,
508,
16,
514,
652,
16,
514,
618,
16,
514,
460,
16,
3010,
27029,
13,
288,
3639,
312,
67,
29206,
1179,
273,
4250,
31,
3639,
312,
67,
4165,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
4276,
12,
19254,
1179,
4250,
16,
514,
508,
16,
514,
652,
16,
514,
618,
16,
514,
460,
16,
3010,
27029,
13,
288,
3639,
312,
67,
29206,
1179,
273,
4250,
31,
3639,
312,
67,
4165,
27... |
IContributionItem result = parentMgr.remove(id); if (result != null) itemRemoved(result); return result; } | IContributionItem result = parentMgr.remove(id); if (result != null) itemRemoved(result); return result; } | public IContributionItem remove(String id) { IContributionItem result = parentMgr.remove(id); if (result != null) itemRemoved(result); return result;} | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/5ddde0e384bac44f41aeb754525f7bdab6a04e11/SubContributionManager.java/clean/bundles/org.eclipse.jface/src/org/eclipse/jface/action/SubContributionManager.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1071,
467,
442,
4027,
1180,
1206,
12,
780,
612,
13,
288,
202,
45,
442,
4027,
1180,
563,
273,
982,
9455,
18,
4479,
12,
350,
1769,
202,
430,
261,
2088,
480,
446,
13,
202,
202,
1726,
10026,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1071,
467,
442,
4027,
1180,
1206,
12,
780,
612,
13,
288,
202,
45,
442,
4027,
1180,
563,
273,
982,
9455,
18,
4479,
12,
350,
1769,
202,
430,
261,
2088,
480,
446,
13,
202,
202,
1726,
10026,
1... |
assertHasValue(ret, filename); | attachment = (Object[]) ret[0]; assertEquals("attach.txt", attachment[0]); assertEquals("newdescription", attachment[1]); assertEquals(7, attachment[2]); assertEquals(username, attachment[4]); bytes = (byte[]) call("ticket.getAttachment", id, filename); data = new String(bytes); assertEquals("newdata", data); | public void testAttachment() throws XmlRpcException, IOException { int id = createTicket("summary", "description", new Hashtable()); String filename = (String) call("ticket.putAttachment", id, "attach.txt", "data".getBytes(), true); // the returned filename may differ, since another ticket may have an // attachment named "attach.txt" // assertEquals("attach.txt", filename); Object[] ret = (Object[]) call("ticket.listAttachments", id); assertEquals(1, ret.length); assertHasValue(ret, filename); byte[] bytes = (byte[]) call("ticket.getAttachment", id, filename); String data = new String(bytes); assertEquals("data", data); String filename2 = (String) call("ticket.putAttachment", id, filename, "data".getBytes(), true); assertEquals(filename, filename2); ret = (Object[]) call("ticket.listAttachments", id); assertEquals(1, ret.length); assertHasValue(ret, filename); String filename3 = (String) call("ticket.putAttachment", id, "attach.txt", "data".getBytes(), false); assertFalse("attach.txt".equals(filename3)); ret = (Object[]) call("ticket.listAttachments", id); assertEquals(2, ret.length); assertHasValue(ret, filename); assertHasValue(ret, filename3); } | 51151 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51151/f4de37db7b6c84008daa5d21a45328f003449dab/TracXmlRpcTest.java/buggy/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1842,
6803,
1435,
1216,
5714,
11647,
503,
16,
1860,
288,
202,
202,
474,
612,
273,
752,
13614,
2932,
7687,
3113,
315,
3384,
3113,
394,
18559,
10663,
202,
202,
780,
1544,
273... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1842,
6803,
1435,
1216,
5714,
11647,
503,
16,
1860,
288,
202,
202,
474,
612,
273,
752,
13614,
2932,
7687,
3113,
315,
3384,
3113,
394,
18559,
10663,
202,
202,
780,
1544,
273... |
private static void setDefaultQueryOptions() { // get the preferences store for the bugzilla preferences IPreferenceStore prefs = BugzillaPlugin.getDefault().getPreferenceStore(); // get the default status values from the store and set them as the default options prefs.setDefault(IBugzillaConstants.STATUS_VALUES, queryOptionsToString(IBugzillaConstants.DEFAULT_STATUS_VALUES)); // get the default preselected status values from the store and set them as the default options prefs.setDefault(IBugzillaConstants.PRESELECTED_STATUS_VALUES, queryOptionsToString(IBugzillaConstants.DEFAULT_PRESELECTED_STATUS_VALUES)); // get the default resolution values from the store and set them as the default options prefs.setDefault(IBugzillaConstants.RESOLUTION_VALUES, queryOptionsToString(IBugzillaConstants.DEFAULT_RESOLUTION_VALUES)); // get the default severity values from the store and set them as the default options prefs.setDefault(IBugzillaConstants.SEVERITY_VALUES, queryOptionsToString(IBugzillaConstants.DEFAULT_SEVERITY_VALUES)); // get the default priority values from the store and set them as the default options prefs.setDefault(IBugzillaConstants.PRIORITY_VALUES, queryOptionsToString(IBugzillaConstants.DEFAULT_PRIORITY_VALUES)); // get the default hardware values from the store and set them as the default options prefs.setDefault(IBugzillaConstants.HARDWARE_VALUES, queryOptionsToString(IBugzillaConstants.DEFAULT_HARDWARE_VALUES)); // get the default os values from the store and set them as the default options prefs.setDefault(IBugzillaConstants.OS_VALUES, queryOptionsToString(IBugzillaConstants.DEFAULT_OS_VALUES)); // get the default product values from the store and set them as the default options prefs.setDefault(IBugzillaConstants.PRODUCT_VALUES, queryOptionsToString(IBugzillaConstants.DEFAULT_PRODUCT_VALUES)); // get the default component values from the store and set them as the default options prefs.setDefault(IBugzillaConstants.COMPONENT_VALUES, queryOptionsToString(IBugzillaConstants.DEFAULT_COMPONENT_VALUES)); // get the default version values from the store and set them as the default options prefs.setDefault(IBugzillaConstants.VERSION_VALUES, queryOptionsToString(IBugzillaConstants.DEFAULT_VERSION_VALUES)); // get the default target values from the store and set them as the default options prefs.setDefault(IBugzillaConstants.TARGET_VALUES, queryOptionsToString(IBugzillaConstants.DEFAULT_TARGET_VALUES)); } | 51989 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51989/b26db65588a080b713dc4a0c9e080a5c53dd7807/BugzillaPreferencePage.java/clean/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/BugzillaPreferencePage.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
225,
760,
225,
918,
225,
9277,
1138,
1320,
1435,
225,
288,
202,
202,
759,
225,
336,
225,
326,
225,
12750,
225,
1707,
225,
364,
225,
326,
225,
7934,
15990,
225,
12750,
202,
20... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
225,
760,
225,
918,
225,
9277,
1138,
1320,
1435,
225,
288,
202,
202,
759,
225,
336,
225,
326,
225,
12750,
225,
1707,
225,
364,
225,
326,
225,
7934,
15990,
225,
12750,
202,
20... | ||
boolean synPredMatched651 = false; if ((((LA(1) >= LITERAL_child && LA(1) <= 114)))) { int _m651 = mark(); synPredMatched651 = true; | boolean synPredMatched152 = false; if ((((LA(1) >= LITERAL_child && LA(1) <= 116)))) { int _m152 = mark(); synPredMatched152 = true; | public final void forwardOrReverseStep() throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); AST forwardOrReverseStep_AST = null; boolean synPredMatched651 = false; if ((((LA(1) >= LITERAL_child && LA(1) <= 114)))) { int _m651 = mark(); synPredMatched651 = true; inputState.guessing++; try { { forwardAxisSpecifier(); match(COLON); } } catch (RecognitionException pe) { synPredMatched651 = false; } rewind(_m651); inputState.guessing--; } if ( synPredMatched651 ) { forwardAxis(); astFactory.addASTChild(currentAST, returnAST); nodeTest(); astFactory.addASTChild(currentAST, returnAST); forwardOrReverseStep_AST = (AST)currentAST.root; } else { boolean synPredMatched653 = false; if ((((LA(1) >= LITERAL_parent && LA(1) <= 118)))) { int _m653 = mark(); synPredMatched653 = true; inputState.guessing++; try { { reverseAxisSpecifier(); match(COLON); } } catch (RecognitionException pe) { synPredMatched653 = false; } rewind(_m653); inputState.guessing--; } if ( synPredMatched653 ) { reverseAxis(); astFactory.addASTChild(currentAST, returnAST); nodeTest(); astFactory.addASTChild(currentAST, returnAST); forwardOrReverseStep_AST = (AST)currentAST.root; } else if ((_tokenSet_6.member(LA(1)))) { abbrevStep(); astFactory.addASTChild(currentAST, returnAST); forwardOrReverseStep_AST = (AST)currentAST.root; } else { throw new NoViableAltException(LT(1), getFilename()); } } returnAST = forwardOrReverseStep_AST; } | 2909 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2909/722cca774247887cf67fef993c71f848a05e075f/XPathParser2.java/clean/src/org/exist/parser/XPathParser2.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
727,
918,
5104,
1162,
12650,
4160,
1435,
1216,
9539,
16,
3155,
1228,
503,
288,
9506,
202,
2463,
9053,
273,
446,
31,
202,
202,
9053,
4154,
783,
9053,
273,
394,
9183,
4154,
5621,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
727,
918,
5104,
1162,
12650,
4160,
1435,
1216,
9539,
16,
3155,
1228,
503,
288,
9506,
202,
2463,
9053,
273,
446,
31,
202,
202,
9053,
4154,
783,
9053,
273,
394,
9183,
4154,
5621,
... |
PsiDocumentManager documentManager = PsiDocumentManager.getInstance(whitespace.getProject()); documentManager.commitDocument(documentManager.getDocument(whitespace.getContainingFile())); | documentManager.commitDocument(document); | private static void fixupWhiteSpace(final PsiWhiteSpace whitespace) { if (whitespace == null) return; PsiElement element1 = whitespace.getPrevSibling(); PsiElement element2 = whitespace.getNextSibling(); if (element2 == null || element1 == null) return; String ws = CodeEditUtil.getStringWhiteSpaceBetweenTokens(whitespace.getNode(), element2.getNode(), StdLanguages.JAVA); LeafElement node = Factory.createSingleLeafElement(TokenType.WHITE_SPACE, ws.toCharArray(), 0, ws.length(), SharedImplUtil.findCharTableByTree(whitespace.getNode()), whitespace.getManager()); whitespace.getParent().getNode().replaceChild(whitespace.getNode(), node); PsiDocumentManager documentManager = PsiDocumentManager.getInstance(whitespace.getProject()); documentManager.commitDocument(documentManager.getDocument(whitespace.getContainingFile())); } | 56627 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56627/e5b21fa0c53fdf94b6ae09bd28b584b1da81d1ed/DeclarationMover.java/buggy/source/com/intellij/openapi/editor/actions/moveUpDown/DeclarationMover.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
3238,
760,
918,
2917,
416,
23108,
12,
6385,
453,
7722,
23108,
7983,
13,
288,
565,
309,
261,
18777,
422,
446,
13,
327,
31,
565,
453,
7722,
1046,
930,
21,
273,
7983,
18,
588,
9958,
10291,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
3238,
760,
918,
2917,
416,
23108,
12,
6385,
453,
7722,
23108,
7983,
13,
288,
565,
309,
261,
18777,
422,
446,
13,
327,
31,
565,
453,
7722,
1046,
930,
21,
273,
7983,
18,
588,
9958,
10291,... |
if(indexType != Type.ITEM) { | if(!hasMixedContent && indexType != Type.ITEM) { | protected Sequence quickNodeSetCompare(Sequence contextSequence) throws XPathException { // if the context sequence hasn't changed we can return a cached result if(cached != null && cached.isValid(contextSequence)) {// LOG.debug("Returning cached result for " + pprint()); return cached.getResult(); } // evaluate left expression NodeSet nodes = (NodeSet) getLeft().eval(contextSequence); if(nodes.getLength() < 2) // fall back to nodeSetCompare if we just have to check a single node return nodeSetCompare(nodes, contextSequence); // evaluate right expression Sequence rightSeq = getRight().eval(contextSequence); if (rightSeq.getLength() > 1) // fall back to nodeSetCompare return nodeSetCompare(nodes, contextSequence); // get the type of a possible index int indexType = nodes.getIndexType(); DocumentSet docs = nodes.getDocumentSet(); NodeSet result = null; if(indexType != Type.ITEM) { // we have a range index defined on the nodes in this sequence Item key = rightSeq.itemAt(0); if(truncation != Constants.TRUNC_NONE) { // truncation is only possible on strings key = key.convertTo(Type.STRING); } else if(key.getType() != indexType) { // index type doesn't match. If index and argument have a numeric type, // we convert to the type of the index if(Type.subTypeOf(indexType, Type.NUMBER) && Type.subTypeOf(key.getType(), Type.NUMBER)) key = key.convertTo(indexType); } // if key does not implement Indexable, we can't use the index if(key instanceof Indexable && Type.subTypeOf(key.getType(), indexType)) { if(truncation != Constants.TRUNC_NONE) { try { result = context.getBroker().getValueIndex().match(docs, nodes, getComparisonString(rightSeq).replace('%', '*'), DBBroker.MATCH_WILDCARDS); } catch (EXistException e) { throw new XPathException(getASTNode(), e.getMessage(), e); } } else { LOG.debug("Using value index for key: " + key.getStringValue()); result = context.getBroker().getValueIndex().find(relation, docs, nodes, (Indexable)key); } } else return nodeSetCompare(nodes, contextSequence); } else if (relation == Constants.EQ && nodes.hasTextIndex()) { // we can use the fulltext index String cmp = getComparisonString(rightSeq); if(cmp.length() < NativeTextEngine.MAX_WORD_LENGTH) nodes = useFulltextIndex(cmp, nodes, docs); // now compare the input node set to the search expression result = context.getBroker().getNodesEqualTo(nodes, docs, relation, cmp, getCollator(contextSequence)); } else if(Type.subTypeOf(rightSeq.getItemType(), Type.STRING) || rightSeq.getItemType() == Type.ATOMIC) { // no usable index found. Fall back to a sequential scan of the nodes result = context.getBroker().getNodesEqualTo(nodes, docs, relation, getComparisonString(rightSeq), getCollator(contextSequence)); } else { // no usable index found. Fall back to nodeSetCompare return nodeSetCompare(nodes, contextSequence); } // can this result be cached? Don't cache if the result depends on local variables. boolean canCache = contextSequence instanceof NodeSet && (getRight().getDependencies() & Dependency.LOCAL_VARS) == 0 && (getLeft().getDependencies() & Dependency.LOCAL_VARS) == 0; if(canCache) cached = new CachedResult((NodeSet)contextSequence, result); return result; } | 2909 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2909/fc995ec0356b880c0f1167497625f824be9461d7/GeneralComparison.java/buggy/src/org/exist/xquery/GeneralComparison.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1117,
8370,
9549,
907,
694,
8583,
12,
4021,
819,
4021,
13,
202,
202,
15069,
10172,
503,
288,
202,
202,
759,
309,
326,
819,
3102,
13342,
1404,
3550,
732,
848,
327,
279,
3472,
563,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1117,
8370,
9549,
907,
694,
8583,
12,
4021,
819,
4021,
13,
202,
202,
15069,
10172,
503,
288,
202,
202,
759,
309,
326,
819,
3102,
13342,
1404,
3550,
732,
848,
327,
279,
3472,
563,
2... |
if (c == C_STAR) { buffer.append('?'); return start; } if (c == '+') { buffer.append("? extends "); return appendTypeSignature(string, start + 1, fullyQualifyTypeNames, buffer); } else if (c == '-') { buffer.append("? super "); return appendTypeSignature(string, start + 1, fullyQualifyTypeNames, buffer); } else { return appendTypeSignature(string, start, fullyQualifyTypeNames, buffer); | switch(c) { case C_STAR : buffer.append('?'); return start; case '+' : buffer.append("? extends "); return appendTypeSignature(string, start + 1, fullyQualifyTypeNames, buffer); case '-' : buffer.append("? super "); return appendTypeSignature(string, start + 1, fullyQualifyTypeNames, buffer); default : return appendTypeSignature(string, start, fullyQualifyTypeNames, buffer); | private static int appendTypeArgumentSignature(char[] string, int start, boolean fullyQualifyTypeNames, StringBuffer buffer) { // need a minimum 1 char if (start >= string.length) { throw new IllegalArgumentException(); } char c = string[start]; if (c == C_STAR) { buffer.append('?'); return start; } if (c == '+') { buffer.append("? extends "); //$NON-NLS-1$ return appendTypeSignature(string, start + 1, fullyQualifyTypeNames, buffer); } else if (c == '-') { buffer.append("? super "); //$NON-NLS-1$ return appendTypeSignature(string, start + 1, fullyQualifyTypeNames, buffer); } else { return appendTypeSignature(string, start, fullyQualifyTypeNames, buffer); }} | 10698 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/10698/9ba8652d2cebf2117416af5e39a70e172556117b/Signature.java/buggy/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Signature.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3238,
760,
509,
714,
559,
1379,
5374,
12,
3001,
8526,
533,
16,
509,
787,
16,
1250,
7418,
5628,
1164,
559,
1557,
16,
6674,
1613,
13,
288,
202,
759,
1608,
279,
5224,
404,
1149,
202,
430,
261,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3238,
760,
509,
714,
559,
1379,
5374,
12,
3001,
8526,
533,
16,
509,
787,
16,
1250,
7418,
5628,
1164,
559,
1557,
16,
6674,
1613,
13,
288,
202,
759,
1608,
279,
5224,
404,
1149,
202,
430,
261,
... |
CLDRFile result = new CLDRFile(null, false); result.dataSource.setLocaleID(localeName); return result; } | CLDRFile result = new CLDRFile(null, false); result.dataSource.setLocaleID(localeName); return result; } | public static CLDRFile make(String localeName) { CLDRFile result = new CLDRFile(null, false); result.dataSource.setLocaleID(localeName); return result; } | 27800 /local/tlutelli/issta_data/temp/all_java2context/java/2006_temp/2006/27800/4716264464632750d34da5032a0718e1d756a967/CLDRFile.java/buggy/tools/java/org/unicode/cldr/util/CLDRFile.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
14934,
6331,
812,
1221,
12,
780,
2573,
461,
13,
288,
377,
202,
5017,
6331,
812,
563,
273,
394,
14934,
6331,
812,
12,
2011,
16,
629,
1769,
202,
202,
2088,
18,
892,
1830,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
14934,
6331,
812,
1221,
12,
780,
2573,
461,
13,
288,
377,
202,
5017,
6331,
812,
563,
273,
394,
14934,
6331,
812,
12,
2011,
16,
629,
1769,
202,
202,
2088,
18,
892,
1830,
18,
... |
public org.quickfix.field.ContractMultiplier getContractMultiplier() throws FieldNotFound { org.quickfix.field.ContractMultiplier value = new org.quickfix.field.ContractMultiplier(); | public quickfix.field.ContractMultiplier getContractMultiplier() throws FieldNotFound { quickfix.field.ContractMultiplier value = new quickfix.field.ContractMultiplier(); | public org.quickfix.field.ContractMultiplier getContractMultiplier() throws FieldNotFound { org.quickfix.field.ContractMultiplier value = new org.quickfix.field.ContractMultiplier(); getField(value); return value; } | 5926 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5926/fecc27f98261270772ff182a1d4dfd94b5daa73d/OrderCancelRequest.java/clean/src/java/src/quickfix/fix44/OrderCancelRequest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
2358,
18,
19525,
904,
18,
1518,
18,
8924,
23365,
336,
8924,
23365,
1435,
1216,
2286,
2768,
225,
288,
2358,
18,
19525,
904,
18,
1518,
18,
8924,
23365,
460,
273,
394,
2358,
18,
19525,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
2358,
18,
19525,
904,
18,
1518,
18,
8924,
23365,
336,
8924,
23365,
1435,
1216,
2286,
2768,
225,
288,
2358,
18,
19525,
904,
18,
1518,
18,
8924,
23365,
460,
273,
394,
2358,
18,
19525,... |
+"I" | private void generateFunctionInit(ClassFileWriter cfw, OptFunctionNode ofn) { final int CONTEXT_ARG = 1; final int SCOPE_ARG = 2; cfw.startMethod(getFunctionInitMethodName(ofn), FUNCTION_INIT_SIGNATURE, (short)(ClassFileWriter.ACC_PRIVATE | ClassFileWriter.ACC_FINAL)); // Call NativeFunction.initScriptFunction cfw.addLoadThis(); cfw.addALoad(CONTEXT_ARG); cfw.addALoad(SCOPE_ARG); cfw.addPush(compilerEnv.getLanguageVersion()); cfw.addPush(ofn.fnode.getFunctionName()); pushParamNamesArray(cfw, ofn.fnode); cfw.addPush(ofn.fnode.getParamCount()); cfw.addInvoke(ByteCode.INVOKEVIRTUAL, "org/mozilla/javascript/NativeFunction", "initScriptFunction", "(Lorg/mozilla/javascript/Context;" +"Lorg/mozilla/javascript/Scriptable;" +"I" +"Ljava/lang/String;" +"[Ljava/lang/String;" +"I" +")V"); // precompile all regexp literals int regexpCount = ofn.fnode.getRegexpCount(); if (regexpCount != 0) { cfw.addLoadThis(); pushRegExpArray(cfw, ofn.fnode, CONTEXT_ARG, SCOPE_ARG); cfw.add(ByteCode.PUTFIELD, mainClassName, REGEXP_ARRAY_FIELD_NAME, REGEXP_ARRAY_FIELD_TYPE); } cfw.add(ByteCode.RETURN); // 3 = (scriptThis/functionRef) + scope + context cfw.stopMethod((short)3); } | 54155 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54155/993454366a57fd32ee051c61ff3a0658292d84f2/Codegen.java/buggy/js/rhino/src/org/mozilla/javascript/optimizer/Codegen.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
2103,
2083,
2570,
12,
797,
812,
2289,
6080,
91,
16,
4766,
1377,
12056,
2083,
907,
434,
82,
13,
565,
288,
3639,
727,
509,
13862,
67,
10973,
273,
404,
31,
3639,
727,
509,
19296... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
2103,
2083,
2570,
12,
797,
812,
2289,
6080,
91,
16,
4766,
1377,
12056,
2083,
907,
434,
82,
13,
565,
288,
3639,
727,
509,
13862,
67,
10973,
273,
404,
31,
3639,
727,
509,
19296... | |
protected Object getLeastAccessedKey(){ Iterator keyIter = getAcesses().keySet().iterator(); Object theReturn = null; int lowestIntVal = -1; while (keyIter.hasNext()) { Object key = keyIter.next(); Integer integ = (Integer)this.getAcesses().get(key); int intval = integ.intValue(); if(intval<lowestIntVal || lowestIntVal==-1){ lowestIntVal = intval; theReturn = key; } } return theReturn; } | protected Object getLeastAccessedKey() { return getLeastAccessedKeyInteger(); } | protected Object getLeastAccessedKey(){ Iterator keyIter = getAcesses().keySet().iterator(); Object theReturn = null; int lowestIntVal = -1; while (keyIter.hasNext()) { Object key = keyIter.next(); Integer integ = (Integer)this.getAcesses().get(key); int intval = integ.intValue(); if(intval<lowestIntVal || lowestIntVal==-1){ lowestIntVal = intval; theReturn = key; } } return theReturn; } | 52001 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52001/bff8905edce84a4c76050df86d3d2e68e2b734de/CacheMap.java/clean/src/java/com/idega/util/caching/CacheMap.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
4750,
1033,
336,
17319,
27762,
653,
1435,
95,
565,
4498,
498,
2360,
273,
4506,
614,
281,
7675,
856,
694,
7675,
9838,
5621,
565,
1033,
326,
990,
273,
446,
31,
565,
509,
11981,
1702,
3053,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
4750,
1033,
336,
17319,
27762,
653,
1435,
95,
565,
4498,
498,
2360,
273,
4506,
614,
281,
7675,
856,
694,
7675,
9838,
5621,
565,
1033,
326,
990,
273,
446,
31,
565,
509,
11981,
1702,
3053,
... |
if (destinationPaths == null) return; | if (destinationPaths == null) { return; } | public void copyProject(IProject project) { errorStatus = null; //Get the project name and location in a two element list ProjectLocationSelectionDialog dialog = new ProjectLocationSelectionDialog( parentShell, project); dialog.setTitle(IDEWorkbenchMessages.CopyProjectOperation_copyProject); if (dialog.open() != Window.OK) return; Object[] destinationPaths = dialog.getResult(); if (destinationPaths == null) return; String newName = (String) destinationPaths[0]; IPath newLocation = new Path((String) destinationPaths[1]); if (!validateCopy(parentShell, project, newName, getModelProviderIds())) return; boolean completed = performProjectCopy(project, newName, newLocation); if (!completed) // ie.- canceled return; // not appropriate to show errors // If errors occurred, open an Error dialog if (errorStatus != null) { ErrorDialog.openError(parentShell, IDEWorkbenchMessages.CopyProjectOperation_copyFailedTitle, null, errorStatus); errorStatus = null; } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/e38d295ea613cf9f08aadb93a84a33d2e91abc5f/CopyProjectOperation.java/clean/bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/CopyProjectOperation.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1610,
4109,
12,
45,
4109,
1984,
13,
288,
3639,
555,
1482,
273,
446,
31,
3639,
368,
967,
326,
1984,
508,
471,
2117,
316,
279,
2795,
930,
666,
3639,
5420,
2735,
6233,
6353,
617... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1610,
4109,
12,
45,
4109,
1984,
13,
288,
3639,
555,
1482,
273,
446,
31,
3639,
368,
967,
326,
1984,
508,
471,
2117,
316,
279,
2795,
930,
666,
3639,
5420,
2735,
6233,
6353,
617... |
public ProfileManager(ObjectStore os, ObjectStoreWriter userProfileOS) throws ObjectStoreException { | public ProfileManager(ObjectStore os, ObjectStoreWriter userProfileOS) { | public ProfileManager(ObjectStore os, ObjectStoreWriter userProfileOS) throws ObjectStoreException { this.os = os; makeTagCheckers(os.getModel()); this.osw = userProfileOS; } | 29158 /local/tlutelli/issta_data/temp/all_java2context/java/2006_temp/2006/29158/c525a7be8a640a150b0a936efd2ea57840baeeb4/ProfileManager.java/clean/intermine/web/main/src/org/intermine/web/ProfileManager.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
11357,
1318,
12,
921,
2257,
1140,
16,
1033,
2257,
2289,
729,
4029,
4618,
13,
3639,
1216,
1033,
21151,
288,
3639,
333,
18,
538,
273,
1140,
31,
3639,
1221,
1805,
1564,
414,
12,
538,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
11357,
1318,
12,
921,
2257,
1140,
16,
1033,
2257,
2289,
729,
4029,
4618,
13,
3639,
1216,
1033,
21151,
288,
3639,
333,
18,
538,
273,
1140,
31,
3639,
1221,
1805,
1564,
414,
12,
538,
... |
public java.util.List getClubListForUserFromTopNodes(com.idega.user.data.User p0,com.idega.idegaweb.IWUserContext p1)throws java.rmi.RemoteException, java.rmi.RemoteException; | public List getClubListForUserFromTopNodes(User user, IWUserContext iwuc) throws RemoteException; | public java.util.List getClubListForUserFromTopNodes(com.idega.user.data.User p0,com.idega.idegaweb.IWUserContext p1)throws java.rmi.RemoteException, java.rmi.RemoteException; | 57353 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57353/b9085a11980388ff611f369f0d4dbedb5242fdd2/MemberUserBusiness.java/buggy/src/java/is/idega/idegaweb/member/business/MemberUserBusiness.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
1071,
2252,
18,
1367,
18,
682,
13674,
373,
682,
19894,
1265,
3401,
3205,
12,
832,
18,
831,
15833,
18,
1355,
18,
892,
18,
1299,
293,
20,
16,
832,
18,
831,
15833,
18,
831,
15833,
4875,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
1071,
2252,
18,
1367,
18,
682,
13674,
373,
682,
19894,
1265,
3401,
3205,
12,
832,
18,
831,
15833,
18,
1355,
18,
892,
18,
1299,
293,
20,
16,
832,
18,
831,
15833,
18,
831,
15833,
4875,
... |
return new Column(m_table, m_column); | result = new Column(m_table, m_column); | public Column generateLogicalModel() { if (m_type != null) { return new Column(m_table, m_column, m_type.getTypeCode(), m_type.getSize()); } else { return new Column(m_table, m_column); } } | 12196 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12196/404232540a6189e72b44b58b6e693d45eabdcc81/ColumnDef.java/clean/archive/core-platform/src/com/arsdigita/persistence/pdl/ast/ColumnDef.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
4753,
2103,
17955,
1488,
1435,
288,
3639,
309,
261,
81,
67,
723,
480,
446,
13,
288,
5411,
327,
394,
4753,
12,
81,
67,
2121,
16,
312,
67,
2827,
16,
312,
67,
723,
18,
588,
15460,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
4753,
2103,
17955,
1488,
1435,
288,
3639,
309,
261,
81,
67,
723,
480,
446,
13,
288,
5411,
327,
394,
4753,
12,
81,
67,
2121,
16,
312,
67,
2827,
16,
312,
67,
723,
18,
588,
15460,
... |
if (! c.shrinkWrap()) { current.setFloatDistances(new FloatDistances() { public int getLeftFloatDistance() { return c.getBlockFormattingContext().getLeftFloatDistance( c, current, maxAvailableWidth); } public int getRightFloatDistance() { return c.getBlockFormattingContext().getRightFloatDistance( c, current, maxAvailableWidth); } }); current.align(); current.setFloatDistances(null); | if (!c.shrinkWrap()) { current.setFloatDistances(new FloatDistances() { public int getLeftFloatDistance() { return c.getBlockFormattingContext().getLeftFloatDistance(c, current, maxAvailableWidth); } public int getRightFloatDistance() { return c.getBlockFormattingContext().getRightFloatDistance(c, current, maxAvailableWidth); } }); current.align(); current.setFloatDistances(null); | private static void saveLine(final LineBox current, LineBox previous, final LayoutContext c, Box block, int minHeight, final int maxAvailableWidth, List elementStack, List pendingFloats) { current.prunePendingInlineBoxes(); int totalLineWidth = positionHorizontally(c, current, 0); current.contentWidth = totalLineWidth; positionVertically(c, block, current); if (! c.shrinkWrap()) { current.setFloatDistances(new FloatDistances() { public int getLeftFloatDistance() { return c.getBlockFormattingContext().getLeftFloatDistance( c, current, maxAvailableWidth); } public int getRightFloatDistance() { return c.getBlockFormattingContext().getRightFloatDistance( c, current, maxAvailableWidth); } }); current.align(); current.setFloatDistances(null); } else { // FIXME Not right, but can't calculated float distance yet // because we don't know how wide the line is. Should save // BFC and BFC offset and use that to calculate float distance // correctly when we're ready to align the line. FloatDistances distances = new FloatDistances(); distances.setLeftFloatDistance(0); distances.setRightFloatDistance(0); current.setFloatDistances(distances); } /* if (c.hasFirstLineStyles()) {// first pop element styles pushed on first line for (int i = 0; i < pushedOnFirstLine.size(); i++) c.popStyle();// Now save the first-line style current.firstLinePseudo = new InlineElement(null, "first-line", null); Style fls = new Style(c.getCurrentStyle(), bounds.width); current.firstLinePseudo.setStartStyle(fls); current.firstLinePseudo.setEndStyle(fls);// then pop first-line styles for (int i = 0; i < c.getFirstLineStyles().size(); i++) c.popStyle();// reinstate element styles for (Iterator i = pushedOnFirstLine.iterator(); i.hasNext();) { c.pushStyle((CascadedStyle) i.next()); } c.clearFirstLineStyles(); } */ if (c.shrinkWrap()) { block.adjustWidthForChild(current.contentWidth); } current.y = previous == null ? 0 : previous.y + previous.height; if (current.height != 0 && current.height < minHeight) {//would like to discard it otherwise, but that could lose inline elements current.height = minHeight; } block.addChild(current); if (pendingFloats.size() > 0) { c.setFloatingY(c.getFloatingY() + current.height); c.getBlockFormattingContext().floatPending(c, pendingFloats); } // new float code if (!block.getStyle().isClearLeft()) { current.x += c.getBlockFormattingContext().getLeftFloatDistance( c, current, maxAvailableWidth); } } | 52947 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52947/ceb21dee5f070c3ac63d70ae7b6eb22a7c0b4641/InlineBoxing.java/buggy/src/java/org/xhtmlrenderer/layout/InlineBoxing.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
760,
918,
1923,
1670,
12,
6385,
5377,
3514,
783,
16,
5377,
3514,
2416,
16,
2398,
727,
9995,
1042,
276,
16,
8549,
1203,
16,
509,
1131,
2686,
16,
2398,
727,
509,
943,
5268,
2384,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
760,
918,
1923,
1670,
12,
6385,
5377,
3514,
783,
16,
5377,
3514,
2416,
16,
2398,
727,
9995,
1042,
276,
16,
8549,
1203,
16,
509,
1131,
2686,
16,
2398,
727,
509,
943,
5268,
2384,
16... |
return "javascript:catchBookmark('" + bookmark + "')"; | return "javascript:catchBookmark('" + ParameterAccessor.htmlEncode( bookmark ) + "')"; | protected String buildBookmarkAction( IAction action, IReportContext context ) { if ( action == null || context == null ) return null; // Get Base URL String baseURL = null; Object renderContext = getRenderContext( context ); if ( renderContext instanceof HTMLRenderContext ) { baseURL = ( (HTMLRenderContext) renderContext ).getBaseURL( ); } if ( renderContext instanceof PDFRenderContext ) { baseURL = ( (PDFRenderContext) renderContext ).getBaseURL( ); } if ( baseURL == null ) return null; // Get bookmark String bookmark = action.getBookmark( ); // In frameset/run mode, use javascript function to fire Ajax request to // link to internal bookmark if ( baseURL.lastIndexOf( IBirtConstants.SERVLET_PATH_FRAMESET ) > 0 || baseURL.lastIndexOf( IBirtConstants.SERVLET_PATH_RUN ) > 0 ) { return "javascript:catchBookmark('" + bookmark + "')"; //$NON-NLS-1$//$NON-NLS-2$ } // Save the URL String StringBuffer link = new StringBuffer( ); boolean realBookmark = false; if ( this.document != null ) { long pageNumber = this.document .getPageNumber( action.getBookmark( ) ); realBookmark = ( pageNumber == this.page && !isEmbeddable ); } try { bookmark = URLEncoder.encode( bookmark, ParameterAccessor.UTF_8_ENCODE ); } catch ( UnsupportedEncodingException e ) { // Does nothing } link.append( baseURL ); link.append( ParameterAccessor.QUERY_CHAR ); // if the document is not null, then use it if ( document != null ) { link.append( ParameterAccessor.PARAM_REPORT_DOCUMENT ); link.append( ParameterAccessor.EQUALS_OPERATOR ); String documentName = document.getName( ); try { documentName = URLEncoder.encode( documentName, ParameterAccessor.UTF_8_ENCODE ); } catch ( UnsupportedEncodingException e ) { // Does nothing } link.append( documentName ); } else if ( action.getReportName( ) != null && action.getReportName( ).length( ) > 0 ) { link.append( ParameterAccessor.PARAM_REPORT ); link.append( ParameterAccessor.EQUALS_OPERATOR ); String reportName = getReportName( context, action ); try { reportName = URLEncoder.encode( reportName, ParameterAccessor.UTF_8_ENCODE ); } catch ( UnsupportedEncodingException e ) { // do nothing } link.append( reportName ); } else { // its an iternal bookmark return "#" + action.getActionString( ); //$NON-NLS-1$ } if ( locale != null ) { link.append( ParameterAccessor.getQueryParameterString( ParameterAccessor.PARAM_LOCALE, locale.toString( ) ) ); } if ( isRtl ) { link.append( ParameterAccessor.getQueryParameterString( ParameterAccessor.PARAM_RTL, String.valueOf( isRtl ) ) ); } // add isMasterPageContent link.append( ParameterAccessor.getQueryParameterString( ParameterAccessor.PARAM_MASTERPAGE, String .valueOf( this.isMasterPageContent ) ) ); if ( realBookmark ) { link.append( "#" ); //$NON-NLS-1$ link.append( bookmark ); } else { link.append( ParameterAccessor.getQueryParameterString( ParameterAccessor.PARAM_BOOKMARK, bookmark ) ); } return link.toString( ); } | 15160 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/15160/ef88ebb73afe5cc4540d743ddd181952658bcf20/ViewerHTMLActionHandler.java/clean/viewer/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/service/ViewerHTMLActionHandler.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1117,
514,
1361,
22966,
1803,
12,
467,
1803,
1301,
16,
467,
4820,
1042,
819,
262,
202,
95,
202,
202,
430,
261,
1301,
422,
446,
747,
819,
422,
446,
262,
1082,
202,
2463,
446,
31,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1117,
514,
1361,
22966,
1803,
12,
467,
1803,
1301,
16,
467,
4820,
1042,
819,
262,
202,
95,
202,
202,
430,
261,
1301,
422,
446,
747,
819,
422,
446,
262,
1082,
202,
2463,
446,
31,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.