You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Andrea Cosentino (Jira)" <ji...@apache.org> on 2026/08/27 16:54:00 UTC
[jira] [Created] (CAMEL-24541) camel-djl: ImageNetUtil.getSynsetName can throw ArrayIndexOutOfBoundsException on synset lines without a space
Andrea Cosentino created CAMEL-24541:
----------------------------------------
Summary: camel-djl: ImageNetUtil.getSynsetName can throw ArrayIndexOutOfBoundsException on synset lines without a space
Key: CAMEL-24541
URL: https://issues.apache.org/jira/browse/CAMEL-24541
Project: Camel
Issue Type: Bug
Components: camel-ai
Reporter: Andrea Cosentino
Assignee: Andrea Cosentino
Fix For: 4.23.0
camel-djl ImageNetUtil (line 40) parses each synset line with .split(" ", 2)[1], assuming every line contains a space separating the class id from the human-readable label. A synset file whose line has no space (a bare id, a trailing blank line, or a malformed entry) makes split return a single-element array, so [1] throws ArrayIndexOutOfBoundsException while loading the model labels. Fix: guard on the split length and fall back to the raw token (or skip the line) when there is no space.
_Claude Code on behalf of oscerd_
--
This message was sent by Atlassian Jira
(v8.20.10#820010)