Buggy code:
public class UserInterfaceBusiness { public UserInterfaceBusiness ( JbpmContext context ) { } public String [ ] procesarDefinicionUI ( File file , ProcessDefinition processDefinition ) throws BPMException , IOException , ZipException , CreateException , NamingException , LoginException , FactoryConfigurationError , ParserConfigurationException , XPathExpressionException , DocumentException , SAXException { } private void changeNotifications ( ProcessDefinition processDefinition ) { } private Document parseUIDescriptor ( ProcessDefinition processDefinition ) throws BPMException , IOException , FactoryConfigurationError , ParserConfigurationException , DocumentException , SAXException { } private String [ ] procesarArchivoXML ( Document documento , ProcessDefinition processDefinition ) throws BPMException , IOException , CreateException , NamingException , LoginException , XPathExpressionException { } private void doUpgrade ( ProcessDefinition processDefinition , String tag , Node elemento , Vector messages ) throws XPathExpressionException { } private void doDefinitionUpgrade ( ProcessDefinition source , ProcessDefinition target , Node elemento , Vector messages ) throws XPathExpressionException { } private boolean doProcessUpgrade ( ProcessInstance instance , Node elemento , ProcessDefinition target , Vector messages ) throws XPathExpressionException { } private boolean upgradeToken ( Token token , ProcessDefinition target , Node upgradeDefinition , Hashtable translations , Vector messages ) throws XPathExpressionException { if ( ( token . getNode ( ) ) == null ) return false ; String newNodeName = null ; String nodeName = token . getNode ( ) . getName ( ) ; if ( upgradeDefinition != null ) { XPathFactory factory = XPathFactory . newInstance ( ) ; XPath xpath = factory . newXPath ( ) ; xpath . setXPathVariableResolver ( new UserInterfaceBusiness . DummyVariableResolver ( nodeName ) ) ; newNodeName = xpath . evaluate ( "//node[source=$source]//@target" , upgradeDefinition ) ; } if ( ( newNodeName == null ) || ( ( newNodeName . length ( ) ) == 0 ) ) newNodeName = nodeName ; org . jbpm . graph . def . Node newNode = target . getNode ( nodeName ) ; if ( newNode == null ) { messages . add ( String . format ( Messages . getString ( "UserInterfaceBusiness.NotUpgradeNode" ) , nodeName , newNodeName , token . getProcessInstance ( ) . getId ( ) ) ) ; return false ; } translations . put ( token , newNode ) ; boolean ok = true ; <START_BUG> for ( Iterator it = token . getChildren ( ) . entrySet ( ) . iterator ( ) ; ok && ( it . hasNext ( ) ) ; ) { <END_BUG> Token child = ( ( Token ) ( it . next ( ) ) ) ; ok = upgradeToken ( child , target , upgradeDefinition , translations , messages ) ; } return ok ; } class DummyVariableResolver implements XPathVariableResolver { String sourceTask ; public DummyVariableResolver ( String sourceTask ) { } public Object resolveVariable ( QName variableName ) { } } private void procesarRolesDefinicionProceso ( Document documento , ProcessDefinition def ) throws BPMException { } private void procesarRolDefinicionProceso ( Document documento , String roleName , ProcessDefinition def ) throws BPMException { } public JbpmContext getContext ( ) { } public void setContext ( JbpmContext context ) { } public class SchemaLoader implements EntityResolver { public static final String FILE_SCHEME = "file:////" ; public InputSource resolveEntity ( String publicId , String systemId ) throws SAXException { } } static final String JAXP_SCHEMA_LANGUAGE = "http:////java.sun.com//xml//jaxp//properties//schemaLanguage" ; static final String W3C_XML_SCHEMA = "http:////www.w3.org//2001//XMLSchema" ; static final String JAXP_SCHEMA_SOURCE = "http:////java.sun.com//xml//jaxp//properties//schemaSource" ; private JbpmContext context = null ; private static Log log = LogFactory . getLog ( UserInterfaceBusiness . class ) ; public String [ ] upgradeProcess ( ProcessInstance process ) throws BPMException , IOException , FactoryConfigurationError , ParserConfigurationException , XPathExpressionException , DocumentException , SAXException { } public String extractVersion ( File f ) throws IOException , ParserConfigurationException , XPathExpressionException , SAXException { } public String extractName ( File f ) throws IOException , ParserConfigurationException , XPathExpressionException , SAXException { } }

Fix:
for ( Iterator it = token . getChildren ( ) . values ( ) . iterator ( ) ; ok && ( it . hasNext ( ) ) ; ) {