{"record":{"id":"aff3aafdf084bc15","repo":"JetBrains/intellij-community","slug":"prompt-is-null","errorCode":null,"errorMessage":"Prompt is null","messagePattern":"Prompt is null","errorType":"exception","errorClass":"BuildException","httpStatus":null,"severity":"error","filePath":"java/java-runtime/src/com/intellij/rt/ant/execution/IdeaInputHandler.java","lineNumber":17,"sourceCode":"// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.\npackage com.intellij.rt.ant.execution;\n\nimport org.apache.tools.ant.BuildException;\nimport org.apache.tools.ant.input.InputHandler;\nimport org.apache.tools.ant.input.InputRequest;\nimport org.apache.tools.ant.input.MultipleChoiceInputRequest;\n\nimport java.io.IOException;\nimport java.util.List;\n\npublic class IdeaInputHandler implements InputHandler {\n  @Override\n  public void handleInput(InputRequest request) throws BuildException {\n    final String prompt = request.getPrompt();\n    if (prompt == null) {\n      throw new BuildException(\"Prompt is null\");\n    }\n    final SegmentedOutputStream err = IdeaAntLogger2.ourErr;\n    if (err == null) {\n      throw new BuildException(\"Selected InputHandler should be used by Intellij IDEA\");\n    }\n    final PacketWriter packet = PacketFactory.ourInstance.createPacket(AntLoggerConstants.INPUT_REQUEST);\n    packet.appendLimitedString(prompt);\n    packet.appendLimitedString(request.getDefaultValue());\n    if (request instanceof MultipleChoiceInputRequest) {\n      @SuppressWarnings(\"unchecked\") \n      List<String> choices = ((MultipleChoiceInputRequest)request).getChoices();\n      if (choices != null && !choices.isEmpty()) {\n        int count = choices.size();\n        packet.appendLong(count);\n        for (String choice : choices) {\n          packet.appendLimitedString(choice);\n        }\n      }","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/java-runtime/src/com/intellij/rt/ant/execution/IdeaInputHandler.java#L1-L35","documentation":"IdeaInputHandler is the Ant InputHandler that pipes Ant <input> task prompts to the IDE UI via packets. Ant's InputRequest.getPrompt() should always carry the prompt text; if it is null the handler cannot build a meaningful request and fails fast with BuildException(\"Prompt is null\").","triggerScenarios":"An Ant build executes an <input> task whose request was constructed without a prompt string (custom Ant version or a task creating InputRequest(null, ...)), and the build uses -inputhandler com.intellij.rt.ant.execution.IdeaInputHandler.","commonSituations":"Custom Ant tasks or macros that instantiate InputRequest directly with a null prompt; malformed third-party build files; running the same build under IDEA where the IDE-specific input handler is forced on.","solutions":["Fix the build/task so every <input> task has a non-empty prompt attribute (validtext/message).","If a custom task creates InputRequest programmatically, pass a non-null prompt string.","As a workaround, run the build with a different input handler (e.g. -inputhandler org.apache.tools.ant.input.DefaultInputHandler) to see where the null prompt originates."],"exampleFix":"<!-- before -->\n<input addproperty=\"v\"/>\n<!-- after -->\n<input message=\"Enter value:\" addproperty=\"v\"/>","handlingStrategy":"validation","validationCode":"<input message=\"Enter value:\" addproperty=\"v\"/> <!-- always provide message/prompt -->","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Give every <input> task a message attribute.","Pass non-null prompts when constructing InputRequest in custom tasks."],"tags":["ant","input","build-tools","validation"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}