{"record":{"id":"d7bb45703d555d86","repo":"apache/iceberg","slug":"unexpected-null-order-s","errorCode":null,"errorMessage":"Unexpected null order: %s","messagePattern":"Unexpected null order: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"api/src/main/java/org/apache/iceberg/NullOrder.java","lineNumber":33,"sourceCode":" * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\npackage org.apache.iceberg;\n\npublic enum NullOrder {\n  NULLS_FIRST,\n  NULLS_LAST;\n\n  @Override\n  public String toString() {\n    switch (this) {\n      case NULLS_FIRST:\n        return \"NULLS FIRST\";\n      case NULLS_LAST:\n        return \"NULLS LAST\";\n      default:\n        throw new IllegalArgumentException(\"Unexpected null order: \" + this);\n    }\n  }\n}\n","sourceCodeStart":15,"sourceCodeEnd":37,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/api/src/main/java/org/apache/iceberg/NullOrder.java#L15-L37","documentation":"Defensive default branch in NullOrder.toString's switch. Both enum constants (NULLS_FIRST, NULLS_LAST) are handled explicitly, so this can only fire if a new constant is added to the enum without updating toString — effectively unreachable with the current enum. It is a sentinel guard, not an input-dependent condition.","triggerScenarios":"Thrown at api/src/main/java/org/apache/iceberg/NullOrder.java:33 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["No caller action possible with the current enum; if it fires, a NullOrder constant was added without a toString case","Update the switch when extending the enum","Use the enum name() for machine-readable output instead of toString()"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}