bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
public static void init(Broker b){ // get configuration parameters synchronized (b){ BeanConf bCfg = new BeanConf(b); b.setBrokerLocal("BeanDirective.Conf", bCfg); if (DEBUG){ System.err.println("DBG: #bean - impliedPackages: " + bCfg.impliedPackages); System.err.println("DBG: #bean - allowedPackages: " + bCfg.allowedPackages); } } }
|
public static void init(Broker b){ // get configuration parameters synchronized (b){ BeanConf bCfg = new BeanConf(b); b.setBrokerLocal("BeanDirective.Conf", bCfg); if (DEBUG){ System.err.println("DBG: #bean - impliedPackages: " + bCfg.impliedPackages); System.err.println("DBG: #bean - allowedPackages: " + bCfg.allowedPackages); } } }
| 1,123,917
|
public void write(FastWriter out, Context context) throws PropertyException, IOException { Map globalBeans = BeanConf.globalBeans; Map appBeans = beanConf.appBeans; boolean isNew = false; try { while (initArgObj instanceof Macro) initArgObj = ((Macro) initArgObj).evaluate(context); // store init args in array if (initArgObj == null || initArgObj.getClass().isArray()){ initArgs = (Object[])initArgObj; } else { initArgs = new Object[1]; initArgs[0] = initArgObj; } Object o = null; Class c = null; switch (scope){ case BEAN_SCOPE_GLOBAL: synchronized (globalBeans){ o = globalBeans.get(targetName); if (o == null){ if (isStaticClass){ c = context.getBroker().classForName(_className); o = new org.webmacro.engine.StaticClassWrapper(c); } else { //c = Class.forName(_className); //o = c.newInstance(); o = instantiate(_className, initArgs); } isNew = true; globalBeans.put(targetName,o); } } break; case BEAN_SCOPE_APPLICATION: synchronized (appBeans){ o = appBeans.get(targetName); if (o == null){ o = instantiate(_className, initArgs); isNew = true; appBeans.put(targetName, o); } } break; case BEAN_SCOPE_SESSION: javax.servlet.http.HttpSession session = (javax.servlet.http.HttpSession)context.getProperty("Session"); //if (context instanceof WebContext){ if (session != null){ synchronized(session){ o = session.getAttribute(targetName); if (o == null){ o = instantiate(_className, initArgs); isNew = true; session.setAttribute(targetName, o); } } } else { throw new PropertyException("#bean usage error: session scope is only valid with servlets!"); } break; default: // make "page" the default scope //case BEAN_SCOPE_PAGE: // NOTE: page beans always overwrite anything in the context // with the same name o = instantiate(_className, initArgs); isNew = true; if (o != null){ Class[] paramTypes = { Context.class }; try { java.lang.reflect.Method m = o.getClass().getMethod("init", paramTypes); if (m != null){ Object[] args = { context }; m.invoke(o, args); } } catch (Exception e){ // ignore } } break; } if (DEBUG) System.err.println("#bean: Class " + _className + " loaded."); target.setValue(context, o); } catch (PropertyException e) { if (DEBUG) System.err.println("#bean: Class " + _className + " failed: " + e); this._log.error("#bean: Class " + _className + " failed.", e); throw e; } catch (Exception e) { String errorText = "#bean: Unable to load bean " + target + " of type " + _className; context.getBroker().getLog("engine").error(errorText, e); writeWarning(errorText, context, out); } if (isNew && onNewBlock != null) onNewBlock.write(out, context); }
|
public void write(FastWriter out, Context context) throws PropertyException, IOException { Map globalBeans = BeanConf.globalBeans; Map appBeans = beanConf.appBeans; boolean isNew = false; try { while (initArgObj instanceof Macro) initArgObj = ((Macro) initArgObj).evaluate(context); // store init args in array if (initArgObj == null || initArgObj.getClass().isArray()){ initArgs = (Object[])initArgObj; } else { initArgs = new Object[1]; initArgs[0] = initArgObj; } Object o = null; Class c = null; switch (scope){ case BEAN_SCOPE_GLOBAL: synchronized (globalBeans){ o = globalBeans.get(targetName); if (o == null){ if (isStaticClass){ c = context.getBroker().classForName(_className); o = new org.webmacro.engine.StaticClassWrapper(c); } else { //c = Class.forName(_className); //o = c.newInstance(); o = instantiate(_className, initArgs); } isNew = true; globalBeans.put(targetName,o); } } break; case BEAN_SCOPE_APPLICATION: synchronized (appBeans){ o = appBeans.get(targetName); if (o == null){ o = instantiate(_className, initArgs); isNew = true; appBeans.put(targetName, o); } } break; case BEAN_SCOPE_SESSION: javax.servlet.http.HttpSession session = (javax.servlet.http.HttpSession)context.getProperty("Session"); //if (context instanceof WebContext){ if (session != null){ synchronized(session){ o = session.getAttribute(targetName); if (o == null){ o = instantiate(_className, initArgs); isNew = true; session.setAttribute(targetName, o); } } } else { PropertyException e = new PropertyException( "#bean usage error: session scope is only valid with servlets!"); _broker.getEvaluationExceptionHandler().evaluate( target, context, e); } break; default: // make "page" the default scope //case BEAN_SCOPE_PAGE: // NOTE: page beans always overwrite anything in the context // with the same name o = instantiate(_className, initArgs); isNew = true; if (o != null){ Class[] paramTypes = { Context.class }; try { java.lang.reflect.Method m = o.getClass().getMethod("init", paramTypes); if (m != null){ Object[] args = { context }; m.invoke(o, args); } } catch (Exception e){ // ignore } } break; } if (DEBUG) System.err.println("#bean: Class " + _className + " loaded."); target.setValue(context, o); } catch (PropertyException e) { if (DEBUG) System.err.println("#bean: Class " + _className + " failed: " + e); this._log.error("#bean: Class " + _className + " failed.", e); throw e; } catch (Exception e) { String errorText = "#bean: Unable to load bean " + target + " of type " + _className; context.getBroker().getLog("engine").error(errorText, e); writeWarning(errorText, context, out); } if (isNew && onNewBlock != null) onNewBlock.write(out, context); }
| 1,123,918
|
public void write(FastWriter out, Context context) throws PropertyException, IOException { Map globalBeans = BeanConf.globalBeans; Map appBeans = beanConf.appBeans; boolean isNew = false; try { while (initArgObj instanceof Macro) initArgObj = ((Macro) initArgObj).evaluate(context); // store init args in array if (initArgObj == null || initArgObj.getClass().isArray()){ initArgs = (Object[])initArgObj; } else { initArgs = new Object[1]; initArgs[0] = initArgObj; } Object o = null; Class c = null; switch (scope){ case BEAN_SCOPE_GLOBAL: synchronized (globalBeans){ o = globalBeans.get(targetName); if (o == null){ if (isStaticClass){ c = context.getBroker().classForName(_className); o = new org.webmacro.engine.StaticClassWrapper(c); } else { //c = Class.forName(_className); //o = c.newInstance(); o = instantiate(_className, initArgs); } isNew = true; globalBeans.put(targetName,o); } } break; case BEAN_SCOPE_APPLICATION: synchronized (appBeans){ o = appBeans.get(targetName); if (o == null){ o = instantiate(_className, initArgs); isNew = true; appBeans.put(targetName, o); } } break; case BEAN_SCOPE_SESSION: javax.servlet.http.HttpSession session = (javax.servlet.http.HttpSession)context.getProperty("Session"); //if (context instanceof WebContext){ if (session != null){ synchronized(session){ o = session.getAttribute(targetName); if (o == null){ o = instantiate(_className, initArgs); isNew = true; session.setAttribute(targetName, o); } } } else { throw new PropertyException("#bean usage error: session scope is only valid with servlets!"); } break; default: // make "page" the default scope //case BEAN_SCOPE_PAGE: // NOTE: page beans always overwrite anything in the context // with the same name o = instantiate(_className, initArgs); isNew = true; if (o != null){ Class[] paramTypes = { Context.class }; try { java.lang.reflect.Method m = o.getClass().getMethod("init", paramTypes); if (m != null){ Object[] args = { context }; m.invoke(o, args); } } catch (Exception e){ // ignore } } break; } if (DEBUG) System.err.println("#bean: Class " + _className + " loaded."); target.setValue(context, o); } catch (PropertyException e) { if (DEBUG) System.err.println("#bean: Class " + _className + " failed: " + e); this._log.error("#bean: Class " + _className + " failed.", e); throw e; } catch (Exception e) { String errorText = "#bean: Unable to load bean " + target + " of type " + _className; context.getBroker().getLog("engine").error(errorText, e); writeWarning(errorText, context, out); } if (isNew && onNewBlock != null) onNewBlock.write(out, context); }
|
public void write(FastWriter out, Context context) throws PropertyException, IOException { Map globalBeans = BeanConf.globalBeans; Map appBeans = beanConf.appBeans; boolean isNew = false; try { while (initArgObj instanceof Macro) initArgObj = ((Macro) initArgObj).evaluate(context); // store init args in array if (initArgObj == null || initArgObj.getClass().isArray()){ initArgs = (Object[])initArgObj; } else { initArgs = new Object[1]; initArgs[0] = initArgObj; } Object o = null; Class c = null; switch (scope){ case BEAN_SCOPE_GLOBAL: synchronized (globalBeans){ o = globalBeans.get(targetName); if (o == null){ if (isStaticClass){ c = context.getBroker().classForName(_className); o = new org.webmacro.engine.StaticClassWrapper(c); } else { //c = Class.forName(_className); //o = c.newInstance(); o = instantiate(_className, initArgs); } isNew = true; globalBeans.put(targetName,o); } } break; case BEAN_SCOPE_APPLICATION: synchronized (appBeans){ o = appBeans.get(targetName); if (o == null){ o = instantiate(_className, initArgs); isNew = true; appBeans.put(targetName, o); } } break; case BEAN_SCOPE_SESSION: javax.servlet.http.HttpSession session = (javax.servlet.http.HttpSession)context.getProperty("Session"); //if (context instanceof WebContext){ if (session != null){ synchronized(session){ o = session.getAttribute(targetName); if (o == null){ o = instantiate(_className, initArgs); isNew = true; session.setAttribute(targetName, o); } } } else { throw new PropertyException("#bean usage error: session scope is only valid with servlets!"); } break; default: // make "page" the default scope //case BEAN_SCOPE_PAGE: // NOTE: page beans always overwrite anything in the context // with the same name o = instantiate(_className, initArgs); isNew = true; if (o != null){ Class[] paramTypes = { Context.class }; try { java.lang.reflect.Method m = o.getClass().getMethod("init", paramTypes); if (m != null){ Object[] args = { context }; m.invoke(o, args); } } catch (Exception e){ // ignore } } break; } _log.debug("BeanDirective: Class " + _className + " loaded."); target.setValue(context, o); } catch (PropertyException e) { if (DEBUG) System.err.println("#bean: Class " + _className + " failed: " + e); this._log.error("#bean: Class " + _className + " failed.", e); throw e; } catch (Exception e) { String errorText = "#bean: Unable to load bean " + target + " of type " + _className; context.getBroker().getLog("engine").error(errorText, e); writeWarning(errorText, context, out); } if (isNew && onNewBlock != null) onNewBlock.write(out, context); }
| 1,123,919
|
public void write(FastWriter out, Context context) throws PropertyException, IOException { Map globalBeans = BeanConf.globalBeans; Map appBeans = beanConf.appBeans; boolean isNew = false; try { while (initArgObj instanceof Macro) initArgObj = ((Macro) initArgObj).evaluate(context); // store init args in array if (initArgObj == null || initArgObj.getClass().isArray()){ initArgs = (Object[])initArgObj; } else { initArgs = new Object[1]; initArgs[0] = initArgObj; } Object o = null; Class c = null; switch (scope){ case BEAN_SCOPE_GLOBAL: synchronized (globalBeans){ o = globalBeans.get(targetName); if (o == null){ if (isStaticClass){ c = context.getBroker().classForName(_className); o = new org.webmacro.engine.StaticClassWrapper(c); } else { //c = Class.forName(_className); //o = c.newInstance(); o = instantiate(_className, initArgs); } isNew = true; globalBeans.put(targetName,o); } } break; case BEAN_SCOPE_APPLICATION: synchronized (appBeans){ o = appBeans.get(targetName); if (o == null){ o = instantiate(_className, initArgs); isNew = true; appBeans.put(targetName, o); } } break; case BEAN_SCOPE_SESSION: javax.servlet.http.HttpSession session = (javax.servlet.http.HttpSession)context.getProperty("Session"); //if (context instanceof WebContext){ if (session != null){ synchronized(session){ o = session.getAttribute(targetName); if (o == null){ o = instantiate(_className, initArgs); isNew = true; session.setAttribute(targetName, o); } } } else { throw new PropertyException("#bean usage error: session scope is only valid with servlets!"); } break; default: // make "page" the default scope //case BEAN_SCOPE_PAGE: // NOTE: page beans always overwrite anything in the context // with the same name o = instantiate(_className, initArgs); isNew = true; if (o != null){ Class[] paramTypes = { Context.class }; try { java.lang.reflect.Method m = o.getClass().getMethod("init", paramTypes); if (m != null){ Object[] args = { context }; m.invoke(o, args); } } catch (Exception e){ // ignore } } break; } if (DEBUG) System.err.println("#bean: Class " + _className + " loaded."); target.setValue(context, o); } catch (PropertyException e) { if (DEBUG) System.err.println("#bean: Class " + _className + " failed: " + e); this._log.error("#bean: Class " + _className + " failed.", e); throw e; } catch (Exception e) { String errorText = "#bean: Unable to load bean " + target + " of type " + _className; context.getBroker().getLog("engine").error(errorText, e); writeWarning(errorText, context, out); } if (isNew && onNewBlock != null) onNewBlock.write(out, context); }
|
public void write(FastWriter out, Context context) throws PropertyException, IOException { Map globalBeans = BeanConf.globalBeans; Map appBeans = beanConf.appBeans; boolean isNew = false; try { while (initArgObj instanceof Macro) initArgObj = ((Macro) initArgObj).evaluate(context); // store init args in array if (initArgObj == null || initArgObj.getClass().isArray()){ initArgs = (Object[])initArgObj; } else { initArgs = new Object[1]; initArgs[0] = initArgObj; } Object o = null; Class c = null; switch (scope){ case BEAN_SCOPE_GLOBAL: synchronized (globalBeans){ o = globalBeans.get(targetName); if (o == null){ if (isStaticClass){ c = context.getBroker().classForName(_className); o = new org.webmacro.engine.StaticClassWrapper(c); } else { //c = Class.forName(_className); //o = c.newInstance(); o = instantiate(_className, initArgs); } isNew = true; globalBeans.put(targetName,o); } } break; case BEAN_SCOPE_APPLICATION: synchronized (appBeans){ o = appBeans.get(targetName); if (o == null){ o = instantiate(_className, initArgs); isNew = true; appBeans.put(targetName, o); } } break; case BEAN_SCOPE_SESSION: javax.servlet.http.HttpSession session = (javax.servlet.http.HttpSession)context.getProperty("Session"); //if (context instanceof WebContext){ if (session != null){ synchronized(session){ o = session.getAttribute(targetName); if (o == null){ o = instantiate(_className, initArgs); isNew = true; session.setAttribute(targetName, o); } } } else { throw new PropertyException("#bean usage error: session scope is only valid with servlets!"); } break; default: // make "page" the default scope //case BEAN_SCOPE_PAGE: // NOTE: page beans always overwrite anything in the context // with the same name o = instantiate(_className, initArgs); isNew = true; if (o != null){ Class[] paramTypes = { Context.class }; try { java.lang.reflect.Method m = o.getClass().getMethod("init", paramTypes); if (m != null){ Object[] args = { context }; m.invoke(o, args); } } catch (Exception e){ // ignore } } break; } if (DEBUG) System.err.println("#bean: Class " + _className + " loaded."); target.setValue(context, o); } catch (PropertyException e) { if (DEBUG) System.err.println("#bean: Class " + _className + " failed: " + e); this._log.error("#bean: Class " + _className + " failed.", e); throw e; } catch (Exception e) { String errorText = "#bean: Unable to load bean " + target + " of type " + _className; context.getBroker().getLog("engine").error(errorText, e); writeWarning(errorText, context, out); } if (isNew && onNewBlock != null) onNewBlock.write(out, context); }
| 1,123,920
|
public void write(FastWriter out, Context context) throws PropertyException, IOException { Map globalBeans = BeanConf.globalBeans; Map appBeans = beanConf.appBeans; boolean isNew = false; try { while (initArgObj instanceof Macro) initArgObj = ((Macro) initArgObj).evaluate(context); // store init args in array if (initArgObj == null || initArgObj.getClass().isArray()){ initArgs = (Object[])initArgObj; } else { initArgs = new Object[1]; initArgs[0] = initArgObj; } Object o = null; Class c = null; switch (scope){ case BEAN_SCOPE_GLOBAL: synchronized (globalBeans){ o = globalBeans.get(targetName); if (o == null){ if (isStaticClass){ c = context.getBroker().classForName(_className); o = new org.webmacro.engine.StaticClassWrapper(c); } else { //c = Class.forName(_className); //o = c.newInstance(); o = instantiate(_className, initArgs); } isNew = true; globalBeans.put(targetName,o); } } break; case BEAN_SCOPE_APPLICATION: synchronized (appBeans){ o = appBeans.get(targetName); if (o == null){ o = instantiate(_className, initArgs); isNew = true; appBeans.put(targetName, o); } } break; case BEAN_SCOPE_SESSION: javax.servlet.http.HttpSession session = (javax.servlet.http.HttpSession)context.getProperty("Session"); //if (context instanceof WebContext){ if (session != null){ synchronized(session){ o = session.getAttribute(targetName); if (o == null){ o = instantiate(_className, initArgs); isNew = true; session.setAttribute(targetName, o); } } } else { throw new PropertyException("#bean usage error: session scope is only valid with servlets!"); } break; default: // make "page" the default scope //case BEAN_SCOPE_PAGE: // NOTE: page beans always overwrite anything in the context // with the same name o = instantiate(_className, initArgs); isNew = true; if (o != null){ Class[] paramTypes = { Context.class }; try { java.lang.reflect.Method m = o.getClass().getMethod("init", paramTypes); if (m != null){ Object[] args = { context }; m.invoke(o, args); } } catch (Exception e){ // ignore } } break; } if (DEBUG) System.err.println("#bean: Class " + _className + " loaded."); target.setValue(context, o); } catch (PropertyException e) { if (DEBUG) System.err.println("#bean: Class " + _className + " failed: " + e); this._log.error("#bean: Class " + _className + " failed.", e); throw e; } catch (Exception e) { String errorText = "#bean: Unable to load bean " + target + " of type " + _className; context.getBroker().getLog("engine").error(errorText, e); writeWarning(errorText, context, out); } if (isNew && onNewBlock != null) onNewBlock.write(out, context); }
|
public void write(FastWriter out, Context context) throws PropertyException, IOException { Map globalBeans = BeanConf.globalBeans; Map appBeans = beanConf.appBeans; boolean isNew = false; try { while (initArgObj instanceof Macro) initArgObj = ((Macro) initArgObj).evaluate(context); // store init args in array if (initArgObj == null || initArgObj.getClass().isArray()){ initArgs = (Object[])initArgObj; } else { initArgs = new Object[1]; initArgs[0] = initArgObj; } Object o = null; Class c = null; switch (scope){ case BEAN_SCOPE_GLOBAL: synchronized (globalBeans){ o = globalBeans.get(targetName); if (o == null){ if (isStaticClass){ c = context.getBroker().classForName(_className); o = new org.webmacro.engine.StaticClassWrapper(c); } else { //c = Class.forName(_className); //o = c.newInstance(); o = instantiate(_className, initArgs); } isNew = true; globalBeans.put(targetName,o); } } break; case BEAN_SCOPE_APPLICATION: synchronized (appBeans){ o = appBeans.get(targetName); if (o == null){ o = instantiate(_className, initArgs); isNew = true; appBeans.put(targetName, o); } } break; case BEAN_SCOPE_SESSION: javax.servlet.http.HttpSession session = (javax.servlet.http.HttpSession)context.getProperty("Session"); //if (context instanceof WebContext){ if (session != null){ synchronized(session){ o = session.getAttribute(targetName); if (o == null){ o = instantiate(_className, initArgs); isNew = true; session.setAttribute(targetName, o); } } } else { throw new PropertyException("#bean usage error: session scope is only valid with servlets!"); } break; default: // make "page" the default scope //case BEAN_SCOPE_PAGE: // NOTE: page beans always overwrite anything in the context // with the same name o = instantiate(_className, initArgs); isNew = true; if (o != null){ Class[] paramTypes = { Context.class }; try { java.lang.reflect.Method m = o.getClass().getMethod("init", paramTypes); if (m != null){ Object[] args = { context }; m.invoke(o, args); } } catch (Exception e){ // ignore } } break; } if (DEBUG) System.err.println("#bean: Class " + _className + " loaded."); target.setValue(context, o); } catch (PropertyException e) { if (DEBUG) System.err.println("#bean: Class " + _className + " failed: " + e); this._log.error("#bean: Class " + _className + " failed.", e); throw e; } catch (Exception e) { String errorText = "#bean: Unable to load bean " + target + " of type " + _className; context.getBroker().getLog("engine").error(errorText, e); writeWarning(errorText, context, out); } if (isNew && onNewBlock != null) onNewBlock.write(out, context); }
| 1,123,921
|
private ChatManager() { chatContainer = new ChatContainer(); // Add a Message Handler SparkManager.getMessageEventManager().addMessageEventNotificationListener(this); SparkManager.getConnection().addPacketListener(new PacketListener() { public void processPacket(final Packet packet) { try { if (customList.contains(StringUtils.parseBareAddress(packet.getFrom()))) { cancelledNotification(packet.getFrom(), ""); } } catch (Exception e) { Log.error(e); } } }, new PacketTypeFilter(Message.class)); }
|
private ChatManager() { chatContainer = new ChatContainer(); // Add a Message Handler SparkManager.getMessageEventManager().addMessageEventNotificationListener(this); SparkManager.getConnection().addPacketListener(new PacketListener() { public void processPacket(final Packet packet) { try { if (customList.contains(StringUtils.parseBareAddress(packet.getFrom()))) { cancelledNotification(packet.getFrom(), ""); } } catch (Exception e) { Log.error(e); } } }, new PacketTypeFilter(Message.class)); }
| 1,123,922
|
public void run() { final ContactList contactList = SparkManager.getWorkspace().getContactList(); ChatRoom chatRoom = null; try { chatRoom = getChatContainer().getChatRoom(StringUtils.parseBareAddress(from)); if (chatRoom != null && chatRoom instanceof ChatRoomImpl) { ((ChatRoomImpl)chatRoom).showTyping(true); } } catch (ChatRoomNotFoundException e) { } contactList.setIconFor(from, SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_EDIT_IMAGE)); customList.add(StringUtils.parseBareAddress(from)); }
|
public void run() { ContactList contactList = SparkManager.getWorkspace().getContactList(); ChatRoom chatRoom = null; try { chatRoom = getChatContainer().getChatRoom(StringUtils.parseBareAddress(from)); if (chatRoom != null && chatRoom instanceof ChatRoomImpl) { ((ChatRoomImpl)chatRoom).showTyping(true); } } catch (ChatRoomNotFoundException e) { } contactList.setIconFor(from, SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_EDIT_IMAGE)); customList.add(StringUtils.parseBareAddress(from)); }
| 1,123,923
|
public void run() { final ContactList contactList = SparkManager.getWorkspace().getContactList(); ChatRoom chatRoom = null; try { chatRoom = getChatContainer().getChatRoom(StringUtils.parseBareAddress(from)); if (chatRoom != null && chatRoom instanceof ChatRoomImpl) { ((ChatRoomImpl)chatRoom).showTyping(true); } } catch (ChatRoomNotFoundException e) { } contactList.setIconFor(from, SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_EDIT_IMAGE)); customList.add(StringUtils.parseBareAddress(from)); }
|
public void run() { final ContactList contactList = SparkManager.getWorkspace().getContactList(); ChatRoom chatRoom = null; try { chatRoom = getChatContainer().getChatRoom(StringUtils.parseBareAddress(from)); if (chatRoom != null && chatRoom instanceof ChatRoomImpl) { ((ChatRoomImpl)chatRoom).showTyping(false); } } catch (ChatRoomNotFoundException e) { } contactList.setIconFor(from, SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_EDIT_IMAGE)); customList.add(StringUtils.parseBareAddress(from)); }
| 1,123,924
|
public void run() { final ContactList contactList = SparkManager.getWorkspace().getContactList(); ChatRoom chatRoom = null; try { chatRoom = getChatContainer().getChatRoom(StringUtils.parseBareAddress(from)); if (chatRoom != null && chatRoom instanceof ChatRoomImpl) { ((ChatRoomImpl)chatRoom).showTyping(true); } } catch (ChatRoomNotFoundException e) { } contactList.setIconFor(from, SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_EDIT_IMAGE)); customList.add(StringUtils.parseBareAddress(from)); }
|
public void run() { final ContactList contactList = SparkManager.getWorkspace().getContactList(); ChatRoom chatRoom = null; try { chatRoom = getChatContainer().getChatRoom(StringUtils.parseBareAddress(from)); if (chatRoom != null && chatRoom instanceof ChatRoomImpl) { ((ChatRoomImpl)chatRoom).showTyping(true); } } catch (ChatRoomNotFoundException e) { } contactList.setIconFor(from, SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_EDIT_IMAGE)); customList.add(StringUtils.parseBareAddress(from)); }
| 1,123,925
|
public void generate(NamespaceMapping namespaceMapping) throws IOException { String namespace = namespaceMapping.getNamespace(); if (namespace == null) { return; } File file = new File(metaInfDir, NamespaceHelper.createDiscoveryPathName(namespace)); file.getParentFile().mkdirs(); log.log("Generating META-INF properties file: " + file + " for namespace: " + namespace); PrintWriter out = new PrintWriter(new FileWriter(file)); try { generatePropertiesFile(out, namespaceMapping.getElements()); } finally { out.close(); } // Generate spring 2.0 mapping file = new File(metaInfDir, "META-INF/spring.handlers"); log.log("Generating Spring 2.0 handler mapping: " + file + " for namespace: " + namespace); out = new PrintWriter(new FileWriter(file)); try { out.println(namespace.replace(":", "\\:") + "=" + NAMESPACE_HANDLER); } finally { out.close(); } }
|
public void generate(NamespaceMapping namespaceMapping) throws IOException { String namespace = namespaceMapping.getNamespace(); if (namespace == null) { return; } File file = new File(metaInfDir, NamespaceHelper.createDiscoveryPathName(namespace)); file.getParentFile().mkdirs(); log.log("Generating META-INF properties file: " + file + " for namespace: " + namespace); PrintWriter out = new PrintWriter(new FileWriter(file)); try { generatePropertiesFile(out, namespaceMapping.getElements()); } finally { out.close(); } // Generate spring 2.0 mapping file = new File(metaInfDir, "META-INF/spring.handlers"); log.log("Generating Spring 2.0 handler mapping: " + file + " for namespace: " + namespace); out = new PrintWriter(new FileWriter(file)); try { out.println(namespace.replaceAll(":", "\\\\:") + "=" + NAMESPACE_HANDLER); } finally { out.close(); } }
| 1,123,928
|
private void decorateCancelButton() { cancelButton.setVisible(false); ResourceUtils.resButton(cancelButton, Res.getString("cancel")); cancelButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); cancelButton.setForeground(new Color(73, 113, 196)); cancelButton.setFont(new Font("Dialog", Font.BOLD, 10)); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { cancelTransfer(); } }); cancelButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { cancelButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { cancelButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); }
|
private void decorateCancelButton() { cancelButton.setVisible(false); ResourceUtils.resButton(cancelButton, Res.getString("cancel")); cancelButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); cancelButton.setForeground(new Color(73, 113, 196)); cancelButton.setFont(new Font("Dialog", Font.BOLD, 11)); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { cancelTransfer(); } }); cancelButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { cancelButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { cancelButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); }
| 1,123,930
|
private void transferDone(final FileTransferRequest request, FileTransfer transfer) { cancelButton.setVisible(false); showAlert(true); String bareJID = StringUtils.parseBareAddress(request.getRequestor()); ContactList contactList = SparkManager.getWorkspace().getContactList(); ContactItem contactItem = contactList.getContactItemByJID(bareJID); titleLabel.setText(Res.getString("message.received.file", contactItem.getNickname())); fileLabel.setText(request.getFileName()); remove(acceptLabel); remove(declineLabel); remove(progressBar); final TransferButton openFileButton = new TransferButton(); final TransferButton openFolderButton = new TransferButton(); add(openFileButton, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0)); add(openFolderButton, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0)); Downloads downloads = Downloads.getInstance(); final File downloadedFile = new File(downloads.getDownloadDirectory(), request.getFileName()); openFileButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { openFileButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { openFileButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); openFolderButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { openFolderButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { openFolderButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); add(fileLabel, new GridBagConstraints(1, 1, 2, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); ResourceUtils.resButton(openFileButton, Res.getString("open")); ResourceUtils.resButton(openFolderButton, Res.getString("open.folder")); openFileButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); openFileButton.setForeground(new Color(73, 113, 196)); openFileButton.setFont(new Font("Dialog", Font.BOLD, 10)); openFolderButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); openFolderButton.setForeground(new Color(73, 113, 196)); openFolderButton.setFont(new Font("Dialog", Font.BOLD, 10)); imageLabel.setIcon(GraphicUtils.getIcon(downloadedFile)); imageLabel.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { showPopup(e, downloadedFile); } public void mouseReleased(MouseEvent e) { showPopup(e, downloadedFile); } }); openFileButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { openFile(downloadedFile); } }); openFolderButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { try { Downloads downloads = Downloads.getInstance(); if (!Spark.isMac()) { try { Desktop.open(downloads.getDownloadDirectory()); } catch (DesktopException e) { Log.error(e); } } else if (Spark.isMac()) { Runtime.getRuntime().exec("open " + downloads.getDownloadDirectory().getCanonicalPath()); } } catch (IOException e1) { Log.error(e1); } } }); if (isImage(downloadedFile.getName())) { try { URL imageURL = downloadedFile.toURL(); ImageIcon image = new ImageIcon(imageURL); image = GraphicUtils.scaleImageIcon(image, 64, 64); imageLabel.setIcon(image); } catch (MalformedURLException e) { Log.error("Could not locate image.", e); imageLabel.setIcon(SparkRes.getImageIcon(SparkRes.DOCUMENT_INFO_32x32)); } } invalidate(); validate(); repaint(); }
|
private void transferDone(final FileTransferRequest request, FileTransfer transfer) { cancelButton.setVisible(false); showAlert(true); String bareJID = StringUtils.parseBareAddress(request.getRequestor()); ContactList contactList = SparkManager.getWorkspace().getContactList(); ContactItem contactItem = contactList.getContactItemByJID(bareJID); titleLabel.setText(Res.getString("message.received.file", contactItem.getNickname())); fileLabel.setText(request.getFileName()); remove(acceptLabel); remove(declineLabel); remove(progressBar); final TransferButton openFileButton = new TransferButton(); final TransferButton openFolderButton = new TransferButton(); add(openFileButton, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0)); add(openFolderButton, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0)); Downloads downloads = Downloads.getInstance(); final File downloadedFile = new File(downloads.getDownloadDirectory(), request.getFileName()); openFileButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { openFileButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { openFileButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); openFolderButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { openFolderButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { openFolderButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); add(fileLabel, new GridBagConstraints(1, 1, 2, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); ResourceUtils.resButton(openFileButton, Res.getString("open")); ResourceUtils.resButton(openFolderButton, Res.getString("open.folder")); openFileButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); openFileButton.setForeground(new Color(73, 113, 196)); openFileButton.setFont(new Font("Dialog", Font.BOLD, 11)); openFolderButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); openFolderButton.setForeground(new Color(73, 113, 196)); openFolderButton.setFont(new Font("Dialog", Font.BOLD, 10)); imageLabel.setIcon(GraphicUtils.getIcon(downloadedFile)); imageLabel.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { showPopup(e, downloadedFile); } public void mouseReleased(MouseEvent e) { showPopup(e, downloadedFile); } }); openFileButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { openFile(downloadedFile); } }); openFolderButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { try { Downloads downloads = Downloads.getInstance(); if (!Spark.isMac()) { try { Desktop.open(downloads.getDownloadDirectory()); } catch (DesktopException e) { Log.error(e); } } else if (Spark.isMac()) { Runtime.getRuntime().exec("open " + downloads.getDownloadDirectory().getCanonicalPath()); } } catch (IOException e1) { Log.error(e1); } } }); if (isImage(downloadedFile.getName())) { try { URL imageURL = downloadedFile.toURL(); ImageIcon image = new ImageIcon(imageURL); image = GraphicUtils.scaleImageIcon(image, 64, 64); imageLabel.setIcon(image); } catch (MalformedURLException e) { Log.error("Could not locate image.", e); imageLabel.setIcon(SparkRes.getImageIcon(SparkRes.DOCUMENT_INFO_32x32)); } } invalidate(); validate(); repaint(); }
| 1,123,931
|
private void transferDone(final FileTransferRequest request, FileTransfer transfer) { cancelButton.setVisible(false); showAlert(true); String bareJID = StringUtils.parseBareAddress(request.getRequestor()); ContactList contactList = SparkManager.getWorkspace().getContactList(); ContactItem contactItem = contactList.getContactItemByJID(bareJID); titleLabel.setText(Res.getString("message.received.file", contactItem.getNickname())); fileLabel.setText(request.getFileName()); remove(acceptLabel); remove(declineLabel); remove(progressBar); final TransferButton openFileButton = new TransferButton(); final TransferButton openFolderButton = new TransferButton(); add(openFileButton, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0)); add(openFolderButton, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0)); Downloads downloads = Downloads.getInstance(); final File downloadedFile = new File(downloads.getDownloadDirectory(), request.getFileName()); openFileButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { openFileButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { openFileButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); openFolderButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { openFolderButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { openFolderButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); add(fileLabel, new GridBagConstraints(1, 1, 2, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); ResourceUtils.resButton(openFileButton, Res.getString("open")); ResourceUtils.resButton(openFolderButton, Res.getString("open.folder")); openFileButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); openFileButton.setForeground(new Color(73, 113, 196)); openFileButton.setFont(new Font("Dialog", Font.BOLD, 10)); openFolderButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); openFolderButton.setForeground(new Color(73, 113, 196)); openFolderButton.setFont(new Font("Dialog", Font.BOLD, 10)); imageLabel.setIcon(GraphicUtils.getIcon(downloadedFile)); imageLabel.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { showPopup(e, downloadedFile); } public void mouseReleased(MouseEvent e) { showPopup(e, downloadedFile); } }); openFileButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { openFile(downloadedFile); } }); openFolderButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { try { Downloads downloads = Downloads.getInstance(); if (!Spark.isMac()) { try { Desktop.open(downloads.getDownloadDirectory()); } catch (DesktopException e) { Log.error(e); } } else if (Spark.isMac()) { Runtime.getRuntime().exec("open " + downloads.getDownloadDirectory().getCanonicalPath()); } } catch (IOException e1) { Log.error(e1); } } }); if (isImage(downloadedFile.getName())) { try { URL imageURL = downloadedFile.toURL(); ImageIcon image = new ImageIcon(imageURL); image = GraphicUtils.scaleImageIcon(image, 64, 64); imageLabel.setIcon(image); } catch (MalformedURLException e) { Log.error("Could not locate image.", e); imageLabel.setIcon(SparkRes.getImageIcon(SparkRes.DOCUMENT_INFO_32x32)); } } invalidate(); validate(); repaint(); }
|
private void transferDone(final FileTransferRequest request, FileTransfer transfer) { cancelButton.setVisible(false); showAlert(true); String bareJID = StringUtils.parseBareAddress(request.getRequestor()); ContactList contactList = SparkManager.getWorkspace().getContactList(); ContactItem contactItem = contactList.getContactItemByJID(bareJID); titleLabel.setText(Res.getString("message.received.file", contactItem.getNickname())); fileLabel.setText(request.getFileName()); remove(acceptLabel); remove(declineLabel); remove(progressBar); final TransferButton openFileButton = new TransferButton(); final TransferButton openFolderButton = new TransferButton(); add(openFileButton, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0)); add(openFolderButton, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0)); Downloads downloads = Downloads.getInstance(); final File downloadedFile = new File(downloads.getDownloadDirectory(), request.getFileName()); openFileButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { openFileButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { openFileButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); openFolderButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { openFolderButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { openFolderButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); add(fileLabel, new GridBagConstraints(1, 1, 2, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); ResourceUtils.resButton(openFileButton, Res.getString("open")); ResourceUtils.resButton(openFolderButton, Res.getString("open.folder")); openFileButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); openFileButton.setForeground(new Color(73, 113, 196)); openFileButton.setFont(new Font("Dialog", Font.BOLD, 10)); openFolderButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); openFolderButton.setForeground(new Color(73, 113, 196)); openFolderButton.setFont(new Font("Dialog", Font.BOLD, 11)); imageLabel.setIcon(GraphicUtils.getIcon(downloadedFile)); imageLabel.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { showPopup(e, downloadedFile); } public void mouseReleased(MouseEvent e) { showPopup(e, downloadedFile); } }); openFileButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { openFile(downloadedFile); } }); openFolderButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { try { Downloads downloads = Downloads.getInstance(); if (!Spark.isMac()) { try { Desktop.open(downloads.getDownloadDirectory()); } catch (DesktopException e) { Log.error(e); } } else if (Spark.isMac()) { Runtime.getRuntime().exec("open " + downloads.getDownloadDirectory().getCanonicalPath()); } } catch (IOException e1) { Log.error(e1); } } }); if (isImage(downloadedFile.getName())) { try { URL imageURL = downloadedFile.toURL(); ImageIcon image = new ImageIcon(imageURL); image = GraphicUtils.scaleImageIcon(image, 64, 64); imageLabel.setIcon(image); } catch (MalformedURLException e) { Log.error("Could not locate image.", e); imageLabel.setIcon(SparkRes.getImageIcon(SparkRes.DOCUMENT_INFO_32x32)); } } invalidate(); validate(); repaint(); }
| 1,123,932
|
public static void autoJoinConferenceRoom(final String roomName, String roomJID, String password) { ChatManager chatManager = SparkManager.getChatManager(); final MultiUserChat groupChat = new MultiUserChat(SparkManager.getConnection(), roomJID); ChatPreferences chatPref = (ChatPreferences)SparkManager.getPreferenceManager().getPreferenceData(ChatPreference.NAMESPACE); final String nickname = chatPref.getNickname().trim(); try { GroupChatRoom chatRoom = (GroupChatRoom)chatManager.getChatContainer().getChatRoom(roomJID); MultiUserChat muc = chatRoom.getMultiUserChat(); if (!muc.isJoined()) { joinRoom(muc, nickname, password); } chatManager.getChatContainer().activateChatRoom(chatRoom); return; } catch (ChatRoomNotFoundException e) { } final GroupChatRoom room = new GroupChatRoom(groupChat); room.setTabTitle(roomName); if (requiresPassword(roomJID) && password == null) { password = JOptionPane.showInputDialog(null, "Enter Room Password", "Need Password", JOptionPane.QUESTION_MESSAGE); if (!ModelUtil.hasLength(password)) { return; } } final List errors = new ArrayList(); final String userPassword = password; final SwingWorker startChat = new SwingWorker() { public Object construct() { if (!groupChat.isJoined()) { int groupChatCounter = 0; while (true) { groupChatCounter++; String joinName = nickname; if (groupChatCounter > 1) { joinName = joinName + groupChatCounter; } if (groupChatCounter < 10) { try { if (ModelUtil.hasLength(userPassword)) { groupChat.join(joinName, userPassword); } else { groupChat.join(joinName); } break; } catch (XMPPException ex) { int code = 0; if (ex.getXMPPError() != null) { code = ex.getXMPPError().getCode(); } if (code == 0) { errors.add("No response from server."); } else if (code == 401) { errors.add("The password did not match the room's password."); } else if (code == 403) { errors.add("You have been banned from this room."); } else if (code == 404) { errors.add("The room you are trying to enter does not exist."); } else if (code == 407) { errors.add("You are not a member of this room.\nThis room requires you to be a member to join."); } else if (code != 409) { break; } } } else { break; } } } return "ok"; } public void finished() { if (errors.size() > 0) { String error = (String)errors.get(0); JOptionPane.showMessageDialog(SparkManager.getMainWindow(), error, "Unable to join the room at this time.", JOptionPane.ERROR_MESSAGE); return; } else if (groupChat.isJoined()) { ChatManager chatManager = SparkManager.getChatManager(); chatManager.getChatContainer().addChatRoom(room); chatManager.getChatContainer().activateChatRoom(room); } else { JOptionPane.showMessageDialog(SparkManager.getMainWindow(), "Unable to join the room.", "Error", JOptionPane.ERROR_MESSAGE); return; } } }; startChat.start(); }
|
public static void autoJoinConferenceRoom(final String roomName, String roomJID, String password) { ChatManager chatManager = SparkManager.getChatManager(); final MultiUserChat groupChat = new MultiUserChat(SparkManager.getConnection(), roomJID); ChatPreferences chatPref = (ChatPreferences)SparkManager.getPreferenceManager().getPreferenceData(ChatPreference.NAMESPACE); final String nickname = chatPref.getNickname().trim(); try { GroupChatRoom chatRoom = (GroupChatRoom)chatManager.getChatContainer().getChatRoom(roomJID); MultiUserChat muc = chatRoom.getMultiUserChat(); if (!muc.isJoined()) { joinRoom(muc, nickname, password); } chatManager.getChatContainer().activateChatRoom(chatRoom); return; } catch (ChatRoomNotFoundException e) { } final GroupChatRoom room = new GroupChatRoom(groupChat); room.setTabTitle(roomName); if (requiresPassword(roomJID) && password == null) { password = JOptionPane.showInputDialog(null, "Enter Room Password", "Need Password", JOptionPane.QUESTION_MESSAGE); if (!ModelUtil.hasLength(password)) { return; } } final List errors = new ArrayList(); final String userPassword = password; final SwingWorker startChat = new SwingWorker() { public Object construct() { if (!groupChat.isJoined()) { int groupChatCounter = 0; while (true) { groupChatCounter++; String joinName = nickname; if (groupChatCounter > 1) { joinName = joinName + groupChatCounter; } if (groupChatCounter < 10) { try { if (ModelUtil.hasLength(userPassword)) { groupChat.join(joinName, userPassword); } else { groupChat.join(joinName); } break; } catch (XMPPException ex) { int code = 0; if (ex.getXMPPError() != null) { code = ex.getXMPPError().getCode(); } if (code == 0) { errors.add("No response from server."); } else if (code == 401) { errors.add("The password did not match the room's password."); } else if (code == 403) { errors.add("You have been banned from this room."); } else if (code == 404) { errors.add("The room you are trying to enter does not exist."); } else if (code == 407) { errors.add("You are not a member of this room.\nThis room requires you to be a member to join."); } else if (code != 409) { break; } } } else { break; } } } return "ok"; } public void finished() { if (errors.size() > 0) { String error = (String)errors.get(0); JOptionPane.showMessageDialog(SparkManager.getMainWindow(), error, "Unable to join the room at this time.", JOptionPane.ERROR_MESSAGE); return; } else if (groupChat.isJoined()) { ChatManager chatManager = SparkManager.getChatManager(); chatManager.getChatContainer().addChatRoom(room); chatManager.getChatContainer().activateChatRoom(room); } else { JOptionPane.showMessageDialog(SparkManager.getMainWindow(), "Unable to join the room.", "Error", JOptionPane.ERROR_MESSAGE); return; } } }; startChat.start(); }
| 1,123,933
|
public static void createPrivateConference(String serviceName, String message, String roomName, Collection jids) { final MultiUserChat chatRoom = new MultiUserChat(SparkManager.getConnection(), roomName + "@" + serviceName); final GroupChatRoom room = new GroupChatRoom(chatRoom); try { ChatPreferences chatPref = (ChatPreferences)SparkManager.getPreferenceManager().getPreferenceData(ChatPreference.NAMESPACE); chatRoom.create(chatPref.getNickname()); // Since this is a private room, make the room not public and set user as owner of the room. Form submitForm = chatRoom.getConfigurationForm().createAnswerForm(); submitForm.setAnswer("muc#roomconfig_publicroom", false); submitForm.setAnswer("muc#roomconfig_roomname", roomName); List owners = new ArrayList(); owners.add(SparkManager.getSessionManager().getBareAddress()); submitForm.setAnswer("muc#roomconfig_roomowners", owners); chatRoom.sendConfigurationForm(submitForm); } catch (XMPPException e1) { Log.error("Unable to send conference room chat configuration form.", e1); } ChatManager chatManager = SparkManager.getChatManager(); // Check if room already is open try { chatManager.getChatContainer().getChatRoom(room.getRoomname()); } catch (ChatRoomNotFoundException e) { chatManager.getChatContainer().addChatRoom(room); chatManager.getChatContainer().activateChatRoom(room); } final Iterator jidsToInvite = jids.iterator(); while (jidsToInvite.hasNext()) { String jid = (String)jidsToInvite.next(); chatRoom.invite(jid, message); room.getTranscriptWindow().insertNotificationMessage("Waiting for " + jid + " to join."); } }
|
public static void createPrivateConference(String serviceName, String message, String roomName, Collection jids) { final MultiUserChat chatRoom = new MultiUserChat(SparkManager.getConnection(), roomName + "@" + serviceName); final GroupChatRoom room = new GroupChatRoom(chatRoom); try { ChatPreferences chatPref = (ChatPreferences)SparkManager.getPreferenceManager().getPreferenceData(ChatPreference.NAMESPACE); chatRoom.create(chatPref.getNickname()); // Since this is a private room, make the room not public and set user as owner of the room. Form submitForm = chatRoom.getConfigurationForm().createAnswerForm(); submitForm.setAnswer("muc#roomconfig_publicroom", false); submitForm.setAnswer("muc#roomconfig_roomname", roomName); List owners = new ArrayList(); owners.add(SparkManager.getSessionManager().getBareAddress()); submitForm.setAnswer("muc#roomconfig_roomowners", owners); chatRoom.sendConfigurationForm(submitForm); } catch (XMPPException e1) { Log.error("Unable to send conference room chat configuration form.", e1); } ChatManager chatManager = SparkManager.getChatManager(); // Check if room already is open try { chatManager.getChatContainer().getChatRoom(room.getRoomname()); } catch (ChatRoomNotFoundException e) { chatManager.getChatContainer().addChatRoom(room); chatManager.getChatContainer().activateChatRoom(room); } final Iterator jidsToInvite = jids.iterator(); while (jidsToInvite.hasNext()) { String jid = (String)jidsToInvite.next(); chatRoom.invite(jid, message); room.getTranscriptWindow().insertNotificationMessage("Waiting for " + jid + " to join."); } }
| 1,123,934
|
public static GroupChatRoom enterRoomOnSameThread(final String roomName, String roomJID, String password) { ChatManager chatManager = SparkManager.getChatManager(); final MultiUserChat groupChat = new MultiUserChat(SparkManager.getConnection(), roomJID); ChatPreferences chatPref = (ChatPreferences)SparkManager.getPreferenceManager().getPreferenceData(ChatPreference.NAMESPACE); final String nickname = chatPref.getNickname().trim(); try { GroupChatRoom chatRoom = (GroupChatRoom)chatManager.getChatContainer().getChatRoom(roomJID); MultiUserChat muc = chatRoom.getMultiUserChat(); if (!muc.isJoined()) { joinRoom(muc, nickname, password); } chatManager.getChatContainer().activateChatRoom(chatRoom); return chatRoom; } catch (ChatRoomNotFoundException e) { } final GroupChatRoom room = new GroupChatRoom(groupChat); room.setTabTitle(roomName); if (requiresPassword(roomJID) && password == null) { password = JOptionPane.showInputDialog(null, "Enter Room Password", "Need Password", JOptionPane.QUESTION_MESSAGE); if (!ModelUtil.hasLength(password)) { return null; } } final List errors = new ArrayList(); final String userPassword = password; if (!groupChat.isJoined()) { int groupChatCounter = 0; while (true) { groupChatCounter++; String joinName = nickname; if (groupChatCounter > 1) { joinName = joinName + groupChatCounter; } if (groupChatCounter < 10) { try { if (ModelUtil.hasLength(userPassword)) { groupChat.join(joinName, userPassword); } else { groupChat.join(joinName); } break; } catch (XMPPException ex) { int code = 0; if (ex.getXMPPError() != null) { code = ex.getXMPPError().getCode(); } if (code == 0) { errors.add("No response from server."); } else if (code == 401) { errors.add("The password did not match the room's password."); } else if (code == 403) { errors.add("You have been banned from this room."); } else if (code == 404) { errors.add("The room you are trying to enter does not exist."); } else if (code == 407) { errors.add("You are not a member of this room.\nThis room requires you to be a member to join."); } else if (code != 409) { break; } } } else { break; } } } if (errors.size() > 0) { String error = (String)errors.get(0); JOptionPane.showMessageDialog(SparkManager.getMainWindow(), error, "Unable to join the room at this time.", JOptionPane.ERROR_MESSAGE); return null; } else if (groupChat.isJoined()) { chatManager.getChatContainer().addChatRoom(room); chatManager.getChatContainer().activateChatRoom(room); } else { JOptionPane.showMessageDialog(SparkManager.getMainWindow(), "Unable to join the room.", "Error", JOptionPane.ERROR_MESSAGE); return null; } return room; }
|
public static GroupChatRoom enterRoomOnSameThread(final String roomName, String roomJID, String password) { ChatManager chatManager = SparkManager.getChatManager(); final MultiUserChat groupChat = new MultiUserChat(SparkManager.getConnection(), roomJID); ChatPreferences chatPref = (ChatPreferences)SparkManager.getPreferenceManager().getPreferenceData(ChatPreference.NAMESPACE); final String nickname = chatPref.getNickname().trim(); try { GroupChatRoom chatRoom = (GroupChatRoom)chatManager.getChatContainer().getChatRoom(roomJID); MultiUserChat muc = chatRoom.getMultiUserChat(); if (!muc.isJoined()) { joinRoom(muc, nickname, password); } chatManager.getChatContainer().activateChatRoom(chatRoom); return chatRoom; } catch (ChatRoomNotFoundException e) { } final GroupChatRoom room = new GroupChatRoom(groupChat); room.setTabTitle(roomName); if (requiresPassword(roomJID) && password == null) { password = JOptionPane.showInputDialog(null, "Enter Room Password", "Need Password", JOptionPane.QUESTION_MESSAGE); if (!ModelUtil.hasLength(password)) { return null; } } final List errors = new ArrayList(); final String userPassword = password; if (!groupChat.isJoined()) { int groupChatCounter = 0; while (true) { groupChatCounter++; String joinName = nickname; if (groupChatCounter > 1) { joinName = joinName + groupChatCounter; } if (groupChatCounter < 10) { try { if (ModelUtil.hasLength(userPassword)) { groupChat.join(joinName, userPassword); } else { groupChat.join(joinName); } break; } catch (XMPPException ex) { int code = 0; if (ex.getXMPPError() != null) { code = ex.getXMPPError().getCode(); } if (code == 0) { errors.add("No response from server."); } else if (code == 401) { errors.add("The password did not match the room's password."); } else if (code == 403) { errors.add("You have been banned from this room."); } else if (code == 404) { errors.add("The room you are trying to enter does not exist."); } else if (code == 407) { errors.add("You are not a member of this room.\nThis room requires you to be a member to join."); } else if (code != 409) { break; } } } else { break; } } } if (errors.size() > 0) { String error = (String)errors.get(0); JOptionPane.showMessageDialog(SparkManager.getMainWindow(), error, "Unable to join the room at this time.", JOptionPane.ERROR_MESSAGE); return null; } else if (groupChat.isJoined()) { chatManager.getChatContainer().addChatRoom(room); chatManager.getChatContainer().activateChatRoom(room); } else { JOptionPane.showMessageDialog(SparkManager.getMainWindow(), "Unable to join the room.", "Error", JOptionPane.ERROR_MESSAGE); return null; } return room; }
| 1,123,935
|
public void joinRoom(final String roomJID, final String roomName) { final ChatPreferences pref = (ChatPreferences)SparkManager.getPreferenceManager().getPreferenceData(ChatPreference.NAMESPACE); // Set default nickname nicknameField.setText(pref.getNickname()); // Enable password field if a password is required passwordField.setVisible(false); passwordLabel.setVisible(false); roomNameDescription.setText(roomName); final JOptionPane pane; TitlePanel titlePanel; // Create the title panel for this dialog titlePanel = new TitlePanel("Join Conference Room", "Specify information for conference room.", SparkRes.getImageIcon(SparkRes.BLANK_IMAGE), true); // Construct main panel w/ layout. final JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout()); mainPanel.add(titlePanel, BorderLayout.NORTH); // The user should only be able to close this dialog. Object[] options = {"Join", "Cancel"}; pane = new JOptionPane(this, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, options, options[0]); mainPanel.add(pane, BorderLayout.CENTER); final JOptionPane p = new JOptionPane(); final JDialog dlg = p.createDialog(SparkManager.getMainWindow(), "Conference Rooms"); dlg.setModal(false); dlg.pack(); dlg.setSize(350, 250); dlg.setResizable(true); dlg.setContentPane(mainPanel); dlg.setLocationRelativeTo(SparkManager.getMainWindow()); PropertyChangeListener changeListener = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { String value = (String)pane.getValue(); if ("Cancel".equals(value)) { pane.setValue(JOptionPane.UNINITIALIZED_VALUE); dlg.dispose(); } else if ("Join".equals(value)) { pane.setValue(JOptionPane.UNINITIALIZED_VALUE); dlg.dispose(); ConferenceUtils.autoJoinConferenceRoom(roomName, roomJID, null); } } }; pane.addPropertyChangeListener(changeListener); dlg.setVisible(true); dlg.toFront(); dlg.requestFocus(); SwingWorker worker = new SwingWorker() { boolean requiresPassword; public Object construct() { requiresPassword = ConferenceUtils.requiresPassword(roomJID); return new Boolean(requiresPassword); } public void finished() { passwordField.setVisible(requiresPassword); passwordLabel.setVisible(requiresPassword); } }; worker.start(); }
|
public void joinRoom(final String roomJID, final String roomName) { final LocalPreferences pref = SettingsManager.getLocalPreferences(); // Set default nickname nicknameField.setText(pref.getNickname()); // Enable password field if a password is required passwordField.setVisible(false); passwordLabel.setVisible(false); roomNameDescription.setText(roomName); final JOptionPane pane; TitlePanel titlePanel; // Create the title panel for this dialog titlePanel = new TitlePanel("Join Conference Room", "Specify information for conference room.", SparkRes.getImageIcon(SparkRes.BLANK_IMAGE), true); // Construct main panel w/ layout. final JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout()); mainPanel.add(titlePanel, BorderLayout.NORTH); // The user should only be able to close this dialog. Object[] options = {"Join", "Cancel"}; pane = new JOptionPane(this, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, options, options[0]); mainPanel.add(pane, BorderLayout.CENTER); final JOptionPane p = new JOptionPane(); final JDialog dlg = p.createDialog(SparkManager.getMainWindow(), "Conference Rooms"); dlg.setModal(false); dlg.pack(); dlg.setSize(350, 250); dlg.setResizable(true); dlg.setContentPane(mainPanel); dlg.setLocationRelativeTo(SparkManager.getMainWindow()); PropertyChangeListener changeListener = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { String value = (String)pane.getValue(); if ("Cancel".equals(value)) { pane.setValue(JOptionPane.UNINITIALIZED_VALUE); dlg.dispose(); } else if ("Join".equals(value)) { pane.setValue(JOptionPane.UNINITIALIZED_VALUE); dlg.dispose(); ConferenceUtils.autoJoinConferenceRoom(roomName, roomJID, null); } } }; pane.addPropertyChangeListener(changeListener); dlg.setVisible(true); dlg.toFront(); dlg.requestFocus(); SwingWorker worker = new SwingWorker() { boolean requiresPassword; public Object construct() { requiresPassword = ConferenceUtils.requiresPassword(roomJID); return new Boolean(requiresPassword); } public void finished() { passwordField.setVisible(requiresPassword); passwordLabel.setVisible(requiresPassword); } }; worker.start(); }
| 1,123,936
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
| 1,123,937
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
| 1,123,938
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
| 1,123,939
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
| 1,123,940
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
| 1,123,941
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
| 1,123,942
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
| 1,123,943
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
| 1,123,944
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
| 1,123,945
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
| 1,123,946
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
| 1,123,947
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
| 1,123,948
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
| 1,123,949
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
| 1,123,950
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
|
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
| 1,123,951
|
public boolean setProperty (Context context, Object instance, Object[] names, Object value, int pos) throws PropertyException, NoSuchMethodException { // names[pos] is what we could set from here int parentPos = names.length - 1; int binPos = parentPos - 1; // if we're not yet at the binary-settable parent, go there if (pos < binPos) { Object grandparent = getProperty(context, instance, names, pos, binPos - 1); PropertyOperator po = _cache.getOperator(grandparent); return po.setProperty(context, grandparent, names, value, binPos); } // if we're at the binary-settable parent, try direct first if (pos == binPos) { // try direct -- move to direct parent and try from there Object parent = null; try { parent = getProperty(context, instance, names, pos, pos); if (parent != null) { PropertyOperator po = _cache.getOperator(parent); if (po.setProperty(context, parent, names, value, pos + 1)) { return true; } } } catch (NoSuchMethodException e) { // oh well, keep trying: XXX this makes binOp expensive } // if direct failed, try binary Accessor binOp = (Accessor) _binaryAccessors.get(names[pos]); if (binOp != null) { try { return binOp.set(instance, (String) names[pos + 1], value); } catch (ClassCastException e) { // names[pos+1] was not a string, just move on return false; } catch (NoSuchMethodException e) { return false; } } return false; } // we're the direct parent, use unaryOp or hash method Accessor unaryOp = (Accessor) _unaryAccessors.get(names[pos]); try { if ((unaryOp != null) && unaryOp.set(instance, value)) { return true; } if (_hashAccessor != null) { return _hashAccessor.set(instance, (String) names[pos], value); } } catch (NoSuchMethodException e) { // fall through } catch (ClassCastException e) { // names[pos] was not a string, fall through } return false; }
|
public boolean setProperty (Context context, Object instance, Object[] names, Object value, int pos) throws PropertyException, NoSuchMethodException { // names[pos] is what we could set from here int parentPos = names.length - 1; int binPos = parentPos - 1; // if we're not yet at the binary-settable parent, go there if (pos < binPos) { Object grandparent = getProperty(context, instance, names, pos, binPos - 1); PropertyOperator po = _cache.getOperator(grandparent); return po.setProperty(context, grandparent, names, value, binPos); } // if we're at the binary-settable parent, try direct first if (pos == binPos) { // try direct -- move to direct parent and try from there Object parent = null; try { parent = getProperty(context, instance, names, pos, pos); if (parent != null) { PropertyOperator po = _cache.getOperator(parent); if (po.setProperty(context, parent, names, value, pos + 1)) { return true; } } } catch (NoSuchMethodException e) { // oh well, keep trying: XXX this makes binOp expensive } // if direct failed, try binary Accessor binOp = (Accessor) _binaryAccessors.get(names[pos]); if (binOp != null) { try { return binOp.set(instance, (String) names[pos + 1], value); } catch (ClassCastException e) { // names[pos+1] was not a string, just move on return false; } catch (NoSuchMethodException e) { return false; } } return false; } // we're the direct parent, use unaryOp or hash method Accessor unaryOp = (Accessor) _unaryAccessors.get(names[pos]); try { if ((unaryOp != null) && unaryOp.set(instance, value)) { return true; } if (_hashAccessor != null) { return _hashAccessor.set(instance, (String) names[pos], value); } } catch (NoSuchMethodException e) { // fall through } catch (ClassCastException e) { // names[pos] was not a string, fall through } return false; }
| 1,123,952
|
public void mouseMoved(MouseEvent e) { if(e != null){ mouseEvent = e; } if(!canShowPopup){ return; } int loc = list.locationToIndex(e.getPoint()); Point point = list.indexToLocation(loc); ContactItem item = (ContactItem)model.getElementAt(loc); if (item == null || item.getFullJID() == null) { return; } if (activeItem != null && activeItem == item) { return; } activeItem = item; window.setVisible(false); window = new JWindow(); window.setFocusableWindowState(false); ContactInfo info = new ContactInfo(item); window.getContentPane().add(info); window.pack(); info.setBorder(BorderFactory.createEtchedBorder()); Point mainWindowLocation = SparkManager.getMainWindow().getLocationOnScreen(); Point listLocation = list.getLocationOnScreen(); int x = (int)mainWindowLocation.getX() + SparkManager.getMainWindow().getWidth(); final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); if ((int)screenSize.getWidth() - 250 >= x) { window.setLocation(x, (int)listLocation.getY() + (int)point.getY()); window.setVisible(true); } else { window.setLocation((int)mainWindowLocation.getX() - 250, (int)listLocation.getY() + (int)point.getY()); window.setVisible(true); } }
|
public void mouseMoved(MouseEvent e) { if(e != null){ mouseEvent = e; } if(!canShowPopup){ return; } int loc = list.locationToIndex(e.getPoint()); Point point = list.indexToLocation(loc); ContactItem item = (ContactItem)model.getElementAt(loc); if (item == null || item.getFullJID() == null) { return; } if (activeItem != null && activeItem == item) { return; } activeItem = item; window.dispose(); window = new JWindow(); window.setFocusableWindowState(false); ContactInfo info = new ContactInfo(item); window.getContentPane().add(info); window.pack(); info.setBorder(BorderFactory.createEtchedBorder()); Point mainWindowLocation = SparkManager.getMainWindow().getLocationOnScreen(); Point listLocation = list.getLocationOnScreen(); int x = (int)mainWindowLocation.getX() + SparkManager.getMainWindow().getWidth(); final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); if ((int)screenSize.getWidth() - 250 >= x) { window.setLocation(x, (int)listLocation.getY() + (int)point.getY()); window.setVisible(true); } else { window.setLocation((int)mainWindowLocation.getX() - 250, (int)listLocation.getY() + (int)point.getY()); window.setVisible(true); } }
| 1,123,953
|
public final Object evaluate(Context data) { try { ByteArrayOutputStream os = new ByteArrayOutputStream(512); FastWriter fw = new FastWriter(os, "UTF8"); write(fw,data); fw.flush(); return os.toString("UTF8"); } catch (IOException e) { _log.exception(e); _log.error("Template: Could not write to ByteArrayOutputStream!"); return null; } }
|
public final Object evaluate(Context data) { try { ByteArrayOutputStream os = new ByteArrayOutputStream(512); FastWriter fw = new FastWriter(os, data.getEncoding()); write(fw,data); fw.flush(); return os.toString("UTF8"); } catch (IOException e) { _log.exception(e); _log.error("Template: Could not write to ByteArrayOutputStream!"); return null; } }
| 1,123,956
|
public final Object evaluate(Context data) { try { ByteArrayOutputStream os = new ByteArrayOutputStream(512); FastWriter fw = new FastWriter(os, "UTF8"); write(fw,data); fw.flush(); return os.toString("UTF8"); } catch (IOException e) { _log.exception(e); _log.error("Template: Could not write to ByteArrayOutputStream!"); return null; } }
|
public final Object evaluate(Context data) { try { ByteArrayOutputStream os = new ByteArrayOutputStream(512); FastWriter fw = new FastWriter(os, "UTF8"); write(fw,data); fw.flush(); return os.toString(data.getEncoding()); } catch (IOException e) { _log.exception(e); _log.error("Template: Could not write to ByteArrayOutputStream!"); return null; } }
| 1,123,957
|
public static ProjectData getGlobalProjectData() { if (globalProjectData != null) return globalProjectData; initialize(); globalProjectData = new ProjectData(); return globalProjectData; }
|
public static ProjectData getGlobalProjectData() { if (globalProjectData != null) return globalProjectData; initialize(); return globalProjectData; }
| 1,123,958
|
public JContactItemField(List items, Window parentWindow) { setLayout(new BorderLayout()); this.items = items; add(textField, BorderLayout.CENTER); textField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { char ch = keyEvent.getKeyChar(); if (validateChar(ch)) { showPopupMenu(); } if (ch == KeyEvent.VK_ENTER) { int index = list.getSelectedIndex(); if (index >= 0) { ContactItem selection = (ContactItem)list.getSelectedValue(); textField.setText(selection.getNickname()); popup.setVisible(false); } } if (ch == KeyEvent.VK_ESCAPE) { popup.setVisible(false); } dispatchEvent(keyEvent); } public void keyPressed(KeyEvent e) { if (isArrowKey(e)) { list.dispatchEvent(e); } } }); list.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyCode() == KeyEvent.VK_ESCAPE) { textField.requestFocus(); } } }); popup = new JWindow(parentWindow); popup.getContentPane().add(new JScrollPane(list)); list.setCellRenderer(new PopupRenderer()); }
|
public JContactItemField(List items) { setLayout(new BorderLayout()); this.items = items; add(textField, BorderLayout.CENTER); textField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { char ch = keyEvent.getKeyChar(); if (validateChar(ch)) { showPopupMenu(); } if (ch == KeyEvent.VK_ENTER) { int index = list.getSelectedIndex(); if (index >= 0) { ContactItem selection = (ContactItem)list.getSelectedValue(); textField.setText(selection.getNickname()); popup.setVisible(false); } } if (ch == KeyEvent.VK_ESCAPE) { popup.setVisible(false); } dispatchEvent(keyEvent); } public void keyPressed(KeyEvent e) { if (isArrowKey(e)) { list.dispatchEvent(e); } } }); list.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyCode() == KeyEvent.VK_ESCAPE) { textField.requestFocus(); } } }); popup = new JWindow(parentWindow); popup.getContentPane().add(new JScrollPane(list)); list.setCellRenderer(new PopupRenderer()); }
| 1,123,960
|
public JContactItemField(List items, Window parentWindow) { setLayout(new BorderLayout()); this.items = items; add(textField, BorderLayout.CENTER); textField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { char ch = keyEvent.getKeyChar(); if (validateChar(ch)) { showPopupMenu(); } if (ch == KeyEvent.VK_ENTER) { int index = list.getSelectedIndex(); if (index >= 0) { ContactItem selection = (ContactItem)list.getSelectedValue(); textField.setText(selection.getNickname()); popup.setVisible(false); } } if (ch == KeyEvent.VK_ESCAPE) { popup.setVisible(false); } dispatchEvent(keyEvent); } public void keyPressed(KeyEvent e) { if (isArrowKey(e)) { list.dispatchEvent(e); } } }); list.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyCode() == KeyEvent.VK_ESCAPE) { textField.requestFocus(); } } }); popup = new JWindow(parentWindow); popup.getContentPane().add(new JScrollPane(list)); list.setCellRenderer(new PopupRenderer()); }
|
public JContactItemField(List items, Window parentWindow) { setLayout(new BorderLayout()); this.items = items; add(textField, BorderLayout.CENTER); textField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { char ch = keyEvent.getKeyChar(); if (validateChar(ch)) { showPopupMenu(); } if (ch == KeyEvent.VK_ENTER) { int index = list.getSelectedIndex(); if (index >= 0) { ContactItem selection = (ContactItem)list.getSelectedValue(); textField.setText(selection.getNickname()); popup.setVisible(false); } } if (ch == KeyEvent.VK_ESCAPE) { popup.setVisible(false); } dispatchEvent(keyEvent); } public void keyPressed(KeyEvent e) { if (isArrowKey(e)) { list.dispatchEvent(e); } } }); list.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyCode() == KeyEvent.VK_ESCAPE) { textField.requestFocus(); } } }); popup = new JWindow(parentWindow); popup.getContentPane().add(new JScrollPane(list)); list.setCellRenderer(new PopupRenderer()); }
| 1,123,961
|
final private boolean jj_3R_23() { Token xsp; xsp = jj_scanpos; if (jj_3R_44()) { jj_scanpos = xsp; if (jj_3R_45()) { jj_scanpos = xsp; if (jj_3R_46()) { jj_scanpos = xsp; if (jj_3R_47()) { jj_scanpos = xsp; if (jj_3R_48()) { jj_scanpos = xsp; if (jj_3R_49()) { jj_scanpos = xsp; if (jj_3R_50()) { jj_scanpos = xsp; if (jj_3R_51()) { jj_scanpos = xsp; if (jj_3R_52()) { jj_scanpos = xsp; if (jj_3R_53()) { jj_scanpos = xsp; if (jj_3R_54()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_23() { Token xsp; xsp = jj_scanpos; if (jj_3R_44()) { jj_scanpos = xsp; if (jj_3R_45()) { jj_scanpos = xsp; if (jj_3R_46()) { jj_scanpos = xsp; if (jj_3R_47()) { jj_scanpos = xsp; if (jj_3R_48()) { jj_scanpos = xsp; if (jj_3R_49()) { jj_scanpos = xsp; if (jj_3R_50()) { jj_scanpos = xsp; if (jj_3R_51()) { jj_scanpos = xsp; if (jj_3R_52()) { jj_scanpos = xsp; if (jj_3R_53()) { jj_scanpos = xsp; if (jj_3R_54()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,963
|
final private boolean jj_3R_23() { Token xsp; xsp = jj_scanpos; if (jj_3R_44()) { jj_scanpos = xsp; if (jj_3R_45()) { jj_scanpos = xsp; if (jj_3R_46()) { jj_scanpos = xsp; if (jj_3R_47()) { jj_scanpos = xsp; if (jj_3R_48()) { jj_scanpos = xsp; if (jj_3R_49()) { jj_scanpos = xsp; if (jj_3R_50()) { jj_scanpos = xsp; if (jj_3R_51()) { jj_scanpos = xsp; if (jj_3R_52()) { jj_scanpos = xsp; if (jj_3R_53()) { jj_scanpos = xsp; if (jj_3R_54()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_23() { Token xsp; xsp = jj_scanpos; if (jj_3R_44()) { jj_scanpos = xsp; if (jj_3R_45()) { jj_scanpos = xsp; if (jj_3R_46()) { jj_scanpos = xsp; if (jj_3R_47()) { jj_scanpos = xsp; if (jj_3R_48()) { jj_scanpos = xsp; if (jj_3R_49()) { jj_scanpos = xsp; if (jj_3R_50()) { jj_scanpos = xsp; if (jj_3R_51()) { jj_scanpos = xsp; if (jj_3R_52()) { jj_scanpos = xsp; if (jj_3R_53()) { jj_scanpos = xsp; if (jj_3R_54()) { jj_scanpos = xsp; if (jj_3R_55()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,964
|
final private boolean jj_3R_30() { Token xsp; xsp = jj_scanpos; if (jj_3R_55()) { jj_scanpos = xsp; if (jj_3R_56()) { jj_scanpos = xsp; if (jj_3R_57()) { jj_scanpos = xsp; if (jj_3R_58()) { jj_scanpos = xsp; if (jj_3R_59()) { jj_scanpos = xsp; if (jj_3R_60()) { jj_scanpos = xsp; if (jj_3R_61()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_30() { Token xsp; xsp = jj_scanpos; if (jj_3R_55()) { jj_scanpos = xsp; if (jj_3R_56()) { jj_scanpos = xsp; if (jj_3R_57()) { jj_scanpos = xsp; if (jj_3R_58()) { jj_scanpos = xsp; if (jj_3R_59()) { jj_scanpos = xsp; if (jj_3R_60()) { jj_scanpos = xsp; if (jj_3R_61()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,965
|
final private boolean jj_3R_30() { Token xsp; xsp = jj_scanpos; if (jj_3R_55()) { jj_scanpos = xsp; if (jj_3R_56()) { jj_scanpos = xsp; if (jj_3R_57()) { jj_scanpos = xsp; if (jj_3R_58()) { jj_scanpos = xsp; if (jj_3R_59()) { jj_scanpos = xsp; if (jj_3R_60()) { jj_scanpos = xsp; if (jj_3R_61()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_30() { Token xsp; xsp = jj_scanpos; if (jj_3R_55()) { jj_scanpos = xsp; if (jj_3R_56()) { jj_scanpos = xsp; if (jj_3R_57()) { jj_scanpos = xsp; if (jj_3R_58()) { jj_scanpos = xsp; if (jj_3R_59()) { jj_scanpos = xsp; if (jj_3R_60()) { jj_scanpos = xsp; if (jj_3R_61()) { jj_scanpos = xsp; if (jj_3R_62()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,966
|
final private boolean jj_3R_41() { if (jj_3R_62()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_41() { if (jj_3R_63()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,967
|
final private boolean jj_3R_42() { Token xsp; xsp = jj_scanpos; if (jj_3R_63()) { jj_scanpos = xsp; if (jj_3R_64()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_42() { Token xsp; xsp = jj_scanpos; if (jj_3R_63()) { jj_scanpos = xsp; if (jj_3R_64()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,968
|
final private boolean jj_3R_42() { Token xsp; xsp = jj_scanpos; if (jj_3R_63()) { jj_scanpos = xsp; if (jj_3R_64()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_42() { Token xsp; xsp = jj_scanpos; if (jj_3R_63()) { jj_scanpos = xsp; if (jj_3R_64()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,969
|
final private boolean jj_3R_45() { if (jj_scan_token(LPAREN)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_45() { if (jj_3R_67()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,971
|
final private boolean jj_3R_46() { if (jj_3R_67()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_46() { if (jj_scan_token(LPAREN)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,972
|
final private boolean jj_3R_48() { if (jj_scan_token(NULL)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_48() { if (jj_3R_69()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,973
|
final private boolean jj_3R_49() { if (jj_scan_token(TRUE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_49() { if (jj_scan_token(NULL)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,974
|
final private boolean jj_3R_50() { if (jj_scan_token(FALSE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_50() { if (jj_scan_token(TRUE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,975
|
final private boolean jj_3R_51() { if (jj_scan_token(UNDEFINED)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_51() { if (jj_scan_token(FALSE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,976
|
final private boolean jj_3R_52() { if (jj_scan_token(OP_NOT)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_52() { if (jj_scan_token(UNDEFINED)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,977
|
final private boolean jj_3R_53() { if (jj_scan_token(NUMBER)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_53() { if (jj_scan_token(OP_NOT)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,978
|
final private boolean jj_3R_54() { if (jj_scan_token(OP_MINUS)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_54() { if (jj_scan_token(NUMBER)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,979
|
final private boolean jj_3R_55() { if (jj_scan_token(OP_EQ)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_55() { if (jj_scan_token(OP_MINUS)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,980
|
final private boolean jj_3R_56() { if (jj_scan_token(OP_SET)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_56() { if (jj_scan_token(OP_EQ)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,981
|
final private boolean jj_3R_57() { if (jj_scan_token(OP_NE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_57() { if (jj_scan_token(OP_SET)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,982
|
final private boolean jj_3R_58() { if (jj_scan_token(OP_GT)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_58() { if (jj_scan_token(OP_NE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,983
|
final private boolean jj_3R_59() { if (jj_scan_token(OP_GE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_59() { if (jj_scan_token(OP_GT)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,984
|
final private boolean jj_3R_60() { if (jj_scan_token(OP_LE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_60() { if (jj_scan_token(OP_GE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,985
|
final private boolean jj_3R_61() { if (jj_scan_token(OP_LT)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_61() { if (jj_scan_token(OP_LE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,986
|
final private boolean jj_3R_62() { Token xsp; xsp = jj_scanpos; if (jj_3R_69()) { jj_scanpos = xsp; if (jj_3R_70()) { jj_scanpos = xsp; if (jj_3R_71()) { jj_scanpos = xsp; if (jj_3R_72()) { jj_scanpos = xsp; if (jj_3R_73()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_62() { Token xsp; xsp = jj_scanpos; if (jj_3R_69()) { jj_scanpos = xsp; if (jj_3R_70()) { jj_scanpos = xsp; if (jj_3R_71()) { jj_scanpos = xsp; if (jj_3R_72()) { jj_scanpos = xsp; if (jj_3R_73()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,987
|
final private boolean jj_3R_62() { Token xsp; xsp = jj_scanpos; if (jj_3R_69()) { jj_scanpos = xsp; if (jj_3R_70()) { jj_scanpos = xsp; if (jj_3R_71()) { jj_scanpos = xsp; if (jj_3R_72()) { jj_scanpos = xsp; if (jj_3R_73()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_62() { Token xsp; xsp = jj_scanpos; if (jj_3R_69()) { jj_scanpos = xsp; if (jj_3R_70()) { jj_scanpos = xsp; if (jj_3R_71()) { jj_scanpos = xsp; if (jj_3R_72()) { jj_scanpos = xsp; if (jj_3R_73()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,988
|
final private boolean jj_3R_63() { if (jj_scan_token(LBRACE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_63() { Token xsp; xsp = jj_scanpos; if (jj_3R_70()) { jj_scanpos = xsp; if (jj_3R_71()) { jj_scanpos = xsp; if (jj_3R_72()) { jj_scanpos = xsp; if (jj_3R_73()) { jj_scanpos = xsp; if (jj_3R_74()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,989
|
final private boolean jj_3R_64() { if (jj_scan_token(RBRACE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_64() { if (jj_scan_token(LBRACE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,991
|
final private boolean jj_3R_65() { if (jj_scan_token(POUND)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_65() { if (jj_scan_token(RBRACE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,992
|
final private boolean jj_3R_66() { if (jj_scan_token(DOLLAR)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_66() { if (jj_scan_token(POUND)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,993
|
final private boolean jj_3R_67() { Token xsp; xsp = jj_scanpos; if (jj_3R_74()) { jj_scanpos = xsp; if (jj_3R_75()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_67() { Token xsp; xsp = jj_scanpos; if (jj_3R_74()) { jj_scanpos = xsp; if (jj_3R_75()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,994
|
final private boolean jj_3R_67() { Token xsp; xsp = jj_scanpos; if (jj_3R_74()) { jj_scanpos = xsp; if (jj_3R_75()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_67() { Token xsp; xsp = jj_scanpos; if (jj_3R_74()) { jj_scanpos = xsp; if (jj_3R_75()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,995
|
final private boolean jj_3R_68() { if (jj_scan_token(LBRACKET)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_68() { Token xsp; xsp = jj_scanpos; if (jj_3R_75()) { jj_scanpos = xsp; if (jj_3R_76()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,996
|
final private boolean jj_3R_69() { if (jj_scan_token(STUFF)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_69() { if (jj_scan_token(LBRACKET)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,998
|
final private boolean jj_3R_70() { if (jj_scan_token(QCHAR)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_70() { if (jj_scan_token(STUFF)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,123,999
|
final private boolean jj_3R_71() { if (jj_scan_token(SLASH)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_71() { if (jj_scan_token(QCHAR)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,124,000
|
final private boolean jj_3R_72() { if (jj_3R_76()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_72() { if (jj_scan_token(SLASH)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,124,001
|
final private boolean jj_3R_74() { if (jj_scan_token(QUOTE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_74() { if (jj_3R_78()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,124,002
|
final private boolean jj_3R_75() { if (jj_scan_token(SQUOTE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_75() { if (jj_scan_token(QUOTE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,124,003
|
final private boolean jj_3R_76() { if (jj_scan_token(POUNDPOUND)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_76() { if (jj_scan_token(SQUOTE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,124,004
|
final private boolean jj_3R_77() { Token xsp; xsp = jj_scanpos; if (jj_3R_78()) { jj_scanpos = xsp; if (jj_3R_79()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_77() { Token xsp; xsp = jj_scanpos; if (jj_3R_78()) { jj_scanpos = xsp; if (jj_3R_79()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,124,005
|
final private boolean jj_3R_77() { Token xsp; xsp = jj_scanpos; if (jj_3R_78()) { jj_scanpos = xsp; if (jj_3R_79()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_77() { Token xsp; xsp = jj_scanpos; if (jj_3R_78()) { jj_scanpos = xsp; if (jj_3R_79()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,124,006
|
final private boolean jj_3R_78() { if (jj_3R_66()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_78() { Token xsp; xsp = jj_scanpos; if (jj_3R_79()) { jj_scanpos = xsp; if (jj_3R_80()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,124,007
|
final private boolean jj_3R_79() { if (jj_scan_token(DOLLAR)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3R_79() { if (jj_3R_67()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,124,009
|
final private boolean jj_3_21() { Token xsp; xsp = jj_scanpos; if (jj_3R_41()) { jj_scanpos = xsp; if (jj_3R_42()) { jj_scanpos = xsp; lookingAhead = true; jj_semLA = lookahead_not_breaking_subd(); lookingAhead = false; if (!jj_semLA || jj_3R_43()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
|
final private boolean jj_3_21() { Token xsp; xsp = jj_scanpos; if (jj_3R_41()) { jj_scanpos = xsp; if (jj_3R_42()) { jj_scanpos = xsp; lookingAhead = true; jj_semLA = lookahead_not_breaking_subd(); lookingAhead = false; if (!jj_semLA || jj_3R_44()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
| 1,124,010
|
private void handleRoomPresence(final Presence p) { final String roomname = StringUtils.parseBareAddress(p.getFrom()); ChatRoom chatRoom; try { chatRoom = getChatRoom(roomname); } catch (ChatRoomNotFoundException e1) { Log.error("Could not locate chat room.", e1); return; } final String userid = StringUtils.parseResource(p.getFrom()); if (p.getType() == Presence.Type.unavailable) { fireUserHasLeft(chatRoom, userid); } else if (p.getType() == Presence.Type.available) { fireUserHasJoined(chatRoom, userid); } // Change tab icon if (chatRoom instanceof ChatRoomImpl) { StatusItem statusItem = SparkManager.getWorkspace().getStatusBar().getItemFromPresence(p); Icon tabIcon = null; if (statusItem == null && p == null) { tabIcon = SparkRes.getImageIcon(SparkRes.CLEAR_BALL_ICON); } else if (statusItem == null && p != null && p.getType() == Presence.Type.available) { tabIcon = SparkRes.getImageIcon(SparkRes.GREEN_BALL); } else { String status = p.getStatus(); if (status != null && status.indexOf("phone") != -1) { tabIcon = SparkRes.getImageIcon(SparkRes.ON_PHONE_IMAGE); } else if (statusItem == null) { tabIcon = SparkRes.getImageIcon(SparkRes.CLEAR_BALL_ICON); } else { tabIcon = statusItem.getIcon(); } } Icon icon = SparkManager.getChatManager().getPresenceIconForContactHandler(p); if (icon != null) { tabIcon = icon; } int tabLoc = indexOfComponent(chatRoom); if (tabLoc != -1) { getTabAt(tabLoc).setIcon(tabIcon); } } }
|
private void handleRoomPresence(final Presence p) { final String roomname = StringUtils.parseBareAddress(p.getFrom()); ChatRoom chatRoom; try { chatRoom = getChatRoom(roomname); } catch (ChatRoomNotFoundException e1) { Log.debug("Could not locate chat room " + roomname); return; } final String userid = StringUtils.parseResource(p.getFrom()); if (p.getType() == Presence.Type.unavailable) { fireUserHasLeft(chatRoom, userid); } else if (p.getType() == Presence.Type.available) { fireUserHasJoined(chatRoom, userid); } // Change tab icon if (chatRoom instanceof ChatRoomImpl) { StatusItem statusItem = SparkManager.getWorkspace().getStatusBar().getItemFromPresence(p); Icon tabIcon = null; if (statusItem == null && p == null) { tabIcon = SparkRes.getImageIcon(SparkRes.CLEAR_BALL_ICON); } else if (statusItem == null && p != null && p.getType() == Presence.Type.available) { tabIcon = SparkRes.getImageIcon(SparkRes.GREEN_BALL); } else { String status = p.getStatus(); if (status != null && status.indexOf("phone") != -1) { tabIcon = SparkRes.getImageIcon(SparkRes.ON_PHONE_IMAGE); } else if (statusItem == null) { tabIcon = SparkRes.getImageIcon(SparkRes.CLEAR_BALL_ICON); } else { tabIcon = statusItem.getIcon(); } } Icon icon = SparkManager.getChatManager().getPresenceIconForContactHandler(p); if (icon != null) { tabIcon = icon; } int tabLoc = indexOfComponent(chatRoom); if (tabLoc != -1) { getTabAt(tabLoc).setIcon(tabIcon); } } }
| 1,124,012
|
private void parseArguments(String[] args) throws Exception { FileFinder finder = new FileFinder(); for (int i = 0; i < args.length; i++) { if (args[i].equals("--basedir")) { finder.addBaseDirectory(new File(args[++i])); } else if (args[i].equals("--datafile")) { setDataFile( args[++i]); } else if (args[i].equals("--destination")) { setDestination( args[++i]); } else if (args[i].equals("--format")) { setFormat( args[++i]); } else { finder.addSourceFilePath(args[i]); } } if (dataFile == null) dataFile = CoverageDataFileHandler.getDefaultDataFile(); if (destinationDir == null) { System.err.println("Error: destination directory must be set"); System.exit(1); } if (format == null) { System.err.println("Error: format must be set"); System.exit(1); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("format is " + format); LOGGER.debug("dataFile is " + dataFile.getAbsolutePath()); LOGGER.debug("destinationDir is " + destinationDir.getAbsolutePath()); } ProjectData projectData = CoverageDataFileHandler.loadCoverageData(dataFile); if (projectData == null) { System.err.println("Error: Unable to read from data file " + dataFile.getAbsolutePath()); System.exit(1); } if (format.equalsIgnoreCase("html")) { new HTMLReport(projectData, destinationDir, finder); } else if (format.equalsIgnoreCase("xml")) { new XMLReport(projectData, destinationDir, finder); } }
|
private void parseArguments(String[] args) throws Exception { FileFinder finder = new FileFinder(); for (int i = 0; i < args.length; i++) { if (args[i].equals("--basedir")) { baseDir = args[++i]; } else if (args[i].equals("--datafile")) { setDataFile( args[++i]); } else if (args[i].equals("--destination")) { setDestination( args[++i]); } else if (args[i].equals("--format")) { setFormat( args[++i]); } else { finder.addSourceFilePath(args[i]); } } if (dataFile == null) dataFile = CoverageDataFileHandler.getDefaultDataFile(); if (destinationDir == null) { System.err.println("Error: destination directory must be set"); System.exit(1); } if (format == null) { System.err.println("Error: format must be set"); System.exit(1); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("format is " + format); LOGGER.debug("dataFile is " + dataFile.getAbsolutePath()); LOGGER.debug("destinationDir is " + destinationDir.getAbsolutePath()); } ProjectData projectData = CoverageDataFileHandler.loadCoverageData(dataFile); if (projectData == null) { System.err.println("Error: Unable to read from data file " + dataFile.getAbsolutePath()); System.exit(1); } if (format.equalsIgnoreCase("html")) { new HTMLReport(projectData, destinationDir, finder); } else if (format.equalsIgnoreCase("xml")) { new XMLReport(projectData, destinationDir, finder); } }
| 1,124,013
|
private void parseArguments(String[] args) throws Exception { FileFinder finder = new FileFinder(); for (int i = 0; i < args.length; i++) { if (args[i].equals("--basedir")) { finder.addBaseDirectory(new File(args[++i])); } else if (args[i].equals("--datafile")) { setDataFile( args[++i]); } else if (args[i].equals("--destination")) { setDestination( args[++i]); } else if (args[i].equals("--format")) { setFormat( args[++i]); } else { finder.addSourceFilePath(args[i]); } } if (dataFile == null) dataFile = CoverageDataFileHandler.getDefaultDataFile(); if (destinationDir == null) { System.err.println("Error: destination directory must be set"); System.exit(1); } if (format == null) { System.err.println("Error: format must be set"); System.exit(1); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("format is " + format); LOGGER.debug("dataFile is " + dataFile.getAbsolutePath()); LOGGER.debug("destinationDir is " + destinationDir.getAbsolutePath()); } ProjectData projectData = CoverageDataFileHandler.loadCoverageData(dataFile); if (projectData == null) { System.err.println("Error: Unable to read from data file " + dataFile.getAbsolutePath()); System.exit(1); } if (format.equalsIgnoreCase("html")) { new HTMLReport(projectData, destinationDir, finder); } else if (format.equalsIgnoreCase("xml")) { new XMLReport(projectData, destinationDir, finder); } }
|
private void parseArguments(String[] args) throws Exception { FileFinder finder = new FileFinder(); for (int i = 0; i < args.length; i++) { if (args[i].equals("--basedir")) { finder.addBaseDirectory(new File(args[++i])); } else if (args[i].equals("--datafile")) { setDataFile( args[++i]); } else if (args[i].equals("--destination")) { setDestination( args[++i]); } else if (args[i].equals("--format")) { setFormat( args[++i]); } else { if( baseDir==null) { finder.addSourceDirectory( args[i]); } else { finder.addSourceFile( baseDir, args[i]); } } } if (dataFile == null) dataFile = CoverageDataFileHandler.getDefaultDataFile(); if (destinationDir == null) { System.err.println("Error: destination directory must be set"); System.exit(1); } if (format == null) { System.err.println("Error: format must be set"); System.exit(1); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("format is " + format); LOGGER.debug("dataFile is " + dataFile.getAbsolutePath()); LOGGER.debug("destinationDir is " + destinationDir.getAbsolutePath()); } ProjectData projectData = CoverageDataFileHandler.loadCoverageData(dataFile); if (projectData == null) { System.err.println("Error: Unable to read from data file " + dataFile.getAbsolutePath()); System.exit(1); } if (format.equalsIgnoreCase("html")) { new HTMLReport(projectData, destinationDir, finder); } else if (format.equalsIgnoreCase("xml")) { new XMLReport(projectData, destinationDir, finder); } }
| 1,124,014
|
private void parseArguments(String[] args) throws Exception { FileFinder finder = new FileFinder(); for (int i = 0; i < args.length; i++) { if (args[i].equals("--basedir")) { finder.addBaseDirectory(new File(args[++i])); } else if (args[i].equals("--datafile")) { setDataFile( args[++i]); } else if (args[i].equals("--destination")) { setDestination( args[++i]); } else if (args[i].equals("--format")) { setFormat( args[++i]); } else { finder.addSourceFilePath(args[i]); } } if (dataFile == null) dataFile = CoverageDataFileHandler.getDefaultDataFile(); if (destinationDir == null) { System.err.println("Error: destination directory must be set"); System.exit(1); } if (format == null) { System.err.println("Error: format must be set"); System.exit(1); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("format is " + format); LOGGER.debug("dataFile is " + dataFile.getAbsolutePath()); LOGGER.debug("destinationDir is " + destinationDir.getAbsolutePath()); } ProjectData projectData = CoverageDataFileHandler.loadCoverageData(dataFile); if (projectData == null) { System.err.println("Error: Unable to read from data file " + dataFile.getAbsolutePath()); System.exit(1); } if (format.equalsIgnoreCase("html")) { new HTMLReport(projectData, destinationDir, finder); } else if (format.equalsIgnoreCase("xml")) { new XMLReport(projectData, destinationDir, finder); } }
|
private void parseArguments(String[] args) throws Exception { FileFinder finder = new FileFinder(); for (int i = 0; i < args.length; i++) { if (args[i].equals("--basedir")) { finder.addBaseDirectory(new File(args[++i])); } else if (args[i].equals("--datafile")) { setDataFile( args[++i]); } else if (args[i].equals("--destination")) { setDestination( args[++i]); } else if (args[i].equals("--format")) { setFormat( args[++i]); } else { finder.addSourceFilePath(args[i]); } } if (dataFile == null) dataFile = CoverageDataFileHandler.getDefaultDataFile(); if (destinationDir == null) { System.err.println("Error: destination directory must be set"); System.exit(1); } if (format == null) { System.err.println("Error: format must be set"); System.exit(1); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("format is " + format); LOGGER.debug("dataFile is " + dataFile.getAbsolutePath()); LOGGER.debug("destinationDir is " + destinationDir.getAbsolutePath()); } ProjectData projectData = CoverageDataFileHandler.loadCoverageData(dataFile); if (projectData == null) { System.err.println("Error: Unable to read from data file " + dataFile.getAbsolutePath()); System.exit(1); } if (format.equalsIgnoreCase("html")) { new HTMLReport(projectData, destinationDir, finder, complexity); } else if (format.equalsIgnoreCase("xml")) { new XMLReport(projectData, destinationDir, finder); } }
| 1,124,015
|
private void parseArguments(String[] args) throws Exception { FileFinder finder = new FileFinder(); for (int i = 0; i < args.length; i++) { if (args[i].equals("--basedir")) { finder.addBaseDirectory(new File(args[++i])); } else if (args[i].equals("--datafile")) { setDataFile( args[++i]); } else if (args[i].equals("--destination")) { setDestination( args[++i]); } else if (args[i].equals("--format")) { setFormat( args[++i]); } else { finder.addSourceFilePath(args[i]); } } if (dataFile == null) dataFile = CoverageDataFileHandler.getDefaultDataFile(); if (destinationDir == null) { System.err.println("Error: destination directory must be set"); System.exit(1); } if (format == null) { System.err.println("Error: format must be set"); System.exit(1); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("format is " + format); LOGGER.debug("dataFile is " + dataFile.getAbsolutePath()); LOGGER.debug("destinationDir is " + destinationDir.getAbsolutePath()); } ProjectData projectData = CoverageDataFileHandler.loadCoverageData(dataFile); if (projectData == null) { System.err.println("Error: Unable to read from data file " + dataFile.getAbsolutePath()); System.exit(1); } if (format.equalsIgnoreCase("html")) { new HTMLReport(projectData, destinationDir, finder); } else if (format.equalsIgnoreCase("xml")) { new XMLReport(projectData, destinationDir, finder); } }
|
private void parseArguments(String[] args) throws Exception { FileFinder finder = new FileFinder(); for (int i = 0; i < args.length; i++) { if (args[i].equals("--basedir")) { finder.addBaseDirectory(new File(args[++i])); } else if (args[i].equals("--datafile")) { setDataFile( args[++i]); } else if (args[i].equals("--destination")) { setDestination( args[++i]); } else if (args[i].equals("--format")) { setFormat( args[++i]); } else { finder.addSourceFilePath(args[i]); } } if (dataFile == null) dataFile = CoverageDataFileHandler.getDefaultDataFile(); if (destinationDir == null) { System.err.println("Error: destination directory must be set"); System.exit(1); } if (format == null) { System.err.println("Error: format must be set"); System.exit(1); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("format is " + format); LOGGER.debug("dataFile is " + dataFile.getAbsolutePath()); LOGGER.debug("destinationDir is " + destinationDir.getAbsolutePath()); } ProjectData projectData = CoverageDataFileHandler.loadCoverageData(dataFile); if (projectData == null) { System.err.println("Error: Unable to read from data file " + dataFile.getAbsolutePath()); System.exit(1); } if (format.equalsIgnoreCase("html")) { new HTMLReport(projectData, destinationDir, finder); } else if (format.equalsIgnoreCase("xml")) { new XMLReport(projectData, destinationDir, finder, complexity); } }
| 1,124,016
|
public void addSourceFilePath(String path) { change(); sourceFilePaths.add(path); }
|
public void addSourceFilePath(String path) { change(); sourceFilePaths.add(getCorrectedPath(path)); }
| 1,124,017
|
public void loadPlugins() { // Delete all old plugins File[] oldFiles = PLUGINS_DIRECTORY.listFiles(); final int no = oldFiles != null ? oldFiles.length : 0; for (int i = 0; i < no; i++) { File file = oldFiles[i]; if (file.isDirectory()) { // Check to see if it has an associated .jar File jarFile = new File(PLUGINS_DIRECTORY, file.getName() + ".jar"); if (!jarFile.exists()) { uninstall(file); } } } updateClasspath(); // At the moment, the plug list is hardcode internally until I begin // using external property files. All depends on deployment. final URL url = getClass().getClassLoader().getResource("META-INF/plugins.xml"); try { InputStreamReader reader = new InputStreamReader(url.openStream()); loadInternalPlugins(reader); } catch (IOException e) { Log.error("Could not load plugins.xml file."); } // Load extension plugins loadPublicPlugins(); // For development purposes, load the plugin specified by -Dplugin=... String plugin = System.getProperty("plugin"); if (plugin != null) { StringTokenizer st = new StringTokenizer(plugin, ", ", false); while (st.hasMoreTokens()) { String token = st.nextToken(); File pluginXML = new File(token); loadPublicPlugin(pluginXML.getParentFile()); } } }
|
public void loadPlugins() { // Delete all old plugins File[] oldFiles = PLUGINS_DIRECTORY.listFiles(); final int no = oldFiles != null ? oldFiles.length : 0; for (int i = 0; i < no; i++) { File file = oldFiles[i]; if (file.isDirectory()) { // Check to see if it has an associated .jar File jarFile = new File(PLUGINS_DIRECTORY, file.getName() + ".jar"); if (!jarFile.exists()) { uninstall(file); } } } updateClasspath(); // At the moment, the plug list is hardcode internally until I begin // using external property files. All depends on deployment. final URL url = getClass().getClassLoader().getResource("META-INF/plugins.xml"); try { InputStreamReader reader = new InputStreamReader(url.openStream()); loadInternalPlugins(reader); } catch (IOException e) { Log.error("Could not load plugins.xml file."); } // Load extension plugins loadPublicPlugins(); // For development purposes, load the plugin specified by -Dplugin=... String plugin = System.getProperty("plugin"); if (plugin != null) { final StringTokenizer st = new StringTokenizer(plugin, ",", false); while (st.hasMoreTokens()) { String token = st.nextToken(); File pluginXML = new File(token); loadPublicPlugin(pluginXML.getParentFile()); } } }
| 1,124,020
|
public Note(String name, NoteHolder holder, String text) { this.name = name; if (holder instanceof Note) parent = (Note) holder; this.notes = new LinkedList<Note>(); this.text = text; holder.addNote(this); }
|
public Note(String name, NoteHolder holder, String text) { this.name = name; this.holder = holder; this.notes = new LinkedList<Note>(); this.text = text; holder.addNote(this); }
| 1,124,022
|
public LogFile(Settings s) throws FileNotFoundException { this(s.getSetting("LogFile")); _trace = s.getBooleanSetting("LogTraceExceptions"); String slevel = s.getSetting("LogLevel", "NOTICE"); _defaultLevel = LogSystem.getLevel(slevel); String format = s.getSetting("LogFormat"); if (format != null) { _mf = new MessageFormat(format); } Settings levels = s.getSubSettings("LogLevel"); String[] keys = levels.keys(); for (int i = 0; i < keys.length; i++) { _levels.put(keys[i], levels.getSetting(keys[i])); } }
|
public LogFile(Settings s) throws FileNotFoundException { this(s.getSetting("LogFile")); _trace = s.getBooleanSetting("LogTraceExceptions"); String slevel = s.getSetting("LogLevel", "NOTICE"); _defaultLevel = LogSystem.getLevel(slevel); String format = s.getSetting("LogFormat"); if (format != null) { _mf = new MessageFormat(format); } Settings levels = s.getSubSettings("LogLevel"); String[] keys = levels.keys(); for (int i = 0; i < keys.length; i++) { _levels.put(keys[i], new Integer(LogSystem.getLevel(levels.getSetting(keys[i])))); } }
| 1,124,023
|
public void write(FastWriter out, Context context) throws PropertyException, IOException { for (int i = 0; i < nConditions; i++) { boolean b = false; try { b = Expression.isTrue(conditions[i].evaluate(context)); } catch (Exception e) { String warning = "#if: Error evaluating condition: " + e; writeWarning(warning, context, out); } if (b) { blocks[i].write(out, context); return; } } // If we fell out, we ran out of conditions, try the else block if any if (elseBlock != null) elseBlock.write(out, context); }
|
public void write(FastWriter out, Context context) throws PropertyException, IOException { for (int i = 0; i < nConditions; i++) { boolean b = false; try { b = Expression.isTrue(conditions[i].evaluate(context)); } catch (Exception e) { String warning = "#if: Error evaluating condition: " + e; writeWarning(warning, context, out); } if (b) { blocks[i].write(out, context); return; } } // If we fell out, we ran out of conditions, try the else block if any if (elseBlock != null) elseBlock.write(out, context); }
| 1,124,024
|
public void invoke(final String jid) { this.jid = jid; final Roster roster = SparkManager.getConnection().getRoster(); // If User is already in roster, do not show. RosterEntry entry = roster.getEntry(jid); if (entry != null && entry.getType() == RosterPacket.ItemType.TO) { Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); return; } String message = Res.getString("message.approve.subscription", UserManager.unescapeJID(jid)); Transport transport = TransportUtils.getTransport(StringUtils.parseServer(jid)); Icon icon = null; if (transport != null) { icon = transport.getIcon(); } messageLabel = new TitlePanel("", message, icon, true); // Add Message Label mainPanel.add(messageLabel, new GridBagConstraints(0, 0, 6, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); String username = StringUtils.parseName(UserManager.unescapeJID(jid)); usernameLabelValue.setText(UserManager.unescapeJID(jid)); nicknameField.setText(username); acceptButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (!rosterBox.isSelected()) { Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); dialog.dispose(); return; } boolean addEntry = addEntry(); if (addEntry) { Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); } else { dialog.dispose(); } } }); denyButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // Send subscribed Presence response = new Presence(Presence.Type.unsubscribe); response.setTo(jid); SparkManager.getConnection().sendPacket(response); dialog.dispose(); } }); viewInfoButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SparkManager.getVCardManager().viewProfile(jid, mainPanel); } }); dialog = new JFrame("Subscription Request"); dialog.setIconImage(SparkRes.getImageIcon(SparkRes.MAIN_IMAGE).getImage()); dialog.getContentPane().add(mainPanel); dialog.pack(); dialog.setSize(400, 225); dialog.setLocationRelativeTo(SparkManager.getMainWindow()); if (SparkManager.getMainWindow().isFocused()) { dialog.setState(Frame.NORMAL); dialog.setVisible(true); } else if (!SparkManager.getMainWindow().isVisible() || !SparkManager.getMainWindow().isFocused()) { dialog.setFocusableWindowState(false); dialog.setState(Frame.ICONIFIED); dialog.setVisible(true); SparkManager.getAlertManager().flashWindowStopOnFocus(dialog); dialog.setFocusableWindowState(true); } }
|
public void invoke(final String jid) { this.jid = jid; final Roster roster = SparkManager.getConnection().getRoster(); // If User is already in roster, do not show. RosterEntry entry = roster.getEntry(jid); if (entry != null && entry.getType() == RosterPacket.ItemType.TO) { Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); return; } String message = Res.getString("message.approve.subscription", UserManager.unescapeJID(jid)); Transport transport = TransportUtils.getTransport(StringUtils.parseServer(jid)); Icon icon = null; if (transport != null) { icon = transport.getIcon(); } messageLabel = new TitlePanel("", message, icon, true); // Add Message Label mainPanel.add(messageLabel, new GridBagConstraints(0, 0, 6, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); String username = StringUtils.parseName(UserManager.unescapeJID(jid)); usernameLabelValue.setText(UserManager.unescapeJID(jid)); nicknameField.setText(username); acceptButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (!rosterBox.isSelected()) { Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); dialog.dispose(); return; } boolean addEntry = addEntry(); if (addEntry) { Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); } else { dialog.dispose(); } } }); denyButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // Send subscribed Presence response = new Presence(Presence.Type.unsubscribe); response.setTo(jid); SparkManager.getConnection().sendPacket(response); dialog.dispose(); } }); viewInfoButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SparkManager.getVCardManager().viewProfile(jid, mainPanel); } }); dialog = new JFrame("Subscription Request"); dialog.setIconImage(SparkRes.getImageIcon(SparkRes.MAIN_IMAGE).getImage()); dialog.getContentPane().add(mainPanel); dialog.pack(); dialog.setSize(400, 250); dialog.setLocationRelativeTo(SparkManager.getMainWindow()); if (SparkManager.getMainWindow().isFocused()) { dialog.setState(Frame.NORMAL); dialog.setVisible(true); } else if (!SparkManager.getMainWindow().isVisible() || !SparkManager.getMainWindow().isFocused()) { dialog.setFocusableWindowState(false); dialog.setState(Frame.ICONIFIED); dialog.setVisible(true); SparkManager.getAlertManager().flashWindowStopOnFocus(dialog); dialog.setFocusableWindowState(true); } }
| 1,124,025
|
public TransportRegistrationPanel(String serviceName) { setLayout(new GridBagLayout()); final Transport transport = TransportManager.getTransport(serviceName); titlePanel = new TitlePanel("AIM Registration", transport.getTitle(), transport.getIcon(), true); add(titlePanel, new GridBagConstraints(0, 0, 2, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); final JLabel usernameLabel = new JLabel(); usernameLabel.setFont(new Font("Dialog", Font.BOLD, 11)); ResourceUtils.resLabel(usernameLabel, usernameField, "&Username:"); add(usernameLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(usernameField, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); final JLabel passwordLabel = new JLabel(); passwordLabel.setFont(new Font("Dialog", Font.BOLD, 11)); ResourceUtils.resLabel(passwordLabel, passwordField, "&Password:"); add(passwordLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(passwordField, new GridBagConstraints(1, 2, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); }
|
public TransportRegistrationPanel(String serviceName) { setLayout(new GridBagLayout()); final Transport transport = TransportManager.getTransport(serviceName); titlePanel = new TitlePanel(transport.getTitle(), transport.getInstructions(), transport.getIcon(), true); add(titlePanel, new GridBagConstraints(0, 0, 2, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); final JLabel usernameLabel = new JLabel(); usernameLabel.setFont(new Font("Dialog", Font.BOLD, 11)); ResourceUtils.resLabel(usernameLabel, usernameField, "&Username:"); add(usernameLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(usernameField, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); final JLabel passwordLabel = new JLabel(); passwordLabel.setFont(new Font("Dialog", Font.BOLD, 11)); ResourceUtils.resLabel(passwordLabel, passwordField, "&Password:"); add(passwordLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(passwordField, new GridBagConstraints(1, 2, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); }
| 1,124,026
|
public static void main(String arg[]) { Log.traceExceptions(true); Log.setLevel(Log.ALL); Log.setTarget(System.err); if (arg.length != 0) { System.out.println("Enabling log types"); Log.enableTypes(arg); } // Build a context WebMacro wm = null; Context context = null; try { wm = new WM(); context = new Context(null); Object names[] = { "prop" }; context.setProperty(names, "Example property"); } catch (Exception e) { e.printStackTrace(); } context.put("helloworld", "Hello World"); context.put("hello", "Hello"); context.put("file", "include.txt"); TestObject[] fruits = { new TestObject("apple",false), new TestObject("lemon",true), new TestObject("pear",false), new TestObject("orange",true), new TestObject("watermelon",false), new TestObject("peach",false), new TestObject("lime",true) }; SelectList sl = new SelectList(fruits, 3); context.put("sl-fruits", sl); context.put("fruits", fruits); context.put("flipper", new TestObject("flip",false)); System.out.println("- - - - - - - - - - - - - - - - - - - -"); System.out.println("Context contains: helloWorld, hello, file, TestObject[] fruits, SelectList sl(fruits, 3), TestObject flipper"); System.out.println("- - - - - - - - - - - - - - - - - - - -"); try { Template t1 = new StreamTemplate(wm.getBroker(), new InputStreamReader(System.in)); t1.parse(); Writer w = new OutputStreamWriter(System.out); System.out.println("*** RESULT ***"); t1.write(w,context); w.close(); System.out.println("*** DONE ***"); //System.out.println(result); } catch (Exception e) { e.printStackTrace(); } }
|
public static void main(String arg[]) { Log.traceExceptions(true); Log.setLevel(Log.ALL); Log.setTarget(System.err); if (arg.length != 0) { System.out.println("Enabling log types"); Log.enableTypes(arg); } // Build a context WebMacro wm = null; Context context = null; try { wm = new WM(); context = new Context(null); Object names[] = { "prop" }; context.setProperty(names, "Example property"); } catch (Exception e) { e.printStackTrace(); } context.put("helloworld", "Hello World"); context.put("hello", "Hello"); context.put("file", "include.txt"); TestObject[] fruits = { new TestObject("apple",false), new TestObject("lemon",true), new TestObject("pear",false), new TestObject("orange",true), new TestObject("watermelon",false), new TestObject("peach",false), new TestObject("lime",true) }; SelectList sl = new SelectList(fruits, 3); context.put("sl-fruits", sl); context.put("fruits", fruits); context.put("flipper", new TestObject("flip",false)); System.out.println("- - - - - - - - - - - - - - - - - - - -"); System.out.println("Context contains: helloWorld, hello, file, TestObject[] fruits, SelectList sl(fruits, 3), TestObject flipper"); System.out.println("- - - - - - - - - - - - - - - - - - - -"); try { Template t1 = new StreamTemplate(wm.getBroker(), new InputStreamReader(System.in)); t1.parse(); Writer w = new OutputStreamWriter(System.out); System.out.println("*** RESULT ***"); t1.write(w,context); w.close(); System.out.println("*** DONE ***"); //System.out.println(result); } catch (Exception e) { e.printStackTrace(); } }
| 1,124,027
|
public static void main(String arg[]) { Log.traceExceptions(true); Log.setLevel(Log.ALL); Log.setTarget(System.err); if (arg.length != 0) { System.out.println("Enabling log types"); Log.enableTypes(arg); } // Build a context WebMacro wm = null; Context context = null; try { wm = new WM(); context = new Context(null); Object names[] = { "prop" }; context.setProperty(names, "Example property"); } catch (Exception e) { e.printStackTrace(); } context.put("helloworld", "Hello World"); context.put("hello", "Hello"); context.put("file", "include.txt"); TestObject[] fruits = { new TestObject("apple",false), new TestObject("lemon",true), new TestObject("pear",false), new TestObject("orange",true), new TestObject("watermelon",false), new TestObject("peach",false), new TestObject("lime",true) }; SelectList sl = new SelectList(fruits, 3); context.put("sl-fruits", sl); context.put("fruits", fruits); context.put("flipper", new TestObject("flip",false)); System.out.println("- - - - - - - - - - - - - - - - - - - -"); System.out.println("Context contains: helloWorld, hello, file, TestObject[] fruits, SelectList sl(fruits, 3), TestObject flipper"); System.out.println("- - - - - - - - - - - - - - - - - - - -"); try { Template t1 = new StreamTemplate(wm.getBroker(), new InputStreamReader(System.in)); t1.parse(); Writer w = new OutputStreamWriter(System.out); System.out.println("*** RESULT ***"); t1.write(w,context); w.close(); System.out.println("*** DONE ***"); //System.out.println(result); } catch (Exception e) { e.printStackTrace(); } }
|
public static void main(String arg[]) { Log.traceExceptions(true); Log.setLevel(Log.ALL); Log.setTarget(System.err); if (arg.length != 0) { System.out.println("Enabling log types"); Log.enableTypes(arg); } // Build a context WebMacro wm = null; Context context = null; try { wm = new WM(); context = new Context(null); Object names[] = { "prop" }; context.setProperty(names, "Example property"); } catch (Exception e) { e.printStackTrace(); } context.put("helloworld", "Hello World"); context.put("hello", "Hello"); context.put("file", "include.txt"); TestObject[] fruits = { new TestObject("apple",false), new TestObject("lemon",true), new TestObject("pear",false), new TestObject("orange",true), new TestObject("watermelon",false), new TestObject("peach",false), new TestObject("lime",true) }; SelectList sl = new SelectList(fruits, 3); context.put("sl-fruits", sl); context.put("fruits", fruits); context.put("flipper", new TestObject("flip",false)); System.out.println("- - - - - - - - - - - - - - - - - - - -"); System.out.println("Context contains: helloWorld, hello, file, TestObject[] fruits, SelectList sl(fruits, 3), TestObject flipper"); System.out.println("- - - - - - - - - - - - - - - - - - - -"); try { Template t1 = new StreamTemplate(wm.getBroker(), new InputStreamReader(System.in)); t1.parse(); Writer w = new OutputStreamWriter(System.out); System.out.println("*** RESULT ***"); t1.write(w,context); w.close(); System.out.println("*** DONE ***"); //System.out.println(result); } catch (Exception e) { e.printStackTrace(); } }
| 1,124,028
|
public static void main(String arg[]) { Log.traceExceptions(true); Log.setLevel(Log.ALL); Log.setTarget(System.err); if (arg.length != 0) { System.out.println("Enabling log types"); Log.enableTypes(arg); } // Build a context WebMacro wm = null; Context context = null; try { wm = new WM(); context = new Context(null); Object names[] = { "prop" }; context.setProperty(names, "Example property"); } catch (Exception e) { e.printStackTrace(); } context.put("helloworld", "Hello World"); context.put("hello", "Hello"); context.put("file", "include.txt"); TestObject[] fruits = { new TestObject("apple",false), new TestObject("lemon",true), new TestObject("pear",false), new TestObject("orange",true), new TestObject("watermelon",false), new TestObject("peach",false), new TestObject("lime",true) }; SelectList sl = new SelectList(fruits, 3); context.put("sl-fruits", sl); context.put("fruits", fruits); context.put("flipper", new TestObject("flip",false)); System.out.println("- - - - - - - - - - - - - - - - - - - -"); System.out.println("Context contains: helloWorld, hello, file, TestObject[] fruits, SelectList sl(fruits, 3), TestObject flipper"); System.out.println("- - - - - - - - - - - - - - - - - - - -"); try { Template t1 = new StreamTemplate(wm.getBroker(), new InputStreamReader(System.in)); t1.parse(); Writer w = new OutputStreamWriter(System.out); System.out.println("*** RESULT ***"); t1.write(w,context); w.close(); System.out.println("*** DONE ***"); //System.out.println(result); } catch (Exception e) { e.printStackTrace(); } }
|
public static void main(String arg[]) { Log.traceExceptions(true); Log.setLevel(Log.ALL); Log.setTarget(System.err); if (arg.length != 0) { System.out.println("Enabling log types"); Log.enableTypes(arg); } // Build a context WebMacro wm = null; Context context = null; System.out.println("- - - - - - - - - - - - - - - - - - - -"); System.out.println("Context contains: helloWorld, hello, file, TestObject[] fruits, SelectList sl(fruits, 3), TestObject flipper"); System.out.println("- - - - - - - - - - - - - - - - - - - -"); wm = new WM(); context = new Context(null); Object names[] = { "prop" }; context.setProperty(names, "Example property"); } catch (Exception e) { e.printStackTrace(); } context.put("helloworld", "Hello World"); context.put("hello", "Hello"); context.put("file", "include.txt"); TestObject[] fruits = { new TestObject("apple",false), new TestObject("lemon",true), new TestObject("pear",false), new TestObject("orange",true), new TestObject("watermelon",false), new TestObject("peach",false), new TestObject("lime",true) }; SelectList sl = new SelectList(fruits, 3); context.put("sl-fruits", sl); context.put("fruits", fruits); context.put("flipper", new TestObject("flip",false)); System.out.println("- - - - - - - - - - - - - - - - - - - -"); System.out.println("Context contains: helloWorld, hello, file, TestObject[] fruits, SelectList sl(fruits, 3), TestObject flipper"); System.out.println("- - - - - - - - - - - - - - - - - - - -"); System.out.println("- - - - - - - - - - - - - - - - - - - -"); System.out.println("Context contains: helloWorld, hello, file, TestObject[] fruits, SelectList sl(fruits, 3), TestObject flipper"); System.out.println("- - - - - - - - - - - - - - - - - - - -"); Template t1 = new StreamTemplate(wm.getBroker(), new InputStreamReader(System.in)); t1.parse(); Writer w = new OutputStreamWriter(System.out); System.out.println("*** RESULT ***"); t1.write(w,context); w.close(); System.out.println("*** DONE ***"); //System.out.println(result); } catch (Exception e) { e.printStackTrace(); } }
| 1,124,029
|
private void registerPresenceListener() { SparkManager.getConnection().addPacketListener(new PacketListener() { public void processPacket(Packet packet) { Presence presence = (Presence)packet; Transport transport = TransportUtils.getTransport(packet.getFrom()); if (transport != null) { boolean registered = presence != null && presence.getMode() != null; if (presence.getType() == Presence.Type.unavailable) { registered = false; } GatewayButton button = uiMap.get(transport); button.signedIn(registered); } } }, new PacketTypeFilter(Presence.class)); ChatManager chatManager = SparkManager.getChatManager(); chatManager.addContactItemHandler(this); // Iterate through Contacts and check for final ContactList contactList = SparkManager.getWorkspace().getContactList(); for (ContactGroup contactGroup : contactList.getContactGroups()) { for (ContactItem contactItem : contactGroup.getContactItems()) { Presence presence = contactItem.getPresence(); if (presence != null) { String domain = StringUtils.parseServer(presence.getFrom()); Transport transport = TransportUtils.getTransport(domain); if (transport != null) { handlePresence(contactItem, presence); contactGroup.fireContactGroupUpdated(); } } } } SparkManager.getSessionManager().addPresenceListener(new PresenceListener() { public void presenceChanged(Presence presence) { for (Transport transport : TransportUtils.getTransports()) { presence.setTo(transport.getServiceName()); SparkManager.getConnection().sendPacket(presence); } } }); }
|
private void registerPresenceListener() { SparkManager.getConnection().addPacketListener(new PacketListener() { public void processPacket(Packet packet) { Presence presence = (Presence)packet; Transport transport = TransportUtils.getTransport(packet.getFrom()); if (transport != null) { boolean registered = presence != null && presence.getMode() != null; if (presence.getType() == Presence.Type.unavailable) { registered = false; } GatewayButton button = uiMap.get(transport); button.signedIn(registered); } } }, new PacketTypeFilter(Presence.class)); ChatManager chatManager = SparkManager.getChatManager(); chatManager.addContactItemHandler(this); // Iterate through Contacts and check for final ContactList contactList = SparkManager.getWorkspace().getContactList(); for (ContactGroup contactGroup : contactList.getContactGroups()) { for (ContactItem contactItem : contactGroup.getContactItems()) { Presence presence = contactItem.getPresence(); if (presence != null) { String domain = StringUtils.parseServer(presence.getFrom()); Transport transport = TransportUtils.getTransport(domain); if (transport != null) { handlePresence(contactItem, presence); contactGroup.fireContactGroupUpdated(); } } } } SparkManager.getSessionManager().addPresenceListener(new PresenceListener() { public void presenceChanged(Presence presence) { for (Transport transport : TransportUtils.getTransports()) { presence.setTo(transport.getServiceName()); SparkManager.getConnection().sendPacket(presence); } } }); }
| 1,124,030
|
public void presenceChanged(Presence presence) { for (Transport transport : TransportUtils.getTransports()) { presence.setTo(transport.getServiceName()); SparkManager.getConnection().sendPacket(presence); } }
|
public void presenceChanged(Presence presence) { for (Transport transport : TransportUtils.getTransports()) { presence.setTo(transport.getServiceName()); SparkManager.getConnection().sendPacket(presence); } }
| 1,124,031
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.