text
stringlengths
171
29.4k
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private void visitModuleExports(Node prop) { String moduleName = guessCJSModuleName(prop.getSourceFileName()); Node module = prop.getChildAtIndex(0); module...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public static Node tryFinally(Node tryBody, Node finallyBody) { Preconditions.checkState(tryBody.isLabelName()); Preconditions.checkState(finallyBody.isLabelName()); ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public static Node tryCatch(Node tryBody, Node catchNode) { Preconditions.checkState(tryBody.isBlock()); Preconditions.checkState(catchNode.isCatch()); Node catchBo...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function x // Test Case [/INST] public void testCost() { checkCost("1", "1"); checkCost("true", "1"); checkCost("false", "1"); checkCost("a", "xx"); checkCost("a + ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private boolean isInlinableObject(List<Reference> refs) { boolean ret = false; for (Reference ref : refs) { Node name = ref.getNode(); Node parent...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function @Override public void enterScope(NodeTraversal t) { if (t.inGlobalScope()) { return; // Don't even brother. All global variables are likely escaped. } if ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function @Override public void enterScope(NodeTraversal t) { if (t.inGlobalScope()) { return; // Don't even brother. All global variables are likely escaped. } if ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private boolean canInline() { // Cannot inline a parameter. if (getDefCfgNode().isFunction()) { return false; } // If one of our dependencies...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function @Override public void process(Node externs, Node root) { (new NodeTraversal(compiler, this)).traverse(root); } // Test Case [/INST] public void testInlineAcrossSideE...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private void computeDependence(final Definition def, Node rValue) { NodeTraversal.traverse(compiler, rValue, new AbstractCfgNodeTraversalCallback() { @Overrid...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function Node getDef(String name, Node useNode) { Preconditions.checkArgument(getCfg().hasNode(useNode)); GraphNode<Node, Branch> n = getCfg().getNode(useNode); FlowState<Mu...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function Node parseInputs() { boolean devMode = options.devMode != DevMode.OFF; // If old roots exist (we are parsing a second time), detach each of the // individual file ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private ExtractionInfo extractMultilineTextualBlock(JsDocToken token, WhitespaceOption option) { if (token == JsDocTo...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public void matchConstraint(ObjectType constraintObj) { // We only want to match contraints on anonymous types. // Handle the case where the constraint object is a rec...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function void add(Node n, Context context) { if (!cc.continueProcessing()) { return; } int type = n.getType(); String opstr = NodeUtil.opToStr(type); int chil...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function @Override void appendOp(String op, boolean binOp) { if (binOp) { if (getLastChar() != ' ') { append(" "); } append(op); ap...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private void unrollBinaryOperator( Node n, int op, String opStr, Context context, Context rhsContext, int leftPrecedence, int rightPrecedence) { Node firstNonOp...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private void inferPropertyTypesToMatchConstraint( JSType type, JSType constraint) { if (type == null || constraint == null) { return; } ObjectType cons...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private boolean canInline( Reference declaration, Reference initialization, Reference reference) { if (!isValidDeclaration(declaration) ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private void traverseFunction(Node n, Node parent) { Preconditions.checkState(n.getChildCount() == 3); Preconditions.checkState(n.isFunction()); final Node fnName ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function @Override Node processFunctionNode(FunctionNode functionNode) { Name name = functionNode.getFunctionName(); Boolean isUnnamedFunction = false; if (name ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function void addNumber(double x) { // This is not pretty printing. This is to prevent misparsing of x- -4 as // x--4 (which is a syntax error). char prev = getLastChar(); ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function String toStringHelper(boolean forAnnotations) { if (hasReferenceName()) { return getReferenceName(); } else if (prettyPrint) { // Don't pretty print recursi...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function JSType resolveInternal(ErrorReporter t, StaticScope<JSType> enclosing) { // TODO(user): Investigate whether it is really necessary to keep two // different mechanisms f...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public void visit(NodeTraversal t, Node n, Node parent) { // Record global variable and function declarations if (t.inGlobalScope()) { if (NodeUtil.isVar...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function FunctionTypeBuilder inferFromOverriddenFunction( @Nullable FunctionType oldType, @Nullable Node paramsParent) { if (oldType == null) { return this; } r...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function FunctionTypeBuilder inferParameterTypes(@Nullable Node argsParent, @Nullable JSDocInfo info) { if (argsParent == null) { if (info == null) { return this...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function Node processForInLoop(ForInLoop loopNode) { // Return the bare minimum to put the AST in a valid state. return newNode( Token.FOR, transfor...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private void attachLiteralTypes(NodeTraversal t, Node n) { switch (n.getType()) { case Token.NULL: n.setJSType(getNativeType(NULL_TYPE)); br...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function void add(String newcode) { maybeEndStatement(); if (newcode.length() == 0) { return; } char c = newcode.charAt(0); if ((isWordChar(c) || c == '\\') ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private void interpretAssigns() { boolean changes = false; do { changes = false; // We can't use traditional iterators and iterables for this list, /...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function Assign(Node assignNode, Node nameNode, boolean isPropertyAssign) { Preconditions.checkState(NodeUtil.isAssignmentOp(assignNode)); this.assignNode = assignNode; ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function x // Test Case [/INST] public void testRecordTypeLeastSuperType2() { RecordTypeBuilder builder = new RecordTypeBuilder(registry); builder.addProperty("e", NUMBER_TYPE,...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public void addMapping( Node node, FilePosition outputStartPosition, FilePosition outputEndPosition) { String sourceFile = node.getSourceFileName(); ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private OriginalMapping getOriginalMappingForEntry(Entry entry) { if (entry.getSourceFileId() == UNMAPPED) { return null; } else { // Adjust the line/column...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function void maybeDeclareQualifiedName(NodeTraversal t, JSDocInfo info, Node n, Node parent, Node rhsValue) { Node ownerNode = n.getFirstChild(); String ownerName...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function @Override public void enterScope(NodeTraversal t) { Node declarationRoot = t.getScopeRoot(); Renamer renamer; if (nameStack.isEmpty()) { // If the contextua...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function @Override public boolean shouldTraverse(NodeTraversal t, Node n, Node parent) { switch (n.getType()) { case Token.FUNCTION: { // Add recursive fu...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function @Override public void visit(NodeTraversal t, Node n, Node parent) { switch (n.getType()) { case Token.NAME: String newName = getReplacementName(n.getString(...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private boolean isInlinableObject(List<Reference> refs) { boolean ret = false; Set<String> validProperties = Sets.newHashSet(); for (Reference ref : refs) {...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private Node tryFoldArrayJoin(Node n) { Node callTarget = n.getFirstChild(); if (callTarget == null || !NodeUtil.isGetProp(callTarget)) { return n; } No...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function void addNumber(double x) { // This is not pretty printing. This is to prevent misparsing of x- -4 as // x--4 (which is a syntax error). char prev = getLastChar(); ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function static boolean isSimpleNumber(String s) { int len = s.length(); for (int index = 0; index < len; index++) { char c = s.charAt(index); if (c < '0' || c > '9'...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private void replaceAssignmentExpression(Var v, Reference ref, Map<String, String> varmap) { // Compute all of the assignme...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public void setPrototypeBasedOn(ObjectType baseType) { // This is a bit weird. We need to successfully handle these // two cases: // Foo.prototype = new Bar(); ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public boolean setPrototype(PrototypeObjectType prototype) { if (prototype == null) { return false; } // getInstanceType fails if the function is not a constr...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function void maybeDeclareQualifiedName(NodeTraversal t, JSDocInfo info, Node n, Node parent, Node rhsValue) { Node ownerNode = n.getFirstChild(); String ownerName...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private static boolean isReduceableFunctionExpression(Node n) { return NodeUtil.isFunctionExpression(n); } // Test Case [/INST] public void testIssue538() { checkC...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public String getLine(int lineNumber) { String js = ""; try { // NOTE(nicksantos): Right now, this is optimized for few warnings. // This is probably the ri...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private static String extractClassNameIfGoog(Node node, Node parent, String functionName){ String className = null; if (NodeUtil.isExprCall(parent)) { Node ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private void computeGenKill(Node n, BitSet gen, BitSet kill, boolean conditional) { switch (n.getType()) { case Token.SCRIPT: case Token.BLOCK: cas...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public void initOptions(CompilerOptions options) { this.options = options; if (errorManager == null) { if (outStream == null) { setErrorManager( ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function boolean expectCanAssignToPropertyOf(NodeTraversal t, Node n, JSType rightType, JSType leftType, Node owner, String propName) { // The NoType check is a hack to make t...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function boolean expectCanAssignTo(NodeTraversal t, Node n, JSType rightType, JSType leftType, String msg) { if (!rightType.canAssignTo(leftType)) { if ((leftType.isCons...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function static TernaryValue getImpureBooleanValue(Node n) { switch (n.getType()) { case Token.ASSIGN: case Token.COMMA: // For ASSIGN and COMMA the value is the...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function static TernaryValue getPureBooleanValue(Node n) { switch (n.getType()) { case Token.STRING: return TernaryValue.forBoolean(n.getString().length() > 0); ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function static boolean functionCallHasSideEffects( Node callNode, @Nullable AbstractCompiler compiler) { if (callNode.getType() != Token.CALL) { throw new IllegalStateE...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private String format(JSError error, boolean warning) { // extract source excerpt SourceExcerptProvider source = getSource(); String sourceExcerpt = source == null ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public void toSource(final CodeBuilder cb, final int inputSeqNum, final Node root) { runInCompilerThread(new Callable<Void>() ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function @Override String toSource(Node n) { initCompilerOptionsIfTesting(); return toSource(n, null); } // Test Case [/INST] public void testES5StrictUseStrictMultipleIn...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private String toSource(Node n, SourceMap sourceMap) { CodePrinter.Builder builder = new CodePrinter.Builder(n); builder.setPrettyPrint(options.prettyPrint); builde...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function static String strEscape(String s, char quote, String doublequoteEscape, String singlequoteEscape, ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public void visit(NodeTraversal t, Node n, Node parent) { JSType childType; JSType leftType, rightType; Node left, right; // To be explicitly set to false if th...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private boolean isPrototypePropertyAssign(Node assign) { Node n = assign.getFirstChild(); if (n != null && NodeUtil.isVarOrSimpleAssignLhs(n, assign) &&...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function boolean parse() { int lineno; int charno; // JSTypes are represented as Rhino AST nodes, and then resolved later. JSTypeExpression type; state = State.SEA...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private Node parseBasicTypeExpression(JsDocToken token) { if (token == JsDocToken.STAR) { return newNode(Token.STAR); } else if (token == JsDocToken.LB) { s...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private Node parseFunctionType(JsDocToken token) { // NOTE(nicksantos): We're not implementing generics at the moment, so // just throw out TypeParameters. if (toke...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private void visitCall(NodeTraversal t, Node n) { Node child = n.getFirstChild(); JSType childType = getJSType(child).restrictByNotNullOrUndefined(); if (!childTyp...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public JSType caseObjectType(ObjectType type) { if (value.equals("function")) { JSType ctorType = getNativeType(U2U_CONSTRUCTOR_TYPE); return resultEqua...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private void declareArguments(Node functionNode) { Node astParameters = functionNode.getFirstChild().getNext(); Node body = astParameters.getNext(); Functio...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private void checkPropertyVisibility(NodeTraversal t, Node getprop, Node parent) { ObjectType objectType = ObjectType.cast(dereference(getprop.getFirstChild()...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private void makeLocalNamesUnique(Node fnNode, boolean isCallInLoop) { Supplier<String> idSupplier = compiler.getUniqueNameIdSupplier(); // Make variable names unique t...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private void visitLabel(Node node, Node parent) { Node nameNode = node.getFirstChild(); Preconditions.checkState(nameNode != null); String name = nameNode.g...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function static String strEscape(String s, char quote, String doublequoteEscape, String singlequoteEscape, ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function @SuppressWarnings("fallthrough") private Node tryFoldComparison(Node n, Node left, Node right) { if (!NodeUtil.isLiteralValue(left, false) || !NodeUtil.isLiteralV...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function static Double getStringNumberValue(String rawJsString) { // vertical tab is not always whitespace String s = trimJsWhiteSpace(rawJsString); // return ScriptRunti...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function static TernaryValue isStrWhiteSpaceChar(int c) { switch (c) { case '\u000B': // <VT> return TernaryValue.TRUE; case ' ': // <SP> case '\n': // <LF...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private boolean isVariableStillLiveWithinExpression( Node n, Node exprRoot, String variable) { while (n != exprRoot) { VariableLiveness state = VariableLiveness...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private VariableLiveness isVariableReadBeforeKill( Node n, String variable) { if (NodeUtil.isName(n) && variable.equals(n.getString())) { if (NodeUtil.isLhs(n,...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function static String strEscape(String s, char quote, String doublequoteEscape, String singlequoteEscape, ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private Node performArithmeticOp(int opType, Node left, Node right) { // Unlike other operations, ADD operands are not always converted // to Number. if (opType == ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function @Override public void process(Node externs, Node root) { new NodeTraversal( compiler, new NormalizeStatements(compiler, assertOnChange)) .traverse(root); ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private void createSynthesizedExternVar(String varName) { Node nameNode = Node.newString(Token.NAME, varName); // Mark the variable as constant if it matches the codin...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private boolean canBeRedeclared(Node n, Scope s) { if (!NodeUtil.isExprAssign(n)) { return false; } Node assign = n.getFirstChild(); Node lhs ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function static boolean isBooleanResultHelper(Node n) { switch (n.getType()) { // Primitives case Token.TRUE: case Token.FALSE: // Comparisons case Tok...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function static boolean evaluatesToLocalValue(Node value, Predicate<Node> locals) { switch (value.getType()) { case Token.ASSIGN: // A result that is aliased by a non-...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function Node processFunctionNode(FunctionNode functionNode) { Name name = functionNode.getFunctionName(); Boolean isUnnamedFunction = false; if (name == null) { ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public final boolean isEmptyType() { return isNoType() || isNoObjectType() || isNoResolvedType(); } // Test Case [/INST] public void testIssue301() throws Exception { ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public int parseArguments(Parameters params) throws CmdLineException { String param = params.getParameter(0); if (param == null) { setter.addValu...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function @Override Node processAssignment(Assignment assignmentNode) { Node assign = processInfixExpression(assignmentNode); return assign; } // Test Case [/INST]...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function @Override Node processUnaryExpression(UnaryExpression exprNode) { int type = transformTokenType(exprNode.getType()); Node operand = transform(exprNode.getOper...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function @SuppressWarnings("fallthrough") private Node tryRemoveUnconditionalBranching(Node n) { /* * For each of the unconditional branching control flow node, check to see ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private Node computeFollowing(Node n) { Node next = ControlFlowAnalysis.computeFollowNode(n); return next; } // Test Case [/INST] public void testCascadedRemovalOf...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function static boolean evaluatesToLocalValue(Node value, Predicate<Node> locals) { switch (value.getType()) { case Token.ASSIGN: // A result that is aliased by a non-...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private boolean isFoldableExpressBlock(Node n) { if (n.getType() == Token.BLOCK) { if (n.hasOneChild()) { Node maybeExpr = n.getFirstChild(); // IE ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private VariableLiveness isVariableReadBeforeKill( Node n, String variable) { if (NodeUtil.isName(n) && variable.equals(n.getString())) { if (NodeUtil.isLhs(n, ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private void updateSimpleDeclaration(String alias, Name refName, Ref ref) { Node rvalue = ref.node.getNext(); Node parent = ref.node.getParent(); Node gramps = pare...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function boolean canCollapseUnannotatedChildNames() { if (type == Type.OTHER || globalSets != 1 || localSets != 0) { return false; } // Don't try to collaps...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private String normalizeSourceName(String filename) { // The DOS command shell will normalize "/" to "\", so we have to // wrestle it back. if (filename.indexOf(fi...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private void visitScript(NodeTraversal t, Node script) { Preconditions.checkArgument(scriptNodeCount == 1, "ProcessCommonJSModules supports only one invocatio...