bugged
stringlengths 6
599k
| fixed
stringlengths 6
40.8M
| __index_level_0__
int64 0
3.24M
|
|---|---|---|
public void testLoad() throws Exception{ Kernel kernel = KernelFactory.newInstance().createKernel("test"); try { File baseDir = new File("src/test/org/xbean/server/spring/loader/").getAbsoluteFile(); System.setProperty("xbean.base.dir", baseDir.getAbsolutePath()); FileSystemRepository repository = new FileSystemRepository(new File(".").getAbsoluteFile()); ClassLoaderXmlPreprocessor classLoaderXmlPreprocessor = new ClassLoaderXmlPreprocessor(repository); List xmlPreprocessors = Collections.singletonList(classLoaderXmlPreprocessor); SpringLoader springLoader = new SpringLoader(); springLoader.setKernel(kernel); springLoader.setBaseDir(baseDir); springLoader.setXmlPreprocessors(xmlPreprocessors); ServiceName configurationName = springLoader.load("classpath-xbean"); kernel.startService(configurationName); Object testService = kernel.getService(new StringServiceName("test")); assertEquals("TestClass", testService.getClass().getName()); assertTrue(testService instanceof SortedSet); } finally { kernel.destroy(); } }
|
public void testLoad() throws Exception{ Kernel kernel = KernelFactory.newInstance().createKernel("test"); try { File baseDir = new File("src/test/org/xbean/server/spring/loader/").getAbsoluteFile(); System.setProperty("xbean.base.dir", baseDir.getAbsolutePath()); FileSystemRepository repository = new FileSystemRepository(new File(".").getAbsoluteFile()); ClassLoaderXmlPreprocessor classLoaderXmlPreprocessor = new ClassLoaderXmlPreprocessor(repository); List xmlPreprocessors = Collections.singletonList(classLoaderXmlPreprocessor); SpringLoader springLoader = new SpringLoader(); springLoader.setKernel(kernel); springLoader.setBaseDir(xbeanDir); springLoader.setXmlPreprocessors(xmlPreprocessors); ServiceName configurationName = springLoader.load("classpath-xbean"); kernel.startService(configurationName); Object testService = kernel.getService(new StringServiceName("test")); assertEquals("TestClass", testService.getClass().getName()); assertTrue(testService instanceof SortedSet); } finally { kernel.destroy(); } }
| 3,232,228
|
public void testReload() throws Exception{ Kernel kernel = KernelFactory.newInstance().createKernel("test"); try { File baseDir = new File("src/test/org/xbean/server/spring/loader/").getAbsoluteFile(); System.setProperty("xbean.base.dir", baseDir.getAbsolutePath()); FileSystemRepository repository = new FileSystemRepository(new File(".").getAbsoluteFile()); ClassLoaderXmlPreprocessor classLoaderXmlPreprocessor = new ClassLoaderXmlPreprocessor(repository); List xmlPreprocessors = Collections.singletonList(classLoaderXmlPreprocessor); SpringLoader springLoader = new SpringLoader(); springLoader.setKernel(kernel); springLoader.setBaseDir(baseDir); springLoader.setXmlPreprocessors(xmlPreprocessors); ServiceName configurationName = springLoader.load("classpath-xbean"); SpringConfigurationServiceFactory serviceFactory = (SpringConfigurationServiceFactory) kernel.getServiceFactory(configurationName); SpringApplicationContext applicationContext = serviceFactory.getApplicationContext(); kernel.startService(configurationName); Object testService = kernel.getService(new StringServiceName("test")); assertEquals("TestClass", testService.getClass().getName()); assertEquals(applicationContext.getClassLoader(), testService.getClass().getClassLoader()); assertTrue(testService instanceof SortedSet); kernel.stopService(configurationName); kernel.startService(configurationName); Object newTestService = kernel.getService(new StringServiceName("test")); assertEquals("TestClass", newTestService.getClass().getName()); assertEquals(applicationContext.getClassLoader(), newTestService.getClass().getClassLoader()); assertTrue(newTestService instanceof SortedSet); assertNotSame("test service should be a new instance", testService, newTestService); assertNotSame("test service should have been loaded from a different classloader", testService.getClass().getClassLoader(), newTestService.getClass().getClassLoader()); } finally { kernel.destroy(); } }
|
public void testReload() throws Exception{ Kernel kernel = KernelFactory.newInstance().createKernel("test"); try { File baseDir = new File("src/test/org/xbean/server/spring/loader/").getAbsoluteFile(); System.setProperty("xbean.base.dir", baseDir.getAbsolutePath()); FileSystemRepository repository = new FileSystemRepository(new File(".").getAbsoluteFile()); ClassLoaderXmlPreprocessor classLoaderXmlPreprocessor = new ClassLoaderXmlPreprocessor(repository); List xmlPreprocessors = Collections.singletonList(classLoaderXmlPreprocessor); SpringLoader springLoader = new SpringLoader(); springLoader.setKernel(kernel); springLoader.setBaseDir(baseDir); springLoader.setXmlPreprocessors(xmlPreprocessors); ServiceName configurationName = springLoader.load("classpath-xbean"); SpringConfigurationServiceFactory serviceFactory = (SpringConfigurationServiceFactory) kernel.getServiceFactory(configurationName); SpringApplicationContext applicationContext = serviceFactory.getApplicationContext(); kernel.startService(configurationName); Object testService = kernel.getService(new StringServiceName("test")); assertEquals("TestClass", testService.getClass().getName()); assertEquals(applicationContext.getClassLoader(), testService.getClass().getClassLoader()); assertTrue(testService instanceof SortedSet); kernel.stopService(configurationName); kernel.startService(configurationName); Object newTestService = kernel.getService(new StringServiceName("test")); assertEquals("TestClass", newTestService.getClass().getName()); assertEquals(applicationContext.getClassLoader(), newTestService.getClass().getClassLoader()); assertTrue(newTestService instanceof SortedSet); assertNotSame("test service should be a new instance", testService, newTestService); assertNotSame("test service should have been loaded from a different classloader", testService.getClass().getClassLoader(), newTestService.getClass().getClassLoader()); } finally { kernel.destroy(); } }
| 3,232,229
|
public void testReload() throws Exception{ Kernel kernel = KernelFactory.newInstance().createKernel("test"); try { File baseDir = new File("src/test/org/xbean/server/spring/loader/").getAbsoluteFile(); System.setProperty("xbean.base.dir", baseDir.getAbsolutePath()); FileSystemRepository repository = new FileSystemRepository(new File(".").getAbsoluteFile()); ClassLoaderXmlPreprocessor classLoaderXmlPreprocessor = new ClassLoaderXmlPreprocessor(repository); List xmlPreprocessors = Collections.singletonList(classLoaderXmlPreprocessor); SpringLoader springLoader = new SpringLoader(); springLoader.setKernel(kernel); springLoader.setBaseDir(baseDir); springLoader.setXmlPreprocessors(xmlPreprocessors); ServiceName configurationName = springLoader.load("classpath-xbean"); SpringConfigurationServiceFactory serviceFactory = (SpringConfigurationServiceFactory) kernel.getServiceFactory(configurationName); SpringApplicationContext applicationContext = serviceFactory.getApplicationContext(); kernel.startService(configurationName); Object testService = kernel.getService(new StringServiceName("test")); assertEquals("TestClass", testService.getClass().getName()); assertEquals(applicationContext.getClassLoader(), testService.getClass().getClassLoader()); assertTrue(testService instanceof SortedSet); kernel.stopService(configurationName); kernel.startService(configurationName); Object newTestService = kernel.getService(new StringServiceName("test")); assertEquals("TestClass", newTestService.getClass().getName()); assertEquals(applicationContext.getClassLoader(), newTestService.getClass().getClassLoader()); assertTrue(newTestService instanceof SortedSet); assertNotSame("test service should be a new instance", testService, newTestService); assertNotSame("test service should have been loaded from a different classloader", testService.getClass().getClassLoader(), newTestService.getClass().getClassLoader()); } finally { kernel.destroy(); } }
|
public void testReload() throws Exception{ Kernel kernel = KernelFactory.newInstance().createKernel("test"); try { File baseDir = new File("src/test/org/xbean/server/spring/loader/").getAbsoluteFile(); System.setProperty("xbean.base.dir", baseDir.getAbsolutePath()); FileSystemRepository repository = new FileSystemRepository(new File(basedir).getAbsoluteFile()); ClassLoaderXmlPreprocessor classLoaderXmlPreprocessor = new ClassLoaderXmlPreprocessor(repository); List xmlPreprocessors = Collections.singletonList(classLoaderXmlPreprocessor); SpringLoader springLoader = new SpringLoader(); springLoader.setKernel(kernel); springLoader.setBaseDir(baseDir); springLoader.setXmlPreprocessors(xmlPreprocessors); ServiceName configurationName = springLoader.load("classpath-xbean"); SpringConfigurationServiceFactory serviceFactory = (SpringConfigurationServiceFactory) kernel.getServiceFactory(configurationName); SpringApplicationContext applicationContext = serviceFactory.getApplicationContext(); kernel.startService(configurationName); Object testService = kernel.getService(new StringServiceName("test")); assertEquals("TestClass", testService.getClass().getName()); assertEquals(applicationContext.getClassLoader(), testService.getClass().getClassLoader()); assertTrue(testService instanceof SortedSet); kernel.stopService(configurationName); kernel.startService(configurationName); Object newTestService = kernel.getService(new StringServiceName("test")); assertEquals("TestClass", newTestService.getClass().getName()); assertEquals(applicationContext.getClassLoader(), newTestService.getClass().getClassLoader()); assertTrue(newTestService instanceof SortedSet); assertNotSame("test service should be a new instance", testService, newTestService); assertNotSame("test service should have been loaded from a different classloader", testService.getClass().getClassLoader(), newTestService.getClass().getClassLoader()); } finally { kernel.destroy(); } }
| 3,232,230
|
public void testReload() throws Exception{ Kernel kernel = KernelFactory.newInstance().createKernel("test"); try { File baseDir = new File("src/test/org/xbean/server/spring/loader/").getAbsoluteFile(); System.setProperty("xbean.base.dir", baseDir.getAbsolutePath()); FileSystemRepository repository = new FileSystemRepository(new File(".").getAbsoluteFile()); ClassLoaderXmlPreprocessor classLoaderXmlPreprocessor = new ClassLoaderXmlPreprocessor(repository); List xmlPreprocessors = Collections.singletonList(classLoaderXmlPreprocessor); SpringLoader springLoader = new SpringLoader(); springLoader.setKernel(kernel); springLoader.setBaseDir(baseDir); springLoader.setXmlPreprocessors(xmlPreprocessors); ServiceName configurationName = springLoader.load("classpath-xbean"); SpringConfigurationServiceFactory serviceFactory = (SpringConfigurationServiceFactory) kernel.getServiceFactory(configurationName); SpringApplicationContext applicationContext = serviceFactory.getApplicationContext(); kernel.startService(configurationName); Object testService = kernel.getService(new StringServiceName("test")); assertEquals("TestClass", testService.getClass().getName()); assertEquals(applicationContext.getClassLoader(), testService.getClass().getClassLoader()); assertTrue(testService instanceof SortedSet); kernel.stopService(configurationName); kernel.startService(configurationName); Object newTestService = kernel.getService(new StringServiceName("test")); assertEquals("TestClass", newTestService.getClass().getName()); assertEquals(applicationContext.getClassLoader(), newTestService.getClass().getClassLoader()); assertTrue(newTestService instanceof SortedSet); assertNotSame("test service should be a new instance", testService, newTestService); assertNotSame("test service should have been loaded from a different classloader", testService.getClass().getClassLoader(), newTestService.getClass().getClassLoader()); } finally { kernel.destroy(); } }
|
public void testReload() throws Exception{ Kernel kernel = KernelFactory.newInstance().createKernel("test"); try { File baseDir = new File("src/test/org/xbean/server/spring/loader/").getAbsoluteFile(); System.setProperty("xbean.base.dir", baseDir.getAbsolutePath()); FileSystemRepository repository = new FileSystemRepository(new File(".").getAbsoluteFile()); ClassLoaderXmlPreprocessor classLoaderXmlPreprocessor = new ClassLoaderXmlPreprocessor(repository); List xmlPreprocessors = Collections.singletonList(classLoaderXmlPreprocessor); SpringLoader springLoader = new SpringLoader(); springLoader.setKernel(kernel); springLoader.setBaseDir(xbeanDir); springLoader.setXmlPreprocessors(xmlPreprocessors); ServiceName configurationName = springLoader.load("classpath-xbean"); SpringConfigurationServiceFactory serviceFactory = (SpringConfigurationServiceFactory) kernel.getServiceFactory(configurationName); SpringApplicationContext applicationContext = serviceFactory.getApplicationContext(); kernel.startService(configurationName); Object testService = kernel.getService(new StringServiceName("test")); assertEquals("TestClass", testService.getClass().getName()); assertEquals(applicationContext.getClassLoader(), testService.getClass().getClassLoader()); assertTrue(testService instanceof SortedSet); kernel.stopService(configurationName); kernel.startService(configurationName); Object newTestService = kernel.getService(new StringServiceName("test")); assertEquals("TestClass", newTestService.getClass().getName()); assertEquals(applicationContext.getClassLoader(), newTestService.getClass().getClassLoader()); assertTrue(newTestService instanceof SortedSet); assertNotSame("test service should be a new instance", testService, newTestService); assertNotSame("test service should have been loaded from a different classloader", testService.getClass().getClassLoader(), newTestService.getClass().getClassLoader()); } finally { kernel.destroy(); } }
| 3,232,231
|
public FileSystemRepository(File root) { this.root = root; }
|
public FileSystemRepository(File root) { this.root = root; }
| 3,232,232
|
private Object[] getGraphicDataZ(Map xAxis, Map yAxis) { Object[] result = new Object[5]; Iterator i = (yAxis.keySet()).iterator(); Iterator j; Integer key; PlanePoint point;//Coordinate ArrayList list; TreeMap values = new TreeMap(); double v, maxY = 0, minY = 0; int x, c, minX = 0, maxX = 0; c = 0; while (i.hasNext()) { key = (Integer) i.next(); j = (xAxis.keySet()).iterator(); list = new ArrayList(); while (j.hasNext()) { x = ((Integer) j.next()).intValue(); v = getValue(x, key.intValue()); if (c == 0) { minY = v; maxY = v; minX = x; maxX = x; } else { minY = Math.min(v, minY); maxY = Math.max(v, maxY); minX = Math.min(minX, x); maxX = Math.max(maxX, x); } c++; point = new PlanePoint(x, v); list.add(point); } values.put(key, list); } result[0] = new Integer(minX); result[1] = new Integer(maxX); result[2] = new Double(minY); result[3] = new Double(maxY); result[4] = values; return result; }
|
private Object[] getGraphicDataZ(Map xAxis, Map yAxis) { Object[] result = new Object[5]; Iterator i = (yAxis.keySet()).iterator(); Iterator j; Integer key; PlanePoint point;//Coordinate ArrayList list; TreeMap values = new TreeMap(); double v, maxY = 0, minY = 0; int x, c, minX = 0, maxX = 0; c = 0; while (i.hasNext()) { key = (Integer) i.next(); j = (xAxis.keySet()).iterator(); list = new ArrayList(); while (j.hasNext()) { x = ((Integer) j.next()).intValue(); v = getValue(x, key.intValue()); if (c == 0) { minY = v; maxY = v; minX = x; maxX = x; } else { minY = Math.min(v, minY); maxY = Math.max(v, maxY); minX = Math.min(minX, x); maxX = Math.max(maxX, x); } c++; point = new PlanePoint(x, v); list.add(point); } values.put(key, list); } result[0] = new Integer(minX); result[1] = new Integer(maxX); result[2] = new Double(minY); result[3] = new Double(maxY); result[4] = values; return result; }
| 3,232,234
|
public void showGraphic(int statsIndex, int axis, Map zSelected, Map tSelected) { this.statsIndex = statsIndex; resultIndex = GRAPHIC_RESULT; graphicCanvas = new GraphicCanvas(this, StatsResultsPane.zAndtFieldNames[statsIndex]); Object[] result; if (axis == T_AXIS) { result = getGraphicDataT(tSelected, zSelected); graphicCanvas.acrossT(zSelected, ((Integer) result[0]).intValue(), ((Integer) result[1]).intValue(), ((Double) result[2]).doubleValue(), ((Double) result[3]).doubleValue(), (Map) result[4]); } else if (axis == Z_AXIS) { result = getGraphicDataZ(zSelected, tSelected); graphicCanvas.acrossT(tSelected, ((Integer) result[0]).intValue(), ((Integer) result[1]).intValue(), ((Double) result[2]).doubleValue(), ((Double) result[3]).doubleValue(), (Map) result[4]); } view.bar.setEnabledButtons(false); view.addGraphic(graphicCanvas); }
|
public void showGraphic(int statsIndex, int axis, Map zSelected, Map tSelected) { this.statsIndex = statsIndex; resultIndex = GRAPHIC_RESULT; graphicCanvas = new GraphicCanvas(this, StatsResultsPane.zAndtFieldNames[statsIndex]); Object[] result; if (axis == T_AXIS) { result = getGraphicDataT(tSelected, zSelected); graphicCanvas.acrossT(zSelected, ((Integer) result[0]).intValue(), ((Integer) result[1]).intValue(), ((Double) result[2]).doubleValue(), ((Double) result[3]).doubleValue(), (Map) result[4]); } else if (axis == Z_AXIS) { result = getGraphicDataZ(zSelected, tSelected); graphicCanvas.acrossZ(tSelected, ((Integer) result[0]).intValue(), ((Integer) result[1]).intValue(), ((Double) result[2]).doubleValue(), ((Double) result[3]).doubleValue(), (Map) result[4]); } view.bar.setEnabledButtons(false); view.addGraphic(graphicCanvas); }
| 3,232,235
|
public void startService() { List agents = (List) singleton.registry.lookup(LookupNames.AGENTS); Iterator i = agents.iterator(); AgentInfo agentInfo; Agent a; //Agents linking phase. while (i.hasNext()) { agentInfo = (AgentInfo) i.next(); a = agentInfo.getAgent(); a.setContext(agentInfo.getRegistry()); } //Agents activation phase. i = agents.iterator(); while (i.hasNext()) { agentInfo = (AgentInfo) i.next(); a = agentInfo.getAgent(); a.activate(); } //TODO: activate services (EventBus, what else?). RenderingEngine re = RenderingEngine.getInstance(this); re.activate(); LoginManager lm = LoginManager.getInstance(this); lm.activate(); //TODO: RE threads should be spawn during an init task. //This is subject to change (see class javadoc). AWTExceptionHanlder.configure(this); //Get ready to interact with the user... TopFrame tf = singleton.registry.getTopFrame(); tf.open(); }
|
public void startService() { List agents = (List) singleton.registry.lookup(LookupNames.AGENTS); Iterator i = agents.iterator(); AgentInfo agentInfo; Agent a; //Agents linking phase. while (i.hasNext()) { agentInfo = (AgentInfo) i.next(); a = agentInfo.getAgent(); a.setContext(agentInfo.getRegistry()); } //Agents activation phase. i = agents.iterator(); while (i.hasNext()) { agentInfo = (AgentInfo) i.next(); a = agentInfo.getAgent(); a.activate(); } //TODO: activate services (EventBus, what else?). RenderingEngine re = RenderingEngine.getInstance(this); re.activate(); LoginManager lm = LoginManager.getInstance(this); lm.activate(); //TODO: RE threads should be spawn during an init task. //This is subject to change (see class javadoc). AWTExceptionHanlder.configure(this); //Get ready to interact with the user... TopFrame tf = singleton.registry.getTopFrame(); tf.open(); }
| 3,232,236
|
public void startService() { List agents = (List) singleton.registry.lookup(LookupNames.AGENTS); Iterator i = agents.iterator(); AgentInfo agentInfo; Agent a; //Agents linking phase. while (i.hasNext()) { agentInfo = (AgentInfo) i.next(); a = agentInfo.getAgent(); a.setContext(agentInfo.getRegistry()); } //Agents activation phase. i = agents.iterator(); while (i.hasNext()) { agentInfo = (AgentInfo) i.next(); a = agentInfo.getAgent(); a.activate(); } //TODO: activate services (EventBus, what else?). RenderingEngine re = RenderingEngine.getInstance(this); re.activate(); LoginManager lm = LoginManager.getInstance(this); lm.activate(); //TODO: RE threads should be spawn during an init task. //This is subject to change (see class javadoc). AWTExceptionHanlder.configure(this); //Get ready to interact with the user... TopFrame tf = singleton.registry.getTopFrame(); tf.open(); }
|
public void startService() { List agents = (List) singleton.registry.lookup(LookupNames.AGENTS); Iterator i = agents.iterator(); AgentInfo agentInfo; Agent a; //Agents linking phase. while (i.hasNext()) { agentInfo = (AgentInfo) i.next(); a = agentInfo.getAgent(); a.setContext(agentInfo.getRegistry()); } //Agents activation phase. i = agents.iterator(); while (i.hasNext()) { agentInfo = (AgentInfo) i.next(); a = agentInfo.getAgent(); a.activate(); } //TODO: activate services (EventBus, what else?). RenderingEngine re = RenderingEngine.getInstance(this); re.activate(); LoginManager lm = LoginManager.getInstance(this); lm.activate(); //TODO: RE threads should be spawn during an init task. //This is subject to change (see class javadoc). AWTExceptionHanlder.configure(this); //Get ready to interact with the user... TopFrame tf = singleton.registry.getTopFrame(); tf.open(); }
| 3,232,237
|
public static void startup(String home) { Initializer initManager = null; if (singleton == null) { try { singleton = new Container(home); initManager = new Initializer(singleton); initManager.configure(); initManager.doInit(); //startService() called by Initializer at end of doInit(). } catch (StartupException se) { if (initManager != null) initManager.rollback(); StringBuffer buf = new StringBuffer(); buf.append("Error message: "+se.getMessage()); buf.append("Originated by: "+se.getOriginator()); UserNotifier un = UIFactory.makeUserNotifier(); un.notifyInitError("Initialization Error", buf.toString(), se); System.exit(1); } } }
|
public static void startup(String home) { Initializer initManager = null; if (singleton == null) { try { singleton = new Container(home); initManager = new Initializer(singleton); initManager.configure(); initManager.doInit(); //startService() called by Initializer at end of doInit(). } catch (StartupException se) { if (initManager != null) initManager.rollback(); StringBuffer buf = new StringBuffer(); buf.append("Error message: "+se.getMessage()); buf.append("Originated by: "+se.getOriginator()); UserNotifier un = UIFactory.makeUserNotifier(); un.notifyInitError("Initialization Error", buf.toString(), se); System.exit(1); } } }
| 3,232,238
|
public void copy(IObject model, ModelMapper mapper) { if (model instanceof Image) { Image i = (Image) model; super.copy(model,mapper); // Details if (i.getDetails() != null){ Details d = i.getDetails(); this.setCreated(mapper.event2timestamp(d.getCreationEvent())); this.setInserted(mapper.event2timestamp(d.getUpdateEvent()));//TODO this.setOwner((ExperimenterData) mapper.findTarget(d.getOwner())); if ( d.getCounts() != null ) { Object annotationCount = d.getCounts().get( Image.ANNOTATIONS ); if ( annotationCount instanceof Integer ) this.setAnnotationCount( (Integer) annotationCount ); Object classificationCount = d.getCounts().get( Image.CATEGORYLINKS ); if ( classificationCount instanceof Integer ) this.setClassificationCount( (Integer) classificationCount ); } } // Fields this.setName(i.getName()); this.setDescription(i.getDescription()); this.setDefaultPixels((PixelsData)mapper.findTarget(i.getDefaultPixels())); this.setAllPixels((Set) mapper.findCollection(i.collectFromPixels(null))); this.setAnnotations((Set) mapper.findCollection(i.collectFromAnnotations(null))); // Collections MapperBlock block = new MapperBlock( mapper ); setDatasets( new HashSet( i.collectFromDatasetLinks( block ))); } else { throw new IllegalArgumentException("ImageData copies only from Image"); } }
|
public void copy(IObject model, ModelMapper mapper) { if (model instanceof Image) { Image i = (Image) model; super.copy(model,mapper); // Details if (i.getDetails() != null){ Details d = i.getDetails(); this.setCreated(mapper.event2timestamp(d.getCreationEvent())); this.setInserted(mapper.event2timestamp(d.getUpdateEvent()));//TODO this.setOwner((ExperimenterData) mapper.findTarget(d.getOwner())); if ( d.getCounts() != null ) { Object annotationCount = d.getCounts().get( Image.ANNOTATIONS ); if ( annotationCount instanceof Integer ) this.setAnnotationCount( (Integer) annotationCount ); Object classificationCount = d.getCounts().get( Image.CATEGORYLINKS ); if ( classificationCount instanceof Integer ) this.setClassificationCount( (Integer) classificationCount ); } } // Fields this.setName(i.getName()); this.setDescription(i.getDescription()); this.setDefaultPixels((PixelsData)mapper.findTarget(i.getDefaultPixels())); this.setAllPixels((Set) mapper.findCollection(i.collectFromPixels(null))); this.setAnnotations((Set) mapper.findCollection(i.collectFromAnnotations(null))); // Collections MapperBlock block = new MapperBlock( mapper ); setDatasets( new HashSet( i.collectFromDatasetLinks( block ))); } else { throw new IllegalArgumentException("ImageData copies only from Image"); } }
| 3,232,239
|
public ASCII_UCodeESC_CharStream(java.io.Reader dstream, int startline, int startcolumn, int buffersize) { inputStream = dstream; line = startline; column = startcolumn - 1; available = bufsize = buffersize; buffer = new char[buffersize]; bufline = new int[buffersize]; bufcolumn = new int[buffersize]; nextCharBuf = new char[4096]; }
|
public ASCII_UCodeESC_CharStream(java.io.Reader dstream, int startline, int startcolumn, int buffersize) { inputStream = dstream; line = startline; column = startcolumn - 1; available = bufsize = buffersize; buffer = new char[buffersize]; bufline = new int[buffersize]; bufcolumn = new int[buffersize]; nextCharBuf = new char[4096]; }
| 3,232,241
|
static final int hexval(char c) throws java.io.IOException { switch (c) { case '0': return 0; case '1': return 1; case '2': return 2; case '3': return 3; case '4': return 4; case '5': return 5; case '6': return 6; case '7': return 7; case '8': return 8; case '9': return 9; case 'a': case 'A': return 10; case 'b': case 'B': return 11; case 'c': case 'C': return 12; case 'd': case 'D': return 13; case 'e': case 'E': return 14; case 'f': case 'F': return 15; } throw new java.io.IOException(); // Should never come here }
|
static final int hexval(char c) throws java.io.IOException { switch (c) { case '0': return 0; case '1': return 1; case '2': return 2; case '3': return 3; case '4': return 4; case '5': return 5; case '6': return 6; case '7': return 7; case '8': return 8; case '9': return 9; case 'a': case 'A': return 10; case 'b': case 'B': return 11; case 'c': case 'C': return 12; case 'd': case 'D': return 13; case 'e': case 'E': return 14; case 'f': case 'F': return 15; } throw new java.io.IOException(); // Should never come here }
| 3,232,242
|
public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); }
|
public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); }
| 3,232,243
|
public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); }
|
public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); }
| 3,232,244
|
public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); }
|
public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); }
| 3,232,245
|
public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); }
|
public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); }
| 3,232,246
|
public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); }
|
public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); }
| 3,232,247
|
public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); }
|
public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); }
| 3,232,248
|
public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); }
|
public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); }
| 3,232,249
|
public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); }
|
public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); }
| 3,232,250
|
public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); }
|
public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); }
| 3,232,251
|
public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); }
|
public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); }
| 3,232,252
|
public static void main(String[] args) { junit.textui.TestRunner.run(SpringFacadeTest.class); }
|
public static void main(String[] args) { junit.textui.TestRunner.run(OmeroPercentTest.class); }
| 3,232,253
|
private int yylex() { char c; boolean spaceSeen = false; boolean commandState; if (lex_strterm != null) { if (lex_strterm instanceof HereDocNode) { int token = hereDocument(); if (token == Token.tSTRING_END) { lex_strterm = null; lex_state = LexState.EXPR_END; } return token; } else { int token = parseString(); if (token == Token.tSTRING_END || token == Token.tREGEXP_END) { lex_strterm = null; lex_state = LexState.EXPR_END; } return token; } } currentPos = support.getPosition(); commandState = commandStart; commandStart = false; retry: for(;;) { c = support.read(); switch(c) { case '\004': /* ^D */ case '\032': /* ^Z */ case 0: /* end of script. */ return 0; /* white spaces */ case ' ': case '\t': case '\f': case '\r': case '\13': /* '\v' */ spaceSeen = true; continue retry; case '#': /* it's a comment */ while ((c = support.read()) != '\n') { if (c == EOF) { return 0; } } /* fall through */ case '\n': if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT || lex_state == LexState.EXPR_CLASS) { continue retry; } commandStart = true; lex_state = LexState.EXPR_BEG; return '\n'; case '*': if ((c = support.read()) == '*') { if ((c = support.read()) == '=') { yaccValue = "**"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); c = Token.tPOW; } else { if (c == '=') { yaccValue = "*"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); if (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c)) { errorHandler.handleError(IErrors.WARNING, support.getPosition(), "`*' interpreted as argument prefix"); c = Token.tSTAR; } else if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { c = Token.tSTAR; } else { c = '*'; } } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } return c; case '!': lex_state = LexState.EXPR_BEG; if ((c = support.read()) == '=') { return Token.tNEQ; } if (c == '~') { return Token.tNMATCH; } support.unread(); return '!'; case '=': // Skip documentation nodes if (was_bol()) { /* skip embedded rd document */ if (support.isNextNoCase("begin")) { c = support.read(); if (Character.isWhitespace(c)) { // In case last next was the newline. support.unread(); for (;;) { support.readLine(); c = support.read(); if (c == EOF) { errorHandler.handleError(IErrors.COMPILE_ERROR, support.getPosition(), "embedded document meets end of file"); return 0; } if (c != '=') continue; if (support.isNextNoCase("end")) { if (support.isEOL()) { break; } c = support.read(); if (Character.isWhitespace(c)) { support.readLine(); break; } else { support.unread(); } } } continue retry; } else { support.unread(); } } } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } c = support.read(); if (c == '=') { c = support.read(); if (c == '=') { return Token.tEQQ; } support.unread(); return Token.tEQ; } if (c == '~') { return Token.tMATCH; } else if (c == '>') { return Token.tASSOC; } support.unread(); return '='; case '<': c = support.read(); if (c == '<' && lex_state != LexState.EXPR_END && lex_state != LexState.EXPR_DOT && lex_state != LexState.EXPR_ENDARG && lex_state != LexState.EXPR_CLASS && (!lex_state.isArgument() || spaceSeen)) { int token = hereDocumentIdentifier(); if (token != 0) return token; } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } if (c == '=') { if ((c = support.read()) == '>') { return Token.tCMP; } support.unread(); return Token.tLEQ; } if (c == '<') { if ((c = support.read()) == '=') { yaccValue = "<<"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); return Token.tLSHFT; } support.unread(); return '<'; case '>': if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } if ((c = support.read()) == '=') { return Token.tGEQ; } if (c == '>') { if ((c = support.read()) == '=') { yaccValue = ">>"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); return Token.tRSHFT; } support.unread(); return '>'; case '"': lex_strterm = new StrTermNode(support.getPosition(), str_dquote, '"', 0); return Token.tSTRING_BEG; case '`': if (lex_state == LexState.EXPR_FNAME) { lex_state = LexState.EXPR_END; return c; } if (lex_state == LexState.EXPR_DOT) { if (commandState) { lex_state = LexState.EXPR_CMDARG; } else { lex_state = LexState.EXPR_ARG; } return c; } lex_strterm = new StrTermNode(support.getPosition(), str_xquote, '`', 0); return Token.tXSTRING_BEG; case '\'': lex_strterm = new StrTermNode(support.getPosition(), str_squote, '\'', 0); return Token.tSTRING_BEG; case '?': if (lex_state == LexState.EXPR_END || lex_state == LexState.EXPR_ENDARG) { lex_state = LexState.EXPR_BEG; return '?'; } c = support.read(); if (c == EOF) { errorHandler.handleError(IErrors.COMPILE_ERROR, support.getPosition(), "incomplete character syntax"); return 0; } if (Character.isWhitespace(c)){ if (!lex_state.isArgument()){ int c2 = 0; switch (c) { case ' ': c2 = 's'; break; case '\n': c2 = 'n'; break; case '\t': c2 = 't'; break; /* What is \v in C? case '\v': c2 = 'v'; break; */ case '\r': c2 = 'r'; break; case '\f': c2 = 'f'; break; } if (c2 != 0) { rb_warn("invalid character syntax; use ?\\" + c2); } } support.unread(); lex_state = LexState.EXPR_BEG; return '?'; /*} else if (ismbchar(c)) { // ruby - we don't support them either? rb_warn("multibyte character literal not supported yet; use ?\\" + c); support.unread(); lexState = LexState.EXPR_BEG; return '?';*/ } else if ((Character.isLetterOrDigit(c) || c == '_') && support.isEOL() == false && isNext_identchar()) { support.unread(); lex_state = LexState.EXPR_BEG; return '?'; } else if (c == '\\') { c = (char)read_escape(); } c &= 0xff; lex_state = LexState.EXPR_END; yaccValue = new Long(c); return Token.tINTEGER; case '&': if ((c = support.read()) == '&') { lex_state = LexState.EXPR_BEG; if ((c = support.read()) == '=') { yaccValue = "&&"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); return Token.tANDOP; } else if (c == '=') { yaccValue = "&"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); if (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c)){ rb_warning("`&' interpreted as argument prefix"); c = Token.tAMPER; } else if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { c = Token.tAMPER; } else { c = '&'; } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } return c; case '|': if ((c = support.read()) == '|') { lex_state = LexState.EXPR_BEG; if ((c = support.read()) == '=') { yaccValue = "||"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); return Token.tOROP; } if (c == '=') { yaccValue = "|"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } support.unread(); return '|'; case '+': c = support.read(); if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; if (c == '@') { return Token.tUPLUS; } support.unread(); return '+'; } if (c == '=') { yaccValue = "+"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID || (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c))) { if (lex_state.isArgument()) arg_ambiguous(); lex_state = LexState.EXPR_BEG; support.unread(); if (Character.isDigit(c)) { c = '+'; return parseNumber(c); } return Token.tUPLUS; } lex_state = LexState.EXPR_BEG; support.unread(); return '+'; case '-': c = support.read(); if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; if (c == '@') { return Token.tUMINUS; } support.unread(); return '-'; } if (c == '=') { yaccValue = "-"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID || (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c))) { if (lex_state.isArgument()) arg_ambiguous(); lex_state = LexState.EXPR_BEG; support.unread(); if (Character.isDigit(c)) { return Token.tUMINUS_NUM; } return Token.tUMINUS; } lex_state = LexState.EXPR_BEG; support.unread(); return '-'; case '.': lex_state = LexState.EXPR_BEG; if ((c = support.read()) == '.') { if ((c = support.read()) == '.') { return Token.tDOT3; } support.unread(); return Token.tDOT2; } support.unread(); if (!Character.isDigit(c)) { lex_state = LexState.EXPR_DOT; return '.'; } c = '.'; // fall through //start_num: case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : return parseNumber(c); case ']': case '}': case ')': conditionState.restart(); cmdArgumentState.restart(); lex_state = LexState.EXPR_END; return c; case ':': c = support.read(); if (c == ':') { if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID || lex_state == LexState.EXPR_CLASS || (lex_state.isArgument() && spaceSeen)) { lex_state = LexState.EXPR_BEG; return Token.tCOLON3; } lex_state = LexState.EXPR_DOT; return Token.tCOLON2; } if (lex_state == LexState.EXPR_END || lex_state == LexState.EXPR_ENDARG || Character.isWhitespace(c)) { support.unread(); lex_state = LexState.EXPR_BEG; return ':'; } switch (c) { case '\'': lex_strterm = new StrTermNode(support.getPosition(), str_ssym, c, 0); break; case '"': lex_strterm = new StrTermNode(support.getPosition(), str_dsym, c, 0); break; default: support.unread(); break; } lex_state = LexState.EXPR_FNAME; return Token.tSYMBEG; case '/': if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { lex_strterm = new StrTermNode(support.getPosition(), str_regexp, '/', 0); return Token.tREGEXP_BEG; } if ((c = support.read()) == '=') { yaccValue = "/"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); if (lex_state.isArgument() && spaceSeen) { if (!Character.isWhitespace(c)) { arg_ambiguous(); lex_strterm = new StrTermNode(support.getPosition(), str_regexp, '/', 0); return Token.tREGEXP_BEG; } } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } return '/'; case '^': if ((c = support.read()) == '=') { yaccValue = "^"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } support.unread(); return '^'; case ';': commandStart = true; case ',': lex_state = LexState.EXPR_BEG; return c; case '~': if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { if ((c = support.read()) != '@') { support.unread(); } } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } return '~'; case '(': commandStart = true; if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { c = Token.tLPAREN; } else if (spaceSeen) { if (lex_state == LexState.EXPR_CMDARG) { c = Token.tLPAREN_ARG; } else if (lex_state == LexState.EXPR_ARG) { rb_warn("don't put space before argument parentheses"); c = '('; } } conditionState.stop(); cmdArgumentState.stop(); lex_state = LexState.EXPR_BEG; return c; case '[': if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; if ((c = support.read()) == ']') { if ((c = support.read()) == '=') { return Token.tASET; } support.unread(); return Token.tAREF; } support.unread(); return '['; } else if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { c = Token.tLBRACK; } else if (lex_state.isArgument() && spaceSeen) { c = Token.tLBRACK; } lex_state = LexState.EXPR_BEG; conditionState.stop(); cmdArgumentState.stop(); return c; case '{': if (lex_state.isArgument() || lex_state == LexState.EXPR_END) { c = '{'; /* block (primary) */ } else if (lex_state == LexState.EXPR_ENDARG) { c = Token.tLBRACE_ARG; /* block (expr) */ } else { c = Token.tLBRACE; /* hash */ } conditionState.stop(); cmdArgumentState.stop(); lex_state = LexState.EXPR_BEG; return c; case '\\': c = support.read(); if (c == '\n') { spaceSeen = true; continue retry; /* skip \\n */ } support.unread(); return '\\'; case '%': if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { return parseQuote(support.read()); } if ((c = support.read()) == '=') { yaccValue = "%"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c)) { return parseQuote(c); } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } support.unread(); return '%'; case '$': lex_state = LexState.EXPR_END; newToken(); c = support.read(); switch (c) { case '_': /* $_: last read line string */ c = support.read(); if (isIdentifierChar(c)) { tokadd('$'); tokadd('_'); break; } support.unread(); c = '_'; /* fall through */ case '~': /* $~: match-data */ // Enebo: We had following line replace line after that, // but it is commented out... //parserSupport.getLocalNames().getLocalIndex(String.valueOf(c)); //local_cnt(c); /* fall through */ case '*': /* $*: argv */ case '$': /* $$: pid */ case '?': /* $?: last status */ case '!': /* $!: error string */ case '@': /* $@: error position */ case '/': /* $/: input record separator */ case '\\': /* $\: output record separator */ case ';': /* $;: field separator */ case ',': /* $,: output field separator */ case '.': /* $.: last read line number */ case '=': /* $=: ignorecase */ case ':': /* $:: load path */ case '<': /* $<: reading filename */ case '>': /* $>: default output handle */ case '\"': /* $": already loaded files */ tokadd('$'); tokadd(c); yaccValue = tok(); return Token.tGVAR; case '-': tokadd('$'); tokadd(c); c = support.read(); tokadd(c); yaccValue = tok(); /* xxx shouldn't check if valid option variable */ return Token.tGVAR; case '&': /* $&: last match */ case '`': /* $`: string before last match */ case '\'': /* $': string after last match */ case '+': /* $+: string matches last paren. */ yaccValue = new BackRefNode(support.getPosition(), c); return Token.tBACK_REF; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': tokadd('$'); do { tokadd(c); c = support.read(); } while (Character.isDigit(c)); support.unread(); yaccValue = new NthRefNode(support.getPosition(), Integer.parseInt(tok().substring(1))); return Token.tNTH_REF; default: if (!isIdentifierChar(c)) { support.unread(); return '$'; } case '0': tokadd('$'); } break; case '@': c = support.read(); newToken(); tokadd('@'); if (c == '@') { tokadd('@'); c = support.read(); } if (Character.isDigit(c)) { if (toklen() == 1) { rb_compile_error("`@" + c + "' is not allowed as an instance variable name"); } else { rb_compile_error("`@@" + c + "' is not allowed as a class variable name"); } } if (!isIdentifierChar(c)) { support.unread(); return '@'; } break; case '_': if (was_bol() && whole_match_p("__END__", false)) { return 0; } newToken(); break; default: if (!isIdentifierChar(c)) { rb_compile_error("Invalid char `\\" + c + "' in expression"); continue retry; } newToken(); break; } do { tokadd(c); if (ismbchar(c)) { int i, len = mbclen(c)-1; for (i = 0; i < len; i++) { c = support.read(); tokadd(c); } } c = support.read(); } while (isIdentifierChar(c)); char peek = support.read(); if ((c == '!' || c == '?') && isIdentifierChar(tok().charAt(0)) && peek != '=') { support.unread(); // put peek back. tokadd(c); } else { support.unreadMany(2); // put peek back. } int result = 0; switch (tok().charAt(0)) { case '$': lex_state = LexState.EXPR_END; result = Token.tGVAR; break; case '@': lex_state = LexState.EXPR_END; if (tok().charAt(1) == '@') { result = Token.tCVAR; } else { result = Token.tIVAR; } break; default: if (toklast() == '!' || toklast() == '?') { result = Token.tFID; } else { if (lex_state == LexState.EXPR_FNAME) { if ((c = support.read()) == '=' && !peek('~') && !peek('>') && (!peek('=') || (support.isEOL() && support.getCharAt(1) == '>'))) { result = Token.tIDENTIFIER; tokadd(c); } else { support.unread(); } } if (result == 0 && ISUPPER(tok().charAt(0))) { result = Token.tCONSTANT; } else { result = Token.tIDENTIFIER; } } if (lex_state != LexState.EXPR_DOT) { /* See if it is a reserved word. */ Keyword keyword = getKeyword(tok(), toklen()); if (keyword != null) { // enum lex_state LexState state = lex_state; lex_state = keyword.state; if (state.isExprFName()) { yaccValue = keyword.name; } if (keyword.id0 == Token.kDO) { if (conditionState.isInState()) { return Token.kDO_COND; } if (cmdArgumentState.isInState() && state != LexState.EXPR_CMDARG) { return Token.kDO_BLOCK; } if (state == LexState.EXPR_ENDARG) { return Token.kDO_BLOCK; } return Token.kDO; } if (state == LexState.EXPR_BEG) { return keyword.id0; } else { if (keyword.id0 != keyword.id1) lex_state = LexState.EXPR_BEG; return keyword.id1; } } } if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID || lex_state == LexState.EXPR_DOT || lex_state == LexState.EXPR_ARG || lex_state == LexState.EXPR_CMDARG) { if (commandState) { lex_state = LexState.EXPR_CMDARG; } else { lex_state = LexState.EXPR_ARG; } } else { lex_state = LexState.EXPR_END; } } yaccValue = tok(); // Lame: parsing logic made it into lexer in ruby...So we // are emulating if (IdUtil.isLocal((String)yaccValue) && ((parserSupport.getBlockNames().isInBlock() && parserSupport.getBlockNames().isDefined((String) yaccValue)) || parserSupport.getLocalNames().isLocalRegistered((String) yaccValue))) { lex_state = LexState.EXPR_END; } return result; } }
|
private int yylex() { char c; boolean spaceSeen = false; boolean commandState; if (lex_strterm != null) { if (lex_strterm instanceof HereDocNode) { int token = hereDocument(); if (token == Token.tSTRING_END) { lex_strterm = null; lex_state = LexState.EXPR_END; } return token; } else { int token = parseString(); if (token == Token.tSTRING_END || token == Token.tREGEXP_END) { lex_strterm = null; lex_state = LexState.EXPR_END; } return token; } } currentPos = support.getPosition(); commandState = commandStart; commandStart = false; retry: for(;;) { c = support.read(); switch(c) { case '\004': /* ^D */ case '\032': /* ^Z */ case 0: /* end of script. */ return 0; /* white spaces */ case ' ': case '\t': case '\f': case '\r': case '\13': /* '\v' */ spaceSeen = true; continue retry; case '#': /* it's a comment */ while ((c = support.read()) != '\n') { if (c == EOF) { return 0; } } /* fall through */ case '\n': if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT || lex_state == LexState.EXPR_CLASS) { continue retry; } commandStart = true; lex_state = LexState.EXPR_BEG; return '\n'; case '*': if ((c = support.read()) == '*') { if ((c = support.read()) == '=') { yaccValue = "**"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); c = Token.tPOW; } else { if (c == '=') { yaccValue = "*"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); if (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c)) { errorHandler.handleError(IErrors.WARNING, support.getPosition(), "`*' interpreted as argument prefix"); c = Token.tSTAR; } else if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { c = Token.tSTAR; } else { c = '*'; } } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } return c; case '!': lex_state = LexState.EXPR_BEG; if ((c = support.read()) == '=') { return Token.tNEQ; } if (c == '~') { return Token.tNMATCH; } support.unread(); return '!'; case '=': // Skip documentation nodes if (was_bol()) { /* skip embedded rd document */ if (support.isNextNoCase("begin")) { c = support.read(); if (Character.isWhitespace(c)) { // In case last next was the newline. support.unread(); for (;;) { c = support.read(); if (c == EOF) { errorHandler.handleError(IErrors.COMPILE_ERROR, support.getPosition(), "embedded document meets end of file"); return 0; } if (c != '=') continue; if (support.isNextNoCase("end")) { if (support.isEOL()) { break; } c = support.read(); if (Character.isWhitespace(c)) { break; } else { support.unread(); } } } continue retry; } else { support.unread(); } } } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } c = support.read(); if (c == '=') { c = support.read(); if (c == '=') { return Token.tEQQ; } support.unread(); return Token.tEQ; } if (c == '~') { return Token.tMATCH; } else if (c == '>') { return Token.tASSOC; } support.unread(); return '='; case '<': c = support.read(); if (c == '<' && lex_state != LexState.EXPR_END && lex_state != LexState.EXPR_DOT && lex_state != LexState.EXPR_ENDARG && lex_state != LexState.EXPR_CLASS && (!lex_state.isArgument() || spaceSeen)) { int token = hereDocumentIdentifier(); if (token != 0) return token; } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } if (c == '=') { if ((c = support.read()) == '>') { return Token.tCMP; } support.unread(); return Token.tLEQ; } if (c == '<') { if ((c = support.read()) == '=') { yaccValue = "<<"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); return Token.tLSHFT; } support.unread(); return '<'; case '>': if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } if ((c = support.read()) == '=') { return Token.tGEQ; } if (c == '>') { if ((c = support.read()) == '=') { yaccValue = ">>"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); return Token.tRSHFT; } support.unread(); return '>'; case '"': lex_strterm = new StrTermNode(support.getPosition(), str_dquote, '"', 0); return Token.tSTRING_BEG; case '`': if (lex_state == LexState.EXPR_FNAME) { lex_state = LexState.EXPR_END; return c; } if (lex_state == LexState.EXPR_DOT) { if (commandState) { lex_state = LexState.EXPR_CMDARG; } else { lex_state = LexState.EXPR_ARG; } return c; } lex_strterm = new StrTermNode(support.getPosition(), str_xquote, '`', 0); return Token.tXSTRING_BEG; case '\'': lex_strterm = new StrTermNode(support.getPosition(), str_squote, '\'', 0); return Token.tSTRING_BEG; case '?': if (lex_state == LexState.EXPR_END || lex_state == LexState.EXPR_ENDARG) { lex_state = LexState.EXPR_BEG; return '?'; } c = support.read(); if (c == EOF) { errorHandler.handleError(IErrors.COMPILE_ERROR, support.getPosition(), "incomplete character syntax"); return 0; } if (Character.isWhitespace(c)){ if (!lex_state.isArgument()){ int c2 = 0; switch (c) { case ' ': c2 = 's'; break; case '\n': c2 = 'n'; break; case '\t': c2 = 't'; break; /* What is \v in C? case '\v': c2 = 'v'; break; */ case '\r': c2 = 'r'; break; case '\f': c2 = 'f'; break; } if (c2 != 0) { rb_warn("invalid character syntax; use ?\\" + c2); } } support.unread(); lex_state = LexState.EXPR_BEG; return '?'; /*} else if (ismbchar(c)) { // ruby - we don't support them either? rb_warn("multibyte character literal not supported yet; use ?\\" + c); support.unread(); lexState = LexState.EXPR_BEG; return '?';*/ } else if ((Character.isLetterOrDigit(c) || c == '_') && support.isEOL() == false && isNext_identchar()) { support.unread(); lex_state = LexState.EXPR_BEG; return '?'; } else if (c == '\\') { c = (char)read_escape(); } c &= 0xff; lex_state = LexState.EXPR_END; yaccValue = new Long(c); return Token.tINTEGER; case '&': if ((c = support.read()) == '&') { lex_state = LexState.EXPR_BEG; if ((c = support.read()) == '=') { yaccValue = "&&"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); return Token.tANDOP; } else if (c == '=') { yaccValue = "&"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); if (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c)){ rb_warning("`&' interpreted as argument prefix"); c = Token.tAMPER; } else if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { c = Token.tAMPER; } else { c = '&'; } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } return c; case '|': if ((c = support.read()) == '|') { lex_state = LexState.EXPR_BEG; if ((c = support.read()) == '=') { yaccValue = "||"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); return Token.tOROP; } if (c == '=') { yaccValue = "|"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } support.unread(); return '|'; case '+': c = support.read(); if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; if (c == '@') { return Token.tUPLUS; } support.unread(); return '+'; } if (c == '=') { yaccValue = "+"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID || (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c))) { if (lex_state.isArgument()) arg_ambiguous(); lex_state = LexState.EXPR_BEG; support.unread(); if (Character.isDigit(c)) { c = '+'; return parseNumber(c); } return Token.tUPLUS; } lex_state = LexState.EXPR_BEG; support.unread(); return '+'; case '-': c = support.read(); if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; if (c == '@') { return Token.tUMINUS; } support.unread(); return '-'; } if (c == '=') { yaccValue = "-"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID || (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c))) { if (lex_state.isArgument()) arg_ambiguous(); lex_state = LexState.EXPR_BEG; support.unread(); if (Character.isDigit(c)) { return Token.tUMINUS_NUM; } return Token.tUMINUS; } lex_state = LexState.EXPR_BEG; support.unread(); return '-'; case '.': lex_state = LexState.EXPR_BEG; if ((c = support.read()) == '.') { if ((c = support.read()) == '.') { return Token.tDOT3; } support.unread(); return Token.tDOT2; } support.unread(); if (!Character.isDigit(c)) { lex_state = LexState.EXPR_DOT; return '.'; } c = '.'; // fall through //start_num: case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : return parseNumber(c); case ']': case '}': case ')': conditionState.restart(); cmdArgumentState.restart(); lex_state = LexState.EXPR_END; return c; case ':': c = support.read(); if (c == ':') { if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID || lex_state == LexState.EXPR_CLASS || (lex_state.isArgument() && spaceSeen)) { lex_state = LexState.EXPR_BEG; return Token.tCOLON3; } lex_state = LexState.EXPR_DOT; return Token.tCOLON2; } if (lex_state == LexState.EXPR_END || lex_state == LexState.EXPR_ENDARG || Character.isWhitespace(c)) { support.unread(); lex_state = LexState.EXPR_BEG; return ':'; } switch (c) { case '\'': lex_strterm = new StrTermNode(support.getPosition(), str_ssym, c, 0); break; case '"': lex_strterm = new StrTermNode(support.getPosition(), str_dsym, c, 0); break; default: support.unread(); break; } lex_state = LexState.EXPR_FNAME; return Token.tSYMBEG; case '/': if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { lex_strterm = new StrTermNode(support.getPosition(), str_regexp, '/', 0); return Token.tREGEXP_BEG; } if ((c = support.read()) == '=') { yaccValue = "/"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); if (lex_state.isArgument() && spaceSeen) { if (!Character.isWhitespace(c)) { arg_ambiguous(); lex_strterm = new StrTermNode(support.getPosition(), str_regexp, '/', 0); return Token.tREGEXP_BEG; } } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } return '/'; case '^': if ((c = support.read()) == '=') { yaccValue = "^"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } support.unread(); return '^'; case ';': commandStart = true; case ',': lex_state = LexState.EXPR_BEG; return c; case '~': if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { if ((c = support.read()) != '@') { support.unread(); } } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } return '~'; case '(': commandStart = true; if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { c = Token.tLPAREN; } else if (spaceSeen) { if (lex_state == LexState.EXPR_CMDARG) { c = Token.tLPAREN_ARG; } else if (lex_state == LexState.EXPR_ARG) { rb_warn("don't put space before argument parentheses"); c = '('; } } conditionState.stop(); cmdArgumentState.stop(); lex_state = LexState.EXPR_BEG; return c; case '[': if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; if ((c = support.read()) == ']') { if ((c = support.read()) == '=') { return Token.tASET; } support.unread(); return Token.tAREF; } support.unread(); return '['; } else if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { c = Token.tLBRACK; } else if (lex_state.isArgument() && spaceSeen) { c = Token.tLBRACK; } lex_state = LexState.EXPR_BEG; conditionState.stop(); cmdArgumentState.stop(); return c; case '{': if (lex_state.isArgument() || lex_state == LexState.EXPR_END) { c = '{'; /* block (primary) */ } else if (lex_state == LexState.EXPR_ENDARG) { c = Token.tLBRACE_ARG; /* block (expr) */ } else { c = Token.tLBRACE; /* hash */ } conditionState.stop(); cmdArgumentState.stop(); lex_state = LexState.EXPR_BEG; return c; case '\\': c = support.read(); if (c == '\n') { spaceSeen = true; continue retry; /* skip \\n */ } support.unread(); return '\\'; case '%': if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { return parseQuote(support.read()); } if ((c = support.read()) == '=') { yaccValue = "%"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c)) { return parseQuote(c); } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } support.unread(); return '%'; case '$': lex_state = LexState.EXPR_END; newToken(); c = support.read(); switch (c) { case '_': /* $_: last read line string */ c = support.read(); if (isIdentifierChar(c)) { tokadd('$'); tokadd('_'); break; } support.unread(); c = '_'; /* fall through */ case '~': /* $~: match-data */ // Enebo: We had following line replace line after that, // but it is commented out... //parserSupport.getLocalNames().getLocalIndex(String.valueOf(c)); //local_cnt(c); /* fall through */ case '*': /* $*: argv */ case '$': /* $$: pid */ case '?': /* $?: last status */ case '!': /* $!: error string */ case '@': /* $@: error position */ case '/': /* $/: input record separator */ case '\\': /* $\: output record separator */ case ';': /* $;: field separator */ case ',': /* $,: output field separator */ case '.': /* $.: last read line number */ case '=': /* $=: ignorecase */ case ':': /* $:: load path */ case '<': /* $<: reading filename */ case '>': /* $>: default output handle */ case '\"': /* $": already loaded files */ tokadd('$'); tokadd(c); yaccValue = tok(); return Token.tGVAR; case '-': tokadd('$'); tokadd(c); c = support.read(); tokadd(c); yaccValue = tok(); /* xxx shouldn't check if valid option variable */ return Token.tGVAR; case '&': /* $&: last match */ case '`': /* $`: string before last match */ case '\'': /* $': string after last match */ case '+': /* $+: string matches last paren. */ yaccValue = new BackRefNode(support.getPosition(), c); return Token.tBACK_REF; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': tokadd('$'); do { tokadd(c); c = support.read(); } while (Character.isDigit(c)); support.unread(); yaccValue = new NthRefNode(support.getPosition(), Integer.parseInt(tok().substring(1))); return Token.tNTH_REF; default: if (!isIdentifierChar(c)) { support.unread(); return '$'; } case '0': tokadd('$'); } break; case '@': c = support.read(); newToken(); tokadd('@'); if (c == '@') { tokadd('@'); c = support.read(); } if (Character.isDigit(c)) { if (toklen() == 1) { rb_compile_error("`@" + c + "' is not allowed as an instance variable name"); } else { rb_compile_error("`@@" + c + "' is not allowed as a class variable name"); } } if (!isIdentifierChar(c)) { support.unread(); return '@'; } break; case '_': if (was_bol() && whole_match_p("__END__", false)) { return 0; } newToken(); break; default: if (!isIdentifierChar(c)) { rb_compile_error("Invalid char `\\" + c + "' in expression"); continue retry; } newToken(); break; } do { tokadd(c); if (ismbchar(c)) { int i, len = mbclen(c)-1; for (i = 0; i < len; i++) { c = support.read(); tokadd(c); } } c = support.read(); } while (isIdentifierChar(c)); char peek = support.read(); if ((c == '!' || c == '?') && isIdentifierChar(tok().charAt(0)) && peek != '=') { support.unread(); // put peek back. tokadd(c); } else { support.unreadMany(2); // put peek back. } int result = 0; switch (tok().charAt(0)) { case '$': lex_state = LexState.EXPR_END; result = Token.tGVAR; break; case '@': lex_state = LexState.EXPR_END; if (tok().charAt(1) == '@') { result = Token.tCVAR; } else { result = Token.tIVAR; } break; default: if (toklast() == '!' || toklast() == '?') { result = Token.tFID; } else { if (lex_state == LexState.EXPR_FNAME) { if ((c = support.read()) == '=' && !peek('~') && !peek('>') && (!peek('=') || (support.isEOL() && support.getCharAt(1) == '>'))) { result = Token.tIDENTIFIER; tokadd(c); } else { support.unread(); } } if (result == 0 && ISUPPER(tok().charAt(0))) { result = Token.tCONSTANT; } else { result = Token.tIDENTIFIER; } } if (lex_state != LexState.EXPR_DOT) { /* See if it is a reserved word. */ Keyword keyword = getKeyword(tok(), toklen()); if (keyword != null) { // enum lex_state LexState state = lex_state; lex_state = keyword.state; if (state.isExprFName()) { yaccValue = keyword.name; } if (keyword.id0 == Token.kDO) { if (conditionState.isInState()) { return Token.kDO_COND; } if (cmdArgumentState.isInState() && state != LexState.EXPR_CMDARG) { return Token.kDO_BLOCK; } if (state == LexState.EXPR_ENDARG) { return Token.kDO_BLOCK; } return Token.kDO; } if (state == LexState.EXPR_BEG) { return keyword.id0; } else { if (keyword.id0 != keyword.id1) lex_state = LexState.EXPR_BEG; return keyword.id1; } } } if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID || lex_state == LexState.EXPR_DOT || lex_state == LexState.EXPR_ARG || lex_state == LexState.EXPR_CMDARG) { if (commandState) { lex_state = LexState.EXPR_CMDARG; } else { lex_state = LexState.EXPR_ARG; } } else { lex_state = LexState.EXPR_END; } } yaccValue = tok(); // Lame: parsing logic made it into lexer in ruby...So we // are emulating if (IdUtil.isLocal((String)yaccValue) && ((parserSupport.getBlockNames().isInBlock() && parserSupport.getBlockNames().isDefined((String) yaccValue)) || parserSupport.getLocalNames().isLocalRegistered((String) yaccValue))) { lex_state = LexState.EXPR_END; } return result; } }
| 3,232,255
|
private int yylex() { char c; boolean spaceSeen = false; boolean commandState; if (lex_strterm != null) { if (lex_strterm instanceof HereDocNode) { int token = hereDocument(); if (token == Token.tSTRING_END) { lex_strterm = null; lex_state = LexState.EXPR_END; } return token; } else { int token = parseString(); if (token == Token.tSTRING_END || token == Token.tREGEXP_END) { lex_strterm = null; lex_state = LexState.EXPR_END; } return token; } } currentPos = support.getPosition(); commandState = commandStart; commandStart = false; retry: for(;;) { c = support.read(); switch(c) { case '\004': /* ^D */ case '\032': /* ^Z */ case 0: /* end of script. */ return 0; /* white spaces */ case ' ': case '\t': case '\f': case '\r': case '\13': /* '\v' */ spaceSeen = true; continue retry; case '#': /* it's a comment */ while ((c = support.read()) != '\n') { if (c == EOF) { return 0; } } /* fall through */ case '\n': if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT || lex_state == LexState.EXPR_CLASS) { continue retry; } commandStart = true; lex_state = LexState.EXPR_BEG; return '\n'; case '*': if ((c = support.read()) == '*') { if ((c = support.read()) == '=') { yaccValue = "**"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); c = Token.tPOW; } else { if (c == '=') { yaccValue = "*"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); if (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c)) { errorHandler.handleError(IErrors.WARNING, support.getPosition(), "`*' interpreted as argument prefix"); c = Token.tSTAR; } else if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { c = Token.tSTAR; } else { c = '*'; } } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } return c; case '!': lex_state = LexState.EXPR_BEG; if ((c = support.read()) == '=') { return Token.tNEQ; } if (c == '~') { return Token.tNMATCH; } support.unread(); return '!'; case '=': // Skip documentation nodes if (was_bol()) { /* skip embedded rd document */ if (support.isNextNoCase("begin")) { c = support.read(); if (Character.isWhitespace(c)) { // In case last next was the newline. support.unread(); for (;;) { support.readLine(); c = support.read(); if (c == EOF) { errorHandler.handleError(IErrors.COMPILE_ERROR, support.getPosition(), "embedded document meets end of file"); return 0; } if (c != '=') continue; if (support.isNextNoCase("end")) { if (support.isEOL()) { break; } c = support.read(); if (Character.isWhitespace(c)) { support.readLine(); break; } else { support.unread(); } } } continue retry; } else { support.unread(); } } } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } c = support.read(); if (c == '=') { c = support.read(); if (c == '=') { return Token.tEQQ; } support.unread(); return Token.tEQ; } if (c == '~') { return Token.tMATCH; } else if (c == '>') { return Token.tASSOC; } support.unread(); return '='; case '<': c = support.read(); if (c == '<' && lex_state != LexState.EXPR_END && lex_state != LexState.EXPR_DOT && lex_state != LexState.EXPR_ENDARG && lex_state != LexState.EXPR_CLASS && (!lex_state.isArgument() || spaceSeen)) { int token = hereDocumentIdentifier(); if (token != 0) return token; } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } if (c == '=') { if ((c = support.read()) == '>') { return Token.tCMP; } support.unread(); return Token.tLEQ; } if (c == '<') { if ((c = support.read()) == '=') { yaccValue = "<<"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); return Token.tLSHFT; } support.unread(); return '<'; case '>': if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } if ((c = support.read()) == '=') { return Token.tGEQ; } if (c == '>') { if ((c = support.read()) == '=') { yaccValue = ">>"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); return Token.tRSHFT; } support.unread(); return '>'; case '"': lex_strterm = new StrTermNode(support.getPosition(), str_dquote, '"', 0); return Token.tSTRING_BEG; case '`': if (lex_state == LexState.EXPR_FNAME) { lex_state = LexState.EXPR_END; return c; } if (lex_state == LexState.EXPR_DOT) { if (commandState) { lex_state = LexState.EXPR_CMDARG; } else { lex_state = LexState.EXPR_ARG; } return c; } lex_strterm = new StrTermNode(support.getPosition(), str_xquote, '`', 0); return Token.tXSTRING_BEG; case '\'': lex_strterm = new StrTermNode(support.getPosition(), str_squote, '\'', 0); return Token.tSTRING_BEG; case '?': if (lex_state == LexState.EXPR_END || lex_state == LexState.EXPR_ENDARG) { lex_state = LexState.EXPR_BEG; return '?'; } c = support.read(); if (c == EOF) { errorHandler.handleError(IErrors.COMPILE_ERROR, support.getPosition(), "incomplete character syntax"); return 0; } if (Character.isWhitespace(c)){ if (!lex_state.isArgument()){ int c2 = 0; switch (c) { case ' ': c2 = 's'; break; case '\n': c2 = 'n'; break; case '\t': c2 = 't'; break; /* What is \v in C? case '\v': c2 = 'v'; break; */ case '\r': c2 = 'r'; break; case '\f': c2 = 'f'; break; } if (c2 != 0) { rb_warn("invalid character syntax; use ?\\" + c2); } } support.unread(); lex_state = LexState.EXPR_BEG; return '?'; /*} else if (ismbchar(c)) { // ruby - we don't support them either? rb_warn("multibyte character literal not supported yet; use ?\\" + c); support.unread(); lexState = LexState.EXPR_BEG; return '?';*/ } else if ((Character.isLetterOrDigit(c) || c == '_') && support.isEOL() == false && isNext_identchar()) { support.unread(); lex_state = LexState.EXPR_BEG; return '?'; } else if (c == '\\') { c = (char)read_escape(); } c &= 0xff; lex_state = LexState.EXPR_END; yaccValue = new Long(c); return Token.tINTEGER; case '&': if ((c = support.read()) == '&') { lex_state = LexState.EXPR_BEG; if ((c = support.read()) == '=') { yaccValue = "&&"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); return Token.tANDOP; } else if (c == '=') { yaccValue = "&"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); if (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c)){ rb_warning("`&' interpreted as argument prefix"); c = Token.tAMPER; } else if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { c = Token.tAMPER; } else { c = '&'; } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } return c; case '|': if ((c = support.read()) == '|') { lex_state = LexState.EXPR_BEG; if ((c = support.read()) == '=') { yaccValue = "||"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); return Token.tOROP; } if (c == '=') { yaccValue = "|"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } support.unread(); return '|'; case '+': c = support.read(); if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; if (c == '@') { return Token.tUPLUS; } support.unread(); return '+'; } if (c == '=') { yaccValue = "+"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID || (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c))) { if (lex_state.isArgument()) arg_ambiguous(); lex_state = LexState.EXPR_BEG; support.unread(); if (Character.isDigit(c)) { c = '+'; return parseNumber(c); } return Token.tUPLUS; } lex_state = LexState.EXPR_BEG; support.unread(); return '+'; case '-': c = support.read(); if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; if (c == '@') { return Token.tUMINUS; } support.unread(); return '-'; } if (c == '=') { yaccValue = "-"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID || (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c))) { if (lex_state.isArgument()) arg_ambiguous(); lex_state = LexState.EXPR_BEG; support.unread(); if (Character.isDigit(c)) { return Token.tUMINUS_NUM; } return Token.tUMINUS; } lex_state = LexState.EXPR_BEG; support.unread(); return '-'; case '.': lex_state = LexState.EXPR_BEG; if ((c = support.read()) == '.') { if ((c = support.read()) == '.') { return Token.tDOT3; } support.unread(); return Token.tDOT2; } support.unread(); if (!Character.isDigit(c)) { lex_state = LexState.EXPR_DOT; return '.'; } c = '.'; // fall through //start_num: case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : return parseNumber(c); case ']': case '}': case ')': conditionState.restart(); cmdArgumentState.restart(); lex_state = LexState.EXPR_END; return c; case ':': c = support.read(); if (c == ':') { if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID || lex_state == LexState.EXPR_CLASS || (lex_state.isArgument() && spaceSeen)) { lex_state = LexState.EXPR_BEG; return Token.tCOLON3; } lex_state = LexState.EXPR_DOT; return Token.tCOLON2; } if (lex_state == LexState.EXPR_END || lex_state == LexState.EXPR_ENDARG || Character.isWhitespace(c)) { support.unread(); lex_state = LexState.EXPR_BEG; return ':'; } switch (c) { case '\'': lex_strterm = new StrTermNode(support.getPosition(), str_ssym, c, 0); break; case '"': lex_strterm = new StrTermNode(support.getPosition(), str_dsym, c, 0); break; default: support.unread(); break; } lex_state = LexState.EXPR_FNAME; return Token.tSYMBEG; case '/': if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { lex_strterm = new StrTermNode(support.getPosition(), str_regexp, '/', 0); return Token.tREGEXP_BEG; } if ((c = support.read()) == '=') { yaccValue = "/"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); if (lex_state.isArgument() && spaceSeen) { if (!Character.isWhitespace(c)) { arg_ambiguous(); lex_strterm = new StrTermNode(support.getPosition(), str_regexp, '/', 0); return Token.tREGEXP_BEG; } } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } return '/'; case '^': if ((c = support.read()) == '=') { yaccValue = "^"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } support.unread(); return '^'; case ';': commandStart = true; case ',': lex_state = LexState.EXPR_BEG; return c; case '~': if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { if ((c = support.read()) != '@') { support.unread(); } } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } return '~'; case '(': commandStart = true; if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { c = Token.tLPAREN; } else if (spaceSeen) { if (lex_state == LexState.EXPR_CMDARG) { c = Token.tLPAREN_ARG; } else if (lex_state == LexState.EXPR_ARG) { rb_warn("don't put space before argument parentheses"); c = '('; } } conditionState.stop(); cmdArgumentState.stop(); lex_state = LexState.EXPR_BEG; return c; case '[': if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; if ((c = support.read()) == ']') { if ((c = support.read()) == '=') { return Token.tASET; } support.unread(); return Token.tAREF; } support.unread(); return '['; } else if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { c = Token.tLBRACK; } else if (lex_state.isArgument() && spaceSeen) { c = Token.tLBRACK; } lex_state = LexState.EXPR_BEG; conditionState.stop(); cmdArgumentState.stop(); return c; case '{': if (lex_state.isArgument() || lex_state == LexState.EXPR_END) { c = '{'; /* block (primary) */ } else if (lex_state == LexState.EXPR_ENDARG) { c = Token.tLBRACE_ARG; /* block (expr) */ } else { c = Token.tLBRACE; /* hash */ } conditionState.stop(); cmdArgumentState.stop(); lex_state = LexState.EXPR_BEG; return c; case '\\': c = support.read(); if (c == '\n') { spaceSeen = true; continue retry; /* skip \\n */ } support.unread(); return '\\'; case '%': if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { return parseQuote(support.read()); } if ((c = support.read()) == '=') { yaccValue = "%"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c)) { return parseQuote(c); } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } support.unread(); return '%'; case '$': lex_state = LexState.EXPR_END; newToken(); c = support.read(); switch (c) { case '_': /* $_: last read line string */ c = support.read(); if (isIdentifierChar(c)) { tokadd('$'); tokadd('_'); break; } support.unread(); c = '_'; /* fall through */ case '~': /* $~: match-data */ // Enebo: We had following line replace line after that, // but it is commented out... //parserSupport.getLocalNames().getLocalIndex(String.valueOf(c)); //local_cnt(c); /* fall through */ case '*': /* $*: argv */ case '$': /* $$: pid */ case '?': /* $?: last status */ case '!': /* $!: error string */ case '@': /* $@: error position */ case '/': /* $/: input record separator */ case '\\': /* $\: output record separator */ case ';': /* $;: field separator */ case ',': /* $,: output field separator */ case '.': /* $.: last read line number */ case '=': /* $=: ignorecase */ case ':': /* $:: load path */ case '<': /* $<: reading filename */ case '>': /* $>: default output handle */ case '\"': /* $": already loaded files */ tokadd('$'); tokadd(c); yaccValue = tok(); return Token.tGVAR; case '-': tokadd('$'); tokadd(c); c = support.read(); tokadd(c); yaccValue = tok(); /* xxx shouldn't check if valid option variable */ return Token.tGVAR; case '&': /* $&: last match */ case '`': /* $`: string before last match */ case '\'': /* $': string after last match */ case '+': /* $+: string matches last paren. */ yaccValue = new BackRefNode(support.getPosition(), c); return Token.tBACK_REF; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': tokadd('$'); do { tokadd(c); c = support.read(); } while (Character.isDigit(c)); support.unread(); yaccValue = new NthRefNode(support.getPosition(), Integer.parseInt(tok().substring(1))); return Token.tNTH_REF; default: if (!isIdentifierChar(c)) { support.unread(); return '$'; } case '0': tokadd('$'); } break; case '@': c = support.read(); newToken(); tokadd('@'); if (c == '@') { tokadd('@'); c = support.read(); } if (Character.isDigit(c)) { if (toklen() == 1) { rb_compile_error("`@" + c + "' is not allowed as an instance variable name"); } else { rb_compile_error("`@@" + c + "' is not allowed as a class variable name"); } } if (!isIdentifierChar(c)) { support.unread(); return '@'; } break; case '_': if (was_bol() && whole_match_p("__END__", false)) { return 0; } newToken(); break; default: if (!isIdentifierChar(c)) { rb_compile_error("Invalid char `\\" + c + "' in expression"); continue retry; } newToken(); break; } do { tokadd(c); if (ismbchar(c)) { int i, len = mbclen(c)-1; for (i = 0; i < len; i++) { c = support.read(); tokadd(c); } } c = support.read(); } while (isIdentifierChar(c)); char peek = support.read(); if ((c == '!' || c == '?') && isIdentifierChar(tok().charAt(0)) && peek != '=') { support.unread(); // put peek back. tokadd(c); } else { support.unreadMany(2); // put peek back. } int result = 0; switch (tok().charAt(0)) { case '$': lex_state = LexState.EXPR_END; result = Token.tGVAR; break; case '@': lex_state = LexState.EXPR_END; if (tok().charAt(1) == '@') { result = Token.tCVAR; } else { result = Token.tIVAR; } break; default: if (toklast() == '!' || toklast() == '?') { result = Token.tFID; } else { if (lex_state == LexState.EXPR_FNAME) { if ((c = support.read()) == '=' && !peek('~') && !peek('>') && (!peek('=') || (support.isEOL() && support.getCharAt(1) == '>'))) { result = Token.tIDENTIFIER; tokadd(c); } else { support.unread(); } } if (result == 0 && ISUPPER(tok().charAt(0))) { result = Token.tCONSTANT; } else { result = Token.tIDENTIFIER; } } if (lex_state != LexState.EXPR_DOT) { /* See if it is a reserved word. */ Keyword keyword = getKeyword(tok(), toklen()); if (keyword != null) { // enum lex_state LexState state = lex_state; lex_state = keyword.state; if (state.isExprFName()) { yaccValue = keyword.name; } if (keyword.id0 == Token.kDO) { if (conditionState.isInState()) { return Token.kDO_COND; } if (cmdArgumentState.isInState() && state != LexState.EXPR_CMDARG) { return Token.kDO_BLOCK; } if (state == LexState.EXPR_ENDARG) { return Token.kDO_BLOCK; } return Token.kDO; } if (state == LexState.EXPR_BEG) { return keyword.id0; } else { if (keyword.id0 != keyword.id1) lex_state = LexState.EXPR_BEG; return keyword.id1; } } } if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID || lex_state == LexState.EXPR_DOT || lex_state == LexState.EXPR_ARG || lex_state == LexState.EXPR_CMDARG) { if (commandState) { lex_state = LexState.EXPR_CMDARG; } else { lex_state = LexState.EXPR_ARG; } } else { lex_state = LexState.EXPR_END; } } yaccValue = tok(); // Lame: parsing logic made it into lexer in ruby...So we // are emulating if (IdUtil.isLocal((String)yaccValue) && ((parserSupport.getBlockNames().isInBlock() && parserSupport.getBlockNames().isDefined((String) yaccValue)) || parserSupport.getLocalNames().isLocalRegistered((String) yaccValue))) { lex_state = LexState.EXPR_END; } return result; } }
|
private int yylex() { char c; boolean spaceSeen = false; boolean commandState; if (lex_strterm != null) { if (lex_strterm instanceof HereDocNode) { int token = hereDocument(); if (token == Token.tSTRING_END) { lex_strterm = null; lex_state = LexState.EXPR_END; } return token; } else { int token = parseString(); if (token == Token.tSTRING_END || token == Token.tREGEXP_END) { lex_strterm = null; lex_state = LexState.EXPR_END; } return token; } } currentPos = support.getPosition(); commandState = commandStart; commandStart = false; retry: for(;;) { c = support.read(); switch(c) { case '\004': /* ^D */ case '\032': /* ^Z */ case 0: /* end of script. */ return 0; /* white spaces */ case ' ': case '\t': case '\f': case '\r': case '\13': /* '\v' */ spaceSeen = true; continue retry; case '#': /* it's a comment */ while ((c = support.read()) != '\n') { if (c == EOF) { return 0; } } /* fall through */ case '\n': if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT || lex_state == LexState.EXPR_CLASS) { continue retry; } commandStart = true; lex_state = LexState.EXPR_BEG; return '\n'; case '*': if ((c = support.read()) == '*') { if ((c = support.read()) == '=') { yaccValue = "**"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); c = Token.tPOW; } else { if (c == '=') { yaccValue = "*"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); if (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c)) { errorHandler.handleError(IErrors.WARNING, support.getPosition(), "`*' interpreted as argument prefix"); c = Token.tSTAR; } else if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { c = Token.tSTAR; } else { c = '*'; } } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } return c; case '!': lex_state = LexState.EXPR_BEG; if ((c = support.read()) == '=') { return Token.tNEQ; } if (c == '~') { return Token.tNMATCH; } support.unread(); return '!'; case '=': // Skip documentation nodes if (was_bol()) { /* skip embedded rd document */ if (support.isNextNoCase("begin")) { c = support.read(); if (Character.isWhitespace(c)) { // In case last next was the newline. support.unread(); for (;;) { support.readLine(); c = support.read(); if (c == EOF) { errorHandler.handleError(IErrors.COMPILE_ERROR, support.getPosition(), "embedded document meets end of file"); return 0; } if (c != '=') continue; if (support.isNextNoCase("end")) { if (support.isEOL()) { break; } c = support.read(); if (Character.isWhitespace(c)) { support.readLine(); break; } else { support.unread(); } } } continue retry; } else { support.unread(); } } } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } c = support.read(); if (c == '=') { c = support.read(); if (c == '=') { return Token.tEQQ; } support.unread(); return Token.tEQ; } if (c == '~') { return Token.tMATCH; } else if (c == '>') { return Token.tASSOC; } support.unread(); return '='; case '<': c = support.read(); if (c == '<' && lex_state != LexState.EXPR_END && lex_state != LexState.EXPR_DOT && lex_state != LexState.EXPR_ENDARG && lex_state != LexState.EXPR_CLASS && (!lex_state.isArgument() || spaceSeen)) { int token = hereDocumentIdentifier(); if (token != 0) return token; } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } if (c == '=') { if ((c = support.read()) == '>') { return Token.tCMP; } support.unread(); return Token.tLEQ; } if (c == '<') { if ((c = support.read()) == '=') { yaccValue = "<<"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); return Token.tLSHFT; } support.unread(); return '<'; case '>': if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } if ((c = support.read()) == '=') { return Token.tGEQ; } if (c == '>') { if ((c = support.read()) == '=') { yaccValue = ">>"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); return Token.tRSHFT; } support.unread(); return '>'; case '"': lex_strterm = new StrTermNode(support.getPosition(), str_dquote, '"', 0); return Token.tSTRING_BEG; case '`': if (lex_state == LexState.EXPR_FNAME) { lex_state = LexState.EXPR_END; return c; } if (lex_state == LexState.EXPR_DOT) { if (commandState) { lex_state = LexState.EXPR_CMDARG; } else { lex_state = LexState.EXPR_ARG; } return c; } lex_strterm = new StrTermNode(support.getPosition(), str_xquote, '`', 0); return Token.tXSTRING_BEG; case '\'': lex_strterm = new StrTermNode(support.getPosition(), str_squote, '\'', 0); return Token.tSTRING_BEG; case '?': if (lex_state == LexState.EXPR_END || lex_state == LexState.EXPR_ENDARG) { lex_state = LexState.EXPR_BEG; return '?'; } c = support.read(); if (c == EOF) { errorHandler.handleError(IErrors.COMPILE_ERROR, support.getPosition(), "incomplete character syntax"); return 0; } if (Character.isWhitespace(c)){ if (!lex_state.isArgument()){ int c2 = 0; switch (c) { case ' ': c2 = 's'; break; case '\n': c2 = 'n'; break; case '\t': c2 = 't'; break; /* What is \v in C? case '\v': c2 = 'v'; break; */ case '\r': c2 = 'r'; break; case '\f': c2 = 'f'; break; } if (c2 != 0) { rb_warn("invalid character syntax; use ?\\" + c2); } } support.unread(); lex_state = LexState.EXPR_BEG; return '?'; /*} else if (ismbchar(c)) { // ruby - we don't support them either? rb_warn("multibyte character literal not supported yet; use ?\\" + c); support.unread(); lexState = LexState.EXPR_BEG; return '?';*/ } else if ((Character.isLetterOrDigit(c) || c == '_') && support.isEOL() == false && isNext_identchar()) { support.unread(); lex_state = LexState.EXPR_BEG; return '?'; } else if (c == '\\') { c = (char)read_escape(); } c &= 0xff; lex_state = LexState.EXPR_END; yaccValue = new Long(c); return Token.tINTEGER; case '&': if ((c = support.read()) == '&') { lex_state = LexState.EXPR_BEG; if ((c = support.read()) == '=') { yaccValue = "&&"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); return Token.tANDOP; } else if (c == '=') { yaccValue = "&"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); if (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c)){ rb_warning("`&' interpreted as argument prefix"); c = Token.tAMPER; } else if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { c = Token.tAMPER; } else { c = '&'; } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } return c; case '|': if ((c = support.read()) == '|') { lex_state = LexState.EXPR_BEG; if ((c = support.read()) == '=') { yaccValue = "||"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); return Token.tOROP; } if (c == '=') { yaccValue = "|"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } support.unread(); return '|'; case '+': c = support.read(); if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; if (c == '@') { return Token.tUPLUS; } support.unread(); return '+'; } if (c == '=') { yaccValue = "+"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID || (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c))) { if (lex_state.isArgument()) arg_ambiguous(); lex_state = LexState.EXPR_BEG; support.unread(); if (Character.isDigit(c)) { c = '+'; return parseNumber(c); } return Token.tUPLUS; } lex_state = LexState.EXPR_BEG; support.unread(); return '+'; case '-': c = support.read(); if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; if (c == '@') { return Token.tUMINUS; } support.unread(); return '-'; } if (c == '=') { yaccValue = "-"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID || (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c))) { if (lex_state.isArgument()) arg_ambiguous(); lex_state = LexState.EXPR_BEG; support.unread(); if (Character.isDigit(c)) { return Token.tUMINUS_NUM; } return Token.tUMINUS; } lex_state = LexState.EXPR_BEG; support.unread(); return '-'; case '.': lex_state = LexState.EXPR_BEG; if ((c = support.read()) == '.') { if ((c = support.read()) == '.') { return Token.tDOT3; } support.unread(); return Token.tDOT2; } support.unread(); if (!Character.isDigit(c)) { lex_state = LexState.EXPR_DOT; return '.'; } c = '.'; // fall through //start_num: case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : return parseNumber(c); case ']': case '}': case ')': conditionState.restart(); cmdArgumentState.restart(); lex_state = LexState.EXPR_END; return c; case ':': c = support.read(); if (c == ':') { if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID || lex_state == LexState.EXPR_CLASS || (lex_state.isArgument() && spaceSeen)) { lex_state = LexState.EXPR_BEG; return Token.tCOLON3; } lex_state = LexState.EXPR_DOT; return Token.tCOLON2; } if (lex_state == LexState.EXPR_END || lex_state == LexState.EXPR_ENDARG || Character.isWhitespace(c)) { support.unread(); lex_state = LexState.EXPR_BEG; return ':'; } switch (c) { case '\'': lex_strterm = new StrTermNode(support.getPosition(), str_ssym, c, 0); break; case '"': lex_strterm = new StrTermNode(support.getPosition(), str_dsym, c, 0); break; default: support.unread(); break; } lex_state = LexState.EXPR_FNAME; return Token.tSYMBEG; case '/': if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { lex_strterm = new StrTermNode(support.getPosition(), str_regexp, '/', 0); return Token.tREGEXP_BEG; } if ((c = support.read()) == '=') { yaccValue = "/"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); if (lex_state.isArgument() && spaceSeen) { if (!Character.isWhitespace(c)) { arg_ambiguous(); lex_strterm = new StrTermNode(support.getPosition(), str_regexp, '/', 0); return Token.tREGEXP_BEG; } } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } return '/'; case '^': if ((c = support.read()) == '=') { yaccValue = "^"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } support.unread(); return '^'; case ';': commandStart = true; case ',': lex_state = LexState.EXPR_BEG; return c; case '~': if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { if ((c = support.read()) != '@') { support.unread(); } } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } return '~'; case '(': commandStart = true; if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { c = Token.tLPAREN; } else if (spaceSeen) { if (lex_state == LexState.EXPR_CMDARG) { c = Token.tLPAREN_ARG; } else if (lex_state == LexState.EXPR_ARG) { rb_warn("don't put space before argument parentheses"); c = '('; } } conditionState.stop(); cmdArgumentState.stop(); lex_state = LexState.EXPR_BEG; return c; case '[': if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; if ((c = support.read()) == ']') { if ((c = support.read()) == '=') { return Token.tASET; } support.unread(); return Token.tAREF; } support.unread(); return '['; } else if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { c = Token.tLBRACK; } else if (lex_state.isArgument() && spaceSeen) { c = Token.tLBRACK; } lex_state = LexState.EXPR_BEG; conditionState.stop(); cmdArgumentState.stop(); return c; case '{': if (lex_state.isArgument() || lex_state == LexState.EXPR_END) { c = '{'; /* block (primary) */ } else if (lex_state == LexState.EXPR_ENDARG) { c = Token.tLBRACE_ARG; /* block (expr) */ } else { c = Token.tLBRACE; /* hash */ } conditionState.stop(); cmdArgumentState.stop(); lex_state = LexState.EXPR_BEG; return c; case '\\': c = support.read(); if (c == '\n') { spaceSeen = true; continue retry; /* skip \\n */ } support.unread(); return '\\'; case '%': if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { return parseQuote(support.read()); } if ((c = support.read()) == '=') { yaccValue = "%"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c)) { return parseQuote(c); } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } support.unread(); return '%'; case '$': lex_state = LexState.EXPR_END; newToken(); c = support.read(); switch (c) { case '_': /* $_: last read line string */ c = support.read(); if (isIdentifierChar(c)) { tokadd('$'); tokadd('_'); break; } support.unread(); c = '_'; /* fall through */ case '~': /* $~: match-data */ // Enebo: We had following line replace line after that, // but it is commented out... //parserSupport.getLocalNames().getLocalIndex(String.valueOf(c)); //local_cnt(c); /* fall through */ case '*': /* $*: argv */ case '$': /* $$: pid */ case '?': /* $?: last status */ case '!': /* $!: error string */ case '@': /* $@: error position */ case '/': /* $/: input record separator */ case '\\': /* $\: output record separator */ case ';': /* $;: field separator */ case ',': /* $,: output field separator */ case '.': /* $.: last read line number */ case '=': /* $=: ignorecase */ case ':': /* $:: load path */ case '<': /* $<: reading filename */ case '>': /* $>: default output handle */ case '\"': /* $": already loaded files */ tokadd('$'); tokadd(c); yaccValue = tok(); return Token.tGVAR; case '-': tokadd('$'); tokadd(c); c = support.read(); tokadd(c); yaccValue = tok(); /* xxx shouldn't check if valid option variable */ return Token.tGVAR; case '&': /* $&: last match */ case '`': /* $`: string before last match */ case '\'': /* $': string after last match */ case '+': /* $+: string matches last paren. */ yaccValue = new BackRefNode(support.getPosition(), c); return Token.tBACK_REF; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': tokadd('$'); do { tokadd(c); c = support.read(); } while (Character.isDigit(c)); support.unread(); yaccValue = new NthRefNode(support.getPosition(), Integer.parseInt(tok().substring(1))); return Token.tNTH_REF; default: if (!isIdentifierChar(c)) { support.unread(); return '$'; } case '0': tokadd('$'); } break; case '@': c = support.read(); newToken(); tokadd('@'); if (c == '@') { tokadd('@'); c = support.read(); } if (Character.isDigit(c)) { if (toklen() == 1) { rb_compile_error("`@" + c + "' is not allowed as an instance variable name"); } else { rb_compile_error("`@@" + c + "' is not allowed as a class variable name"); } } if (!isIdentifierChar(c)) { support.unread(); return '@'; } break; case '_': if (was_bol() && whole_match_p("_END__", false)) { return 0; } newToken(); break; default: if (!isIdentifierChar(c)) { rb_compile_error("Invalid char `\\" + c + "' in expression"); continue retry; } newToken(); break; } do { tokadd(c); if (ismbchar(c)) { int i, len = mbclen(c)-1; for (i = 0; i < len; i++) { c = support.read(); tokadd(c); } } c = support.read(); } while (isIdentifierChar(c)); char peek = support.read(); if ((c == '!' || c == '?') && isIdentifierChar(tok().charAt(0)) && peek != '=') { support.unread(); // put peek back. tokadd(c); } else { support.unreadMany(2); // put peek back. } int result = 0; switch (tok().charAt(0)) { case '$': lex_state = LexState.EXPR_END; result = Token.tGVAR; break; case '@': lex_state = LexState.EXPR_END; if (tok().charAt(1) == '@') { result = Token.tCVAR; } else { result = Token.tIVAR; } break; default: if (toklast() == '!' || toklast() == '?') { result = Token.tFID; } else { if (lex_state == LexState.EXPR_FNAME) { if ((c = support.read()) == '=' && !peek('~') && !peek('>') && (!peek('=') || (support.isEOL() && support.getCharAt(1) == '>'))) { result = Token.tIDENTIFIER; tokadd(c); } else { support.unread(); } } if (result == 0 && ISUPPER(tok().charAt(0))) { result = Token.tCONSTANT; } else { result = Token.tIDENTIFIER; } } if (lex_state != LexState.EXPR_DOT) { /* See if it is a reserved word. */ Keyword keyword = getKeyword(tok(), toklen()); if (keyword != null) { // enum lex_state LexState state = lex_state; lex_state = keyword.state; if (state.isExprFName()) { yaccValue = keyword.name; } if (keyword.id0 == Token.kDO) { if (conditionState.isInState()) { return Token.kDO_COND; } if (cmdArgumentState.isInState() && state != LexState.EXPR_CMDARG) { return Token.kDO_BLOCK; } if (state == LexState.EXPR_ENDARG) { return Token.kDO_BLOCK; } return Token.kDO; } if (state == LexState.EXPR_BEG) { return keyword.id0; } else { if (keyword.id0 != keyword.id1) lex_state = LexState.EXPR_BEG; return keyword.id1; } } } if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID || lex_state == LexState.EXPR_DOT || lex_state == LexState.EXPR_ARG || lex_state == LexState.EXPR_CMDARG) { if (commandState) { lex_state = LexState.EXPR_CMDARG; } else { lex_state = LexState.EXPR_ARG; } } else { lex_state = LexState.EXPR_END; } } yaccValue = tok(); // Lame: parsing logic made it into lexer in ruby...So we // are emulating if (IdUtil.isLocal((String)yaccValue) && ((parserSupport.getBlockNames().isInBlock() && parserSupport.getBlockNames().isDefined((String) yaccValue)) || parserSupport.getLocalNames().isLocalRegistered((String) yaccValue))) { lex_state = LexState.EXPR_END; } return result; } }
| 3,232,256
|
public void replace(long beg, long len, RubyObject repl) { int length = getLength(); if (len < 0) { throw new RubyIndexException(getRuby(), "Negative array length: " + len); } if (beg < 0) { beg += length; } if (beg < 0) { throw new RubyIndexException(getRuby(), "Index out of bounds: " + beg); } modify(); for (int i = 0; beg < length && i < len; i++) { list.remove((int) beg); } autoExpand(beg); if (repl instanceof RubyArray) { List repList = ((RubyArray) repl).getList(); list.ensureCapacity(length + repList.size()); list.addAll((int) beg, repList); } else if (!repl.isNil()) { list.add((int) beg, repl); } }
|
public void replace(long beg, long len, RubyObject repl) { int length = getLength(); if (len < 0) { throw new RubyIndexException(getRuby(), "Negative array length: " + len); } if (beg < 0) { beg += length; } if (beg < 0) { throw new RubyIndexException(getRuby(), "Index out of bounds: " + beg); } modify(); for (int i = 0; beg < length && i < len; i++) { list.remove((int) beg); } autoExpand(beg); if (repl instanceof RubyArray) { List repList = ((RubyArray) repl).getList(); list.ensureCapacity(length + repList.size()); list.addAll((int) beg, new ArrayList(repList)); } else if (!repl.isNil()) { list.add((int) beg, repl); } }
| 3,232,257
|
public RubyBoolean primitive_p() { return RubyBoolean.newBoolean(getRuntime(), javaClass.isPrimitive()); }
|
public RubyBoolean primitive_p() { return RubyBoolean.newBoolean(getRuntime(), isPrimitive()); }
| 3,232,259
|
public NoteTree(Shell shell, Composite parent, Listener l) { // Tree and context menu. tree = new Tree(parent, SWT.MULTI); contextMenu = new TreeContextMenu(shell, tree, l); // Text editor for renaming tree nodes. treeEditor = new TreeEditor(tree); treeEditor.grabHorizontal = true; treeEditor.minimumWidth = 50; // Events. this.l = l; l.mapEvent(tree, SWT.MouseDoubleClick, MainController.DISPLAY_TAB); }
|
public NoteTree(Shell shell, Composite parent, Listener l) { // Tree and context menu. tree = new Tree(parent, SWT.MULTI); contextMenu = new TreeContextMenu(shell, tree, l); // Text editor for renaming tree nodes. treeEditor = new TreeEditor(tree); treeEditor.grabHorizontal = true; treeEditor.minimumWidth = 50; // Events. this.l = l; l.mapEvent(tree, SWT.MouseDoubleClick, MainController.DISPLAY_TAB); }
| 3,232,261
|
public NoteTree(Shell shell, Composite parent, Listener l) { // Tree and context menu. tree = new Tree(parent, SWT.MULTI); contextMenu = new TreeContextMenu(shell, tree, l); // Text editor for renaming tree nodes. treeEditor = new TreeEditor(tree); treeEditor.grabHorizontal = true; treeEditor.minimumWidth = 50; // Events. this.l = l; l.mapEvent(tree, SWT.MouseDoubleClick, MainController.DISPLAY_TAB); }
|
public NoteTree(Shell shell, Composite parent, Listener l) { // Tree and context menu. tree = new Tree(parent, SWT.MULTI); contextMenu = new TreeContextMenu(shell, tree, l); // Text editor for renaming tree nodes. treeEditor = new TreeEditor(tree); treeEditor.grabHorizontal = true; treeEditor.minimumWidth = 50; // Events. this.l = l; l.mapEvent(tree, SWT.MouseDoubleClick, MainController.DISPLAY_TAB); }
| 3,232,262
|
public void initialiseTreeEditor() { TreeItem ti = tree.getSelection()[0]; if (ti == null) return; // HERE: might have to use a Rectangle for this border. // Also should make it so as soon as the text box loses // focus the editor goes away. Text treeTextEditor = new Text(tree, SWT.NONE); treeTextEditor.setText(ti.getText()); treeTextEditor.selectAll(); treeTextEditor.setFocus(); treeEditor.setEditor(treeTextEditor, ti); l.mapEvent(treeTextEditor, SWT.Modify, TreeController.RENAME_NOTE); l.mapEvent(treeTextEditor, SWT.FocusOut, TreeController.FINISH_RENAME_NOTE); l.mapEvent(treeTextEditor, SWT.KeyDown, TreeController.FINISH_RENAME_NOTE); }
|
public void initialiseTreeEditor() { TreeItem ti = tree.getSelection()[0]; if (ti == null) return; // HERE: might have to use a Rectangle for this border. // Also should make it so as soon as the text box loses // focus the editor goes away. Text treeTextEditor = new Text(tree, SWT.NONE); treeTextEditor.setText(ti.getText()); treeTextEditor.selectAll(); treeTextEditor.setFocus(); treeEditor.setEditor(treeTextEditor, ti); l.mapEvent(treeTextEditor, SWT.Modify, TreeController.RENAME_NOTE); l.mapEvent(treeTextEditor, SWT.FocusOut, TreeController.FINISH_RENAME_NOTE); l.mapEvent(treeTextEditor, SWT.KeyDown, TreeController.FINISH_RENAME_NOTE); }
| 3,232,263
|
public TreeContextMenu(Shell shell, Control parent, Listener l) { // menu menu = new Menu(shell, SWT.POP_UP); l.mapEvent(menu, SWT.Show, TreeContextMenuController.INITIALISE_MENU); parent.setMenu(menu); // menu items addNote = createMenuItem(menu, "Add Note", l, TreeContextMenuController.ADD_NOTE); removeNotes = createMenuItem(menu, "Remove Notes", l, TreeContextMenuController.REMOVE_NOTES); renameNote = createMenuItem(menu, "Rename Note", l, TreeContextMenuController.RENAME_NOTE); }
|
public TreeContextMenu(Shell shell, Control parent, Listener l) { // menu menu = new Menu(shell, SWT.POP_UP); l.mapEvent(menu, SWT.Show, TreeContextMenuController.INITIALISE_MENU); parent.setMenu(menu); // menu items addNote = createMenuItem(menu, "Add Note", l, TreeContextMenuController.ADD_NOTE); removeNotes = createMenuItem(menu, "Remove Notes", l, TreeContextMenuController.REMOVE_NOTES); renameNote = createMenuItem(menu, "Rename Note", l, TreeContextMenuController.RENAME_NOTE); }
| 3,232,264
|
public TreeContextMenu(Shell shell, Control parent, Listener l) { // menu menu = new Menu(shell, SWT.POP_UP); l.mapEvent(menu, SWT.Show, TreeContextMenuController.INITIALISE_MENU); parent.setMenu(menu); // menu items addNote = createMenuItem(menu, "Add Note", l, TreeContextMenuController.ADD_NOTE); removeNotes = createMenuItem(menu, "Remove Notes", l, TreeContextMenuController.REMOVE_NOTES); renameNote = createMenuItem(menu, "Rename Note", l, TreeContextMenuController.RENAME_NOTE); }
|
public TreeContextMenu(Shell shell, Control parent, Listener l) { // menu menu = new Menu(shell, SWT.POP_UP); l.mapEvent(menu, SWT.Show, TreeContextMenuController.INITIALISE_MENU); parent.setMenu(menu); // menu items addNote = createMenuItem(menu, "Add Note", l, TreeContextMenuController.ADD_NOTE); removeNotes = createMenuItem(menu, "Remove Notes", l, TreeContextMenuController.REMOVE_NOTES); renameNote = createMenuItem(menu, "Rename Note", l, TreeContextMenuController.RENAME_NOTE); }
| 3,232,265
|
public Set findCGCIHierarchies(final Set arg0) { // CONTRACT if (null == arg0 || arg0.size() == 0) { return new HashSet(); } List result = containerDao.findCGCIHierarchies(arg0); Set imagesAll = new HashSet(result); if (null == imagesAll || imagesAll.size() == 0) { return new HashSet(); }//TODO log if this is empty. (input/output) update jdbc tests. // LOGIC Set hierarchies = new HashSet(); Iterator i = imagesAll.iterator(); while (i.hasNext()) { Image img = (Image) i.next(); Set classifications = img.getClassifications(); Set categories = new HashSet(); for (Iterator c = classifications.iterator(); c.hasNext();) { Classification cla = (Classification) c.next(); if (cla.getValid().booleanValue()) { // TODO do this in query categories.add(cla.getCategory()); } } if (categories == null || categories.size() < 1) { hierarchies.add(img); } else { Iterator c = categories.iterator(); while (c.hasNext()) { // OPTIMAL TODO looping over get!! // ??? Integer cId = (Integer) c.next(); Category2 ca = new Category2();//containerDao.loadC(cId));// TODO hql if (null == ca.images) ca.images = new HashSet(); ca.images.add(img); Integer cgId = ca.getCategoryGroup(); // and HERE ?? // FIXME CategoryGroup2 cg = new CategoryGroup2();//containerDao.loadCG(cgId)); // not a // collection?? if (cg == null) { hierarchies.add(ca); } else { if (null == cg.categories) cg.categories = new HashSet(); cg.categories.add(ca); hierarchies.add(cg); } } } } return (Set) clean(hierarchies); }
|
public Set findCGCIHierarchies(final Set arg0) { // CONTRACT if (null == arg0 || arg0.size() == 0) { return new HashSet(); } List result = containerDao.findCGCIHierarchies(arg0); Set imagesAll = new HashSet(result); if (null == imagesAll || imagesAll.size() == 0) { return new HashSet(); }//TODO log if this is empty. (input/output) update jdbc tests. // LOGIC Set hierarchies = new HashSet(); Iterator i = imagesAll.iterator(); while (i.hasNext()) { Image img = (Image) i.next(); Set classifications = img.getClassifications(); Set categories = new HashSet(); for (Iterator c = classifications.iterator(); c.hasNext();) { Classification cla = (Classification) c.next(); if (cla.getValid().booleanValue()) { // TODO do this in query categories.add(cla.getCategory()); } } if (categories == null || categories.size() < 1) { hierarchies.add(img); } else { Iterator c = categories.iterator(); while (c.hasNext()) { // OPTIMAL TODO looping over get!! // ??? Integer cId = (Integer) c.next(); Category2 ca = new Category2();//containerDao.loadC(cId));// TODO hql if (null == ca.images) ca.images = new HashSet(); ca.images.add(img); Integer cgId = ca.getCategoryGroup(); // and HERE ?? // FIXME CategoryGroup2 cg = new CategoryGroup2();//containerDao.loadCG(cgId)); // not a // collection?? if (cg == null) { hierarchies.add(ca); } else { if (null == cg.categories) cg.categories = new HashSet(); cg.categories.add(ca); hierarchies.add(cg); } } } } return (Set) clean(hierarchies); }
| 3,232,266
|
void hessianClean(Object obj, Set done) { if (null==obj) return; if (done.contains(obj)) return; done.add(obj); if (obj instanceof Map) { Map map = (Map) obj; for (Iterator i = map.values().iterator(); i.hasNext();) { Object value = i.next(); hessianClean(value,done); } } else if (obj instanceof Set) { Set set = (Set) obj; for (Iterator i = set.iterator(); i.hasNext();) { Object item = i.next(); hessianClean(item,done); } } else { // TODO can check for super class when implemented Method[] methods = obj.getClass().getDeclaredMethods(); for (int i = 0; i < methods.length; i++) { Method method = methods[i]; if (method.getName().startsWith("get")){ if (0==method.getParameterTypes().length){ Object result=invokeGetter(obj,method); if (! Hibernate.isInitialized(result)){ Method setter = getSetterForGetter(methods,method); if (null==setter){ throw new IllegalStateException("No setter for getter; this will explode"); } setToNull(obj,setter); } else { hessianClean(result,done); } } } } } }
|
void hessianClean(Object obj, Set done) { if (null==obj) return; if (done.contains(obj)) return; done.add(obj); if (obj instanceof Map) { Map map = (Map) obj; for (Iterator i = map.values().iterator(); i.hasNext();) { Object value = i.next(); hessianClean(value,done); } } else if (obj instanceof Set) { Set set = (Set) obj; for (Iterator i = set.iterator(); i.hasNext();) { Object item = i.next(); hessianClean(item,done); } } else { // TODO can check for super class when implemented Method[] methods = obj.getClass().getDeclaredMethods(); for (int i = 0; i < methods.length; i++) { Method method = methods[i]; if (method.getName().startsWith("get")){ if (0==method.getParameterTypes().length){ Object result=invokeGetter(obj,method); if (! Hibernate.isInitialized(result)){ Method setter = getSetterForGetter(methods,method); if (null==setter){ throw new IllegalStateException("No setter for getter; this will explode"); } setToNull(obj,setter); } else { hessianClean(result,done); } } } } } }
| 3,232,269
|
Object invokeGetter(Object target, Method getter){ Object result=null; try { result = getter.invoke(target,new Object[]{}); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); } return result; }
|
Object invokeGetter(Object target, Method getter){ Object result=null; try { result = getter.invoke(target,new Object[]{}); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block re.initCause(e); throw re; } catch (IllegalAccessException e) { // TODO Auto-generated catch block re.initCause(e); throw re; } catch (InvocationTargetException e) { // TODO Auto-generated catch block re.initCause(e); throw re; } return result; }
| 3,232,270
|
Object invokeGetter(Object target, Method getter){ Object result=null; try { result = getter.invoke(target,new Object[]{}); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); } return result; }
|
Object invokeGetter(Object target, Method getter){ Object result=null; try { result = getter.invoke(target,new Object[]{}); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block re.initCause(e); throw re; } catch (IllegalAccessException e) { // TODO Auto-generated catch block re.initCause(e); throw re; } catch (InvocationTargetException e) { // TODO Auto-generated catch block re.initCause(e); throw re; } return result; }
| 3,232,271
|
Object invokeGetter(Object target, Method getter){ Object result=null; try { result = getter.invoke(target,new Object[]{}); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); } return result; }
|
Object invokeGetter(Object target, Method getter){ Object result=null; try { result = getter.invoke(target,new Object[]{}); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block re.initCause(e); throw re; } catch (IllegalAccessException e) { // TODO Auto-generated catch block re.initCause(e); throw re; } catch (InvocationTargetException e) { // TODO Auto-generated catch block re.initCause(e); throw re; } return result; }
| 3,232,272
|
public Object loadCGCIHierarchy(final Class arg0, final int arg1) { // CONTRACT if (!CategoryGroup.class.equals(arg0) && !Category.class.equals(arg0)) { throw new IllegalArgumentException( "Class parameter for loadCGCIHierarchy() must be CategoryGroup or Category."); } return clean(containerDao.loadHierarchy(arg0, arg1)); }
|
public Object loadCGCIHierarchy(final Class arg0, final int arg1) { // CONTRACT if (!CategoryGroup.class.equals(arg0) && !Category.class.equals(arg0)) { throw new IllegalArgumentException( "Class parameter for loadCGCIHierarchy() must be CategoryGroup or Category, not "+arg0); } return clean(containerDao.loadHierarchy(arg0, arg1)); }
| 3,232,273
|
public Object loadPDIHierarchy(final Class arg0, final int arg1) { // CONTRACT if (!Project.class.equals(arg0) && !Dataset.class.equals(arg0)) { throw new IllegalArgumentException( "Class parameter for loadPDIHierarchy() must be Project or Dataset."); } return clean(containerDao.loadHierarchy(arg0, arg1)); }
|
public Object loadPDIHierarchy(final Class arg0, final int arg1) { // CONTRACT if (!Project.class.equals(arg0) && !Dataset.class.equals(arg0)) { throw new IllegalArgumentException( "Class parameter for loadPDIHierarchy() must be Project or Dataset, not "+arg0); } return clean(containerDao.loadHierarchy(arg0, arg1)); }
| 3,232,274
|
void setToNull(Object obj, Method setter){ RuntimeException re = new RuntimeException("Error trying to set to null"); try { setter.invoke(obj,new Object[]{null}); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } }
|
void setToNull(Object obj, Method setter){ RuntimeException re = new RuntimeException("Error trying to set to null."); try { setter.invoke(obj,new Object[]{null}); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } }
| 3,232,275
|
void setToNull(Object obj, Method setter){ RuntimeException re = new RuntimeException("Error trying to set to null"); try { setter.invoke(obj,new Object[]{null}); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } }
|
void setToNull(Object obj, Method setter){ RuntimeException re = new RuntimeException("Error trying to set to null"); try { setter.invoke(obj,new Object[]{null}); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block re.initCause(e); throw re; } catch (IllegalAccessException e) { // TODO Auto-generated catch block re.initCause(e); throw re; } catch (InvocationTargetException e) { // TODO Auto-generated catch block re.initCause(e); throw re; } }
| 3,232,276
|
void setToNull(Object obj, Method setter){ RuntimeException re = new RuntimeException("Error trying to set to null"); try { setter.invoke(obj,new Object[]{null}); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } }
|
void setToNull(Object obj, Method setter){ RuntimeException re = new RuntimeException("Error trying to set to null"); try { setter.invoke(obj,new Object[]{null}); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block re.initCause(e); throw re; } catch (IllegalAccessException e) { // TODO Auto-generated catch block re.initCause(e); throw re; } catch (InvocationTargetException e) { // TODO Auto-generated catch block re.initCause(e); throw re; } }
| 3,232,277
|
void setToNull(Object obj, Method setter){ RuntimeException re = new RuntimeException("Error trying to set to null"); try { setter.invoke(obj,new Object[]{null}); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } }
|
void setToNull(Object obj, Method setter){ RuntimeException re = new RuntimeException("Error trying to set to null"); try { setter.invoke(obj,new Object[]{null}); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block re.initCause(e); throw re; } catch (IllegalAccessException e) { // TODO Auto-generated catch block re.initCause(e); throw re; } catch (InvocationTargetException e) { // TODO Auto-generated catch block re.initCause(e); throw re; } }
| 3,232,278
|
Map sortDatasetAnnotations(final List l) { Set result = new HashSet(l); // TODO this everywhere if (null == result || result.size() == 0) { return new HashMap(); } Map map = new HashMap(); // SORT Iterator i = result.iterator(); while (i.hasNext()) { DatasetAnnotation ann = (DatasetAnnotation) i.next(); Integer ds_id = ann.getDataset().getDatasetId(); if (!map.containsKey(ds_id)) { map.put(ds_id, new HashSet()); } ((Set) map.get(ds_id)).add(ann); } return map; }
|
Map sortDatasetAnnotations(final List l) { Set result = new HashSet(l); // TODO this everywhere if (null == result || result.size() == 0) { return new HashMap(); } Map map = new HashMap(); // SORT Iterator i = result.iterator(); while (i.hasNext()) { DatasetAnnotation ann = (DatasetAnnotation) i.next(); Integer ds_id = ann.getDataset().getDatasetId(); if (!map.containsKey(ds_id)) { map.put(ds_id, new HashSet()); } ((Set) map.get(ds_id)).add(ann); } return map; }
| 3,232,279
|
Map sortImageAnnotations(final List l) { Set result = new HashSet(l); // TODO this everywhere if (null == result || result.size() == 0) { return new HashMap(); } Map map = new HashMap(); // SORT Iterator i = result.iterator(); while (i.hasNext()) { ImageAnnotation ann = (ImageAnnotation) i.next(); Integer img_id = ann.getImage().getImageId(); if (!map.containsKey(img_id)) { map.put(img_id, new HashSet()); } ((Set) map.get(img_id)).add(ann); } return map; }
|
Map sortImageAnnotations(final List l) { Set result = new HashSet(l); // TODO this everywhere if (null == result || result.size() == 0) { return new HashMap(); } Map map = new HashMap(); // SORT Iterator i = result.iterator(); while (i.hasNext()) { ImageAnnotation ann = (ImageAnnotation) i.next(); Integer img_id = ann.getImage().getImageId(); if (!map.containsKey(img_id)) { map.put(img_id, new HashSet()); } ((Set) map.get(img_id)).add(ann); } return map; }
| 3,232,280
|
private void parseArguments(String[] args) { // Parse our parameters Collection locations = new Vector(); for (int i = 0; i < args.length; i++) { if (args[i].equals("--basedir")) baseDir = new File(args[++i]); else if (args[i].equals("--datafile")) CoverageDataFileHandler.setDefaultDataFile(args[++i]); else if (args[i].equals("--destination")) destinationDirectory = new File(args[++i]); else if (args[i].equals("--ignore")) { String regex = args[++i]; try { Perl5Compiler pc = new Perl5Compiler(); this.ignoreRegexp = pc.compile(regex); } catch (MalformedPatternException e) { logger.warn("The regular expression " + regex + " is invalid: " + e.getLocalizedMessage()); } } else locations.add(args[i]); } // Load coverage data, instrument classes, save coverage data projectData = ProjectData.getGlobalProjectData(); Iterator iter = locations.iterator(); while (iter.hasNext()) addInstrumentation((String)iter.next()); ProjectData.saveGlobalProjectData(); }
|
private void parseArguments(String[] args) { // Parse our parameters Collection locations = new Vector(); for (int i = 0; i < args.length; i++) { if (args[i].equals("--basedir")) baseDir = new File(args[++i]); else if (args[i].equals("--datafile")) CoverageDataFileHandler.setDefaultDataFile(args[++i]); else if (args[i].equals("--destination")) destinationDirectory = new File(args[++i]); else if (args[i].equals("--ignore")) { String regex = args[++i]; try { Perl5Compiler pc = new Perl5Compiler(); this.ignoreRegexp = pc.compile(regex); } catch (MalformedPatternException e) { logger.warn("The regular expression " + regex + " is invalid: " + e.getLocalizedMessage()); } } else locations.add(args[i]); } // Load coverage data, instrument classes, save coverage data projectData = ProjectData.getGlobalProjectData(); Iterator iter = locations.iterator(); while (iter.hasNext()) addInstrumentation((String)iter.next()); ProjectData.saveGlobalProjectData(); }
| 3,232,282
|
private void parseArguments(String[] args) { // Parse our parameters Collection locations = new Vector(); for (int i = 0; i < args.length; i++) { if (args[i].equals("--basedir")) baseDir = new File(args[++i]); else if (args[i].equals("--datafile")) CoverageDataFileHandler.setDefaultDataFile(args[++i]); else if (args[i].equals("--destination")) destinationDirectory = new File(args[++i]); else if (args[i].equals("--ignore")) { String regex = args[++i]; try { Perl5Compiler pc = new Perl5Compiler(); this.ignoreRegexp = pc.compile(regex); } catch (MalformedPatternException e) { logger.warn("The regular expression " + regex + " is invalid: " + e.getLocalizedMessage()); } } else locations.add(args[i]); } // Load coverage data, instrument classes, save coverage data projectData = ProjectData.getGlobalProjectData(); Iterator iter = locations.iterator(); while (iter.hasNext()) addInstrumentation((String)iter.next()); ProjectData.saveGlobalProjectData(); }
|
private void parseArguments(String[] args) { // Parse our parameters Collection locations = new Vector(); for (int i = 0; i < args.length; i++) { if (args[i].equals("--basedir")) baseDir = new File(args[++i]); else if (args[i].equals("--datafile")) CoverageDataFileHandler.setDefaultDataFile(args[++i]); else if (args[i].equals("--destination")) destinationDirectory = new File(args[++i]); else if (args[i].equals("--ignore")) { String regex = args[++i]; try { Perl5Compiler pc = new Perl5Compiler(); this.ignoreRegexp = pc.compile(regex); } catch (MalformedPatternException e) { logger.warn("The regular expression " + regex + " is invalid: " + e.getLocalizedMessage()); } } else locations.add(args[i]); } // Load coverage data, instrument classes, save coverage data projectData = ProjectData.getGlobalProjectData(); Iterator iter = locations.iterator(); while (iter.hasNext()) addInstrumentation((String)iter.next()); ProjectData.saveGlobalProjectData(); }
| 3,232,283
|
private void parseArguments(String[] args) { // Parse our parameters Collection locations = new Vector(); for (int i = 0; i < args.length; i++) { if (args[i].equals("--basedir")) baseDir = new File(args[++i]); else if (args[i].equals("--datafile")) CoverageDataFileHandler.setDefaultDataFile(args[++i]); else if (args[i].equals("--destination")) destinationDirectory = new File(args[++i]); else if (args[i].equals("--ignore")) { String regex = args[++i]; try { Perl5Compiler pc = new Perl5Compiler(); this.ignoreRegexp = pc.compile(regex); } catch (MalformedPatternException e) { logger.warn("The regular expression " + regex + " is invalid: " + e.getLocalizedMessage()); } } else locations.add(args[i]); } // Load coverage data, instrument classes, save coverage data projectData = ProjectData.getGlobalProjectData(); Iterator iter = locations.iterator(); while (iter.hasNext()) addInstrumentation((String)iter.next()); ProjectData.saveGlobalProjectData(); }
|
private void parseArguments(String[] args) { // Parse our parameters Collection locations = new Vector(); for (int i = 0; i < args.length; i++) { if (args[i].equals("--basedir")) baseDir = new File(args[++i]); else if (args[i].equals("--datafile")) CoverageDataFileHandler.setDefaultDataFile(args[++i]); else if (args[i].equals("--destination")) destinationDirectory = new File(args[++i]); else if (args[i].equals("--ignore")) { String regex = args[++i]; try { Perl5Compiler pc = new Perl5Compiler(); this.ignoreRegexp = pc.compile(regex); } catch (MalformedPatternException e) { logger.warn("The regular expression " + regex + " is invalid: " + e.getLocalizedMessage()); } } else locations.add(args[i]); } // Load coverage data, instrument classes, save coverage data projectData = ProjectData.getGlobalProjectData(); Iterator iter = locations.iterator(); while (iter.hasNext()) addInstrumentation((String)iter.next()); ProjectData.saveGlobalProjectData(); }
| 3,232,284
|
public void assign(Ruby ruby, RubyObject self, RubyObject value, boolean check) { RubyObject recv = getRecvNode().eval(ruby, self); if (getArgsNode() == null) { /* attr set */ recv.getRubyClass().call(recv, getMId(), new RubyObject[] {value}, 0); } else { RubyArray args = (RubyArray)getArgsNode().eval(ruby, self); args.push(value); recv.getRubyClass().call(recv, getMId(), args.toJavaArray(), 0); } }
|
public void assign(Ruby ruby, RubyObject self, RubyObject value, boolean check) { RubyObject recv = getRecvNode().eval(ruby, self); if (getArgsNode() == null) { /* attr set */ recv.getRubyClass().call(recv, getMId(), new RubyPointer(new RubyObject[] {value}), 0); } else { RubyArray args = (RubyArray)getArgsNode().eval(ruby, self); args.push(value); recv.getRubyClass().call(recv, getMId(), args.toJavaArray(), 0); } }
| 3,232,285
|
public void assign(Ruby ruby, RubyObject self, RubyObject value, boolean check) { RubyObject recv = getRecvNode().eval(ruby, self); if (getArgsNode() == null) { /* attr set */ recv.getRubyClass().call(recv, getMId(), new RubyObject[] {value}, 0); } else { RubyArray args = (RubyArray)getArgsNode().eval(ruby, self); args.push(value); recv.getRubyClass().call(recv, getMId(), args.toJavaArray(), 0); } }
|
public void assign(Ruby ruby, RubyObject self, RubyObject value, boolean check) { RubyObject recv = getRecvNode().eval(ruby, self); if (getArgsNode() == null) { /* attr set */ recv.getRubyClass().call(recv, getMId(), new RubyObject[] {value}, 0); } else { RubyArray args = (RubyArray)getArgsNode().eval(ruby, self); args.push(value); recv.getRubyClass().call(recv, getMId(), new RubyPointer(args.getList()), 0); } }
| 3,232,286
|
public RubyObject eval(Ruby ruby, RubyObject self) { // TMP_PROTECT; RubyBlock tmpBlock = ArgsUtil.beginCallArgs(ruby); RubyObject recv = getRecvNode().eval(ruby, self); RubyObject[] args = ArgsUtil.setupArgs(ruby, self, getArgsNode()); ArgsUtil.endCallArgs(ruby, tmpBlock); return recv.getRubyClass().call(recv, getMId(), args, 0); }
|
public RubyObject eval(Ruby ruby, RubyObject self) { // TMP_PROTECT; RubyBlock tmpBlock = ArgsUtil.beginCallArgs(ruby); RubyObject recv = getRecvNode().eval(ruby, self); RubyPointer args = ArgsUtil.setupArgs(ruby, self, getArgsNode()); ArgsUtil.endCallArgs(ruby, tmpBlock); return recv.getRubyClass().call(recv, getMId(), args, 0); }
| 3,232,287
|
public static RubyClass createProcClass(Ruby ruby) { return new ProcDefinition(ruby).getType(); }
|
public static RubyClass createProcClass(Ruby ruby) { RubyClass result = ruby.defineClass("Proc", ruby.getClasses().getObjectClass()); CallbackFactory callbackFactory = ruby.callbackFactory(); result.defineMethod("arity", callbackFactory.getMethod(RubyProc.class, "arity")); result.defineMethod("call", callbackFactory.getOptMethod(RubyProc.class, "call")); result.defineMethod("[]", callbackFactory.getOptMethod(RubyProc.class, "call")); result.defineSingletonMethod("new", callbackFactory.getOptSingletonMethod(RubyProc.class, "newInstance")); return result; }
| 3,232,288
|
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(false); } } catch (ChatRoomNotFoundException e) { } contactList.useDefaults(from); customList.remove(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.useDefaults(from); customList.remove(StringUtils.parseBareAddress(from)); }
| 3,232,289
|
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(false); } } catch (ChatRoomNotFoundException e) { } contactList.useDefaults(from); customList.remove(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.useDefaults(from); customList.remove(StringUtils.parseBareAddress(from)); }
| 3,232,290
|
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(false); } } catch (ChatRoomNotFoundException e) { } contactList.useDefaults(from); customList.remove(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(false); } } catch (ChatRoomNotFoundException e) { } contactList.useDefaults(from); customList.remove(StringUtils.parseBareAddress(from)); }
| 3,232,291
|
public void modelChanged(HeatMapModel model) { if(model == null) { return; } this.model = model; setTitle("HeatMap: " + model.getInfoSource().getDataset().getName()); treePanel.setModel(model.getModel()); treePanel.removeListener(dispatcher); modeBar.removeListener(dispatcher); dispatcher = new HeatMapDispatcher(model,statusPanel); treePanel.addListener(dispatcher); modeBar.addListener(dispatcher); gradPanel.setEnabled(false); revalidate(); repaint(); }
|
public void modelChanged(HeatMapModel model) { if(model == null) { return; } this.model = model; setTitle("HeatMap: " + model.getInfoSource().getDataset().getName()); treePanel.setModel(model.getModel()); treePanel.removeListener(dispatcher); modeBar.removeListener(dispatcher); dispatcher = new HeatMapDispatcher(model,statusPanel,gradPanel); dispatcher.setCurrentMode(modeBar.getCurrentMode()); dispatcher.setCurrentScale(scaleBar.getCurrentScaleType()); treePanel.addListener(dispatcher); modeBar.addListener(dispatcher); gradPanel.setEnabled(false); revalidate(); repaint(); }
| 3,232,294
|
public RubyObject yieldUnder(RubyModule under) { return under.executeUnder(new Callback() { public RubyObject execute(RubyObject self, RubyObject[] args, Ruby ruby) { // if () { Block oldBlock = ruby.getBlock().getCurrent().cloneBlock(); /* copy the block to avoid modifying global data. */ ruby.getBlock().getCurrent().getFrame().setNamespace(ruby.getCurrentFrame().getNamespace()); try { return ruby.yield(args[0], args[0], ruby.getRubyClass(), false).toRubyObject(); } finally { ruby.getBlock().setCurrent(oldBlock); } // } /* static block, no need to restore */ // ruby.getBlock().frame.setNamespace(ruby.getRubyFrame().getNamespace()); // return ruby.yield0(args[0], args[0], ruby.getRubyClass(), false); } public int getArity() { return -1; } }, new RubyObject[] { this }); }
|
public RubyObject yieldUnder(RubyModule under) { return under.executeUnder(new Callback() { public RubyObject execute(RubyObject self, RubyObject[] args, Ruby ruby) { // if () { Block oldBlock = ruby.getBlockStack().getCurrent().cloneBlock(); /* copy the block to avoid modifying global data. */ ruby.getBlock().getCurrent().getFrame().setNamespace(ruby.getCurrentFrame().getNamespace()); try { return ruby.yield(args[0], args[0], ruby.getRubyClass(), false).toRubyObject(); } finally { ruby.getBlock().setCurrent(oldBlock); } // } /* static block, no need to restore */ // ruby.getBlock().frame.setNamespace(ruby.getRubyFrame().getNamespace()); // return ruby.yield0(args[0], args[0], ruby.getRubyClass(), false); } public int getArity() { return -1; } }, new RubyObject[] { this }); }
| 3,232,296
|
public RubyObject yieldUnder(RubyModule under) { return under.executeUnder(new Callback() { public RubyObject execute(RubyObject self, RubyObject[] args, Ruby ruby) { // if () { Block oldBlock = ruby.getBlock().getCurrent().cloneBlock(); /* copy the block to avoid modifying global data. */ ruby.getBlock().getCurrent().getFrame().setNamespace(ruby.getCurrentFrame().getNamespace()); try { return ruby.yield(args[0], args[0], ruby.getRubyClass(), false).toRubyObject(); } finally { ruby.getBlock().setCurrent(oldBlock); } // } /* static block, no need to restore */ // ruby.getBlock().frame.setNamespace(ruby.getRubyFrame().getNamespace()); // return ruby.yield0(args[0], args[0], ruby.getRubyClass(), false); } public int getArity() { return -1; } }, new RubyObject[] { this }); }
|
public RubyObject yieldUnder(RubyModule under) { return under.executeUnder(new Callback() { public RubyObject execute(RubyObject self, RubyObject[] args, Ruby ruby) { // if () { Block oldBlock = ruby.getBlock().getCurrent().cloneBlock(); /* copy the block to avoid modifying global data. */ ruby.getBlockStack().getCurrent().getFrame().setNamespace(ruby.getCurrentFrame().getNamespace()); try { return ruby.yield(args[0], args[0], ruby.getRubyClass(), false).toRubyObject(); } finally { ruby.getBlock().setCurrent(oldBlock); } // } /* static block, no need to restore */ // ruby.getBlock().frame.setNamespace(ruby.getRubyFrame().getNamespace()); // return ruby.yield0(args[0], args[0], ruby.getRubyClass(), false); } public int getArity() { return -1; } }, new RubyObject[] { this }); }
| 3,232,297
|
public RubyObject yieldUnder(RubyModule under) { return under.executeUnder(new Callback() { public RubyObject execute(RubyObject self, RubyObject[] args, Ruby ruby) { // if () { Block oldBlock = ruby.getBlock().getCurrent().cloneBlock(); /* copy the block to avoid modifying global data. */ ruby.getBlock().getCurrent().getFrame().setNamespace(ruby.getCurrentFrame().getNamespace()); try { return ruby.yield(args[0], args[0], ruby.getRubyClass(), false).toRubyObject(); } finally { ruby.getBlock().setCurrent(oldBlock); } // } /* static block, no need to restore */ // ruby.getBlock().frame.setNamespace(ruby.getRubyFrame().getNamespace()); // return ruby.yield0(args[0], args[0], ruby.getRubyClass(), false); } public int getArity() { return -1; } }, new RubyObject[] { this }); }
|
public RubyObject yieldUnder(RubyModule under) { return under.executeUnder(new Callback() { public RubyObject execute(RubyObject self, RubyObject[] args, Ruby ruby) { // if () { Block oldBlock = ruby.getBlock().getCurrent().cloneBlock(); /* copy the block to avoid modifying global data. */ ruby.getBlock().getCurrent().getFrame().setNamespace(ruby.getCurrentFrame().getNamespace()); try { return ruby.yield(args[0], args[0], ruby.getRubyClass(), false).toRubyObject(); } finally { ruby.getBlockStack().setCurrent(oldBlock); } // } /* static block, no need to restore */ // ruby.getBlock().frame.setNamespace(ruby.getRubyFrame().getNamespace()); // return ruby.yield0(args[0], args[0], ruby.getRubyClass(), false); } public int getArity() { return -1; } }, new RubyObject[] { this }); }
| 3,232,298
|
public RubyObject execute(RubyObject self, RubyObject[] args, Ruby ruby) { // if () { Block oldBlock = ruby.getBlock().getCurrent().cloneBlock(); /* copy the block to avoid modifying global data. */ ruby.getBlock().getCurrent().getFrame().setNamespace(ruby.getCurrentFrame().getNamespace()); try { return ruby.yield(args[0], args[0], ruby.getRubyClass(), false).toRubyObject(); } finally { ruby.getBlock().setCurrent(oldBlock); } // } /* static block, no need to restore */ // ruby.getBlock().frame.setNamespace(ruby.getRubyFrame().getNamespace()); // return ruby.yield0(args[0], args[0], ruby.getRubyClass(), false); }
|
public RubyObject execute(RubyObject self, RubyObject[] args, Ruby ruby) { // if () { Block oldBlock = ruby.getBlockStack().getCurrent().cloneBlock(); /* copy the block to avoid modifying global data. */ ruby.getBlock().getCurrent().getFrame().setNamespace(ruby.getCurrentFrame().getNamespace()); try { return ruby.yield(args[0], args[0], ruby.getRubyClass(), false).toRubyObject(); } finally { ruby.getBlock().setCurrent(oldBlock); } // } /* static block, no need to restore */ // ruby.getBlock().frame.setNamespace(ruby.getRubyFrame().getNamespace()); // return ruby.yield0(args[0], args[0], ruby.getRubyClass(), false); }
| 3,232,299
|
public RubyObject execute(RubyObject self, RubyObject[] args, Ruby ruby) { // if () { Block oldBlock = ruby.getBlock().getCurrent().cloneBlock(); /* copy the block to avoid modifying global data. */ ruby.getBlock().getCurrent().getFrame().setNamespace(ruby.getCurrentFrame().getNamespace()); try { return ruby.yield(args[0], args[0], ruby.getRubyClass(), false).toRubyObject(); } finally { ruby.getBlock().setCurrent(oldBlock); } // } /* static block, no need to restore */ // ruby.getBlock().frame.setNamespace(ruby.getRubyFrame().getNamespace()); // return ruby.yield0(args[0], args[0], ruby.getRubyClass(), false); }
|
public RubyObject execute(RubyObject self, RubyObject[] args, Ruby ruby) { // if () { Block oldBlock = ruby.getBlock().getCurrent().cloneBlock(); /* copy the block to avoid modifying global data. */ ruby.getBlockStack().getCurrent().getFrame().setNamespace(ruby.getCurrentFrame().getNamespace()); try { return ruby.yield(args[0], args[0], ruby.getRubyClass(), false).toRubyObject(); } finally { ruby.getBlock().setCurrent(oldBlock); } // } /* static block, no need to restore */ // ruby.getBlock().frame.setNamespace(ruby.getRubyFrame().getNamespace()); // return ruby.yield0(args[0], args[0], ruby.getRubyClass(), false); }
| 3,232,300
|
public RubyObject execute(RubyObject self, RubyObject[] args, Ruby ruby) { // if () { Block oldBlock = ruby.getBlock().getCurrent().cloneBlock(); /* copy the block to avoid modifying global data. */ ruby.getBlock().getCurrent().getFrame().setNamespace(ruby.getCurrentFrame().getNamespace()); try { return ruby.yield(args[0], args[0], ruby.getRubyClass(), false).toRubyObject(); } finally { ruby.getBlock().setCurrent(oldBlock); } // } /* static block, no need to restore */ // ruby.getBlock().frame.setNamespace(ruby.getRubyFrame().getNamespace()); // return ruby.yield0(args[0], args[0], ruby.getRubyClass(), false); }
|
public RubyObject execute(RubyObject self, RubyObject[] args, Ruby ruby) { // if () { Block oldBlock = ruby.getBlock().getCurrent().cloneBlock(); /* copy the block to avoid modifying global data. */ ruby.getBlock().getCurrent().getFrame().setNamespace(ruby.getCurrentFrame().getNamespace()); try { return ruby.yield(args[0], args[0], ruby.getRubyClass(), false).toRubyObject(); } finally { ruby.getBlockStack().setCurrent(oldBlock); } // } /* static block, no need to restore */ // ruby.getBlock().frame.setNamespace(ruby.getRubyFrame().getNamespace()); // return ruby.yield0(args[0], args[0], ruby.getRubyClass(), false); }
| 3,232,301
|
public String toString(){ return "AnalysisChainNode"+(analysisChainNodeId==null ? ":Hash"+this.hashCode() : ":"+analysisChainNodeId); }
|
public String toString(){ return "AnalysisChainNode"+(analysisChainNodeId==null ? ":Hash_"+this.hashCode() : ":Id_"+analysisChainNodeId); }
| 3,232,302
|
private LoadServiceResource findFile(String name) { if (name.startsWith("jar:")) { try { return new LoadServiceResource(new URL(name), name); } catch (MalformedURLException e) { throw runtime.newIOErrorFromException(e); } } try { JRubyFile file = JRubyFile.create(runtime.getCurrentDirectory(),name); if(file.isFile() && file.isAbsolute()) { try { return new LoadServiceResource(file.toURL(),name); } catch (MalformedURLException e) { throw runtime.newIOErrorFromException(e); } } } catch (AccessControlException accessEx) { // ignore, applet security } catch (IllegalArgumentException illArgEx) { } ClassLoader classLoader = runtime.getJavaSupport().getJavaClassLoader(); String xname = name.replace('\\', '/'); // Look in classpath next (we do not use File as a test since UNC names will match) // Note: Jar resources must always begin with an '/'. if (xname.charAt(0) == '/') { URL loc = classLoader.getResource(xname); // Make sure this is not a directory or unavailable in some way if (isRequireable(loc)) { return new LoadServiceResource(loc, loc.getPath()); } } for (Iterator pathIter = loadPath.iterator(); pathIter.hasNext();) { String entry = pathIter.next().toString(); if (entry.startsWith("jar:")) { JarFile current = (JarFile)jarFiles.get(entry); if(null == current) { try { current = new JarFile(entry.substring(4)); jarFiles.put(entry,current); } catch (FileNotFoundException ignored) { } catch (IOException e) { throw runtime.newIOErrorFromException(e); } } if (current.getJarEntry(name) != null) { try { return new LoadServiceResource(new URL(entry + name), entry + name); } catch (MalformedURLException e) { throw runtime.newIOErrorFromException(e); } } } try { JRubyFile current = JRubyFile.create(JRubyFile.create(runtime.getCurrentDirectory(),entry).getAbsolutePath(), name); if (current.isFile()) { try { return new LoadServiceResource(current.toURL(), current.getPath()); } catch (MalformedURLException e) { throw runtime.newIOErrorFromException(e); } } } catch (AccessControlException accessEx) { // ignore, we're in an applet } catch (IllegalArgumentException illArgEx) { // ignore; Applet under windows has issues with current dir = "/" } // otherwise, try to load from classpath (Note: Jar resources always uses '/') URL loc = classLoader.getResource(entry.replace('\\', '/') + "/" + xname); // Make sure this is not a directory or unavailable in some way if (isRequireable(loc)) { return new LoadServiceResource(loc, loc.getPath()); } } // Try to load from classpath without prefix. "A/b.rb" will not load as // "./A/b.rb" in a jar file. (Note: Jar resources always uses '/') URL loc = classLoader.getResource(xname); return isRequireable(loc) ? new LoadServiceResource(loc, loc.getPath()) : null; }
|
private LoadServiceResource findFile(String name) { if (name.startsWith("jar:")) { try { return new LoadServiceResource(new URL(name), name); } catch (MalformedURLException e) { throw runtime.newIOErrorFromException(e); } } try { JRubyFile file = JRubyFile.create(runtime.getCurrentDirectory(),name); if(file.isFile() && file.isAbsolute()) { try { return new LoadServiceResource(file.toURL(),name); } catch (MalformedURLException e) { throw runtime.newIOErrorFromException(e); } } } catch (AccessControlException accessEx) { // ignore, applet security } catch (IllegalArgumentException illArgEx) { } ClassLoader classLoader = runtime.getJavaSupport().getJavaClassLoader(); String xname = name.replace('\\', '/'); // Look in classpath next (we do not use File as a test since UNC names will match) // Note: Jar resources must always begin with an '/'. if (xname.charAt(0) == '/') { URL loc = classLoader.getResource(xname); // Make sure this is not a directory or unavailable in some way if (isRequireable(loc)) { return new LoadServiceResource(loc, loc.getPath()); } } for (Iterator pathIter = loadPath.iterator(); pathIter.hasNext();) { String entry = pathIter.next().toString(); if (entry.startsWith("jar:")) { JarFile current = (JarFile)jarFiles.get(entry); if(null == current) { try { current = new JarFile(entry.substring(4)); jarFiles.put(entry,current); } catch (FileNotFoundException ignored) { } catch (IOException e) { throw runtime.newIOErrorFromException(e); } } if (current.getJarEntry(name) != null) { try { return new LoadServiceResource(new URL(entry + name), entry + name); } catch (MalformedURLException e) { throw runtime.newIOErrorFromException(e); } } } try { JRubyFile current = JRubyFile.create(JRubyFile.create(runtime.getCurrentDirectory(),entry).getAbsolutePath(), name); if (current.isFile()) { try { return new LoadServiceResource(current.toURL(), current.getPath()); } catch (MalformedURLException e) { throw runtime.newIOErrorFromException(e); } } } catch (AccessControlException accessEx) { // ignore, we're in an applet } catch (IllegalArgumentException illArgEx) { // ignore; Applet under windows has issues with current dir = "/" } // otherwise, try to load from classpath (Note: Jar resources always uses '/') URL loc = classLoader.getResource(entry.replace('\\', '/') + "/" + xname); // Make sure this is not a directory or unavailable in some way if (isRequireable(loc)) { return new LoadServiceResource(loc, loc.getPath()); } } // Try to load from classpath without prefix. "A/b.rb" will not load as // "./A/b.rb" in a jar file. (Note: Jar resources always uses '/') URL loc = classLoader.getResource(xname); return isRequireable(loc) ? new LoadServiceResource(loc, loc.getPath()) : null; }
| 3,232,303
|
private LoadServiceResource findFile(String name) { if (name.startsWith("jar:")) { try { return new LoadServiceResource(new URL(name), name); } catch (MalformedURLException e) { throw runtime.newIOErrorFromException(e); } } try { JRubyFile file = JRubyFile.create(runtime.getCurrentDirectory(),name); if(file.isFile() && file.isAbsolute()) { try { return new LoadServiceResource(file.toURL(),name); } catch (MalformedURLException e) { throw runtime.newIOErrorFromException(e); } } } catch (AccessControlException accessEx) { // ignore, applet security } catch (IllegalArgumentException illArgEx) { } ClassLoader classLoader = runtime.getJavaSupport().getJavaClassLoader(); String xname = name.replace('\\', '/'); // Look in classpath next (we do not use File as a test since UNC names will match) // Note: Jar resources must always begin with an '/'. if (xname.charAt(0) == '/') { URL loc = classLoader.getResource(xname); // Make sure this is not a directory or unavailable in some way if (isRequireable(loc)) { return new LoadServiceResource(loc, loc.getPath()); } } for (Iterator pathIter = loadPath.iterator(); pathIter.hasNext();) { String entry = pathIter.next().toString(); if (entry.startsWith("jar:")) { JarFile current = (JarFile)jarFiles.get(entry); if(null == current) { try { current = new JarFile(entry.substring(4)); jarFiles.put(entry,current); } catch (FileNotFoundException ignored) { } catch (IOException e) { throw runtime.newIOErrorFromException(e); } } if (current.getJarEntry(name) != null) { try { return new LoadServiceResource(new URL(entry + name), entry + name); } catch (MalformedURLException e) { throw runtime.newIOErrorFromException(e); } } } try { JRubyFile current = JRubyFile.create(JRubyFile.create(runtime.getCurrentDirectory(),entry).getAbsolutePath(), name); if (current.isFile()) { try { return new LoadServiceResource(current.toURL(), current.getPath()); } catch (MalformedURLException e) { throw runtime.newIOErrorFromException(e); } } } catch (AccessControlException accessEx) { // ignore, we're in an applet } catch (IllegalArgumentException illArgEx) { // ignore; Applet under windows has issues with current dir = "/" } // otherwise, try to load from classpath (Note: Jar resources always uses '/') URL loc = classLoader.getResource(entry.replace('\\', '/') + "/" + xname); // Make sure this is not a directory or unavailable in some way if (isRequireable(loc)) { return new LoadServiceResource(loc, loc.getPath()); } } // Try to load from classpath without prefix. "A/b.rb" will not load as // "./A/b.rb" in a jar file. (Note: Jar resources always uses '/') URL loc = classLoader.getResource(xname); return isRequireable(loc) ? new LoadServiceResource(loc, loc.getPath()) : null; }
|
private LoadServiceResource findFile(String name) { if (name.startsWith("jar:")) { try { return new LoadServiceResource(new URL(name), name); } catch (MalformedURLException e) { throw runtime.newIOErrorFromException(e); } } try { JRubyFile file = JRubyFile.create(runtime.getCurrentDirectory(),name); if(file.isFile() && file.isAbsolute()) { try { return new LoadServiceResource(file.toURL(),name); } catch (MalformedURLException e) { throw runtime.newIOErrorFromException(e); } } } catch (AccessControlException accessEx) { // ignore, applet security } catch (IllegalArgumentException illArgEx) { } ClassLoader classLoader = runtime.getJavaSupport().getJavaClassLoader(); String xname = name.replace('\\', '/'); // Look in classpath next (we do not use File as a test since UNC names will match) // Note: Jar resources must always begin with an '/'. if (xname.charAt(0) == '/') { URL loc = classLoader.getResource(xname); // Make sure this is not a directory or unavailable in some way if (isRequireable(loc)) { return new LoadServiceResource(loc, loc.getPath()); } } for (Iterator pathIter = loadPath.iterator(); pathIter.hasNext();) { String entry = pathIter.next().toString(); if (entry.startsWith("jar:")) { JarFile current = (JarFile)jarFiles.get(entry); if(null == current) { try { current = new JarFile(entry.substring(4)); jarFiles.put(entry,current); } catch (FileNotFoundException ignored) { } catch (IOException e) { throw runtime.newIOErrorFromException(e); } } if (current.getJarEntry(name) != null) { try { return new LoadServiceResource(new URL(entry + name), entry + name); } catch (MalformedURLException e) { throw runtime.newIOErrorFromException(e); } } } try { JRubyFile current = JRubyFile.create(JRubyFile.create(runtime.getCurrentDirectory(),entry).getAbsolutePath(), name); if (current.isFile()) { try { return new LoadServiceResource(current.toURL(), current.getPath()); } catch (MalformedURLException e) { throw runtime.newIOErrorFromException(e); } } } catch (AccessControlException accessEx) { // ignore, we're in an applet } catch (IllegalArgumentException illArgEx) { // ignore; Applet under windows has issues with current dir = "/" } // otherwise, try to load from classpath (Note: Jar resources always uses '/') URL loc = classLoader.getResource(entry.replace('\\', '/') + "/" + xname); // Make sure this is not a directory or unavailable in some way if (isRequireable(loc)) { return new LoadServiceResource(loc, loc.getPath()); } } // Try to load from classpath without prefix. "A/b.rb" will not load as // "./A/b.rb" in a jar file. (Note: Jar resources always uses '/') URL loc = classLoader.getResource(xname); return isRequireable(loc) ? new LoadServiceResource(loc, loc.getPath()) : null; }
| 3,232,304
|
private LoadServiceResource findFile(String name) { if (name.startsWith("jar:")) { try { return new LoadServiceResource(new URL(name), name); } catch (MalformedURLException e) { throw runtime.newIOErrorFromException(e); } } try { JRubyFile file = JRubyFile.create(runtime.getCurrentDirectory(),name); if(file.isFile() && file.isAbsolute()) { try { return new LoadServiceResource(file.toURL(),name); } catch (MalformedURLException e) { throw runtime.newIOErrorFromException(e); } } } catch (AccessControlException accessEx) { // ignore, applet security } catch (IllegalArgumentException illArgEx) { } ClassLoader classLoader = runtime.getJavaSupport().getJavaClassLoader(); String xname = name.replace('\\', '/'); // Look in classpath next (we do not use File as a test since UNC names will match) // Note: Jar resources must always begin with an '/'. if (xname.charAt(0) == '/') { URL loc = classLoader.getResource(xname); // Make sure this is not a directory or unavailable in some way if (isRequireable(loc)) { return new LoadServiceResource(loc, loc.getPath()); } } for (Iterator pathIter = loadPath.iterator(); pathIter.hasNext();) { String entry = pathIter.next().toString(); if (entry.startsWith("jar:")) { JarFile current = (JarFile)jarFiles.get(entry); if(null == current) { try { current = new JarFile(entry.substring(4)); jarFiles.put(entry,current); } catch (FileNotFoundException ignored) { } catch (IOException e) { throw runtime.newIOErrorFromException(e); } } if (current.getJarEntry(name) != null) { try { return new LoadServiceResource(new URL(entry + name), entry + name); } catch (MalformedURLException e) { throw runtime.newIOErrorFromException(e); } } } try { JRubyFile current = JRubyFile.create(JRubyFile.create(runtime.getCurrentDirectory(),entry).getAbsolutePath(), name); if (current.isFile()) { try { return new LoadServiceResource(current.toURL(), current.getPath()); } catch (MalformedURLException e) { throw runtime.newIOErrorFromException(e); } } } catch (AccessControlException accessEx) { // ignore, we're in an applet } catch (IllegalArgumentException illArgEx) { // ignore; Applet under windows has issues with current dir = "/" } // otherwise, try to load from classpath (Note: Jar resources always uses '/') URL loc = classLoader.getResource(entry.replace('\\', '/') + "/" + xname); // Make sure this is not a directory or unavailable in some way if (isRequireable(loc)) { return new LoadServiceResource(loc, loc.getPath()); } } // Try to load from classpath without prefix. "A/b.rb" will not load as // "./A/b.rb" in a jar file. (Note: Jar resources always uses '/') URL loc = classLoader.getResource(xname); return isRequireable(loc) ? new LoadServiceResource(loc, loc.getPath()) : null; }
|
private LoadServiceResource findFile(String name) { if (name.startsWith("jar:")) { try { return new LoadServiceResource(new URL(name), name); } catch (MalformedURLException e) { throw runtime.newIOErrorFromException(e); } } try { JRubyFile file = JRubyFile.create(runtime.getCurrentDirectory(),name); if(file.isFile() && file.isAbsolute()) { try { return new LoadServiceResource(file.toURL(),name); } catch (MalformedURLException e) { throw runtime.newIOErrorFromException(e); } } } catch (AccessControlException accessEx) { // ignore, applet security } catch (IllegalArgumentException illArgEx) { } ClassLoader classLoader = runtime.getJavaSupport().getJavaClassLoader(); String xname = name.replace('\\', '/'); // Look in classpath next (we do not use File as a test since UNC names will match) // Note: Jar resources must always begin with an '/'. if (xname.charAt(0) == '/') { URL loc = classLoader.getResource(xname); // Make sure this is not a directory or unavailable in some way if (isRequireable(loc)) { return new LoadServiceResource(loc, loc.getPath()); } } for (Iterator pathIter = loadPath.iterator(); pathIter.hasNext();) { String entry = pathIter.next().toString(); if (entry.startsWith("jar:")) { JarFile current = (JarFile)jarFiles.get(entry); if(null == current) { try { current = new JarFile(entry.substring(4)); jarFiles.put(entry,current); } catch (FileNotFoundException ignored) { } catch (IOException e) { throw runtime.newIOErrorFromException(e); } } if (current.getJarEntry(name) != null) { try { return new LoadServiceResource(new URL(entry + name), entry + name); } catch (MalformedURLException e) { throw runtime.newIOErrorFromException(e); } } } try { JRubyFile current = JRubyFile.create(JRubyFile.create(runtime.getCurrentDirectory(),entry).getAbsolutePath(), name); if (current.isFile()) { try { return new LoadServiceResource(current.toURL(), current.getPath()); } catch (MalformedURLException e) { throw runtime.newIOErrorFromException(e); } } } catch (AccessControlException accessEx) { // ignore, we're in an applet } catch (IllegalArgumentException illArgEx) { // ignore; Applet under windows has issues with current dir = "/" } // otherwise, try to load from classpath (Note: Jar resources always uses '/') URL loc = classLoader.getResource(entry.replace('\\', '/') + "/" + xname); // Make sure this is not a directory or unavailable in some way if (isRequireable(loc)) { return new LoadServiceResource(loc, loc.getPath()); } } // Try to load from classpath without prefix. "A/b.rb" will not load as // "./A/b.rb" in a jar file. (Note: Jar resources always uses '/') URL loc = classLoader.getResource(xname); return isRequireable(loc) ? new LoadServiceResource(loc, loc.getPath()) : null; }
| 3,232,305
|
public void init(List additionalDirectories) { for (Iterator iter = additionalDirectories.iterator(); iter.hasNext();) { addPath((String) iter.next()); } // wrap in try/catch for security exceptions in an applet try { if (runtime.getSafeLevel() == 0) { String jrubyLib = System.getProperty("jruby.lib"); if (jrubyLib != null) { addPath(jrubyLib); } } String jrubyHome = System.getProperty("jruby.home"); if (jrubyHome != null) { char sep = '/'; String rubyDir = jrubyHome + sep + "lib" + sep + "ruby" + sep; addPath(rubyDir + "site_ruby" + sep + Constants.RUBY_MAJOR_VERSION); addPath(rubyDir + "site_ruby" + sep + Constants.RUBY_MAJOR_VERSION + sep + "java"); addPath(rubyDir + "site_ruby"); addPath(rubyDir + Constants.RUBY_MAJOR_VERSION); addPath(rubyDir + Constants.RUBY_MAJOR_VERSION + sep + "java"); // Added to make sure we find default distribution files within jar file. // TODO: Either make jrubyHome become the jar file or allow "classpath-only" paths addPath("lib" + sep + "ruby" + sep + Constants.RUBY_MAJOR_VERSION); } } catch (AccessControlException accessEx) { // ignore, we're in an applet and can't access filesystem anyway } if (runtime.getSafeLevel() == 0) { addPath("."); } }
|
public void init(List additionalDirectories) { for (Iterator iter = additionalDirectories.iterator(); iter.hasNext();) { addPath((String) iter.next()); } // wrap in try/catch for security exceptions in an applet try { if (runtime.getSafeLevel() == 0) { String jrubyLib = System.getProperty("jruby.lib"); if (jrubyLib != null) { addPath(jrubyLib); } } String jrubyHome = System.getProperty("jruby.home"); if (jrubyHome != null) { char sep = '/'; String rubyDir = jrubyHome + sep + "lib" + sep + "ruby" + sep; addPath(rubyDir + "site_ruby" + sep + Constants.RUBY_MAJOR_VERSION); addPath(rubyDir + "site_ruby" + sep + Constants.RUBY_MAJOR_VERSION + sep + "java"); addPath(rubyDir + "site_ruby"); addPath(rubyDir + Constants.RUBY_MAJOR_VERSION); addPath(rubyDir + Constants.RUBY_MAJOR_VERSION + sep + "java"); // Added to make sure we find default distribution files within jar file. // TODO: Either make jrubyHome become the jar file or allow "classpath-only" paths addPath("lib" + sep + "ruby" + sep + Constants.RUBY_MAJOR_VERSION); } } catch (AccessControlException accessEx) { // ignore, we're in an applet and can't access filesystem anyway } if (runtime.getSafeLevel() == 0) { addPath("."); } }
| 3,232,307
|
public void init(List additionalDirectories) { for (Iterator iter = additionalDirectories.iterator(); iter.hasNext();) { addPath((String) iter.next()); } // wrap in try/catch for security exceptions in an applet try { if (runtime.getSafeLevel() == 0) { String jrubyLib = System.getProperty("jruby.lib"); if (jrubyLib != null) { addPath(jrubyLib); } } String jrubyHome = System.getProperty("jruby.home"); if (jrubyHome != null) { char sep = '/'; String rubyDir = jrubyHome + sep + "lib" + sep + "ruby" + sep; addPath(rubyDir + "site_ruby" + sep + Constants.RUBY_MAJOR_VERSION); addPath(rubyDir + "site_ruby" + sep + Constants.RUBY_MAJOR_VERSION + sep + "java"); addPath(rubyDir + "site_ruby"); addPath(rubyDir + Constants.RUBY_MAJOR_VERSION); addPath(rubyDir + Constants.RUBY_MAJOR_VERSION + sep + "java"); // Added to make sure we find default distribution files within jar file. // TODO: Either make jrubyHome become the jar file or allow "classpath-only" paths addPath("lib" + sep + "ruby" + sep + Constants.RUBY_MAJOR_VERSION); } } catch (AccessControlException accessEx) { // ignore, we're in an applet and can't access filesystem anyway } if (runtime.getSafeLevel() == 0) { addPath("."); } }
|
public void init(List additionalDirectories) { for (Iterator iter = additionalDirectories.iterator(); iter.hasNext();) { addPath((String) iter.next()); } // wrap in try/catch for security exceptions in an applet try { if (runtime.getSafeLevel() == 0) { String jrubyLib = System.getProperty("jruby.lib"); if (jrubyLib != null) { addPath(jrubyLib); } } String jrubyHome = System.getProperty("jruby.home"); if (jrubyHome != null) { char sep = '/'; String rubyDir = jrubyHome + sep + "lib" + sep + "ruby" + sep; addPath(rubyDir + "site_ruby" + sep + Constants.RUBY_MAJOR_VERSION); addPath(rubyDir + "site_ruby" + sep + Constants.RUBY_MAJOR_VERSION + sep + "java"); addPath(rubyDir + "site_ruby"); addPath(rubyDir + Constants.RUBY_MAJOR_VERSION); addPath(rubyDir + Constants.RUBY_MAJOR_VERSION + sep + "java"); // Added to make sure we find default distribution files within jar file. // TODO: Either make jrubyHome become the jar file or allow "classpath-only" paths addPath("lib" + sep + "ruby" + sep + Constants.RUBY_MAJOR_VERSION); } } catch (AccessControlException accessEx) { // ignore, we're in an applet and can't access filesystem anyway } if (runtime.getSafeLevel() == 0) { addPath("."); } }
| 3,232,308
|
public void init(List additionalDirectories) { for (Iterator iter = additionalDirectories.iterator(); iter.hasNext();) { addPath((String) iter.next()); } // wrap in try/catch for security exceptions in an applet try { if (runtime.getSafeLevel() == 0) { String jrubyLib = System.getProperty("jruby.lib"); if (jrubyLib != null) { addPath(jrubyLib); } } String jrubyHome = System.getProperty("jruby.home"); if (jrubyHome != null) { char sep = '/'; String rubyDir = jrubyHome + sep + "lib" + sep + "ruby" + sep; addPath(rubyDir + "site_ruby" + sep + Constants.RUBY_MAJOR_VERSION); addPath(rubyDir + "site_ruby" + sep + Constants.RUBY_MAJOR_VERSION + sep + "java"); addPath(rubyDir + "site_ruby"); addPath(rubyDir + Constants.RUBY_MAJOR_VERSION); addPath(rubyDir + Constants.RUBY_MAJOR_VERSION + sep + "java"); // Added to make sure we find default distribution files within jar file. // TODO: Either make jrubyHome become the jar file or allow "classpath-only" paths addPath("lib" + sep + "ruby" + sep + Constants.RUBY_MAJOR_VERSION); } } catch (AccessControlException accessEx) { // ignore, we're in an applet and can't access filesystem anyway } if (runtime.getSafeLevel() == 0) { addPath("."); } }
|
public void init(List additionalDirectories) { for (Iterator iter = additionalDirectories.iterator(); iter.hasNext();) { addPath((String) iter.next()); } // wrap in try/catch for security exceptions in an applet try { if (runtime.getSafeLevel() == 0) { String jrubyLib = System.getProperty("jruby.lib"); if (jrubyLib != null) { addPath(jrubyLib); } } String jrubyHome = System.getProperty("jruby.home"); if (jrubyHome != null) { char sep = '/'; String rubyDir = jrubyHome + sep + "lib" + sep + "ruby" + sep; addPath(rubyDir + "site_ruby" + sep + Constants.RUBY_MAJOR_VERSION); addPath(rubyDir + "site_ruby"); addPath(rubyDir + Constants.RUBY_MAJOR_VERSION); addPath(rubyDir + Constants.RUBY_MAJOR_VERSION + sep + "java"); // Added to make sure we find default distribution files within jar file. // TODO: Either make jrubyHome become the jar file or allow "classpath-only" paths addPath("lib" + sep + "ruby" + sep + Constants.RUBY_MAJOR_VERSION); } } catch (AccessControlException accessEx) { // ignore, we're in an applet and can't access filesystem anyway } if (runtime.getSafeLevel() == 0) { addPath("."); } }
| 3,232,309
|
public void init(List additionalDirectories) { for (Iterator iter = additionalDirectories.iterator(); iter.hasNext();) { addPath((String) iter.next()); } // wrap in try/catch for security exceptions in an applet try { if (runtime.getSafeLevel() == 0) { String jrubyLib = System.getProperty("jruby.lib"); if (jrubyLib != null) { addPath(jrubyLib); } } String jrubyHome = System.getProperty("jruby.home"); if (jrubyHome != null) { char sep = '/'; String rubyDir = jrubyHome + sep + "lib" + sep + "ruby" + sep; addPath(rubyDir + "site_ruby" + sep + Constants.RUBY_MAJOR_VERSION); addPath(rubyDir + "site_ruby" + sep + Constants.RUBY_MAJOR_VERSION + sep + "java"); addPath(rubyDir + "site_ruby"); addPath(rubyDir + Constants.RUBY_MAJOR_VERSION); addPath(rubyDir + Constants.RUBY_MAJOR_VERSION + sep + "java"); // Added to make sure we find default distribution files within jar file. // TODO: Either make jrubyHome become the jar file or allow "classpath-only" paths addPath("lib" + sep + "ruby" + sep + Constants.RUBY_MAJOR_VERSION); } } catch (AccessControlException accessEx) { // ignore, we're in an applet and can't access filesystem anyway } if (runtime.getSafeLevel() == 0) { addPath("."); } }
|
public void init(List additionalDirectories) { for (Iterator iter = additionalDirectories.iterator(); iter.hasNext();) { addPath((String) iter.next()); } // wrap in try/catch for security exceptions in an applet try { if (runtime.getSafeLevel() == 0) { String jrubyLib = System.getProperty("jruby.lib"); if (jrubyLib != null) { addPath(jrubyLib); } } String jrubyHome = System.getProperty("jruby.home"); if (jrubyHome != null) { char sep = '/'; String rubyDir = jrubyHome + sep + "lib" + sep + "ruby" + sep; addPath(rubyDir + "site_ruby" + sep + Constants.RUBY_MAJOR_VERSION); addPath(rubyDir + "site_ruby" + sep + Constants.RUBY_MAJOR_VERSION + sep + "java"); addPath(rubyDir + "site_ruby"); addPath(rubyDir + Constants.RUBY_MAJOR_VERSION); addPath(rubyDir + Constants.RUBY_MAJOR_VERSION + sep + "java"); // Added to make sure we find default distribution files within jar file. // TODO: Either make jrubyHome become the jar file or allow "classpath-only" paths addPath("lib" + sep + "ruby" + sep + Constants.RUBY_MAJOR_VERSION); } } catch (AccessControlException accessEx) { // ignore, we're in an applet and can't access filesystem anyway } if (runtime.getSafeLevel() == 0) { addPath("."); } }
| 3,232,310
|
public void init(List additionalDirectories) { for (Iterator iter = additionalDirectories.iterator(); iter.hasNext();) { addPath((String) iter.next()); } // wrap in try/catch for security exceptions in an applet try { if (runtime.getSafeLevel() == 0) { String jrubyLib = System.getProperty("jruby.lib"); if (jrubyLib != null) { addPath(jrubyLib); } } String jrubyHome = System.getProperty("jruby.home"); if (jrubyHome != null) { char sep = '/'; String rubyDir = jrubyHome + sep + "lib" + sep + "ruby" + sep; addPath(rubyDir + "site_ruby" + sep + Constants.RUBY_MAJOR_VERSION); addPath(rubyDir + "site_ruby" + sep + Constants.RUBY_MAJOR_VERSION + sep + "java"); addPath(rubyDir + "site_ruby"); addPath(rubyDir + Constants.RUBY_MAJOR_VERSION); addPath(rubyDir + Constants.RUBY_MAJOR_VERSION + sep + "java"); // Added to make sure we find default distribution files within jar file. // TODO: Either make jrubyHome become the jar file or allow "classpath-only" paths addPath("lib" + sep + "ruby" + sep + Constants.RUBY_MAJOR_VERSION); } } catch (AccessControlException accessEx) { // ignore, we're in an applet and can't access filesystem anyway } if (runtime.getSafeLevel() == 0) { addPath("."); } }
|
public void init(List additionalDirectories) { for (Iterator iter = additionalDirectories.iterator(); iter.hasNext();) { addPath((String) iter.next()); } // wrap in try/catch for security exceptions in an applet try { if (runtime.getSafeLevel() == 0) { String jrubyLib = System.getProperty("jruby.lib"); if (jrubyLib != null) { addPath(jrubyLib); } } String jrubyHome = System.getProperty("jruby.home"); if (jrubyHome != null) { char sep = '/'; String rubyDir = jrubyHome + sep + "lib" + sep + "ruby" + sep; addPath(rubyDir + "site_ruby" + sep + Constants.RUBY_MAJOR_VERSION); addPath(rubyDir + "site_ruby" + sep + Constants.RUBY_MAJOR_VERSION + sep + "java"); addPath(rubyDir + "site_ruby"); addPath(rubyDir + Constants.RUBY_MAJOR_VERSION); addPath(rubyDir + Constants.RUBY_MAJOR_VERSION + sep + "java"); // Added to make sure we find default distribution files within jar file. // TODO: Either make jrubyHome become the jar file or allow "classpath-only" paths addPath("lib" + sep + "ruby" + sep + Constants.RUBY_MAJOR_VERSION); } } catch (AccessControlException accessEx) { // ignore, we're in an applet and can't access filesystem anyway } if (runtime.getSafeLevel() == 0) { addPath("."); } }
| 3,232,311
|
public void init(List additionalDirectories) { for (Iterator iter = additionalDirectories.iterator(); iter.hasNext();) { addPath((String) iter.next()); } // wrap in try/catch for security exceptions in an applet try { if (runtime.getSafeLevel() == 0) { String jrubyLib = System.getProperty("jruby.lib"); if (jrubyLib != null) { addPath(jrubyLib); } } String jrubyHome = System.getProperty("jruby.home"); if (jrubyHome != null) { char sep = '/'; String rubyDir = jrubyHome + sep + "lib" + sep + "ruby" + sep; addPath(rubyDir + "site_ruby" + sep + Constants.RUBY_MAJOR_VERSION); addPath(rubyDir + "site_ruby" + sep + Constants.RUBY_MAJOR_VERSION + sep + "java"); addPath(rubyDir + "site_ruby"); addPath(rubyDir + Constants.RUBY_MAJOR_VERSION); addPath(rubyDir + Constants.RUBY_MAJOR_VERSION + sep + "java"); // Added to make sure we find default distribution files within jar file. // TODO: Either make jrubyHome become the jar file or allow "classpath-only" paths addPath("lib" + sep + "ruby" + sep + Constants.RUBY_MAJOR_VERSION); } } catch (AccessControlException accessEx) { // ignore, we're in an applet and can't access filesystem anyway } if (runtime.getSafeLevel() == 0) { addPath("."); } }
|
public void init(List additionalDirectories) { for (Iterator iter = additionalDirectories.iterator(); iter.hasNext();) { addPath((String) iter.next()); } // wrap in try/catch for security exceptions in an applet try { if (runtime.getSafeLevel() == 0) { String jrubyLib = System.getProperty("jruby.lib"); if (jrubyLib != null) { addPath(jrubyLib); } } String jrubyHome = System.getProperty("jruby.home"); if (jrubyHome != null) { char sep = '/'; String rubyDir = jrubyHome + sep + "lib" + sep + "ruby" + sep; addPath(rubyDir + "site_ruby" + sep + Constants.RUBY_MAJOR_VERSION); addPath(rubyDir + "site_ruby" + sep + Constants.RUBY_MAJOR_VERSION + sep + "java"); addPath(rubyDir + "site_ruby"); addPath(rubyDir + Constants.RUBY_MAJOR_VERSION); addPath(rubyDir + Constants.RUBY_MAJOR_VERSION + sep + "java"); // Added to make sure we find default distribution files within jar file. // TODO: Either make jrubyHome become the jar file or allow "classpath-only" paths addPath("lib" + sep + "ruby" + sep + Constants.RUBY_MAJOR_VERSION); } } catch (AccessControlException accessEx) { // ignore, we're in an applet and can't access filesystem anyway } if (runtime.getSafeLevel() == 0) { addPath("."); } }
| 3,232,312
|
public void load(String file) { Library library = null; library = findLibrary(file); if (library == null) { throw runtime.newLoadError("No such file to load -- " + file); } try { library.load(runtime); } catch (IOException e) { throw runtime.newLoadError("IO error -- " + file); } }
|
public void load(String file) { Library library = null; library = findLibrary(file); if (library == null) { library = findLibraryWithClassloaders(file); if (library == null) { throw runtime.newLoadError("No such file to load -- " + file); } } try { library.load(runtime); } catch (IOException e) { throw runtime.newLoadError("IO error -- " + file); } }
| 3,232,313
|
public boolean require(String file) { String filestr = suffixPattern.matcher(file).replaceAll("$1"); if (loadedFeaturesInternal.contains(filestr)) { return false; } smartLoad(filestr); return true; }
|
public boolean require(String file) { String filestr = allPattern.matcher(file).replaceAll("$1"); if (loadedFeaturesInternal.contains(filestr)) { return false; } smartLoad(filestr); return true; }
| 3,232,314
|
public void smartLoad(String file) { Library library = null; String loadName = file; // nothing yet, try suffixes for (int i = 0; i < suffixes.length; i++) { library = findLibrary(file + suffixes[i]); if (library != null) { loadName = file + suffixes[i]; break; } } if(library == null) { library = findLibrary(file); if(library != null) { loadName = file; } } library = tryLoadExtension(library,file); if (library == null) { throw runtime.newLoadError("No such file to load -- " + file); } try { loadedFeaturesInternal.add(file); loadedFeatures.add(runtime.newString(loadName)); library.load(runtime); } catch (IOException e) { loadedFeaturesInternal.remove(file); loadedFeatures.remove(runtime.newString(loadName)); throw runtime.newLoadError("IO error -- " + file); } }
|
public void smartLoad(String file) { Library library = null; String loadName = file; // nothing yet, try suffixes for (int i = 0; i < suffixes.length; i++) { library = findLibrary(file + suffixes[i]); if (library != null) { loadName = file + suffixes[i]; break; } } if(library == null) { library = findLibrary(file); if(library != null) { loadName = file; } } library = tryLoadExtension(library,file); if (library == null) { throw runtime.newLoadError("No such file to load -- " + file); } try { loadedFeaturesInternal.add(file); loadedFeatures.add(runtime.newString(loadName)); library.load(runtime); } catch (IOException e) { loadedFeaturesInternal.remove(file); loadedFeatures.remove(runtime.newString(loadName)); throw runtime.newLoadError("IO error -- " + file); } }
| 3,232,316
|
public void smartLoad(String file) { Library library = null; String loadName = file; // nothing yet, try suffixes for (int i = 0; i < suffixes.length; i++) { library = findLibrary(file + suffixes[i]); if (library != null) { loadName = file + suffixes[i]; break; } } if(library == null) { library = findLibrary(file); if(library != null) { loadName = file; } } library = tryLoadExtension(library,file); if (library == null) { throw runtime.newLoadError("No such file to load -- " + file); } try { loadedFeaturesInternal.add(file); loadedFeatures.add(runtime.newString(loadName)); library.load(runtime); } catch (IOException e) { loadedFeaturesInternal.remove(file); loadedFeatures.remove(runtime.newString(loadName)); throw runtime.newLoadError("IO error -- " + file); } }
|
public void smartLoad(String file) { Library library = null; String loadName = file; // nothing yet, try suffixes for (int i = 0; i < suffixes.length; i++) { library = findLibrary(file + suffixes[i]); if (library != null) { loadName = file + extensionsToSearch[i]; break; } } if(library == null) { library = findLibrary(file); if(library != null) { loadName = file; } } library = tryLoadExtension(library,file); if (library == null) { throw runtime.newLoadError("No such file to load -- " + file); } try { loadedFeaturesInternal.add(file); loadedFeatures.add(runtime.newString(loadName)); library.load(runtime); } catch (IOException e) { loadedFeaturesInternal.remove(file); loadedFeatures.remove(runtime.newString(loadName)); throw runtime.newLoadError("IO error -- " + file); } }
| 3,232,317
|
public void smartLoad(String file) { Library library = null; String loadName = file; // nothing yet, try suffixes for (int i = 0; i < suffixes.length; i++) { library = findLibrary(file + suffixes[i]); if (library != null) { loadName = file + suffixes[i]; break; } } if(library == null) { library = findLibrary(file); if(library != null) { loadName = file; } } library = tryLoadExtension(library,file); if (library == null) { throw runtime.newLoadError("No such file to load -- " + file); } try { loadedFeaturesInternal.add(file); loadedFeatures.add(runtime.newString(loadName)); library.load(runtime); } catch (IOException e) { loadedFeaturesInternal.remove(file); loadedFeatures.remove(runtime.newString(loadName)); throw runtime.newLoadError("IO error -- " + file); } }
|
public void smartLoad(String file) { Library library = null; String loadName = file; // nothing yet, try suffixes for (int i = 0; i < suffixes.length; i++) { library = findLibrary(file + suffixes[i]); if (library != null) { loadName = file + suffixes[i]; break; } } if(library == null) { library = findLibrary(file); if(library != null) { loadName = file; } } library = tryLoadExtension(library,file); if (library == null) { throw runtime.newLoadError("No such file to load -- " + file); } try { loadedFeaturesInternal.add(file); loadedFeatures.add(runtime.newString(loadName)); library.load(runtime); } catch (IOException e) { loadedFeaturesInternal.remove(file); loadedFeatures.remove(runtime.newString(loadName)); throw runtime.newLoadError("IO error -- " + file); } }
| 3,232,318
|
public void smartLoad(String file) { Library library = null; String loadName = file; // nothing yet, try suffixes for (int i = 0; i < suffixes.length; i++) { library = findLibrary(file + suffixes[i]); if (library != null) { loadName = file + suffixes[i]; break; } } if(library == null) { library = findLibrary(file); if(library != null) { loadName = file; } } library = tryLoadExtension(library,file); if (library == null) { throw runtime.newLoadError("No such file to load -- " + file); } try { loadedFeaturesInternal.add(file); loadedFeatures.add(runtime.newString(loadName)); library.load(runtime); } catch (IOException e) { loadedFeaturesInternal.remove(file); loadedFeatures.remove(runtime.newString(loadName)); throw runtime.newLoadError("IO error -- " + file); } }
|
public void smartLoad(String file) { Library library = null; String loadName = file; // nothing yet, try suffixes for (int i = 0; i < suffixes.length; i++) { library = findLibrary(file + suffixes[i]); if (library != null) { loadName = file + suffixes[i]; break; } } if(library == null) { library = findLibrary(file); if(library != null) { loadName = file; } } library = tryLoadExtension(library,file); if (library == null) { throw runtime.newLoadError("no such file to load -- " + file); } try { loadedFeaturesInternal.add(file); loadedFeatures.add(runtime.newString(loadName)); library.load(runtime); } catch (IOException e) { loadedFeaturesInternal.remove(file); loadedFeatures.remove(runtime.newString(loadName)); throw runtime.newLoadError("IO error -- " + file); } }
| 3,232,319
|
public void smartLoad(String file) { Library library = null; String loadName = file; // nothing yet, try suffixes for (int i = 0; i < suffixes.length; i++) { library = findLibrary(file + suffixes[i]); if (library != null) { loadName = file + suffixes[i]; break; } } if(library == null) { library = findLibrary(file); if(library != null) { loadName = file; } } library = tryLoadExtension(library,file); if (library == null) { throw runtime.newLoadError("No such file to load -- " + file); } try { loadedFeaturesInternal.add(file); loadedFeatures.add(runtime.newString(loadName)); library.load(runtime); } catch (IOException e) { loadedFeaturesInternal.remove(file); loadedFeatures.remove(runtime.newString(loadName)); throw runtime.newLoadError("IO error -- " + file); } }
|
public void smartLoad(String file) { Library library = null; String loadName = file; // nothing yet, try suffixes for (int i = 0; i < suffixes.length; i++) { library = findLibrary(file + suffixes[i]); if (library != null) { loadName = file + suffixes[i]; break; } } if(library == null) { library = findLibrary(file); if(library != null) { loadName = file; } } library = tryLoadExtension(library,file); if (library == null) { throw runtime.newLoadError("No such file to load -- " + file); } try { loadedFeaturesInternal.add(file); loadedFeatures.add(runtime.newString(loadName)); library.load(runtime); } catch (IOException e) { loadedFeaturesInternal.remove(file); loadedFeatures.remove(runtime.newString(loadName)); throw runtime.newLoadError("IO error -- " + file); } }
| 3,232,320
|
private Library tryLoadExtension(Library library, String file) { // This code exploits the fact that all .jar files will be found for the JarredScript feature. // This is where the basic extension mechanism gets fixed Library oldLibrary = library; if(library == null || library instanceof JarredScript) { // Create package name, by splitting on / and joining all but the last elements with a ".", and downcasing them. String[] all = file.split("/"); StringBuffer finName = new StringBuffer(); for(int i=0,j=(all.length-1);i<j;i++) { finName.append(all[i].toLowerCase()).append("."); } // Make the class name look nice, by splitting on _ and capitalize each segment, then joining // the, together without anything separating them, and last put on "Service" at the end. String[] last = all[all.length-1].split("_"); for(int i=0,j=last.length;i<j;i++) { finName.append(Character.toUpperCase(last[i].charAt(0))).append(last[i].substring(1)); } finName.append("Service"); // We don't want a package name beginning with dots, so we remove them String className = finName.toString().replaceAll("^\\.*",""); // If there is a jar-file with the required name, we add this to the class path. if(library instanceof JarredScript) { // It's _really_ expensive to check that the class actually exists in the Jar, so // we don't do that now. runtime.getJavaSupport().addToClasspath(((JarredScript)library).getResource().getURL()); } try { Class theClass = runtime.getJavaSupport().loadJavaClass(className); library = new ClassExtensionLibrary(theClass); } catch(Exception ee) { library = null; } } // If there was a good library before, we go back to that if(library == null && oldLibrary != null) { library = oldLibrary; } return library; }
|
private Library tryLoadExtension(Library library, String file) { // This code exploits the fact that all .jar files will be found for the JarredScript feature. // This is where the basic extension mechanism gets fixed Library oldLibrary = library; if(library == null || library instanceof JarredScript) { // Create package name, by splitting on / and joining all but the last elements with a ".", and downcasing them. String[] all = file.split("/"); StringBuffer finName = new StringBuffer(); for(int i=0, j=(all.length-1); i<j; i++) { finName.append(all[i].toLowerCase()).append("."); } // Make the class name look nice, by splitting on _ and capitalize each segment, then joining // the, together without anything separating them, and last put on "Service" at the end. String[] last = all[all.length-1].split("_"); for(int i=0,j=last.length;i<j;i++) { finName.append(Character.toUpperCase(last[i].charAt(0))).append(last[i].substring(1)); } finName.append("Service"); // We don't want a package name beginning with dots, so we remove them String className = finName.toString().replaceAll("^\\.*",""); // If there is a jar-file with the required name, we add this to the class path. if(library instanceof JarredScript) { // It's _really_ expensive to check that the class actually exists in the Jar, so // we don't do that now. runtime.getJavaSupport().addToClasspath(((JarredScript)library).getResource().getURL()); } try { Class theClass = runtime.getJavaSupport().loadJavaClass(className); library = new ClassExtensionLibrary(theClass); } catch(Exception ee) { library = null; } } // If there was a good library before, we go back to that if(library == null && oldLibrary != null) { library = oldLibrary; } return library; }
| 3,232,321
|
private Library tryLoadExtension(Library library, String file) { // This code exploits the fact that all .jar files will be found for the JarredScript feature. // This is where the basic extension mechanism gets fixed Library oldLibrary = library; if(library == null || library instanceof JarredScript) { // Create package name, by splitting on / and joining all but the last elements with a ".", and downcasing them. String[] all = file.split("/"); StringBuffer finName = new StringBuffer(); for(int i=0,j=(all.length-1);i<j;i++) { finName.append(all[i].toLowerCase()).append("."); } // Make the class name look nice, by splitting on _ and capitalize each segment, then joining // the, together without anything separating them, and last put on "Service" at the end. String[] last = all[all.length-1].split("_"); for(int i=0,j=last.length;i<j;i++) { finName.append(Character.toUpperCase(last[i].charAt(0))).append(last[i].substring(1)); } finName.append("Service"); // We don't want a package name beginning with dots, so we remove them String className = finName.toString().replaceAll("^\\.*",""); // If there is a jar-file with the required name, we add this to the class path. if(library instanceof JarredScript) { // It's _really_ expensive to check that the class actually exists in the Jar, so // we don't do that now. runtime.getJavaSupport().addToClasspath(((JarredScript)library).getResource().getURL()); } try { Class theClass = runtime.getJavaSupport().loadJavaClass(className); library = new ClassExtensionLibrary(theClass); } catch(Exception ee) { library = null; } } // If there was a good library before, we go back to that if(library == null && oldLibrary != null) { library = oldLibrary; } return library; }
|
private Library tryLoadExtension(Library library, String file) { // This code exploits the fact that all .jar files will be found for the JarredScript feature. // This is where the basic extension mechanism gets fixed Library oldLibrary = library; if(library == null || library instanceof JarredScript) { // Create package name, by splitting on / and joining all but the last elements with a ".", and downcasing them. String[] all = file.split("/"); StringBuffer finName = new StringBuffer(); for(int i=0,j=(all.length-1);i<j;i++) { finName.append(all[i].toLowerCase()).append("."); } // Make the class name look nice, by splitting on _ and capitalize each segment, then joining // the, together without anything separating them, and last put on "Service" at the end. String[] last = all[all.length-1].split("_"); for(int i=0, j=last.length; i<j; i++) { finName.append(Character.toUpperCase(last[i].charAt(0))).append(last[i].substring(1)); } finName.append("Service"); // We don't want a package name beginning with dots, so we remove them String className = finName.toString().replaceAll("^\\.*",""); // If there is a jar-file with the required name, we add this to the class path. if(library instanceof JarredScript) { // It's _really_ expensive to check that the class actually exists in the Jar, so // we don't do that now. runtime.getJavaSupport().addToClasspath(((JarredScript)library).getResource().getURL()); } try { Class theClass = runtime.getJavaSupport().loadJavaClass(className); library = new ClassExtensionLibrary(theClass); } catch(Exception ee) { library = null; } } // If there was a good library before, we go back to that if(library == null && oldLibrary != null) { library = oldLibrary; } return library; }
| 3,232,322
|
public Object[] getSelectItemListArray() { return new Object[4]; }
|
public Object[] getSelectItemListArray() { return new Object[4]; }
| 3,232,324
|
public void clearLinks() { start.clearLinkedTo(end); end.clearLinkedTo(start); }
|
public void clearLinks() { start.clearLinkedTo(end); end.clearLinkedTo(start); }
| 3,232,326
|
private ChatManager() { chatContainer = new ChatContainer(); // Add a Message Handler SparkManager.getMessageEventManager().addMessageEventNotificationListener(this); SparkManager.getConnection().addPacketListener(new PacketListener() { public void processPacket(final Packet packet) { if (customList.contains(StringUtils.parseBareAddress(packet.getFrom()))) { cancelledNotification(packet.getFrom(), ""); } } }, new PacketTypeFilter(Message.class)); // Start timeout checkRoomsForTimeout(); }
|
private ChatManager() { chatContainer = new ChatContainer(); // Add a Message Handler SparkManager.getMessageEventManager().addMessageEventNotificationListener(this); SparkManager.getConnection().addPacketListener(new PacketListener() { public void processPacket(final Packet packet) { if (customList.contains(StringUtils.parseBareAddress(packet.getFrom()))) { cancelledNotification(packet.getFrom(), ""); } } }, new PacketTypeFilter(Message.class)); // Start timeout }
| 3,232,327
|
public ZoomMenuManager(ImageInspectorManager control) { this.control = control; items = new HashMap(); }
|
public ZoomMenuManager(ImageInspectorManager control) { this.control = control; items = new HashMap(); }
| 3,232,328
|
public void actionPerformed(ActionEvent e) { int index = Integer.parseInt(e.getActionCommand()); Double value = (Double) inverseValues.get(new Integer(index)); if (value != null) control.setZoomLevel(value.doubleValue()); else throw new Error("Invalid Action ID "+index); }
|
public void actionPerformed(ActionEvent e) { int index = Integer.parseInt(e.getActionCommand()); Double value = (Double) inverseValues.get(new Integer(index)); if (value != null) control.setZoomLevel(value.doubleValue()); else throw new Error("Invalid Action ID "+index); }
| 3,232,329
|
void attachItemListener(AbstractButton item, int id) { item.setActionCommand(""+id); item.addActionListener(this); items.put(new Integer(id), item); }
|
void attachItemListener(AbstractButton item, int id) { item.setActionCommand(""+id); item.addActionListener(this); items.put(new Integer(id), item); }
| 3,232,330
|
private IRubyObject getConstantInner(String name, boolean exclude) { IRubyObject objectClass = getRuntime().getObject(); boolean retryForModule = false; RubyModule p = this; retry: while (true) { while (p != null) { IRubyObject constant = p.getConstantAt(name); if (constant == null) { if (getRuntime().getLoadService().autoload(name) != null) { continue; } } if (constant != null) { if (exclude && p == objectClass && this != objectClass) { getRuntime().getWarnings().warn("toplevel constant " + name + " referenced by " + getName() + "::" + name); } return constant; } p = p.getSuperClass(); } if (!exclude && !retryForModule && getClass().equals(RubyModule.class)) { retryForModule = true; p = getRuntime().getObject(); continue retry; } break; } return callMethod(getRuntime().getCurrentContext(), "const_missing", RubySymbol.newSymbol(getRuntime(), name)); }
|
private IRubyObject getConstantInner(String name, boolean exclude) { IRubyObject objectClass = getRuntime().getObject(); boolean retryForModule = false; RubyModule p = this; retry: while (true) { while (p != null) { IRubyObject constant = p.getConstantAt(name); if (constant == null) { if (getRuntime().getLoadService().autoload(p.getName() + "::" + name) != null) { continue; } } if (constant != null) { if (exclude && p == objectClass && this != objectClass) { getRuntime().getWarnings().warn("toplevel constant " + name + " referenced by " + getName() + "::" + name); } return constant; } p = p.getSuperClass(); } if (!exclude && !retryForModule && getClass().equals(RubyModule.class)) { retryForModule = true; p = getRuntime().getObject(); continue retry; } break; } return callMethod(getRuntime().getCurrentContext(), "const_missing", RubySymbol.newSymbol(getRuntime(), name)); }
| 3,232,331
|
public SortedSet getSourceFiles() { SortedSet sourceFiles = new TreeSet(); Iterator iter = this.children.values().iterator(); while (iter.hasNext()) { PackageData packageData = (PackageData)iter.next(); sourceFiles.addAll(packageData.getSourceFiles()); } return sourceFiles; }
|
public SortedSet getSourceFiles() { SortedSet sourceFiles = new TreeSet(); Iterator iter = this.children.values().iterator(); while (iter.hasNext()) { PackageData packageData = (PackageData)iter.next(); sourceFiles.addAll(packageData.getSourceFiles()); } return sourceFiles; }
| 3,232,333
|
public SortedSet getSourceFiles() { SortedSet sourceFiles = new TreeSet(); Iterator iter = this.children.values().iterator(); while (iter.hasNext()) { PackageData packageData = (PackageData)iter.next(); sourceFiles.addAll(packageData.getSourceFiles()); } return sourceFiles; }
|
public SortedSet getSourceFiles() { SortedSet sourceFiles = new TreeSet(); Iterator iter = this.children.values().iterator(); while (iter.hasNext()) { PackageData packageData = (PackageData)iter.next(); sourceFiles.addAll(packageData.getSourceFiles()); } return sourceFiles; }
| 3,232,334
|
private JMenu createFileMenu() { JMenu menu = new JMenu("File"); menu.setMnemonic(KeyEvent.VK_F); TreeViewerAction a = controller.getAction( TreeViewerControl.CREATE_TOP_CONTAINER); JMenuItem item = new JMenuItem(a); item.setText(a.getActionName()); menuItems.add(item); menu.add(item); a = controller.getAction(TreeViewerControl.CREATE_OBJECT); item = new JMenuItem(a); menu.add(item); item.setText(a.getActionName()); menuItems.add(item); menu.add(createRootMenu()); menu.add(new JSeparator(JSeparator.HORIZONTAL)); a = controller.getAction(TreeViewerControl.VIEW); item = new JMenuItem(a); item.setText(a.getActionName()); menuItems.add(item); menu.add(item); menu.add(new JMenuItem( controller.getAction(TreeViewerControl.REFRESH_TREE))); menu.add(new JSeparator(JSeparator.HORIZONTAL)); menu.add(new JMenuItem( controller.getAction(TreeViewerControl.EXIT))); return menu; }
|
private JMenu createFileMenu() { JMenu menu = new JMenu("File"); menu.setMnemonic(KeyEvent.VK_F); TreeViewerAction a = controller.getAction( TreeViewerControl.CREATE_TOP_CONTAINER); JMenuItem item = new JMenuItem(a); item.setText(a.getActionName()); menuItems.add(item); menu.add(item); a = controller.getAction(TreeViewerControl.CREATE_OBJECT); item = new JMenuItem(a); menu.add(item); item.setText(a.getActionName()); menuItems.add(item); createRootMenu(); menu.add(new JSeparator(JSeparator.HORIZONTAL)); a = controller.getAction(TreeViewerControl.VIEW); item = new JMenuItem(a); item.setText(a.getActionName()); menuItems.add(item); menu.add(item); menu.add(new JMenuItem( controller.getAction(TreeViewerControl.REFRESH_TREE))); menu.add(new JSeparator(JSeparator.HORIZONTAL)); menu.add(new JMenuItem( controller.getAction(TreeViewerControl.EXIT))); return menu; }
| 3,232,335
|
public void addClassData(ClassData classData) { String packageName = classData.getPackageName(); PackageData packageData = (PackageData)children.get(packageName); if (packageData == null) { packageData = new PackageData(packageName); // Each key is a package name, stored as an String object. // Each value is information about the package, stored as a PackageData object. this.children.put(packageName, packageData); } packageData.addClassData(classData); this.sourceFiles.put(classData.getSourceFileName(), packageData.getChild(classData.getSourceFileName())); this.classes.put(classData.getName(), classData); }
|
public void addClassData(ClassData classData) { String packageName = classData.getPackageName(); PackageData packageData = (PackageData)children.get(packageName); if (packageData == null) { packageData = new PackageData(packageName); // Each key is a package name, stored as an String object. // Each value is information about the package, stored as a PackageData object. this.children.put(packageName, packageData); } packageData.addClassData(classData); this.sourceFiles.put(classData.getSourceFileName(), packageData.getChild(classData.getSourceFileName())); this.classes.put(classData.getName(), classData); }
| 3,232,336
|
public static ProjectData getGlobalProjectData() { if (globalProjectData != null) return globalProjectData; File dataFile = CoverageDataFileHandler.getDefaultDataFile(); // Read projectData from the serialized file. if (dataFile.isFile()) { //System.out.println("Cobertura: Loading global project data from " + dataFile.getAbsolutePath()); globalProjectData = CoverageDataFileHandler .loadCoverageData(dataFile); } if (globalProjectData == null) { // We could not read from the serialized file, so create a new object. System.out.println("Cobertura: Coverage data file " + dataFile.getAbsolutePath() + " either does not exist or is not readable. Creating a new data file."); globalProjectData = new ProjectData(); } // Hack for Tomcat - by saving project data right now we force loading // of classes involved in this process (like ObjectOutputStream) // so that it won't be necessary to load them on JVM shutdown if( System.getProperty("catalina.home")!=null) { saveGlobalProjectData(); // Additionaly force loading of other classes that might be not loaded // becouse saved project data was empty ClassData.class.toString(); CoverageData.class.toString(); CoverageDataContainer.class.toString(); HasBeenInstrumented.class.toString(); LineData.class.toString(); PackageData.class.toString(); SourceFileData.class.toString(); } // Add a hook to save the data when the JVM exits saveTimer = new SaveTimer(); Runtime.getRuntime().addShutdownHook(new Thread(saveTimer)); // Possibly also save the coverage data every x seconds? //Timer timer = new Timer(true); //timer.schedule(saveTimer, 100); return globalProjectData; }
|
public static ProjectData getGlobalProjectData() { if (globalProjectData != null) return globalProjectData; File dataFile = CoverageDataFileHandler.getDefaultDataFile(); // Read projectData from the serialized file. if (dataFile.isFile()) { //System.out.println("Cobertura: Loading global project data from " + dataFile.getAbsolutePath()); globalProjectData = CoverageDataFileHandler .loadCoverageData(dataFile); } if (globalProjectData == null) { // We could not read from the serialized file, so create a new object. System.out.println("Cobertura: Coverage data file " + dataFile.getAbsolutePath() + " either does not exist or is not readable. Creating a new data file."); globalProjectData = new ProjectData(); } // Hack for Tomcat - by saving project data right now we force loading // of classes involved in this process (like ObjectOutputStream) // so that it won't be necessary to load them on JVM shutdown if( System.getProperty("catalina.home")!=null) { saveGlobalProjectData(); // Additionaly force loading of other classes that might be not loaded // becouse saved project data was empty ClassData.class.toString(); CoverageData.class.toString(); CoverageDataContainer.class.toString(); HasBeenInstrumented.class.toString(); LineData.class.toString(); PackageData.class.toString(); SourceFileData.class.toString(); } // Add a hook to save the data when the JVM exits saveTimer = new SaveTimer(); Runtime.getRuntime().addShutdownHook(new Thread(saveTimer)); // Possibly also save the coverage data every x seconds? //Timer timer = new Timer(true); //timer.schedule(saveTimer, 100); return globalProjectData; }
| 3,232,337
|
public void merge(CoverageData coverageData) { super.merge(coverageData); ProjectData projectData = (ProjectData)coverageData; for (Iterator iter = projectData.sourceFiles.keySet().iterator(); iter.hasNext();) { Object key = iter.next(); if (!this.sourceFiles.containsKey(key)) { this.sourceFiles.put(key, projectData.sourceFiles.get(key)); } } for (Iterator iter = projectData.classes.keySet().iterator(); iter.hasNext();) { Object key = iter.next(); if (!this.classes.containsKey(key)) { this.classes.put(key, projectData.classes.get(key)); } } }
|
public void merge(CoverageData coverageData) { super.merge(coverageData); ProjectData projectData = (ProjectData)coverageData; for (Iterator iter = projectData.sourceFiles.keySet().iterator(); iter.hasNext();) { Object key = iter.next(); if (!this.sourceFiles.containsKey(key)) { this.sourceFiles.put(key, projectData.sourceFiles.get(key)); } } for (Iterator iter = projectData.classes.keySet().iterator(); iter.hasNext();) { Object key = iter.next(); if (!this.classes.containsKey(key)) { this.classes.put(key, projectData.classes.get(key)); } } }
| 3,232,338
|
public static void saveGlobalProjectData() { ProjectData projectData = getGlobalProjectData(); synchronized (projectData) { CoverageDataFileHandler.saveCoverageData(projectData, CoverageDataFileHandler.getDefaultDataFile()); } }
|
public static void saveGlobalProjectData() { ProjectData projectData = getGlobalProjectData(); synchronized (projectData) { CoverageDataFileHandler.saveCoverageData(projectData, CoverageDataFileHandler.getDefaultDataFile()); } }
| 3,232,339
|
public static void saveGlobalProjectData() { ProjectData projectData = getGlobalProjectData(); synchronized (projectData) { CoverageDataFileHandler.saveCoverageData(projectData, CoverageDataFileHandler.getDefaultDataFile()); } }
|
public static void saveGlobalProjectData() { ProjectData projectData = getGlobalProjectData(); synchronized (projectData) { CoverageDataFileHandler.saveCoverageData(projectData, CoverageDataFileHandler.getDefaultDataFile()); } }
| 3,232,340
|
public UIComponent getEditContainer() { WFUtilArticle localizer = WFUtilArticle.getWFUtilArticle(); String ref = ARTICLE_ITEM_BEAN_ID + ".";// String bref = WFPage.CONTENT_BUNDLE + "."; WFContainer mainContainer = new WFContainer(); mainContainer.setId(ARTICLE_EDITOR_ID); WFErrorMessages em = new WFErrorMessages(); em.addErrorMessage(HEADLINE_ID); em.addErrorMessage(TEASER_ID);// em.addErrorMessage(PUBLISHED_FROM_DATE_ID);// em.addErrorMessage(PUBLISHED_TO_DATE_ID); em.addErrorMessage(SAVE_ID); mainContainer.add(em); HtmlPanelGrid p = WFPanelUtil.getPlainFormPanel(2); p.getChildren().add(WFUtil.group(localizer.getTextVB("headline"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "language"), WFUtil.getText(":"))); HtmlInputText headlineInput = WFUtil.getInputText(HEADLINE_ID, ref + "headline"); headlineInput.setSize(40); p.getChildren().add(headlineInput); //HtmlSelectOneMenu localeMenu = WFUtil.getSelectOneMenu(LOCALE_ID, ref + "allLocales", ref + "pendingLocaleId"); //localeMenu.setOnchange("document.forms[0].submit();"); //p.getChildren().add(localeMenu); p.getChildren().add(WFUtil.group(localizer.getTextVB("teaser"), WFUtil.getText(":"))); HtmlInputTextarea teaserArea = WFUtil.getTextArea(TEASER_ID, ref + "teaser", "440px", "30px"); p.getChildren().add(teaserArea); p.getChildren().add(WFUtil.group(localizer.getTextVB("author"), WFUtil.getText(":"))); HtmlInputText authorInput = WFUtil.getInputText(AUTHOR_ID, ref + "author"); authorInput.setSize(22); p.getChildren().add(authorInput); p.getChildren().add(WFUtil.group(localizer.getTextVB("body"), WFUtil.getText(":"))); HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "100%", "400px"); bodyArea.addPlugin(HTMLArea.PLUGIN_TABLE_OPERATIONS); bodyArea.addPlugin(HTMLArea.PLUGIN_DYNAMIC_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CONTEXT_MENU); bodyArea.addPlugin(HTMLArea.PLUGIN_LIST_TYPE); bodyArea.addPlugin(HTMLArea.PLUGIN_CHARACTER_MAP); bodyArea.setAllowFontSelection(false); HtmlCommandButton editButton = localizer.getButtonVB(EDIT_HTML_ID, "edit"); editButton.setOnclick("wurl='htmlarea/webface/htmledit.jsp?" + PREVIEW_ARTICLE_ITEM_ID + "='+this.tabindex;window.open(wurl,'Edit','height=450,width=600,resizable=yes,status=no,toolbar=no,menubar=no,location=no,scrollbars=no');return false;"); p.getChildren().add(WFUtil.group(WFUtil.group(bodyArea, WFUtil.getBreak()), editButton));/* WFContainer imageContainer = new WFContainer(); imageContainer.add(WFUtil.getButtonVB(ADD_IMAGE_ID, bref + "add_image", this)); imageContainer.add(WFUtil.getBreak()); imageContainer.add(getImageList()); p.getChildren().add(imageContainer); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "source"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "main_category"), WFUtil.getText(":"))); HtmlInputTextarea sourceArea = WFUtil.getTextArea(SOURCE_ID, ref + "source", "440px", "30px"); p.getChildren().add(sourceArea); HtmlSelectOneMenu mainCategoryMenu = WFUtil.getSelectOneMenu(MAIN_CATEGORY_ID, ref + "categories", ref + "mainCategoryId"); p.getChildren().add(mainCategoryMenu); */ mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1);/* p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "created"), WFUtil.getTextVB(ref + "creationDate") ));*/ p.getChildren().add(WFUtil.getText(" ")); UIComponent t = WFUtil.group(localizer.getHeaderTextVB("status"), WFUtil.getText(": ")); t.getChildren().add(WFUtil.getTextVB(ref + "status")); p.getChildren().add(t); p.getChildren().add(WFUtil.getText(" ")); p.getChildren().add(WFUtil.group(localizer.getHeaderTextVB("current_version"), WFUtil.getTextVB(ref + "versionId") )); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getFormPanel(2); p.getChildren().add(WFUtil.group(localizer.getTextVB("comment"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "attachments"), WFUtil.getText(":"))); HtmlInputTextarea commentArea = WFUtil.getTextArea(COMMENT_ID, ref + "comment", "400px", "60px"); p.getChildren().add(commentArea);// WFContainer attachmentContainer = new WFContainer();// attachmentContainer.add(WFUtil.getButtonVB(ADD_ATTACHMENT_ID, bref + "add_attachment", this));// attachmentContainer.add(WFUtil.getBreak());// attachmentContainer.add(getAttachmentList());// p.getChildren().add(attachmentContainer); mainContainer.add(p); // p = WFPanelUtil.getFormPanel(1);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "related_content_items"), WFUtil.getText(":"))); // WFContainer contentItemContainer = new WFContainer(); // contentItemContainer.add(WFUtil.getButtonVB(ADD_RELATED_CONTENT_ITEM_ID, bref + "add_content_item", this));// contentItemContainer.add(WFUtil.getBreak());// contentItemContainer.add(getRelatedContentItemsList());// p.getChildren().add(contentItemContainer);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "publishing_date"), WFUtil.getText(":"))); // WFDateInput publishedFromInput = WFUtil.getDateInput(PUBLISHED_FROM_DATE_ID, ref + "case.publishedFromDate");// publishedFromInput.setShowTime(true);// p.getChildren().add(publishedFromInput);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "expiration_date"), WFUtil.getText(":"))); // WFDateInput publishedToInput = WFUtil.getDateInput(PUBLISHED_TO_DATE_ID, ref + "case.publishedToDate");// publishedToInput.setShowTime(true);// p.getChildren().add(publishedToInput); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1);// HtmlCommandButton editCategoriesButton = WFUtil.getButtonVB(EDIT_CATEGORIES_ID, bref + "edit_categories", this);// p.getChildren().add(editCategoriesButton); p.getChildren().add(WFUtil.group(localizer.getTextVB("category"), WFUtil.getText(":"))); HtmlInputText categoryInput = WFUtil.getInputText(MAIN_CATEGORY_ID, ref + "mainCategory"); if(null==categoryInput.getValue() || "".equals(categoryInput.getValue())) { categoryInput.setValue(ROOT_CATEGORY); } categoryInput.setSize(40); p.getChildren().add(categoryInput); p.getChildren().add(WFUtil.getBreak());// WFComponentSelector cs = new WFComponentSelector();// cs.setId(BUTTON_SELECTOR_ID);// cs.setDividerText(" "); HtmlCommandButton saveButton = WFUtil.getButtonVB(SAVE_ID, "save", this);// cs.add(saveButton);// cs.add(WFUtil.getButtonVB(FOR_REVIEW_ID, bref + "for_review", this));// cs.add(WFUtil.getButtonVB(PUBLISH_ID, bref + "publish", this));// cs.add(WFUtil.getButtonVB(REWRITE_ID, bref + "rewrite", this));// cs.add(WFUtil.getButtonVB(REJECT_ID, bref + "reject", this));// cs.add(WFUtil.getButtonVB(DELETE_ID, bref + "delete", this));// cs.add(WFUtil.getButtonVB(CANCEL_ID, bref + "cancel", this));// cs.setSelectedId(CANCEL_ID, true);// p.getChildren().add(cs); p.getChildren().add(saveButton); mainContainer.add(p); WFComponentSelector editorSelector = new WFComponentSelector(); editorSelector.setId(EDITOR_SELECTOR_ID); editorSelector.add(mainContainer); editorSelector.add(getCategoryEditContainer());// FileUploadForm f = new FileUploadForm(this, FILE_UPLOAD_ID, FILE_UPLOAD_CANCEL_ID); FileUploadForm f = new FileUploadForm(); f.setId(FILE_UPLOAD_FORM_ID); editorSelector.add(f); editorSelector.add(getRelatedContentItemsContainer()); editorSelector.setSelectedId(ARTICLE_EDITOR_ID, true); return editorSelector; }
|
public UIComponent getEditContainer() { WFUtilArticle localizer = WFUtilArticle.getWFUtilArticle(); String ref = ARTICLE_ITEM_BEAN_ID + ".";// String bref = WFPage.CONTENT_BUNDLE + "."; WFContainer mainContainer = new WFContainer(); mainContainer.setId(ARTICLE_EDITOR_ID); WFErrorMessages em = new WFErrorMessages(); em.addErrorMessage(HEADLINE_ID); em.addErrorMessage(TEASER_ID);// em.addErrorMessage(PUBLISHED_FROM_DATE_ID);// em.addErrorMessage(PUBLISHED_TO_DATE_ID); em.addErrorMessage(SAVE_ID); mainContainer.add(em); HtmlPanelGrid p = WFPanelUtil.getPlainFormPanel(2); p.getChildren().add(WFUtil.group(localizer.getTextVB("headline"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "language"), WFUtil.getText(":"))); HtmlInputText headlineInput = WFUtil.getInputText(HEADLINE_ID, ref + "headline"); headlineInput.setSize(40); p.getChildren().add(headlineInput); //HtmlSelectOneMenu localeMenu = WFUtil.getSelectOneMenu(LOCALE_ID, ref + "allLocales", ref + "pendingLocaleId"); //localeMenu.setOnchange("document.forms[0].submit();"); //p.getChildren().add(localeMenu); p.getChildren().add(WFUtil.group(localizer.getTextVB("teaser"), WFUtil.getText(":"))); HtmlInputTextarea teaserArea = WFUtil.getTextArea(TEASER_ID, ref + "teaser", "440px", "30px"); p.getChildren().add(teaserArea); p.getChildren().add(WFUtil.group(localizer.getTextVB("author"), WFUtil.getText(":"))); HtmlInputText authorInput = WFUtil.getInputText(AUTHOR_ID, ref + "author"); authorInput.setSize(22); p.getChildren().add(authorInput); p.getChildren().add(WFUtil.group(localizer.getTextVB("body"), WFUtil.getText(":"))); HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "100%", "400px"); bodyArea.addPlugin(HTMLArea.PLUGIN_TABLE_OPERATIONS); bodyArea.addPlugin(HTMLArea.PLUGIN_DYNAMIC_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CONTEXT_MENU); bodyArea.addPlugin(HTMLArea.PLUGIN_LIST_TYPE); bodyArea.addPlugin(HTMLArea.PLUGIN_CHARACTER_MAP); bodyArea.setAllowFontSelection(false); HtmlCommandButton editButton = localizer.getButtonVB(EDIT_HTML_ID, "edit"); editButton.setOnclick("wurl='htmlarea/webface/htmledit.jsp?" + PREVIEW_ARTICLE_ITEM_ID + "='+this.tabindex;window.open(wurl,'Edit','height=450,width=600,resizable=yes,status=no,toolbar=no,menubar=no,location=no,scrollbars=no');return false;"); p.getChildren().add(WFUtil.group(WFUtil.group(bodyArea, WFUtil.getBreak()), editButton));/* WFContainer imageContainer = new WFContainer(); imageContainer.add(WFUtil.getButtonVB(ADD_IMAGE_ID, bref + "add_image", this)); imageContainer.add(WFUtil.getBreak()); imageContainer.add(getImageList()); p.getChildren().add(imageContainer); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "source"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "main_category"), WFUtil.getText(":"))); HtmlInputTextarea sourceArea = WFUtil.getTextArea(SOURCE_ID, ref + "source", "440px", "30px"); p.getChildren().add(sourceArea); HtmlSelectOneMenu mainCategoryMenu = WFUtil.getSelectOneMenu(MAIN_CATEGORY_ID, ref + "categories", ref + "mainCategoryId"); p.getChildren().add(mainCategoryMenu); */ mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1);/* p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "created"), WFUtil.getTextVB(ref + "creationDate") ));*/ p.getChildren().add(WFUtil.getText(" ")); UIComponent t = WFUtil.group(localizer.getHeaderTextVB("status"), WFUtil.getText(": ")); t.getChildren().add(WFUtil.getTextVB(ref + "status")); p.getChildren().add(t); p.getChildren().add(WFUtil.getText(" ")); p.getChildren().add(WFUtil.group(localizer.getHeaderTextVB("current_version"), WFUtil.getTextVB(ref + "versionId") )); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getFormPanel(2); p.getChildren().add(WFUtil.group(localizer.getTextVB("comment"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "attachments"), WFUtil.getText(":"))); HtmlInputTextarea commentArea = WFUtil.getTextArea(COMMENT_ID, ref + "comment", "400px", "60px"); p.getChildren().add(commentArea);// WFContainer attachmentContainer = new WFContainer();// attachmentContainer.add(WFUtil.getButtonVB(ADD_ATTACHMENT_ID, bref + "add_attachment", this));// attachmentContainer.add(WFUtil.getBreak());// attachmentContainer.add(getAttachmentList());// p.getChildren().add(attachmentContainer); mainContainer.add(p); // p = WFPanelUtil.getFormPanel(1);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "related_content_items"), WFUtil.getText(":"))); // WFContainer contentItemContainer = new WFContainer(); // contentItemContainer.add(WFUtil.getButtonVB(ADD_RELATED_CONTENT_ITEM_ID, bref + "add_content_item", this));// contentItemContainer.add(WFUtil.getBreak());// contentItemContainer.add(getRelatedContentItemsList());// p.getChildren().add(contentItemContainer);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "publishing_date"), WFUtil.getText(":"))); // WFDateInput publishedFromInput = WFUtil.getDateInput(PUBLISHED_FROM_DATE_ID, ref + "case.publishedFromDate");// publishedFromInput.setShowTime(true);// p.getChildren().add(publishedFromInput);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "expiration_date"), WFUtil.getText(":"))); // WFDateInput publishedToInput = WFUtil.getDateInput(PUBLISHED_TO_DATE_ID, ref + "case.publishedToDate");// publishedToInput.setShowTime(true);// p.getChildren().add(publishedToInput); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1);// HtmlCommandButton editCategoriesButton = WFUtil.getButtonVB(EDIT_CATEGORIES_ID, bref + "edit_categories", this);// p.getChildren().add(editCategoriesButton); p.getChildren().add(WFUtil.group(localizer.getTextVB("category"), WFUtil.getText(":"))); HtmlInputText categoryInput = WFUtil.getInputText(MAIN_CATEGORY_ID, ref + "mainCategory"); if(null==categoryInput.getValue() || "".equals(categoryInput.getValue())) { categoryInput.setValue(ROOT_CATEGORY); } categoryInput.setSize(40); p.getChildren().add(categoryInput); p.getChildren().add(WFUtil.getBreak());// WFComponentSelector cs = new WFComponentSelector();// cs.setId(BUTTON_SELECTOR_ID);// cs.setDividerText(" "); HtmlCommandButton saveButton = WFUtil.getButtonVB(SAVE_ID, "save", this);// cs.add(saveButton);// cs.add(WFUtil.getButtonVB(FOR_REVIEW_ID, bref + "for_review", this));// cs.add(WFUtil.getButtonVB(PUBLISH_ID, bref + "publish", this));// cs.add(WFUtil.getButtonVB(REWRITE_ID, bref + "rewrite", this));// cs.add(WFUtil.getButtonVB(REJECT_ID, bref + "reject", this));// cs.add(WFUtil.getButtonVB(DELETE_ID, bref + "delete", this));// cs.add(WFUtil.getButtonVB(CANCEL_ID, bref + "cancel", this));// cs.setSelectedId(CANCEL_ID, true);// p.getChildren().add(cs); p.getChildren().add(saveButton); mainContainer.add(p); WFComponentSelector editorSelector = new WFComponentSelector(); editorSelector.setId(EDITOR_SELECTOR_ID); editorSelector.add(mainContainer); editorSelector.add(getCategoryEditContainer());// FileUploadForm f = new FileUploadForm(this, FILE_UPLOAD_ID, FILE_UPLOAD_CANCEL_ID); FileUploadForm f = new FileUploadForm(); f.setId(FILE_UPLOAD_FORM_ID); editorSelector.add(f); editorSelector.add(getRelatedContentItemsContainer()); editorSelector.setSelectedId(ARTICLE_EDITOR_ID, true); return editorSelector; }
| 3,232,342
|
public UIComponent getEditContainer() { WFUtilArticle localizer = WFUtilArticle.getWFUtilArticle(); String ref = ARTICLE_ITEM_BEAN_ID + ".";// String bref = WFPage.CONTENT_BUNDLE + "."; WFContainer mainContainer = new WFContainer(); mainContainer.setId(ARTICLE_EDITOR_ID); WFErrorMessages em = new WFErrorMessages(); em.addErrorMessage(HEADLINE_ID); em.addErrorMessage(TEASER_ID);// em.addErrorMessage(PUBLISHED_FROM_DATE_ID);// em.addErrorMessage(PUBLISHED_TO_DATE_ID); em.addErrorMessage(SAVE_ID); mainContainer.add(em); HtmlPanelGrid p = WFPanelUtil.getPlainFormPanel(2); p.getChildren().add(WFUtil.group(localizer.getTextVB("headline"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "language"), WFUtil.getText(":"))); HtmlInputText headlineInput = WFUtil.getInputText(HEADLINE_ID, ref + "headline"); headlineInput.setSize(40); p.getChildren().add(headlineInput); //HtmlSelectOneMenu localeMenu = WFUtil.getSelectOneMenu(LOCALE_ID, ref + "allLocales", ref + "pendingLocaleId"); //localeMenu.setOnchange("document.forms[0].submit();"); //p.getChildren().add(localeMenu); p.getChildren().add(WFUtil.group(localizer.getTextVB("teaser"), WFUtil.getText(":"))); HtmlInputTextarea teaserArea = WFUtil.getTextArea(TEASER_ID, ref + "teaser", "440px", "30px"); p.getChildren().add(teaserArea); p.getChildren().add(WFUtil.group(localizer.getTextVB("author"), WFUtil.getText(":"))); HtmlInputText authorInput = WFUtil.getInputText(AUTHOR_ID, ref + "author"); authorInput.setSize(22); p.getChildren().add(authorInput); p.getChildren().add(WFUtil.group(localizer.getTextVB("body"), WFUtil.getText(":"))); HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "100%", "400px"); bodyArea.addPlugin(HTMLArea.PLUGIN_TABLE_OPERATIONS); bodyArea.addPlugin(HTMLArea.PLUGIN_DYNAMIC_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CONTEXT_MENU); bodyArea.addPlugin(HTMLArea.PLUGIN_LIST_TYPE); bodyArea.addPlugin(HTMLArea.PLUGIN_CHARACTER_MAP); bodyArea.setAllowFontSelection(false); HtmlCommandButton editButton = localizer.getButtonVB(EDIT_HTML_ID, "edit"); editButton.setOnclick("wurl='htmlarea/webface/htmledit.jsp?" + PREVIEW_ARTICLE_ITEM_ID + "='+this.tabindex;window.open(wurl,'Edit','height=450,width=600,resizable=yes,status=no,toolbar=no,menubar=no,location=no,scrollbars=no');return false;"); p.getChildren().add(WFUtil.group(WFUtil.group(bodyArea, WFUtil.getBreak()), editButton));/* WFContainer imageContainer = new WFContainer(); imageContainer.add(WFUtil.getButtonVB(ADD_IMAGE_ID, bref + "add_image", this)); imageContainer.add(WFUtil.getBreak()); imageContainer.add(getImageList()); p.getChildren().add(imageContainer); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "source"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "main_category"), WFUtil.getText(":"))); HtmlInputTextarea sourceArea = WFUtil.getTextArea(SOURCE_ID, ref + "source", "440px", "30px"); p.getChildren().add(sourceArea); HtmlSelectOneMenu mainCategoryMenu = WFUtil.getSelectOneMenu(MAIN_CATEGORY_ID, ref + "categories", ref + "mainCategoryId"); p.getChildren().add(mainCategoryMenu); */ mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1);/* p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "created"), WFUtil.getTextVB(ref + "creationDate") ));*/ p.getChildren().add(WFUtil.getText(" ")); UIComponent t = WFUtil.group(localizer.getHeaderTextVB("status"), WFUtil.getText(": ")); t.getChildren().add(WFUtil.getTextVB(ref + "status")); p.getChildren().add(t); p.getChildren().add(WFUtil.getText(" ")); p.getChildren().add(WFUtil.group(localizer.getHeaderTextVB("current_version"), WFUtil.getTextVB(ref + "versionId") )); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getFormPanel(2); p.getChildren().add(WFUtil.group(localizer.getTextVB("comment"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "attachments"), WFUtil.getText(":"))); HtmlInputTextarea commentArea = WFUtil.getTextArea(COMMENT_ID, ref + "comment", "400px", "60px"); p.getChildren().add(commentArea);// WFContainer attachmentContainer = new WFContainer();// attachmentContainer.add(WFUtil.getButtonVB(ADD_ATTACHMENT_ID, bref + "add_attachment", this));// attachmentContainer.add(WFUtil.getBreak());// attachmentContainer.add(getAttachmentList());// p.getChildren().add(attachmentContainer); mainContainer.add(p); // p = WFPanelUtil.getFormPanel(1);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "related_content_items"), WFUtil.getText(":"))); // WFContainer contentItemContainer = new WFContainer(); // contentItemContainer.add(WFUtil.getButtonVB(ADD_RELATED_CONTENT_ITEM_ID, bref + "add_content_item", this));// contentItemContainer.add(WFUtil.getBreak());// contentItemContainer.add(getRelatedContentItemsList());// p.getChildren().add(contentItemContainer);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "publishing_date"), WFUtil.getText(":"))); // WFDateInput publishedFromInput = WFUtil.getDateInput(PUBLISHED_FROM_DATE_ID, ref + "case.publishedFromDate");// publishedFromInput.setShowTime(true);// p.getChildren().add(publishedFromInput);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "expiration_date"), WFUtil.getText(":"))); // WFDateInput publishedToInput = WFUtil.getDateInput(PUBLISHED_TO_DATE_ID, ref + "case.publishedToDate");// publishedToInput.setShowTime(true);// p.getChildren().add(publishedToInput); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1);// HtmlCommandButton editCategoriesButton = WFUtil.getButtonVB(EDIT_CATEGORIES_ID, bref + "edit_categories", this);// p.getChildren().add(editCategoriesButton); p.getChildren().add(WFUtil.group(localizer.getTextVB("category"), WFUtil.getText(":"))); HtmlInputText categoryInput = WFUtil.getInputText(MAIN_CATEGORY_ID, ref + "mainCategory"); if(null==categoryInput.getValue() || "".equals(categoryInput.getValue())) { categoryInput.setValue(ROOT_CATEGORY); } categoryInput.setSize(40); p.getChildren().add(categoryInput); p.getChildren().add(WFUtil.getBreak());// WFComponentSelector cs = new WFComponentSelector();// cs.setId(BUTTON_SELECTOR_ID);// cs.setDividerText(" "); HtmlCommandButton saveButton = WFUtil.getButtonVB(SAVE_ID, "save", this);// cs.add(saveButton);// cs.add(WFUtil.getButtonVB(FOR_REVIEW_ID, bref + "for_review", this));// cs.add(WFUtil.getButtonVB(PUBLISH_ID, bref + "publish", this));// cs.add(WFUtil.getButtonVB(REWRITE_ID, bref + "rewrite", this));// cs.add(WFUtil.getButtonVB(REJECT_ID, bref + "reject", this));// cs.add(WFUtil.getButtonVB(DELETE_ID, bref + "delete", this));// cs.add(WFUtil.getButtonVB(CANCEL_ID, bref + "cancel", this));// cs.setSelectedId(CANCEL_ID, true);// p.getChildren().add(cs); p.getChildren().add(saveButton); mainContainer.add(p); WFComponentSelector editorSelector = new WFComponentSelector(); editorSelector.setId(EDITOR_SELECTOR_ID); editorSelector.add(mainContainer); editorSelector.add(getCategoryEditContainer());// FileUploadForm f = new FileUploadForm(this, FILE_UPLOAD_ID, FILE_UPLOAD_CANCEL_ID); FileUploadForm f = new FileUploadForm(); f.setId(FILE_UPLOAD_FORM_ID); editorSelector.add(f); editorSelector.add(getRelatedContentItemsContainer()); editorSelector.setSelectedId(ARTICLE_EDITOR_ID, true); return editorSelector; }
|
public UIComponent getEditContainer() { WFUtilArticle localizer = WFUtilArticle.getWFUtilArticle(); String ref = ARTICLE_ITEM_BEAN_ID + ".";// String bref = WFPage.CONTENT_BUNDLE + "."; WFContainer mainContainer = new WFContainer(); mainContainer.setId(ARTICLE_EDITOR_ID); WFErrorMessages em = new WFErrorMessages(); em.addErrorMessage(HEADLINE_ID); em.addErrorMessage(TEASER_ID);// em.addErrorMessage(PUBLISHED_FROM_DATE_ID);// em.addErrorMessage(PUBLISHED_TO_DATE_ID); em.addErrorMessage(SAVE_ID); mainContainer.add(em); HtmlPanelGrid p = WFPanelUtil.getPlainFormPanel(2); p.getChildren().add(WFUtil.group(localizer.getTextVB("headline"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "language"), WFUtil.getText(":"))); HtmlInputText headlineInput = WFUtil.getInputText(HEADLINE_ID, ref + "headline"); headlineInput.setSize(40); p.getChildren().add(headlineInput); //HtmlSelectOneMenu localeMenu = WFUtil.getSelectOneMenu(LOCALE_ID, ref + "allLocales", ref + "pendingLocaleId"); //localeMenu.setOnchange("document.forms[0].submit();"); //p.getChildren().add(localeMenu); p.getChildren().add(WFUtil.group(localizer.getTextVB("teaser"), WFUtil.getText(":"))); HtmlInputTextarea teaserArea = WFUtil.getTextArea(TEASER_ID, ref + "teaser", "440px", "30px"); p.getChildren().add(teaserArea); p.getChildren().add(WFUtil.group(localizer.getTextVB("author"), WFUtil.getText(":"))); HtmlInputText authorInput = WFUtil.getInputText(AUTHOR_ID, ref + "author"); authorInput.setSize(22); p.getChildren().add(authorInput); p.getChildren().add(WFUtil.group(localizer.getTextVB("body"), WFUtil.getText(":"))); HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "100%", "400px"); bodyArea.addPlugin(HTMLArea.PLUGIN_TABLE_OPERATIONS); bodyArea.addPlugin(HTMLArea.PLUGIN_DYNAMIC_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CONTEXT_MENU); bodyArea.addPlugin(HTMLArea.PLUGIN_LIST_TYPE); bodyArea.addPlugin(HTMLArea.PLUGIN_CHARACTER_MAP); bodyArea.setAllowFontSelection(false); HtmlCommandButton editButton = localizer.getButtonVB(EDIT_HTML_ID, "edit"); editButton.setOnclick("wurl='htmlarea/webface/htmledit.jsp?" + PREVIEW_ARTICLE_ITEM_ID + "='+this.tabindex;window.open(wurl,'Edit','height=450,width=600,resizable=yes,status=no,toolbar=no,menubar=no,location=no,scrollbars=no');return false;"); p.getChildren().add(WFUtil.group(WFUtil.group(bodyArea, WFUtil.getBreak()), editButton));/* WFContainer imageContainer = new WFContainer(); imageContainer.add(WFUtil.getButtonVB(ADD_IMAGE_ID, bref + "add_image", this)); imageContainer.add(WFUtil.getBreak()); imageContainer.add(getImageList()); p.getChildren().add(imageContainer); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "source"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "main_category"), WFUtil.getText(":"))); HtmlInputTextarea sourceArea = WFUtil.getTextArea(SOURCE_ID, ref + "source", "440px", "30px"); p.getChildren().add(sourceArea); HtmlSelectOneMenu mainCategoryMenu = WFUtil.getSelectOneMenu(MAIN_CATEGORY_ID, ref + "categories", ref + "mainCategoryId"); p.getChildren().add(mainCategoryMenu); */ mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1);/* p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "created"), WFUtil.getTextVB(ref + "creationDate") ));*/ p.getChildren().add(WFUtil.getText(" ")); UIComponent t = WFUtil.group(localizer.getHeaderTextVB("status"), WFUtil.getText(": ")); t.getChildren().add(WFUtil.getTextVB(ref + "status")); p.getChildren().add(t); p.getChildren().add(WFUtil.getText(" ")); p.getChildren().add(WFUtil.group(localizer.getHeaderTextVB("current_version"), WFUtil.getTextVB(ref + "versionId") )); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getFormPanel(2); p.getChildren().add(WFUtil.group(localizer.getTextVB("comment"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "attachments"), WFUtil.getText(":"))); HtmlInputTextarea commentArea = WFUtil.getTextArea(COMMENT_ID, ref + "comment", "400px", "60px"); p.getChildren().add(commentArea);// WFContainer attachmentContainer = new WFContainer();// attachmentContainer.add(WFUtil.getButtonVB(ADD_ATTACHMENT_ID, bref + "add_attachment", this));// attachmentContainer.add(WFUtil.getBreak());// attachmentContainer.add(getAttachmentList());// p.getChildren().add(attachmentContainer); mainContainer.add(p); // p = WFPanelUtil.getFormPanel(1);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "related_content_items"), WFUtil.getText(":"))); // WFContainer contentItemContainer = new WFContainer(); // contentItemContainer.add(WFUtil.getButtonVB(ADD_RELATED_CONTENT_ITEM_ID, bref + "add_content_item", this));// contentItemContainer.add(WFUtil.getBreak());// contentItemContainer.add(getRelatedContentItemsList());// p.getChildren().add(contentItemContainer);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "publishing_date"), WFUtil.getText(":"))); // WFDateInput publishedFromInput = WFUtil.getDateInput(PUBLISHED_FROM_DATE_ID, ref + "case.publishedFromDate");// publishedFromInput.setShowTime(true);// p.getChildren().add(publishedFromInput);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "expiration_date"), WFUtil.getText(":"))); // WFDateInput publishedToInput = WFUtil.getDateInput(PUBLISHED_TO_DATE_ID, ref + "case.publishedToDate");// publishedToInput.setShowTime(true);// p.getChildren().add(publishedToInput); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1);// HtmlCommandButton editCategoriesButton = WFUtil.getButtonVB(EDIT_CATEGORIES_ID, bref + "edit_categories", this);// p.getChildren().add(editCategoriesButton); p.getChildren().add(WFUtil.group(localizer.getTextVB("category"), WFUtil.getText(":"))); HtmlInputText categoryInput = WFUtil.getInputText(MAIN_CATEGORY_ID, ref + "mainCategory"); if(null==categoryInput.getValue() || "".equals(categoryInput.getValue())) { categoryInput.setValue(ROOT_CATEGORY); } categoryInput.setSize(40); p.getChildren().add(categoryInput); p.getChildren().add(WFUtil.getBreak());// WFComponentSelector cs = new WFComponentSelector();// cs.setId(BUTTON_SELECTOR_ID);// cs.setDividerText(" "); HtmlCommandButton saveButton = WFUtil.getButtonVB(SAVE_ID, "save", this);// cs.add(saveButton);// cs.add(WFUtil.getButtonVB(FOR_REVIEW_ID, bref + "for_review", this));// cs.add(WFUtil.getButtonVB(PUBLISH_ID, bref + "publish", this));// cs.add(WFUtil.getButtonVB(REWRITE_ID, bref + "rewrite", this));// cs.add(WFUtil.getButtonVB(REJECT_ID, bref + "reject", this));// cs.add(WFUtil.getButtonVB(DELETE_ID, bref + "delete", this));// cs.add(WFUtil.getButtonVB(CANCEL_ID, bref + "cancel", this));// cs.setSelectedId(CANCEL_ID, true);// p.getChildren().add(cs); p.getChildren().add(saveButton); mainContainer.add(p); WFComponentSelector editorSelector = new WFComponentSelector(); editorSelector.setId(EDITOR_SELECTOR_ID); editorSelector.add(mainContainer); editorSelector.add(getCategoryEditContainer());// FileUploadForm f = new FileUploadForm(this, FILE_UPLOAD_ID, FILE_UPLOAD_CANCEL_ID); FileUploadForm f = new FileUploadForm(); f.setId(FILE_UPLOAD_FORM_ID); editorSelector.add(f); editorSelector.add(getRelatedContentItemsContainer()); editorSelector.setSelectedId(ARTICLE_EDITOR_ID, true); return editorSelector; }
| 3,232,343
|
public UIComponent getEditContainer() { WFUtilArticle localizer = WFUtilArticle.getWFUtilArticle(); String ref = ARTICLE_ITEM_BEAN_ID + ".";// String bref = WFPage.CONTENT_BUNDLE + "."; WFContainer mainContainer = new WFContainer(); mainContainer.setId(ARTICLE_EDITOR_ID); WFErrorMessages em = new WFErrorMessages(); em.addErrorMessage(HEADLINE_ID); em.addErrorMessage(TEASER_ID);// em.addErrorMessage(PUBLISHED_FROM_DATE_ID);// em.addErrorMessage(PUBLISHED_TO_DATE_ID); em.addErrorMessage(SAVE_ID); mainContainer.add(em); HtmlPanelGrid p = WFPanelUtil.getPlainFormPanel(2); p.getChildren().add(WFUtil.group(localizer.getTextVB("headline"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "language"), WFUtil.getText(":"))); HtmlInputText headlineInput = WFUtil.getInputText(HEADLINE_ID, ref + "headline"); headlineInput.setSize(40); p.getChildren().add(headlineInput); //HtmlSelectOneMenu localeMenu = WFUtil.getSelectOneMenu(LOCALE_ID, ref + "allLocales", ref + "pendingLocaleId"); //localeMenu.setOnchange("document.forms[0].submit();"); //p.getChildren().add(localeMenu); p.getChildren().add(WFUtil.group(localizer.getTextVB("teaser"), WFUtil.getText(":"))); HtmlInputTextarea teaserArea = WFUtil.getTextArea(TEASER_ID, ref + "teaser", "440px", "30px"); p.getChildren().add(teaserArea); p.getChildren().add(WFUtil.group(localizer.getTextVB("author"), WFUtil.getText(":"))); HtmlInputText authorInput = WFUtil.getInputText(AUTHOR_ID, ref + "author"); authorInput.setSize(22); p.getChildren().add(authorInput); p.getChildren().add(WFUtil.group(localizer.getTextVB("body"), WFUtil.getText(":"))); HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "100%", "400px"); bodyArea.addPlugin(HTMLArea.PLUGIN_TABLE_OPERATIONS); bodyArea.addPlugin(HTMLArea.PLUGIN_DYNAMIC_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CONTEXT_MENU); bodyArea.addPlugin(HTMLArea.PLUGIN_LIST_TYPE); bodyArea.addPlugin(HTMLArea.PLUGIN_CHARACTER_MAP); bodyArea.setAllowFontSelection(false); HtmlCommandButton editButton = localizer.getButtonVB(EDIT_HTML_ID, "edit"); editButton.setOnclick("wurl='htmlarea/webface/htmledit.jsp?" + PREVIEW_ARTICLE_ITEM_ID + "='+this.tabindex;window.open(wurl,'Edit','height=450,width=600,resizable=yes,status=no,toolbar=no,menubar=no,location=no,scrollbars=no');return false;"); p.getChildren().add(WFUtil.group(WFUtil.group(bodyArea, WFUtil.getBreak()), editButton));/* WFContainer imageContainer = new WFContainer(); imageContainer.add(WFUtil.getButtonVB(ADD_IMAGE_ID, bref + "add_image", this)); imageContainer.add(WFUtil.getBreak()); imageContainer.add(getImageList()); p.getChildren().add(imageContainer); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "source"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "main_category"), WFUtil.getText(":"))); HtmlInputTextarea sourceArea = WFUtil.getTextArea(SOURCE_ID, ref + "source", "440px", "30px"); p.getChildren().add(sourceArea); HtmlSelectOneMenu mainCategoryMenu = WFUtil.getSelectOneMenu(MAIN_CATEGORY_ID, ref + "categories", ref + "mainCategoryId"); p.getChildren().add(mainCategoryMenu); */ mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1);/* p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "created"), WFUtil.getTextVB(ref + "creationDate") ));*/ p.getChildren().add(WFUtil.getText(" ")); UIComponent t = WFUtil.group(localizer.getHeaderTextVB("status"), WFUtil.getText(": ")); t.getChildren().add(WFUtil.getTextVB(ref + "status")); p.getChildren().add(t); p.getChildren().add(WFUtil.getText(" ")); p.getChildren().add(WFUtil.group(localizer.getHeaderTextVB("current_version"), WFUtil.getTextVB(ref + "versionId") )); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getFormPanel(2); p.getChildren().add(WFUtil.group(localizer.getTextVB("comment"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "attachments"), WFUtil.getText(":"))); HtmlInputTextarea commentArea = WFUtil.getTextArea(COMMENT_ID, ref + "comment", "400px", "60px"); p.getChildren().add(commentArea);// WFContainer attachmentContainer = new WFContainer();// attachmentContainer.add(WFUtil.getButtonVB(ADD_ATTACHMENT_ID, bref + "add_attachment", this));// attachmentContainer.add(WFUtil.getBreak());// attachmentContainer.add(getAttachmentList());// p.getChildren().add(attachmentContainer); mainContainer.add(p); // p = WFPanelUtil.getFormPanel(1);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "related_content_items"), WFUtil.getText(":"))); // WFContainer contentItemContainer = new WFContainer(); // contentItemContainer.add(WFUtil.getButtonVB(ADD_RELATED_CONTENT_ITEM_ID, bref + "add_content_item", this));// contentItemContainer.add(WFUtil.getBreak());// contentItemContainer.add(getRelatedContentItemsList());// p.getChildren().add(contentItemContainer);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "publishing_date"), WFUtil.getText(":"))); // WFDateInput publishedFromInput = WFUtil.getDateInput(PUBLISHED_FROM_DATE_ID, ref + "case.publishedFromDate");// publishedFromInput.setShowTime(true);// p.getChildren().add(publishedFromInput);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "expiration_date"), WFUtil.getText(":"))); // WFDateInput publishedToInput = WFUtil.getDateInput(PUBLISHED_TO_DATE_ID, ref + "case.publishedToDate");// publishedToInput.setShowTime(true);// p.getChildren().add(publishedToInput); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1);// HtmlCommandButton editCategoriesButton = WFUtil.getButtonVB(EDIT_CATEGORIES_ID, bref + "edit_categories", this);// p.getChildren().add(editCategoriesButton); p.getChildren().add(WFUtil.group(localizer.getTextVB("category"), WFUtil.getText(":"))); HtmlInputText categoryInput = WFUtil.getInputText(MAIN_CATEGORY_ID, ref + "mainCategory"); if(null==categoryInput.getValue() || "".equals(categoryInput.getValue())) { categoryInput.setValue(ROOT_CATEGORY); } categoryInput.setSize(40); p.getChildren().add(categoryInput); p.getChildren().add(WFUtil.getBreak());// WFComponentSelector cs = new WFComponentSelector();// cs.setId(BUTTON_SELECTOR_ID);// cs.setDividerText(" "); HtmlCommandButton saveButton = WFUtil.getButtonVB(SAVE_ID, "save", this);// cs.add(saveButton);// cs.add(WFUtil.getButtonVB(FOR_REVIEW_ID, bref + "for_review", this));// cs.add(WFUtil.getButtonVB(PUBLISH_ID, bref + "publish", this));// cs.add(WFUtil.getButtonVB(REWRITE_ID, bref + "rewrite", this));// cs.add(WFUtil.getButtonVB(REJECT_ID, bref + "reject", this));// cs.add(WFUtil.getButtonVB(DELETE_ID, bref + "delete", this));// cs.add(WFUtil.getButtonVB(CANCEL_ID, bref + "cancel", this));// cs.setSelectedId(CANCEL_ID, true);// p.getChildren().add(cs); p.getChildren().add(saveButton); mainContainer.add(p); WFComponentSelector editorSelector = new WFComponentSelector(); editorSelector.setId(EDITOR_SELECTOR_ID); editorSelector.add(mainContainer); editorSelector.add(getCategoryEditContainer());// FileUploadForm f = new FileUploadForm(this, FILE_UPLOAD_ID, FILE_UPLOAD_CANCEL_ID); FileUploadForm f = new FileUploadForm(); f.setId(FILE_UPLOAD_FORM_ID); editorSelector.add(f); editorSelector.add(getRelatedContentItemsContainer()); editorSelector.setSelectedId(ARTICLE_EDITOR_ID, true); return editorSelector; }
|
public UIComponent getEditContainer() { WFUtilArticle localizer = WFUtilArticle.getWFUtilArticle(); String ref = ARTICLE_ITEM_BEAN_ID + ".";// String bref = WFPage.CONTENT_BUNDLE + "."; WFContainer mainContainer = new WFContainer(); mainContainer.setId(ARTICLE_EDITOR_ID); WFErrorMessages em = new WFErrorMessages(); em.addErrorMessage(HEADLINE_ID); em.addErrorMessage(TEASER_ID);// em.addErrorMessage(PUBLISHED_FROM_DATE_ID);// em.addErrorMessage(PUBLISHED_TO_DATE_ID); em.addErrorMessage(SAVE_ID); mainContainer.add(em); HtmlPanelGrid p = WFPanelUtil.getPlainFormPanel(2); p.getChildren().add(WFUtil.group(localizer.getTextVB("headline"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "language"), WFUtil.getText(":"))); HtmlInputText headlineInput = WFUtil.getInputText(HEADLINE_ID, ref + "headline"); headlineInput.setSize(40); p.getChildren().add(headlineInput); //HtmlSelectOneMenu localeMenu = WFUtil.getSelectOneMenu(LOCALE_ID, ref + "allLocales", ref + "pendingLocaleId"); //localeMenu.setOnchange("document.forms[0].submit();"); //p.getChildren().add(localeMenu); p.getChildren().add(WFUtil.group(localizer.getTextVB("teaser"), WFUtil.getText(":"))); HtmlInputTextarea teaserArea = WFUtil.getTextArea(TEASER_ID, ref + "teaser", "440px", "30px"); p.getChildren().add(teaserArea); p.getChildren().add(WFUtil.group(localizer.getTextVB("author"), WFUtil.getText(":"))); HtmlInputText authorInput = WFUtil.getInputText(AUTHOR_ID, ref + "author"); authorInput.setSize(22); p.getChildren().add(authorInput); p.getChildren().add(WFUtil.group(localizer.getTextVB("body"), WFUtil.getText(":"))); HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "100%", "400px"); bodyArea.addPlugin(HTMLArea.PLUGIN_TABLE_OPERATIONS); bodyArea.addPlugin(HTMLArea.PLUGIN_DYNAMIC_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CONTEXT_MENU); bodyArea.addPlugin(HTMLArea.PLUGIN_LIST_TYPE); bodyArea.addPlugin(HTMLArea.PLUGIN_CHARACTER_MAP); bodyArea.setAllowFontSelection(false); HtmlCommandButton editButton = localizer.getButtonVB(EDIT_HTML_ID, "edit"); editButton.setOnclick("wurl='htmlarea/webface/htmledit.jsp?" + PREVIEW_ARTICLE_ITEM_ID + "='+this.tabindex;window.open(wurl,'Edit','height=450,width=600,resizable=yes,status=no,toolbar=no,menubar=no,location=no,scrollbars=no');return false;"); p.getChildren().add(WFUtil.group(WFUtil.group(bodyArea, WFUtil.getBreak()), editButton));/* WFContainer imageContainer = new WFContainer(); imageContainer.add(WFUtil.getButtonVB(ADD_IMAGE_ID, bref + "add_image", this)); imageContainer.add(WFUtil.getBreak()); imageContainer.add(getImageList()); p.getChildren().add(imageContainer); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "source"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "main_category"), WFUtil.getText(":"))); HtmlInputTextarea sourceArea = WFUtil.getTextArea(SOURCE_ID, ref + "source", "440px", "30px"); p.getChildren().add(sourceArea); HtmlSelectOneMenu mainCategoryMenu = WFUtil.getSelectOneMenu(MAIN_CATEGORY_ID, ref + "categories", ref + "mainCategoryId"); p.getChildren().add(mainCategoryMenu); */ mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1);/* p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "created"), WFUtil.getTextVB(ref + "creationDate") ));*/ p.getChildren().add(WFUtil.getText(" ")); UIComponent t = WFUtil.group(localizer.getHeaderTextVB("status"), WFUtil.getText(": ")); t.getChildren().add(WFUtil.getTextVB(ref + "status")); p.getChildren().add(t); p.getChildren().add(WFUtil.getText(" ")); p.getChildren().add(WFUtil.group(localizer.getHeaderTextVB("current_version"), WFUtil.getTextVB(ref + "versionId") )); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getFormPanel(2); p.getChildren().add(WFUtil.group(localizer.getTextVB("comment"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "attachments"), WFUtil.getText(":"))); HtmlInputTextarea commentArea = WFUtil.getTextArea(COMMENT_ID, ref + "comment", "400px", "60px"); p.getChildren().add(commentArea);// WFContainer attachmentContainer = new WFContainer();// attachmentContainer.add(WFUtil.getButtonVB(ADD_ATTACHMENT_ID, bref + "add_attachment", this));// attachmentContainer.add(WFUtil.getBreak());// attachmentContainer.add(getAttachmentList());// p.getChildren().add(attachmentContainer); mainContainer.add(p); // p = WFPanelUtil.getFormPanel(1);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "related_content_items"), WFUtil.getText(":"))); // WFContainer contentItemContainer = new WFContainer(); // contentItemContainer.add(WFUtil.getButtonVB(ADD_RELATED_CONTENT_ITEM_ID, bref + "add_content_item", this));// contentItemContainer.add(WFUtil.getBreak());// contentItemContainer.add(getRelatedContentItemsList());// p.getChildren().add(contentItemContainer);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "publishing_date"), WFUtil.getText(":"))); // WFDateInput publishedFromInput = WFUtil.getDateInput(PUBLISHED_FROM_DATE_ID, ref + "case.publishedFromDate");// publishedFromInput.setShowTime(true);// p.getChildren().add(publishedFromInput);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "expiration_date"), WFUtil.getText(":"))); // WFDateInput publishedToInput = WFUtil.getDateInput(PUBLISHED_TO_DATE_ID, ref + "case.publishedToDate");// publishedToInput.setShowTime(true);// p.getChildren().add(publishedToInput); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1);// HtmlCommandButton editCategoriesButton = WFUtil.getButtonVB(EDIT_CATEGORIES_ID, bref + "edit_categories", this);// p.getChildren().add(editCategoriesButton); p.getChildren().add(WFUtil.group(localizer.getTextVB("category"), WFUtil.getText(":"))); HtmlInputText categoryInput = WFUtil.getInputText(MAIN_CATEGORY_ID, ref + "mainCategory"); if(null==categoryInput.getValue() || "".equals(categoryInput.getValue())) { categoryInput.setValue(ROOT_CATEGORY); } categoryInput.setSize(40); p.getChildren().add(categoryInput); p.getChildren().add(WFUtil.getBreak());// WFComponentSelector cs = new WFComponentSelector();// cs.setId(BUTTON_SELECTOR_ID);// cs.setDividerText(" "); HtmlCommandButton saveButton = WFUtil.getButtonVB(SAVE_ID, "save", this);// cs.add(saveButton);// cs.add(WFUtil.getButtonVB(FOR_REVIEW_ID, bref + "for_review", this));// cs.add(WFUtil.getButtonVB(PUBLISH_ID, bref + "publish", this));// cs.add(WFUtil.getButtonVB(REWRITE_ID, bref + "rewrite", this));// cs.add(WFUtil.getButtonVB(REJECT_ID, bref + "reject", this));// cs.add(WFUtil.getButtonVB(DELETE_ID, bref + "delete", this));// cs.add(WFUtil.getButtonVB(CANCEL_ID, bref + "cancel", this));// cs.setSelectedId(CANCEL_ID, true);// p.getChildren().add(cs); p.getChildren().add(saveButton); mainContainer.add(p); WFComponentSelector editorSelector = new WFComponentSelector(); editorSelector.setId(EDITOR_SELECTOR_ID); editorSelector.add(mainContainer); editorSelector.add(getCategoryEditContainer());// FileUploadForm f = new FileUploadForm(this, FILE_UPLOAD_ID, FILE_UPLOAD_CANCEL_ID); FileUploadForm f = new FileUploadForm(); f.setId(FILE_UPLOAD_FORM_ID); editorSelector.add(f); editorSelector.add(getRelatedContentItemsContainer()); editorSelector.setSelectedId(ARTICLE_EDITOR_ID, true); return editorSelector; }
| 3,232,344
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.