bugged
stringlengths
6
599k
fixed
stringlengths
6
40.8M
__index_level_0__
int64
0
3.24M
public static BPalette getZoomPalette(final BrowserModel backingModel, final BrowserTopModel model) { if(backingModel == null || model == null) { return null; } BPalette palette = new BPalette(model,"Zoom"); BIcon toFitIcon = new BIcon("Fit",false); MouseDownActions defaultActions = new MouseDownActions(); PiccoloAction toFitAction = PiccoloActionFactory.getZoomToFitAction(backingModel); defaultActions.setMouseClickAction(PiccoloModifiers.NORMAL, toFitAction); toFitIcon.setMouseDownActions(defaultActions); palette.addIcon(toFitIcon); BIcon to50Icon = new BIcon("50%",false); MouseDownActions to50Actions = new MouseDownActions(); PiccoloAction to50Action = PiccoloActionFactory.getZoomTo50Action(backingModel); defaultActions.setMouseClickAction(PiccoloModifiers.NORMAL, to50Action); to50Icon.setMouseDownActions(to50Actions); palette.addIcon(to50Icon); BIcon to75Icon = new BIcon("75%",false); MouseDownActions to75Actions = new MouseDownActions(); PiccoloAction to75Action = PiccoloActionFactory.getZoomTo75Action(backingModel); defaultActions.setMouseClickAction(PiccoloModifiers.NORMAL, to75Action); to75Icon.setMouseDownActions(to75Actions); palette.addIcon(to75Icon); BIcon to100Icon = new BIcon("100%",false); MouseDownActions to100Actions = new MouseDownActions(); PiccoloAction toActualAction = PiccoloActionFactory.getZoomToActualAction(backingModel); defaultActions.setMouseClickAction(PiccoloModifiers.NORMAL, toActualAction); to100Icon.setMouseDownActions(to100Actions); palette.addIcon(to100Icon); BIcon to200Icon = new BIcon("200%",false); MouseDownActions to200Actions = new MouseDownActions(); PiccoloAction to200Action = PiccoloActionFactory.getZoomTo200Action(backingModel); defaultActions.setMouseClickAction(PiccoloModifiers.NORMAL, to200Action); to50Icon.setMouseDownActions(to200Actions); palette.addIcon(to200Icon); return palette; }
public static BPalette getZoomPalette(final BrowserModel backingModel, final BrowserTopModel model) { if(backingModel == null || model == null) { return null; } BPalette palette = new BPalette(model,"Zoom"); BIcon toFitIcon = new BIcon("Fit",false); MouseDownActions defaultActions = new MouseDownActions(); PiccoloAction toFitAction = PiccoloActionFactory.getZoomToFitAction(backingModel); defaultActions.setMouseClickAction(PiccoloModifiers.NORMAL, toFitAction); toFitIcon.setMouseDownActions(defaultActions); palette.addIcon(toFitIcon); BIcon to50Icon = new BIcon("50%",false); MouseDownActions to50Actions = new MouseDownActions(); PiccoloAction to50Action = PiccoloActionFactory.getZoomTo50Action(backingModel); defaultActions.setMouseClickAction(PiccoloModifiers.NORMAL, to50Action); to50Icon.setMouseDownActions(to50Actions); palette.addIcon(to50Icon); BIcon to75Icon = new BIcon("75%",false); MouseDownActions to75Actions = new MouseDownActions(); PiccoloAction to75Action = PiccoloActionFactory.getZoomTo75Action(backingModel); defaultActions.setMouseClickAction(PiccoloModifiers.NORMAL, to75Action); to75Icon.setMouseDownActions(to75Actions); palette.addIcon(to75Icon); BIcon to100Icon = new BIcon("100%",false); MouseDownActions to100Actions = new MouseDownActions(); PiccoloAction toActualAction = PiccoloActionFactory.getZoomToActualAction(backingModel); defaultActions.setMouseClickAction(PiccoloModifiers.NORMAL, toActualAction); to100Icon.setMouseDownActions(to100Actions); palette.addIcon(to100Icon); BIcon to200Icon = new BIcon("200%",false); MouseDownActions to200Actions = new MouseDownActions(); PiccoloAction to200Action = PiccoloActionFactory.getZoomTo200Action(backingModel); defaultActions.setMouseClickAction(PiccoloModifiers.NORMAL, to200Action); to200Icon.setMouseDownActions(to200Actions); palette.addIcon(to200Icon); return palette; }
3,228,555
public void addBrowser(BrowserController browser) { if (browser != null) { browserList.add(0,browser); } }
public void addBrowser(UIWrapper browser) { if (browser != null) { browserList.add(0,browser); } }
3,228,557
public DatasetData retrieveDataset(int datasetID) throws DSOutOfServiceException, DSAccessException;
public DatasetData retrieveDataset(int datasetID) throws DSOutOfServiceException, DSAccessException;
3,228,558
public BrowserController getBrowser(int index) { try { return (BrowserController) browserList.get(index); } catch (Exception e) { // TODO: log message here return null; } }
public UIWrapper getBrowser(int index) { try { return (BrowserController) browserList.get(index); } catch (Exception e) { // TODO: log message here return null; } }
3,228,559
public BrowserController getBrowser(int index) { try { return (BrowserController) browserList.get(index); } catch (Exception e) { // TODO: log message here return null; } }
public BrowserController getBrowser(int index) { try { return (UIWrapper) browserList.get(index); } catch (Exception e) { // TODO: log message here return null; } }
3,228,560
public static String format(String message, int stepsComplete, int totalSteps) { message.replaceAll("%n",String.valueOf(stepsComplete)); message.replaceAll("%t",String.valueOf(totalSteps)); return message; }
public static String format(String message, int stepsComplete, int totalSteps) { message.replaceAll("%n",String.valueOf(stepsComplete)); message.replaceAll("%t",String.valueOf(totalSteps)); return message; }
3,228,561
private void addInstrumentation(File file) { if (file.isDirectory()) { File[] contents = file.listFiles(); for (int i = 0; i < contents.length; i++) addInstrumentation(contents[i]); return; } if (!isClass(file)) { return; } if (logger.isDebugEnabled()) { logger.debug("instrumenting " + file.getAbsolutePath()); } InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(projectData, cw, ignoreRegexp); cr.accept(cv, false); } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } }
private void addInstrumentation(File file) { if (file.isDirectory()) { File[] contents = file.listFiles(); for (int i = 0; i < contents.length; i++) addInstrumentation(contents[i]); return; } if (!isClass(file)) { return; } if (logger.isDebugEnabled()) { logger.debug("instrumenting " + file.getAbsolutePath()); } InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(projectData, cw, ignoreRegexp); cr.accept(cv, false); } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } }
3,228,562
private void addInstrumentation(File file) { if (file.isDirectory()) { File[] contents = file.listFiles(); for (int i = 0; i < contents.length; i++) addInstrumentation(contents[i]); return; } if (!isClass(file)) { return; } if (logger.isDebugEnabled()) { logger.debug("instrumenting " + file.getAbsolutePath()); } InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(projectData, cw, ignoreRegexp); cr.accept(cv, false); } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } }
private void addInstrumentation(File file) { if (file.isDirectory()) { File[] contents = file.listFiles(); for (int i = 0; i < contents.length; i++) addInstrumentation(contents[i]); return; } if (!isClass(file)) { return; } if (logger.isDebugEnabled()) { logger.debug("instrumenting " + file.getAbsolutePath()); } InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(projectData, cw, ignoreRegexp); cr.accept(cv, false); } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } }
3,228,563
private void addInstrumentation(File file) { if (file.isDirectory()) { File[] contents = file.listFiles(); for (int i = 0; i < contents.length; i++) addInstrumentation(contents[i]); return; } if (!isClass(file)) { return; } if (logger.isDebugEnabled()) { logger.debug("instrumenting " + file.getAbsolutePath()); } InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(projectData, cw, ignoreRegexp); cr.accept(cv, false); } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } }
private void addInstrumentation(File file) { if (file.isDirectory()) { File[] contents = file.listFiles(); for (int i = 0; i < contents.length; i++) addInstrumentation(contents[i]); return; } if (!isClass(file)) { return; } if (logger.isDebugEnabled()) { logger.debug("instrumenting " + file.getAbsolutePath()); } InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(projectData, cw, ignoreRegexp); cr.accept(cv, false); } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } }
3,228,564
private void addInstrumentation(File file) { if (file.isDirectory()) { File[] contents = file.listFiles(); for (int i = 0; i < contents.length; i++) addInstrumentation(contents[i]); return; } if (!isClass(file)) { return; } if (logger.isDebugEnabled()) { logger.debug("instrumenting " + file.getAbsolutePath()); } InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(projectData, cw, ignoreRegexp); cr.accept(cv, false); } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } }
private void addInstrumentation(File file) { if (file.isDirectory()) { File[] contents = file.listFiles(); for (int i = 0; i < contents.length; i++) addInstrumentation(contents[i]); return; } if (!isClass(file)) { return; } if (logger.isDebugEnabled()) { logger.debug("instrumenting " + file.getAbsolutePath()); } InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(projectData, cw, ignoreRegexp); cr.accept(cv, false); } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } }
3,228,565
public static void main(String[] args) { long startTime = System.currentTimeMillis(); Main main = new Main(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } main.parseArguments(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); }
public static void main(String[] args) { long startTime = System.currentTimeMillis(); Main main = new Main(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } main.parseArguments(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); }
3,228,566
public ClassInstrumenter(ProjectData projectData, final ClassVisitor cv, Pattern ignoreRegexp) { super(cv); this.projectData = projectData; this.ignoreRegex = ignoreRegexp; }
public ClassInstrumenter(ProjectData projectData, final ClassVisitor cv, Pattern ignoreRegexp) { super(cv); this.projectData = projectData; this.ignoreRegex = ignoreRegexp; }
3,228,567
public ClassInstrumenter(ProjectData projectData, final ClassVisitor cv, Pattern ignoreRegexp) { super(cv); this.projectData = projectData; this.ignoreRegex = ignoreRegexp; }
public ClassInstrumenter(ProjectData projectData, final ClassVisitor cv, Pattern ignoreRegexp) { super(cv); this.projectData = projectData; this.ignoreRegex = ignoreRegexp; }
3,228,568
public RubyClass defineClass(String name, RubyClass superClass) { return defineClassUnder(name, superClass, objectClass); }
public RubyClass defineClass(String name, RubyClass superClass) { return defineClassUnder(name, superClass, objectClass.getCRef()); }
3,228,569
public RubyClass defineClassUnder(String name, RubyClass superClass, RubyModule parentModule) { if (superClass == null) { superClass = objectClass; } return superClass.newSubClass(name, parentModule); }
public RubyClass defineClassUnder(String name, RubyClass superClass, SinglyLinkedList parentCRef) { if (superClass == null) { superClass = objectClass; } return superClass.newSubClass(name, parentModule); }
3,228,570
public RubyClass defineClassUnder(String name, RubyClass superClass, RubyModule parentModule) { if (superClass == null) { superClass = objectClass; } return superClass.newSubClass(name, parentModule); }
public RubyClass defineClassUnder(String name, RubyClass superClass, RubyModule parentModule) { if (superClass == null) { superClass = objectClass; } return superClass.newSubClass(name, parentCRef); }
3,228,571
public RubyModule defineModule(String name) { return defineModuleUnder(name, objectClass); }
public RubyModule defineModule(String name) { return defineModuleUnder(name, objectClass.getCRef()); }
3,228,572
public RubyModule defineModuleUnder(String name, RubyModule parentModule) { RubyModule newModule = RubyModule.newModule(this, name, parentModule); parentModule.setConstant(name, newModule); return newModule; }
public RubyModule defineModuleUnder(String name, RubyModule parentModule) { RubyModule newModule = RubyModule.newModule(this, name, parentModule); parentModule.setConstant(name, newModule); return newModule; }
3,228,573
public RubyModule defineModuleUnder(String name, RubyModule parentModule) { RubyModule newModule = RubyModule.newModule(this, name, parentModule); parentModule.setConstant(name, newModule); return newModule; }
public RubyModule defineModuleUnder(String name, RubyModule parentModule) { RubyModule newModule = RubyModule.newModule(this, name, parentModule); ((RubyModule)parentCRef.getValue()).setConstant(name, newModule); return newModule; }
3,228,574
public RubyModule getModule(String name) { return (RubyModule) objectClass.getConstant(name, false); }
public RubyModule getModule(String name) { return (RubyModule) objectClass.getConstantAt(name); }
3,228,575
public RubyModule getOrCreateModule(String name) { RubyModule module = (RubyModule) getCurrentContext().getRubyClass().getConstant(name, false); if (module == null) { module = (RubyModule) getCurrentContext().getRubyClass().setConstant(name, defineModule(name)); } else if (getSafeLevel() >= 4) { throw newSecurityError("Extending module prohibited."); } if (getCurrentContext().getWrapper() != null) { module.getSingletonClass().includeModule(getCurrentContext().getWrapper()); module.includeModule(getCurrentContext().getWrapper()); } return module; }
public RubyModule getOrCreateModule(String name) { RubyModule module = (RubyModule) getCurrentContext().getRubyClass().getConstantAt(name); if (module == null) { module = (RubyModule) getCurrentContext().getRubyClass().setConstant(name, defineModule(name)); } else if (getSafeLevel() >= 4) { throw newSecurityError("Extending module prohibited."); } if (getCurrentContext().getWrapper() != null) { module.getSingletonClass().includeModule(getCurrentContext().getWrapper()); module.includeModule(getCurrentContext().getWrapper()); } return module; }
3,228,576
private void initCoreClasses() { ObjectMetaClass objectMetaClass = new ObjectMetaClass(this); objectMetaClass.initializeClass(); objectClass = objectMetaClass; objectClass.setConstant("Object", objectClass); RubyClass moduleClass = new ModuleMetaClass(this, objectClass); objectClass.setConstant("Module", moduleClass); RubyClass classClass = new RubyClass(this, null /* Would be Class if it could */, moduleClass, null, "Class"); objectClass.setConstant("Class", classClass); RubyClass metaClass = objectClass.makeMetaClass(classClass, getCurrentContext().getRubyClass()); metaClass = moduleClass.makeMetaClass(metaClass, getCurrentContext().getRubyClass()); metaClass = classClass.makeMetaClass(metaClass, getCurrentContext().getRubyClass()); ((ObjectMetaClass) moduleClass).initializeBootstrapClass(); objectClass.includeModule(RubyKernel.createKernelModule(this)); RubyClass.createClassClass(classClass); RubyNil.createNilClass(this); // We cannot define this constant until nil itself was made objectClass.defineConstant("NIL", getNil()); // Pre-create the core classes we know we will get referenced by starting up the runtime. RubyBoolean.createFalseClass(this); RubyBoolean.createTrueClass(this); RubyComparable.createComparable(this); defineModule("Enumerable"); // Impl: src/builtin/enumerable.rb new StringMetaClass(this).initializeClass(); new SymbolMetaClass(this).initializeClass(); RubyThreadGroup.createThreadGroupClass(this); RubyThread.createThreadClass(this); RubyException.createExceptionClass(this); new NumericMetaClass(this).initializeClass(); new IntegerMetaClass(this).initializeClass(); new FixnumMetaClass(this).initializeClass(); new HashMetaClass(this).initializeClass(); new IOMetaClass(this).initializeClass(); new ArrayMetaClass(this).initializeClass(); Java.createJavaModule(this); RubyStruct.createStructClass(this); RubyFloat.createFloatClass(this); new BignumMetaClass(this).initializeClass(); RubyMath.createMathModule(this); // depends on all numeric types RubyRegexp.createRegexpClass(this); RubyRange.createRangeClass(this); RubyObjectSpace.createObjectSpaceModule(this); RubyGC.createGCModule(this); new ProcMetaClass(this).initializeClass(); RubyMethod.createMethodClass(this); RubyMatchData.createMatchDataClass(this); RubyMarshal.createMarshalModule(this); RubyDir.createDirClass(this); RubyFileTest.createFileTestModule(this); new FileMetaClass(this).initializeClass(); // depends on IO, FileTest RubyPrecision.createPrecisionModule(this); RubyProcess.createProcessModule(this); RubyTime.createTimeClass(this); RubyUnboundMethod.defineUnboundMethodClass(this); RubyClass exceptionClass = getClass("Exception"); RubyClass standardError = defineClass("StandardError", exceptionClass); RubyClass runtimeError = defineClass("RuntimeError", standardError); RubyClass ioError = defineClass("IOError", standardError); RubyClass scriptError = defineClass("ScriptError", exceptionClass); RubyClass nameError = defineClass("NameError", scriptError); defineClass("SystemExit", exceptionClass); defineClass("Fatal", exceptionClass); defineClass("Interrupt", exceptionClass); defineClass("SignalException", exceptionClass); defineClass("TypeError", standardError); defineClass("ArgumentError", standardError); defineClass("IndexError", standardError); defineClass("RangeError", standardError); defineClass("SyntaxError", scriptError); defineClass("LoadError", scriptError); defineClass("NotImplementedError", scriptError); defineClass("NoMethodError", nameError); defineClass("SecurityError", standardError); defineClass("NoMemError", exceptionClass); defineClass("RegexpError", standardError); defineClass("EOFError", ioError); defineClass("LocalJumpError", standardError); defineClass("ThreadError", standardError); defineClass("SystemStackError", exceptionClass); NativeException.createClass(this, runtimeError); systemCallError = defineClass("SystemCallError", standardError); errnoModule = defineModule("Errno"); initErrnoErrors(); getLoadService().addAutoload("UnboundMethod", new IAutoloadMethod() { public IRubyObject load(IRuby ruby, String name) { return RubyUnboundMethod.defineUnboundMethodClass(ruby); } }); }
private void initCoreClasses() { ObjectMetaClass objectMetaClass = new ObjectMetaClass(this); objectMetaClass.initializeClass(); objectClass = objectMetaClass; objectClass.setConstant("Object", objectClass); RubyClass moduleClass = new ModuleMetaClass(this, objectClass); objectClass.setConstant("Module", moduleClass); RubyClass classClass = new RubyClass(this, null /* Would be Class if it could */, moduleClass, null, "Class"); objectClass.setConstant("Class", classClass); RubyClass metaClass = objectClass.makeMetaClass(classClass, getCurrentContext().getRubyClass()); metaClass = moduleClass.makeMetaClass(metaClass, getCurrentContext().getRubyClass()); metaClass = classClass.makeMetaClass(metaClass, getCurrentContext().getRubyClass()); ((ObjectMetaClass) moduleClass).initializeBootstrapClass(); objectClass.includeModule(RubyKernel.createKernelModule(this)); RubyClass.createClassClass(classClass); RubyNil.createNilClass(this); // We cannot define this constant until nil itself was made objectClass.defineConstant("NIL", getNil()); // Pre-create the core classes we know we will get referenced by starting up the runtime. RubyBoolean.createFalseClass(this); RubyBoolean.createTrueClass(this); RubyComparable.createComparable(this); defineModule("Enumerable"); // Impl: src/builtin/enumerable.rb new StringMetaClass(this).initializeClass(); new SymbolMetaClass(this).initializeClass(); RubyThreadGroup.createThreadGroupClass(this); RubyThread.createThreadClass(this); RubyException.createExceptionClass(this); new NumericMetaClass(this).initializeClass(); new IntegerMetaClass(this).initializeClass(); new FixnumMetaClass(this).initializeClass(); new HashMetaClass(this).initializeClass(); new IOMetaClass(this).initializeClass(); new ArrayMetaClass(this).initializeClass(); Java.createJavaModule(this); RubyStruct.createStructClass(this); RubyFloat.createFloatClass(this); new BignumMetaClass(this).initializeClass(); RubyMath.createMathModule(this); // depends on all numeric types RubyRegexp.createRegexpClass(this); RubyRange.createRangeClass(this); RubyObjectSpace.createObjectSpaceModule(this); RubyGC.createGCModule(this); new ProcMetaClass(this).initializeClass(); RubyMethod.createMethodClass(this); RubyMatchData.createMatchDataClass(this); RubyMarshal.createMarshalModule(this); RubyDir.createDirClass(this); RubyFileTest.createFileTestModule(this); new FileMetaClass(this).initializeClass(); // depends on IO, FileTest RubyPrecision.createPrecisionModule(this); RubyProcess.createProcessModule(this); RubyTime.createTimeClass(this); RubyUnboundMethod.defineUnboundMethodClass(this); RubyClass exceptionClass = getClass("Exception"); RubyClass standardError = defineClass("StandardError", exceptionClass); RubyClass runtimeError = defineClass("RuntimeError", standardError); RubyClass ioError = defineClass("IOError", standardError); RubyClass scriptError = defineClass("ScriptError", exceptionClass); RubyClass nameError = defineClass("NameError", scriptError); defineClass("SystemExit", exceptionClass); defineClass("Fatal", exceptionClass); defineClass("Interrupt", exceptionClass); defineClass("SignalException", exceptionClass); defineClass("TypeError", standardError); defineClass("ArgumentError", standardError); defineClass("IndexError", standardError); defineClass("RangeError", standardError); defineClass("SyntaxError", scriptError); defineClass("LoadError", scriptError); defineClass("NotImplementedError", scriptError); defineClass("NoMethodError", nameError); defineClass("SecurityError", standardError); defineClass("NoMemError", exceptionClass); defineClass("RegexpError", standardError); defineClass("EOFError", ioError); defineClass("LocalJumpError", standardError); defineClass("ThreadError", standardError); defineClass("SystemStackError", exceptionClass); NativeException.createClass(this, runtimeError); systemCallError = defineClass("SystemCallError", standardError); errnoModule = defineModule("Errno"); initErrnoErrors(); getLoadService().addAutoload("UnboundMethod", new IAutoloadMethod() { public IRubyObject load(IRuby ruby, String name) { return RubyUnboundMethod.defineUnboundMethodClass(ruby); } }); }
3,228,578
public void loadNode(String scriptName, Node node, boolean wrap) { IRubyObject self = getTopSelf(); ThreadContext context = getCurrentContext(); RubyModule wrapper = context.getWrapper(); if (!wrap) { secure(4); /* should alter global state */ context.preNodeEval(null, objectClass, self); } else { /* load in anonymous module as toplevel */ context.preNodeEval(RubyModule.newModule(this, null), context.getWrapper(), self); self = getTopSelf().rbClone(); self.extendObject(context.getRubyClass()); } /* default visibility is private at loading toplevel */ getCurrentContext().setCurrentVisibility(Visibility.PRIVATE); try { self.eval(node); } catch (JumpException je) { if (je.getJumpType() == JumpException.JumpType.ReturnJump) { // Make sure this does not bubble out to java caller. } else { throw je; } } finally { context.postNodeEval(wrapper); } }
public void loadNode(String scriptName, Node node, boolean wrap) { IRubyObject self = getTopSelf(); ThreadContext context = getCurrentContext(); RubyModule wrapper = context.getWrapper(); if (!wrap) { secure(4); /* should alter global state */ context.preNodeEval(null, objectClass, self); } else { /* load in anonymous module as toplevel */ context.preNodeEval(RubyModule.newModule(this, null), context.getWrapper(), self); self = getTopSelf().rbClone(); self.extendObject(context.getRubyClass()); } /* default visibility is private at loading toplevel */ getCurrentContext().setCurrentVisibility(Visibility.PRIVATE); try { self.eval(node); } catch (JumpException je) { if (je.getJumpType() == JumpException.JumpType.ReturnJump) { // Make sure this does not bubble out to java caller. } else { throw je; } } finally { context.postNodeEval(wrapper); } }
3,228,580
public void loadNode(String scriptName, Node node, boolean wrap) { IRubyObject self = getTopSelf(); ThreadContext context = getCurrentContext(); RubyModule wrapper = context.getWrapper(); if (!wrap) { secure(4); /* should alter global state */ context.preNodeEval(null, objectClass, self); } else { /* load in anonymous module as toplevel */ context.preNodeEval(RubyModule.newModule(this, null), context.getWrapper(), self); self = getTopSelf().rbClone(); self.extendObject(context.getRubyClass()); } /* default visibility is private at loading toplevel */ getCurrentContext().setCurrentVisibility(Visibility.PRIVATE); try { self.eval(node); } catch (JumpException je) { if (je.getJumpType() == JumpException.JumpType.ReturnJump) { // Make sure this does not bubble out to java caller. } else { throw je; } } finally { context.postNodeEval(wrapper); } }
public void loadNode(String scriptName, Node node, boolean wrap) { IRubyObject self = getTopSelf(); ThreadContext context = getCurrentContext(); RubyModule wrapper = context.getWrapper(); if (!wrap) { secure(4); /* should alter global state */ context.preNodeEval(null, objectClass, self); } else { /* load in anonymous module as toplevel */ context.preNodeEval(RubyModule.newModule(this, null), context.getWrapper(), self); self = getTopSelf().rbClone(); self.extendObject(context.getRubyClass()); } /* default visibility is private at loading toplevel */ getCurrentContext().setCurrentVisibility(Visibility.PRIVATE); try { self.eval(node); } catch (JumpException je) { if (je.getJumpType() == JumpException.JumpType.ReturnJump) { // Make sure this does not bubble out to java caller. } else { throw je; } } finally { context.postNodeEval(wrapper); } }
3,228,581
public void loadNode(String scriptName, Node node, boolean wrap) { IRubyObject self = getTopSelf(); ThreadContext context = getCurrentContext(); RubyModule wrapper = context.getWrapper(); if (!wrap) { secure(4); /* should alter global state */ context.preNodeEval(null, objectClass, self); } else { /* load in anonymous module as toplevel */ context.preNodeEval(RubyModule.newModule(this, null), context.getWrapper(), self); self = getTopSelf().rbClone(); self.extendObject(context.getRubyClass()); } /* default visibility is private at loading toplevel */ getCurrentContext().setCurrentVisibility(Visibility.PRIVATE); try { self.eval(node); } catch (JumpException je) { if (je.getJumpType() == JumpException.JumpType.ReturnJump) { // Make sure this does not bubble out to java caller. } else { throw je; } } finally { context.postNodeEval(wrapper); } }
public void loadNode(String scriptName, Node node, boolean wrap) { IRubyObject self = getTopSelf(); ThreadContext context = getCurrentContext(); RubyModule wrapper = context.getWrapper(); if (!wrap) { secure(4); /* should alter global state */ context.preNodeEval(null, objectClass, self); } else { /* load in anonymous module as toplevel */ context.preNodeEval(RubyModule.newModule(this, null), context.getWrapper(), self); self = getTopSelf().rbClone(); self.extendObject(context.getRubyClass()); } /* default visibility is private at loading toplevel */ getCurrentContext().setCurrentVisibility(Visibility.PRIVATE); try { self.eval(node); } catch (JumpException je) { if (je.getJumpType() == JumpException.JumpType.ReturnJump) { // Make sure this does not bubble out to java caller. } else { throw je; } } finally { context.postNodeEval(wrapper); } }
3,228,582
public BignumMetaClass(Ruby runtime) { super("Bignum", RubyBignum.class, runtime.getObject()); }
public BignumMetaClass(Ruby runtime) { super("Bignum", RubyBignum.class, runtime.getClass("Integer")); }
3,228,583
public static RubyModule createGCModule(Ruby ruby) { return new GCDefinition(ruby).getModule(); }
public static RubyModule createGCModule(Ruby ruby) { RubyModule result = ruby.defineModule("GC"); CallbackFactory callbackFactory = ruby.callbackFactory(); result.defineSingletonMethod("start", callbackFactory.getSingletonMethod(RubyGC.class, "start")); result.defineSingletonMethod("garbage_collect", callbackFactory.getSingletonMethod(RubyGC.class, "start")); return result; }
3,228,584
public static RubyModule createProcessModule(IRuby runtime) { RubyModule process = runtime.defineModule("Process"); RubyModule process_status = process.defineClassUnder("Status", runtime.getObject()); CallbackFactory processCallbackFactory = runtime.callbackFactory(RubyProcess.class); CallbackFactory process_statusCallbackFactory = runtime.callbackFactory(RubyProcess.RubyStatus.class);// process.defineModuleFunction("fork", processCallbackFactory.getSingletonMethod("fork"));// process.defineModuleFunction("exit!", processCallbackFactory.getOptSingletonMethod("exit_bang"));// process.defineModuleFunction("exit", processCallbackFactory.getOptSingletonMethod("exit"));// process.defineModuleFunction("abort", processCallbackFactory.getOptSingletonMethod("abort"));// process.defineModuleFunction("kill", processCallbackFactory.getOptSingletonMethod("kill"));// process.defineModuleFunction("wait", processCallbackFactory.getOptSingletonMethod("wait"));// process.defineModuleFunction("wait2", processCallbackFactory.getOptSingletonMethod("wait2"));// process.defineModuleFunction("waitpid", processCallbackFactory.getOptSingletonMethod("waitpid"));// process.defineModuleFunction("waitpid2", processCallbackFactory.getOptSingletonMethod("waitpid2"));// process.defineModuleFunction("waitall", processCallbackFactory.getSingletonMethod("waitall"));// process.defineModuleFunction("detach", processCallbackFactory.getSingletonMethod("detach", IRubyObject.class));// process.defineModuleFunction("pid", processCallbackFactory.getSingletonMethod("pid"));// process.defineModuleFunction("ppid", processCallbackFactory.getSingletonMethod("ppid"));//// process.defineModuleFunction("getpgrp", processCallbackFactory.getSingletonMethod("getprgrp"));// process.defineModuleFunction("setpgrp", processCallbackFactory.getSingletonMethod("setpgrp"));// process.defineModuleFunction("getpgid", processCallbackFactory.getSingletonMethod("getpgid", IRubyObject.class));// process.defineModuleFunction("setpgid", processCallbackFactory.getSingletonMethod("setpgid", IRubyObject.class, IRubyObject.class));//// process.defineModuleFunction("setsid", processCallbackFactory.getSingletonMethod("setsid"));//// process.defineModuleFunction("getpriority", processCallbackFactory.getSingletonMethod("getpriority", IRubyObject.class, IRubyObject.class));// process.defineModuleFunction("setpriority", processCallbackFactory.getSingletonMethod("setpriority", IRubyObject.class, IRubyObject.class, IRubyObject.class));// #ifdef HAVE_GETPRIORITY// rb_define_const(rb_mProcess, "PRIO_PROCESS", INT2FIX(PRIO_PROCESS));// rb_define_const(rb_mProcess, "PRIO_PGRP", INT2FIX(PRIO_PGRP));// rb_define_const(rb_mProcess, "PRIO_USER", INT2FIX(PRIO_USER));// #endif// process.defineModuleFunction("uid", processCallbackFactory.getSingletonMethod("uid"));// process.defineModuleFunction("uid=", processCallbackFactory.getSingletonMethod("uid_set", IRubyObject.class));// process.defineModuleFunction("gid", processCallbackFactory.getSingletonMethod("gid"));// process.defineModuleFunction("gid=", processCallbackFactory.getSingletonMethod("gid_set", IRubyObject.class));// process.defineModuleFunction("euid", processCallbackFactory.getSingletonMethod("euid"));// process.defineModuleFunction("euid=", processCallbackFactory.getSingletonMethod("euid_set", IRubyObject.class));// process.defineModuleFunction("egid", processCallbackFactory.getSingletonMethod("egid"));// process.defineModuleFunction("egid=", processCallbackFactory.getSingletonMethod("egid_set", IRubyObject.class));// process.defineModuleFunction("initgroups", processCallbackFactory.getSingletonMethod("initgroups", IRubyObject.class, IRubyObject.class));// process.defineModuleFunction("groups", processCallbackFactory.getSingletonMethod("groups"));// process.defineModuleFunction("groups=", processCallbackFactory.getSingletonMethod("groups_set", IRubyObject.class));// process.defineModuleFunction("maxgroups", processCallbackFactory.getSingletonMethod("maxgroups"));// process.defineModuleFunction("maxgroups=", processCallbackFactory.getSingletonMethod("maxgroups_set", IRubyObject.class)); process.defineModuleFunction("times", processCallbackFactory.getSingletonMethod("times")); // Process::Status methods // process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq"));// process_status.defineMethod("&", process_statusCallbackFactory.getMethod("op_and")); process_status.defineMethod(">>", process_statusCallbackFactory.getMethod("rightshift_op", IRubyObject.class)); process_status.defineMethod("to_i", process_statusCallbackFactory.getMethod("to_i"));// process_status.defineMethod("to_int", process_statusCallbackFactory.getMethod("to_int")); process_status.defineMethod("to_s", process_statusCallbackFactory.getMethod("to_s")); process_status.defineMethod("inspect", process_statusCallbackFactory.getMethod("inspect"));// process_status.defineMethod("pid", process_statusCallbackFactory.getMethod("pid"));// process_status.defineMethod("stopped?", process_statusCallbackFactory.getMethod("stopped_p"));// process_status.defineMethod("stopsig", process_statusCallbackFactory.getMethod("stopsig"));// process_status.defineMethod("signaled?", process_statusCallbackFactory.getMethod("signaled_p"));// process_status.defineMethod("termsig", process_statusCallbackFactory.getMethod("termsig"));// process_status.defineMethod("exited?", process_statusCallbackFactory.getMethod("exited_p")); process_status.defineMethod("exitstatus", process_statusCallbackFactory.getMethod("exitstatus")); process_status.defineMethod("success?", process_statusCallbackFactory.getMethod("success_p"));// process_status.defineMethod("coredump?", process_statusCallbackFactory.getMethod("coredump_p")); return process; }
process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); publicprocess_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); staticprocess_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); RubyModuleprocess_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); createProcessModule(IRubyprocess_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); runtime)process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); {process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); RubyModuleprocess_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processprocess_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); =process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); runtime.defineModule("Process");process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); RubyModuleprocess_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_statusprocess_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); =process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineClassUnder("Status",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); runtime.getObject());process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); CallbackFactoryprocess_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactoryprocess_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); =process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); runtime.callbackFactory(RubyProcess.class);process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); CallbackFactoryprocess_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_statusCallbackFactoryprocess_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); =process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); runtime.callbackFactory(RubyProcess.RubyStatus.class);//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("fork",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getSingletonMethod("fork"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("exit!",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getOptSingletonMethod("exit_bang"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("exit",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getOptSingletonMethod("exit"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("abort",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getOptSingletonMethod("abort"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("kill",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getOptSingletonMethod("kill"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("wait",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getOptSingletonMethod("wait"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("wait2",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getOptSingletonMethod("wait2"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("waitpid",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getOptSingletonMethod("waitpid"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("waitpid2",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getOptSingletonMethod("waitpid2"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("waitall",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getSingletonMethod("waitall"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("detach",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getSingletonMethod("detach",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); IRubyObject.class));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("pid",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getSingletonMethod("pid"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("ppid",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getSingletonMethod("ppid"));////process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("getpgrp",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getSingletonMethod("getprgrp"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("setpgrp",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getSingletonMethod("setpgrp"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("getpgid",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getSingletonMethod("getpgid",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); IRubyObject.class));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("setpgid",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getSingletonMethod("setpgid",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); IRubyObject.class,process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); IRubyObject.class));////process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("setsid",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getSingletonMethod("setsid"));////process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("getpriority",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getSingletonMethod("getpriority",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); IRubyObject.class,process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); IRubyObject.class));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("setpriority",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getSingletonMethod("setpriority",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); IRubyObject.class,process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); IRubyObject.class,process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); IRubyObject.class));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); #ifdefprocess_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); HAVE_GETPRIORITY//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); rb_define_const(rb_mProcess,process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); "PRIO_PROCESS",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); INT2FIX(PRIO_PROCESS));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); rb_define_const(rb_mProcess,process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); "PRIO_PGRP",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); INT2FIX(PRIO_PGRP));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); rb_define_const(rb_mProcess,process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); "PRIO_USER",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); INT2FIX(PRIO_USER));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); #endif//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("uid",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getSingletonMethod("uid"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("uid=",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getSingletonMethod("uid_set",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); IRubyObject.class));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("gid",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getSingletonMethod("gid"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("gid=",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getSingletonMethod("gid_set",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); IRubyObject.class));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("euid",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getSingletonMethod("euid"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("euid=",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getSingletonMethod("euid_set",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); IRubyObject.class));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("egid",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getSingletonMethod("egid"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("egid=",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getSingletonMethod("egid_set",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); IRubyObject.class));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("initgroups",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getSingletonMethod("initgroups",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); IRubyObject.class,process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); IRubyObject.class));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("groups",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getSingletonMethod("groups"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("groups=",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getSingletonMethod("groups_set",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); IRubyObject.class));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("maxgroups",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getSingletonMethod("maxgroups"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("maxgroups=",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getSingletonMethod("maxgroups_set",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); IRubyObject.class));process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process.defineModuleFunction("times",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); processCallbackFactory.getSingletonMethod("times"));process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); //process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); Process::Statusprocess_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); methodsprocess_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); //process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_statusCallbackFactory.getMethod("op_eq"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("&",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_statusCallbackFactory.getMethod("op_and"));process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod(">>",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_statusCallbackFactory.getMethod("rightshift_op",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); IRubyObject.class));process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("to_i",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_statusCallbackFactory.getMethod("to_i"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("to_int",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_statusCallbackFactory.getMethod("to_int"));process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("to_s",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_statusCallbackFactory.getMethod("to_s"));process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("inspect",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_statusCallbackFactory.getMethod("inspect"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("pid",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_statusCallbackFactory.getMethod("pid"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("stopped?",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_statusCallbackFactory.getMethod("stopped_p"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("stopsig",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_statusCallbackFactory.getMethod("stopsig"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("signaled?",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_statusCallbackFactory.getMethod("signaled_p"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("termsig",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_statusCallbackFactory.getMethod("termsig"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("exited?",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_statusCallbackFactory.getMethod("exited_p"));process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("exitstatus",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_statusCallbackFactory.getMethod("exitstatus"));process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("success?",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_statusCallbackFactory.getMethod("success_p"));//process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("coredump?",process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_statusCallbackFactory.getMethod("coredump_p"));process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); returnprocess_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process;process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); process_status.defineMethod("==", process_statusCallbackFactory.getMethod("op_eq", IRubyObject.class)); }
3,228,585
protected RubyFileStat(IRuby runtime, JRubyFile file) { super(runtime, runtime.getClass("File").getClass("Stat")); if(!file.exists()) { throw runtime.newErrnoENOENTError("No such file or directory - " + file.getPath()); } // We cannot determine, so always return 4096 (better than blowing up) blksize = runtime.newFixnum(4096); isDirectory = runtime.newBoolean(file.isDirectory()); isFile = runtime.newBoolean(file.isFile()); ftype = file.isDirectory()? runtime.newString("directory") : (file.isFile() ? runtime.newString("file") : null); // implementation to lowest common denominator...Windows has no file mode, but C ruby returns either 0100444 or 0100666 int baseMode = 0100000; if (file.canRead()) { baseMode += READ; } if (file.canWrite()) { baseMode += WRITE; } mode = runtime.newFixnum(baseMode); mtime = runtime.newFixnum(file.lastModified()); isReadable = runtime.newBoolean(file.canRead()); isWritable = runtime.newBoolean(file.canWrite()); size = runtime.newFixnum(file.length()); // We cannot determine this in Java, so we will always return false (better than blowing up) isSymlink = runtime.getFalse(); }
protected RubyFileStat(IRuby runtime, JRubyFile file) { super(runtime, runtime.getClass("File").getClass("Stat")); if(!file.exists()) { throw runtime.newErrnoENOENTError("No such file or directory - " + file.getPath()); } // We cannot determine, so always return 4096 (better than blowing up) blksize = runtime.newFixnum(4096); isDirectory = runtime.newBoolean(file.isDirectory()); isFile = runtime.newBoolean(file.isFile()); ftype = file.isDirectory()? runtime.newString("directory") : (file.isFile() ? runtime.newString("file") : null); // implementation to lowest common denominator...Windows has no file mode, but C ruby returns either 0100444 or 0100666 int baseMode = 0100000; if (file.canRead()) { baseMode += READ; } if (file.canWrite()) { baseMode += WRITE; } mode = runtime.newFixnum(baseMode); mtime = runtime.newTime(file.lastModified()); isReadable = runtime.newBoolean(file.canRead()); isWritable = runtime.newBoolean(file.canWrite()); size = runtime.newFixnum(file.length()); // We cannot determine this in Java, so we will always return false (better than blowing up) isSymlink = runtime.getFalse(); }
3,228,586
int getBitDepth() { return 16; // FIXME pixels.getPixelsType(); }
int getBitDepth() { PixelsType type = pixels.getPixelsType(); if (type.getValue().equals("int8") || type.getValue().equals("uint8")) { return 8; } else if (type.getValue().equals("int16") || type.getValue().equals("uint16")) { return 16; } else if (type.getValue().equals("int32") || type.getValue().equals("uint32") || type.getValue().equals("float")) { return 32; } else if (type.getValue().equals("double")) { return 64; } throw new RuntimeException("Pixels type '" + type.getValue() + "' unsupported by nio."); // FIXME pixels.getPixelsType(); }
3,228,587
private boolean flatten(ArrayList ary) { boolean mod = false; for (int i = ary.size() - 1; i >= 0; i--) { if (ary.get(i) instanceof RubyArray) { ArrayList ary2 = ((RubyArray) ary.remove(i)).getList(); flatten(ary2); ary.addAll(i, ary2); mod = true; } } return mod; }
private boolean flatten(ArrayList ary) { boolean mod = false; for (int i = ary.size() - 1; i >= 0; i--) { if (ary.get(i) instanceof RubyArray) { ArrayList ary2 = ((RubyArray) ary.remove(i)).getList(); flatten(ary2); ary.addAll(i, ary2); mod = true; } } return mod; }
3,228,588
public IRubyObject rbClone() { RubyArray ary = newArray(getRuntime(), list); ary.setupClone(this); return ary; }
public IRubyObject rbClone() { RubyArray ary = newArray(getRuntime(), new ArrayList(list)); ary.setupClone(this); return ary; }
3,228,589
public static Callback getSelfMethod() { return new Callback() { public RubyObject execute(RubyObject recv, RubyObject[] args, Ruby ruby) { return recv; } }; }
public static Callback getSelfMethod(final int arity) { return new Callback() { public RubyObject execute(RubyObject recv, RubyObject[] args, Ruby ruby) { return recv; } }; }
3,228,590
public RubyClass getSingletonClass() { if (isNil()) { return getNilSingletonClass(); } RubyClass type = getInternalClass().isSingleton() ? getInternalClass() : makeMetaClass(getInternalClass()); type.setTaint(isTaint()); type.setFrozen(isFrozen()); return type; }
public RubyClass getSingletonClass() { if (isNil()) { return getNilSingletonClass(); } RubyClass type = getInternalClass().isSingleton() ? getInternalClass() : makeMetaClass(getInternalClass()); type.setTaint(isTaint()); type.setFrozen(isFrozen()); return type; }
3,228,592
public IRubyObject yieldUnder(RubyModule under) { return under.executeUnder(new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { // if () { Block oldBlock = runtime.getBlockStack().getCurrent().cloneBlock(); /* copy the block to avoid modifying global data. */ runtime.getBlockStack().getCurrent().getFrame().setNamespace(runtime.getCurrentFrame().getNamespace()); try { return runtime.yield(args[0], args[0], runtime.getRubyClass(), false); } finally { runtime.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 IRubyObject[] { this }); }
public IRubyObject yieldUnder(RubyModule under) { return under.executeUnder(new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { // if () { Block oldBlock = runtime.getBlockStack().getCurrent().cloneBlock(); /* copy the block to avoid modifying global data. */ runtime.getBlockStack().getCurrent().getFrame().setNamespace(runtime.getCurrentFrame().getNamespace()); try { return runtime.yield(args[0], args[0], runtime.getRubyClass(), false); } finally { runtime.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 IRubyObject[] { this }); }
3,228,593
public IRubyObject execute(IRubyObject self, IRubyObject[] args) { // if () { Block oldBlock = runtime.getBlockStack().getCurrent().cloneBlock(); /* copy the block to avoid modifying global data. */ runtime.getBlockStack().getCurrent().getFrame().setNamespace(runtime.getCurrentFrame().getNamespace()); try { return runtime.yield(args[0], args[0], runtime.getRubyClass(), false); } finally { runtime.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 IRubyObject execute(IRubyObject self, IRubyObject[] args) { // if () { Block oldBlock = runtime.getBlockStack().getCurrent().cloneBlock(); /* copy the block to avoid modifying global data. */ runtime.getBlockStack().getCurrent().getFrame().setNamespace(runtime.getCurrentFrame().getNamespace()); try { return runtime.yield(args[0], args[0], runtime.getRubyClass(), false); } finally { runtime.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,228,594
public void connectionClosedOnError(final Exception ex) { SwingUtilities.invokeLater(new Runnable() { public void run() { Log.error("Connection closed on error.", ex); String message = "Your connection was closed due to an error."; if (ex instanceof XMPPException) { XMPPException xmppEx = (XMPPException)ex; StreamError error = xmppEx.getStreamError(); String reason = error.getCode(); if ("conflict".equals(reason)) { message = "Your connection was closed due to the same user logging in from another location."; } } Collection rooms = SparkManager.getChatManager().getChatContainer().getChatRooms(); Iterator iter = rooms.iterator(); while (iter.hasNext()) { ChatRoom chatRoom = (ChatRoom)iter.next(); chatRoom.getChatInputEditor().setEnabled(false); chatRoom.getSendButton().setEnabled(false); chatRoom.getTranscriptWindow().insertNotificationMessage(message); } } }); }
public void connectionClosedOnError(final Exception ex) { SwingUtilities.invokeLater(new Runnable() { public void run() { Log.error("Connection closed on error.", ex); String message = Res.getString("message.disconnected.error"); if (ex instanceof XMPPException) { XMPPException xmppEx = (XMPPException)ex; StreamError error = xmppEx.getStreamError(); String reason = error.getCode(); if ("conflict".equals(reason)) { message = "Your connection was closed due to the same user logging in from another location."; } } Collection rooms = SparkManager.getChatManager().getChatContainer().getChatRooms(); Iterator iter = rooms.iterator(); while (iter.hasNext()) { ChatRoom chatRoom = (ChatRoom)iter.next(); chatRoom.getChatInputEditor().setEnabled(false); chatRoom.getSendButton().setEnabled(false); chatRoom.getTranscriptWindow().insertNotificationMessage(message); } } }); }
3,228,595
public void connectionClosedOnError(final Exception ex) { SwingUtilities.invokeLater(new Runnable() { public void run() { Log.error("Connection closed on error.", ex); String message = "Your connection was closed due to an error."; if (ex instanceof XMPPException) { XMPPException xmppEx = (XMPPException)ex; StreamError error = xmppEx.getStreamError(); String reason = error.getCode(); if ("conflict".equals(reason)) { message = "Your connection was closed due to the same user logging in from another location."; } } Collection rooms = SparkManager.getChatManager().getChatContainer().getChatRooms(); Iterator iter = rooms.iterator(); while (iter.hasNext()) { ChatRoom chatRoom = (ChatRoom)iter.next(); chatRoom.getChatInputEditor().setEnabled(false); chatRoom.getSendButton().setEnabled(false); chatRoom.getTranscriptWindow().insertNotificationMessage(message); } } }); }
public void connectionClosedOnError(final Exception ex) { SwingUtilities.invokeLater(new Runnable() { public void run() { Log.error("Connection closed on error.", ex); String message = "Your connection was closed due to an error."; if (ex instanceof XMPPException) { XMPPException xmppEx = (XMPPException)ex; StreamError error = xmppEx.getStreamError(); String reason = error.getCode(); if ("conflict".equals(reason)) { message = Res.getString("message.disconnected.conflict.error"); } } Collection rooms = SparkManager.getChatManager().getChatContainer().getChatRooms(); Iterator iter = rooms.iterator(); while (iter.hasNext()) { ChatRoom chatRoom = (ChatRoom)iter.next(); chatRoom.getChatInputEditor().setEnabled(false); chatRoom.getSendButton().setEnabled(false); chatRoom.getTranscriptWindow().insertNotificationMessage(message); } } }); }
3,228,596
public void run() { Log.error("Connection closed on error.", ex); String message = "Your connection was closed due to an error."; if (ex instanceof XMPPException) { XMPPException xmppEx = (XMPPException)ex; StreamError error = xmppEx.getStreamError(); String reason = error.getCode(); if ("conflict".equals(reason)) { message = "Your connection was closed due to the same user logging in from another location."; } } Collection rooms = SparkManager.getChatManager().getChatContainer().getChatRooms(); Iterator iter = rooms.iterator(); while (iter.hasNext()) { ChatRoom chatRoom = (ChatRoom)iter.next(); chatRoom.getChatInputEditor().setEnabled(false); chatRoom.getSendButton().setEnabled(false); chatRoom.getTranscriptWindow().insertNotificationMessage(message); } }
public void run() { Log.error("Connection closed on error.", ex); String message = Res.getString("message.disconnected.error"); if (ex instanceof XMPPException) { XMPPException xmppEx = (XMPPException)ex; StreamError error = xmppEx.getStreamError(); String reason = error.getCode(); if ("conflict".equals(reason)) { message = "Your connection was closed due to the same user logging in from another location."; } } Collection rooms = SparkManager.getChatManager().getChatContainer().getChatRooms(); Iterator iter = rooms.iterator(); while (iter.hasNext()) { ChatRoom chatRoom = (ChatRoom)iter.next(); chatRoom.getChatInputEditor().setEnabled(false); chatRoom.getSendButton().setEnabled(false); chatRoom.getTranscriptWindow().insertNotificationMessage(message); } }
3,228,597
public void run() { Log.error("Connection closed on error.", ex); String message = "Your connection was closed due to an error."; if (ex instanceof XMPPException) { XMPPException xmppEx = (XMPPException)ex; StreamError error = xmppEx.getStreamError(); String reason = error.getCode(); if ("conflict".equals(reason)) { message = "Your connection was closed due to the same user logging in from another location."; } } Collection rooms = SparkManager.getChatManager().getChatContainer().getChatRooms(); Iterator iter = rooms.iterator(); while (iter.hasNext()) { ChatRoom chatRoom = (ChatRoom)iter.next(); chatRoom.getChatInputEditor().setEnabled(false); chatRoom.getSendButton().setEnabled(false); chatRoom.getTranscriptWindow().insertNotificationMessage(message); } }
public void run() { Log.error("Connection closed on error.", ex); String message = "Your connection was closed due to an error."; if (ex instanceof XMPPException) { XMPPException xmppEx = (XMPPException)ex; StreamError error = xmppEx.getStreamError(); String reason = error.getCode(); if ("conflict".equals(reason)) { message = Res.getString("message.disconnected.conflict.error"); } } Collection rooms = SparkManager.getChatManager().getChatContainer().getChatRooms(); Iterator iter = rooms.iterator(); while (iter.hasNext()) { ChatRoom chatRoom = (ChatRoom)iter.next(); chatRoom.getChatInputEditor().setEnabled(false); chatRoom.getSendButton().setEnabled(false); chatRoom.getTranscriptWindow().insertNotificationMessage(message); } }
3,228,598
private void setIdleListener() throws Exception { final Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { LocalPreferences localPref = SettingsManager.getLocalPreferences(); int delay = 0; if (localPref.isIdleOn()) { delay = localPref.getIdleTime() * 60000; } else { return; } long idleTime = SystemInfo.getSessionIdleTime(); boolean isLocked = SystemInfo.isSessionLocked(); if (idleTime > delay) { try { // Handle if spark is not connected to the server. if (SparkManager.getConnection() == null || !SparkManager.getConnection().isConnected()) { return; } // Change Status Workspace workspace = SparkManager.getWorkspace(); Presence presence = workspace.getStatusBar().getPresence(); if (workspace != null && presence.getMode() == Presence.Mode.available) { unavaliable = true; StatusItem away = workspace.getStatusBar().getStatusItem("Away"); Presence p = away.getPresence(); if (isLocked) { p.setStatus("User has locked their workstation."); } else { p.setStatus("Away due to idle."); } previousPriority = presence.getPriority(); p.setPriority(0); SparkManager.getSessionManager().changePresence(p); } } catch (Exception e) { Log.error("Error with IDLE status.", e); timer.cancel(); } } else { if (unavaliable) { setAvailableIfActive(); } } } }, 1000, 1000); }
private void setIdleListener() throws Exception { final Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { LocalPreferences localPref = SettingsManager.getLocalPreferences(); int delay = 0; if (localPref.isIdleOn()) { delay = localPref.getIdleTime() * 60000; } else { return; } long idleTime = SystemInfo.getSessionIdleTime(); boolean isLocked = SystemInfo.isSessionLocked(); if (idleTime > delay) { try { // Handle if spark is not connected to the server. if (SparkManager.getConnection() == null || !SparkManager.getConnection().isConnected()) { return; } // Change Status Workspace workspace = SparkManager.getWorkspace(); Presence presence = workspace.getStatusBar().getPresence(); if (workspace != null && presence.getMode() == Presence.Mode.available) { unavaliable = true; StatusItem away = workspace.getStatusBar().getStatusItem("Away"); Presence p = away.getPresence(); if (isLocked) { p.setStatus(Res.getString("message.locked.workstation")); } else { p.setStatus("Away due to idle."); } previousPriority = presence.getPriority(); p.setPriority(0); SparkManager.getSessionManager().changePresence(p); } } catch (Exception e) { Log.error("Error with IDLE status.", e); timer.cancel(); } } else { if (unavaliable) { setAvailableIfActive(); } } } }, 1000, 1000); }
3,228,599
private void setIdleListener() throws Exception { final Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { LocalPreferences localPref = SettingsManager.getLocalPreferences(); int delay = 0; if (localPref.isIdleOn()) { delay = localPref.getIdleTime() * 60000; } else { return; } long idleTime = SystemInfo.getSessionIdleTime(); boolean isLocked = SystemInfo.isSessionLocked(); if (idleTime > delay) { try { // Handle if spark is not connected to the server. if (SparkManager.getConnection() == null || !SparkManager.getConnection().isConnected()) { return; } // Change Status Workspace workspace = SparkManager.getWorkspace(); Presence presence = workspace.getStatusBar().getPresence(); if (workspace != null && presence.getMode() == Presence.Mode.available) { unavaliable = true; StatusItem away = workspace.getStatusBar().getStatusItem("Away"); Presence p = away.getPresence(); if (isLocked) { p.setStatus("User has locked their workstation."); } else { p.setStatus("Away due to idle."); } previousPriority = presence.getPriority(); p.setPriority(0); SparkManager.getSessionManager().changePresence(p); } } catch (Exception e) { Log.error("Error with IDLE status.", e); timer.cancel(); } } else { if (unavaliable) { setAvailableIfActive(); } } } }, 1000, 1000); }
private void setIdleListener() throws Exception { final Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { LocalPreferences localPref = SettingsManager.getLocalPreferences(); int delay = 0; if (localPref.isIdleOn()) { delay = localPref.getIdleTime() * 60000; } else { return; } long idleTime = SystemInfo.getSessionIdleTime(); boolean isLocked = SystemInfo.isSessionLocked(); if (idleTime > delay) { try { // Handle if spark is not connected to the server. if (SparkManager.getConnection() == null || !SparkManager.getConnection().isConnected()) { return; } // Change Status Workspace workspace = SparkManager.getWorkspace(); Presence presence = workspace.getStatusBar().getPresence(); if (workspace != null && presence.getMode() == Presence.Mode.available) { unavaliable = true; StatusItem away = workspace.getStatusBar().getStatusItem("Away"); Presence p = away.getPresence(); if (isLocked) { p.setStatus("User has locked their workstation."); } else { p.setStatus(Res.getString("message.away.idle")); } previousPriority = presence.getPriority(); p.setPriority(0); SparkManager.getSessionManager().changePresence(p); } } catch (Exception e) { Log.error("Error with IDLE status.", e); timer.cancel(); } } else { if (unavaliable) { setAvailableIfActive(); } } } }, 1000, 1000); }
3,228,600
public void run() { LocalPreferences localPref = SettingsManager.getLocalPreferences(); int delay = 0; if (localPref.isIdleOn()) { delay = localPref.getIdleTime() * 60000; } else { return; } long idleTime = SystemInfo.getSessionIdleTime(); boolean isLocked = SystemInfo.isSessionLocked(); if (idleTime > delay) { try { // Handle if spark is not connected to the server. if (SparkManager.getConnection() == null || !SparkManager.getConnection().isConnected()) { return; } // Change Status Workspace workspace = SparkManager.getWorkspace(); Presence presence = workspace.getStatusBar().getPresence(); if (workspace != null && presence.getMode() == Presence.Mode.available) { unavaliable = true; StatusItem away = workspace.getStatusBar().getStatusItem("Away"); Presence p = away.getPresence(); if (isLocked) { p.setStatus("User has locked their workstation."); } else { p.setStatus("Away due to idle."); } previousPriority = presence.getPriority(); p.setPriority(0); SparkManager.getSessionManager().changePresence(p); } } catch (Exception e) { Log.error("Error with IDLE status.", e); timer.cancel(); } } else { if (unavaliable) { setAvailableIfActive(); } } }
public void run() { LocalPreferences localPref = SettingsManager.getLocalPreferences(); int delay = 0; if (localPref.isIdleOn()) { delay = localPref.getIdleTime() * 60000; } else { return; } long idleTime = SystemInfo.getSessionIdleTime(); boolean isLocked = SystemInfo.isSessionLocked(); if (idleTime > delay) { try { // Handle if spark is not connected to the server. if (SparkManager.getConnection() == null || !SparkManager.getConnection().isConnected()) { return; } // Change Status Workspace workspace = SparkManager.getWorkspace(); Presence presence = workspace.getStatusBar().getPresence(); if (workspace != null && presence.getMode() == Presence.Mode.available) { unavaliable = true; StatusItem away = workspace.getStatusBar().getStatusItem("Away"); Presence p = away.getPresence(); if (isLocked) { p.setStatus(Res.getString("message.locked.workstation")); } else { p.setStatus("Away due to idle."); } previousPriority = presence.getPriority(); p.setPriority(0); SparkManager.getSessionManager().changePresence(p); } } catch (Exception e) { Log.error("Error with IDLE status.", e); timer.cancel(); } } else { if (unavaliable) { setAvailableIfActive(); } } }
3,228,601
public void run() { LocalPreferences localPref = SettingsManager.getLocalPreferences(); int delay = 0; if (localPref.isIdleOn()) { delay = localPref.getIdleTime() * 60000; } else { return; } long idleTime = SystemInfo.getSessionIdleTime(); boolean isLocked = SystemInfo.isSessionLocked(); if (idleTime > delay) { try { // Handle if spark is not connected to the server. if (SparkManager.getConnection() == null || !SparkManager.getConnection().isConnected()) { return; } // Change Status Workspace workspace = SparkManager.getWorkspace(); Presence presence = workspace.getStatusBar().getPresence(); if (workspace != null && presence.getMode() == Presence.Mode.available) { unavaliable = true; StatusItem away = workspace.getStatusBar().getStatusItem("Away"); Presence p = away.getPresence(); if (isLocked) { p.setStatus("User has locked their workstation."); } else { p.setStatus("Away due to idle."); } previousPriority = presence.getPriority(); p.setPriority(0); SparkManager.getSessionManager().changePresence(p); } } catch (Exception e) { Log.error("Error with IDLE status.", e); timer.cancel(); } } else { if (unavaliable) { setAvailableIfActive(); } } }
public void run() { LocalPreferences localPref = SettingsManager.getLocalPreferences(); int delay = 0; if (localPref.isIdleOn()) { delay = localPref.getIdleTime() * 60000; } else { return; } long idleTime = SystemInfo.getSessionIdleTime(); boolean isLocked = SystemInfo.isSessionLocked(); if (idleTime > delay) { try { // Handle if spark is not connected to the server. if (SparkManager.getConnection() == null || !SparkManager.getConnection().isConnected()) { return; } // Change Status Workspace workspace = SparkManager.getWorkspace(); Presence presence = workspace.getStatusBar().getPresence(); if (workspace != null && presence.getMode() == Presence.Mode.available) { unavaliable = true; StatusItem away = workspace.getStatusBar().getStatusItem("Away"); Presence p = away.getPresence(); if (isLocked) { p.setStatus("User has locked their workstation."); } else { p.setStatus(Res.getString("message.away.idle")); } previousPriority = presence.getPriority(); p.setPriority(0); SparkManager.getSessionManager().changePresence(p); } } catch (Exception e) { Log.error("Error with IDLE status.", e); timer.cancel(); } } else { if (unavaliable) { setAvailableIfActive(); } } }
3,228,602
public StatusItem getStatusItem(String label) { Iterator iter = dndList.iterator(); while (iter.hasNext()) { StatusItem item = (StatusItem)iter.next(); if (item.getText().equals(label)) { return item; } } return null; }
public StatusItem getStatusItem(String label) { Iterator iter = statusList.iterator(); while (iter.hasNext()) { StatusItem item = (StatusItem)iter.next(); if (item.getText().equals(label)) { return item; } } return null; }
3,228,603
void showClassifications() { getViewport().add(getClassificationComponent()); //add(getClassificationComponent(), BorderLayout.CENTER); }
voidshowClassifications(){ getViewport().add(getClassificationComponent());//add(getClassificationComponent(),BorderLayout.CENTER);}
3,228,604
public static IRubyObject open(IRubyObject recv, IRubyObject[] args) { String arg = args[0].convertToString().getValue(); // Should this logic be pushed into RubyIO Somewhere? if (arg.startsWith("|")) { String command = arg.substring(1); // exec process, create IO with process try { // TODO: may need to part cli parms out ourself? Process p = Runtime.getRuntime().exec(command); RubyIO io = new RubyIO(recv.getRuntime(), p); if (recv.getRuntime().getCurrentContext().isBlockGiven()) { try { recv.getRuntime().getCurrentContext().yield(io); return recv.getRuntime().getNil(); } finally { io.close(); } } return io; } catch (IOException ioe) { throw recv.getRuntime().newIOErrorFromException(ioe); } } return ((FileMetaClass) recv.getRuntime().getClass("File")).open(args); }
public static IRubyObject open(IRubyObject recv, IRubyObject[] args) { String arg = args[0].convertToString().toString(); // Should this logic be pushed into RubyIO Somewhere? if (arg.startsWith("|")) { String command = arg.substring(1); // exec process, create IO with process try { // TODO: may need to part cli parms out ourself? Process p = Runtime.getRuntime().exec(command); RubyIO io = new RubyIO(recv.getRuntime(), p); if (recv.getRuntime().getCurrentContext().isBlockGiven()) { try { recv.getRuntime().getCurrentContext().yield(io); return recv.getRuntime().getNil(); } finally { io.close(); } } return io; } catch (IOException ioe) { throw recv.getRuntime().newIOErrorFromException(ioe); } } return ((FileMetaClass) recv.getRuntime().getClass("File")).open(args); }
3,228,606
private boolean isRescueHandled(RubyException actExcptn, IListNode exceptionNodes) { // TMP_PROTECT; if (exceptionNodes == null) { return actExcptn.isKindOf(ruby.getExceptions().getStandardError()); } Block tmpBlock = ArgsUtil.beginCallArgs(ruby); RubyObject[] args = ArgsUtil.setupArgs(ruby, this, exceptionNodes); ArgsUtil.endCallArgs(ruby, tmpBlock); for (int i = 0; i < args.length; i++) { if (args[i].isKindOf(ruby.getClasses().getModuleClass())) { throw new TypeError(ruby, "class or module required for rescue clause"); } if (actExcptn.isKindOf((RubyModule) args[i])) { return true; } } return false; }
private boolean isRescueHandled(RubyException actExcptn, IListNode exceptionNodes) { // TMP_PROTECT; if (exceptionNodes == null) { return actExcptn.isKindOf(ruby.getExceptions().getStandardError()); } Block tmpBlock = ArgsUtil.beginCallArgs(ruby); RubyObject[] args = ArgsUtil.setupArgs(ruby, this, exceptionNodes); ArgsUtil.endCallArgs(ruby, tmpBlock); for (int i = 0; i < args.length; i++) { if (! args[i].isKindOf(ruby.getClasses().getModuleClass())) { throw new TypeError(ruby, "class or module required for rescue clause"); } if (actExcptn.isKindOf((RubyModule) args[i])) { return true; } } return false; }
3,228,607
public final static Block beginCallArgs(final Ruby ruby) { final Block actBlock = ruby.getBlockStack().getCurrent(); if (ruby.getCurrentIter().isPre()) { ruby.getBlockStack().pop(); } ruby.getIterStack().push(Iter.ITER_NOT); return actBlock; }
public final static Block beginCallArgs(final Ruby ruby) { final Block currentBlock = ruby.getBlockStack().getCurrent(); if (ruby.getCurrentIter().isPre()) { ruby.getBlockStack().pop(); } ruby.getIterStack().push(Iter.ITER_NOT); return actBlock; }
3,228,608
public final static Block beginCallArgs(final Ruby ruby) { final Block actBlock = ruby.getBlockStack().getCurrent(); if (ruby.getCurrentIter().isPre()) { ruby.getBlockStack().pop(); } ruby.getIterStack().push(Iter.ITER_NOT); return actBlock; }
public final static Block beginCallArgs(final Ruby ruby) { final Block actBlock = ruby.getBlockStack().getCurrent(); if (ruby.getCurrentIter().isPre()) { ruby.getBlockStack().pop(); } ruby.getIterStack().push(Iter.ITER_NOT); return currentBlock; }
3,228,609
public final static void endCallArgs( final Ruby ruby, final Block actBlock) { if (actBlock != null) { // XXX ruby.getBlockStack().push(actBlock); // Refresh the next attribute. } ruby.getIterStack().pop(); }
public final static void endCallArgs( final Ruby ruby, final Block actBlock) { if (actBlock != null) { // XXX ruby.getBlockStack().push(actBlock); // Refresh the next attribute. } ruby.getIterStack().pop(); }
3,228,610
public int getChannelFamily(int arg0) { return delegate.getChannelFamily(arg0); }
public Family getChannelFamily(int arg0) { return delegate.getChannelFamily(arg0); }
3,228,611
public int getModel() { return delegate.getModel(); }
public RenderingModel getModel() { return delegate.getModel(); }
3,228,612
public void setModel(int arg0) { delegate.setModel(arg0); }
public void setModel(RenderingModel arg0) { delegate.setModel(arg0); }
3,228,613
public void setQuantizationMap(int arg0, int arg1, double arg2, boolean arg3) { delegate.setQuantizationMap(arg0, arg1, arg2, arg3); }
public void setQuantizationMap(int arg0, Family arg1, double arg2, boolean arg3) { delegate.setQuantizationMap(arg0, arg1, arg2, arg3); }
3,228,614
private void dumpPackage(Package pack) { println("<package name=\"" + pack.getName() + "\"" + " line-rate=\"" + pack.getLineCoverageRate() + "\"" + " branch-rate=\"" + pack.getBranchCoverageRate() + "\"" + ">"); increaseIndentation(); dumpClasses((Clazz[])pack.getClasses().toArray( new Clazz[pack.getClasses().size()])); }
private void dumpPackage(Package pack) { println("<package name=\"" + pack.getName() + "\"" + " line-rate=\"" + pack.getLineCoverageRate() + "\"" + " branch-rate=\"" + pack.getBranchCoverageRate() + "\"" + ">"); increaseIndentation(); dumpClasses((Clazz[])pack.getClasses().toArray( new Clazz[pack.getClasses().size()])); }
3,228,615
private void dumpPackages(Coverage coverage) { Iterator it = coverage.getPackages().iterator(); while (it.hasNext()) { dumpPackage((Package)it.next()); } }
private void dumpPackages(Coverage coverage) { Iterator it = coverage.getPackages().iterator(); while (it.hasNext()) { dumpPackage((Package)it.next()); } }
3,228,616
public double getLineCoverageRate() { if (numberOfLines == 0) { return 1; } return (double)numberOfCoveredLines / (double)numberOfLines; }
public double getLineCoverageRate() { if (numberOfLines == 0) { return 1; } return (double)numberOfCoveredLines / (double)numberOfLines; }
3,228,617
public double getLineCoverageRate() { if (numberOfLines == 0) { return 1; } return (double)numberOfCoveredLines / (double)numberOfLines; }
public double getLineCoverageRate() { if (numberOfLines == 0) { return 1; } return (double)numberOfCoveredLines / (double)numberOfLines; }
3,228,618
public double getBranchCoverageRate() { if (numberOfBranches == 0) { if (numberOfCoveredLines == 0) { return 0; } return 1; } return (double)numberOfCoveredBranches / (double)numberOfBranches; }
public double getBranchCoverageRate() { if (numberOfBranches == 0) { if (numberOfCoveredLines == 0) { return 0; } return 1; } return (double)numberOfCoveredBranches / (double)numberOfBranches; }
3,228,619
public double getBranchCoverageRate() { if (numberOfBranches == 0) { if (numberOfCoveredLines == 0) { return 0; } return 1; } return (double)numberOfCoveredBranches / (double)numberOfBranches; }
public double getBranchCoverageRate() { if (numberOfBranches == 0) { if (numberOfCoveredLines == 0) { return 0; } return 1; } return (double)numberOfCoveredBranches / (double)numberOfBranches; }
3,228,620
public double getBranchCoverageRate() { if (numberOfBranches == 0) { if (numberOfCoveredLines == 0) { return 0; } return 1; } return (double)numberOfCoveredBranches / (double)numberOfBranches; }
public double getBranchCoverageRate() { if (numberOfBranches == 0) { if (numberOfCoveredLines == 0) { return 0; } return 1; } return (double)numberOfCoveredBranches / (double)numberOfBranches; }
3,228,621
public List childNodes() { return Collections.EMPTY_LIST; }
public List childNodes() { return EMPTY_LIST; }
3,228,622
private JMenu createEditMenu() { JMenu menu = new JMenu("Edit"); menu.setMnemonic(KeyEvent.VK_E); menu.add(new JMenuItem(controller.getAction(HiViewerControl.FIND))); menu.add(new JSeparator(SwingConstants.HORIZONTAL)); menu.add(new JMenuItem(controller.getAction(HiViewerControl.VIEW))); menu.add(new JSeparator(SwingConstants.HORIZONTAL)); menu.add(createClassifySubMenu()); menu.add(new JMenuItem(controller.getAction(HiViewerControl.ANNOTATE))); menu.add(new JMenuItem(controller.getAction(HiViewerControl.REMOVE))); menu.add(new JSeparator(SwingConstants.HORIZONTAL)); menu.add(new JMenuItem( controller.getAction(HiViewerControl.PROPERTIES))); return menu; }
private JMenu createEditMenu() { JMenu menu = new JMenu("Edit"); menu.setMnemonic(KeyEvent.VK_E); menu.add(new JMenuItem(controller.getAction(HiViewerControl.FIND))); menu.add(new JSeparator(SwingConstants.HORIZONTAL)); menu.add(new JMenuItem(controller.getAction(HiViewerControl.VIEW))); menu.add(new JSeparator(SwingConstants.HORIZONTAL)); menu.add(new JMenuItem(controller.getAction(HiViewerControl.CLASSIFY))); menu.add(new JMenuItem(controller.getAction( HiViewerControl.DECLASSIFY))); menu.add(new JMenuItem(controller.getAction(HiViewerControl.ANNOTATE))); menu.add(new JMenuItem(controller.getAction(HiViewerControl.REMOVE))); menu.add(new JSeparator(SwingConstants.HORIZONTAL)); menu.add(new JMenuItem( controller.getAction(HiViewerControl.PROPERTIES))); return menu; }
3,228,623
private static RubyTime createTime(IRubyObject type, IRubyObject[] args, boolean gmt) { int len = 6; if (args.length == 10) { args = new IRubyObject[] { args[5], args[4], args[3], args[2], args[1], args[0], }; } else { len = type.checkArgumentCount(args, 1, 7); } int year = RubyNumeric.fix2int(args[0]); int month = 0; if (len > 1) { if (!args[1].isNil()) { if (args[1] instanceof RubyString) { month = -1; for (int i = 0; i < 12; i++) { if (months[i].equalsIgnoreCase(args[1].toString())) { month = i; } } if (month == -1) { try { month = Integer.parseInt(args[1].toString()) - 1; } catch (NumberFormatException nfExcptn) { throw new ArgumentError(type.getRuntime(), "Argument out of range."); } } } else { month = RubyNumeric.fix2int(args[1]) - 1; } } if (0 > month || month > 11) { throw new ArgumentError(type.getRuntime(), "Argument out of range."); } } int[] int_args = { 1, 0, 0, 0, 0 }; for (int i = 0; len > i + 2; i++) { if (!args[i + 2].isNil()) { int_args[i] = RubyNumeric.fix2int(args[i + 2]); if (time_min[i] > int_args[i] || int_args[i] > time_max[i]) { throw new ArgumentError(type.getRuntime(), "Argument out of range."); } } } RubyTime time = new RubyTime(type.getRuntime(), (RubyClass) type); if (gmt) { time.cal = Calendar.getInstance(TimeZone.getTimeZone("GMT")); } else { time.cal = Calendar.getInstance(); } time.cal.set(year, month, int_args[0], int_args[1], int_args[2], int_args[3]); time.cal.set(Calendar.MILLISECOND, int_args[4] / 1000); time.usec = int_args[4] % 1000; time.callInit(args); return time; }
private static RubyTime createTime(IRubyObject type, IRubyObject[] args, boolean gmt) { int len = 6; if (args.length == 10) { args = new IRubyObject[] { args[5], args[4], args[3], args[2], args[1], args[0], }; } else { len = type.checkArgumentCount(args, 1, 7); } int year = RubyNumeric.fix2int(args[0]); int month = 0; if (len > 1) { if (!args[1].isNil()) { if (args[1] instanceof RubyString) { month = -1; for (int i = 0; i < 12; i++) { if (months[i].equalsIgnoreCase(args[1].toString())) { month = i; } } if (month == -1) { try { month = Integer.parseInt(args[1].toString()) - 1; } catch (NumberFormatException nfExcptn) { throw new ArgumentError(type.getRuntime(), "Argument out of range."); } } } else { month = RubyNumeric.fix2int(args[1]) - 1; } } if (0 > month || month > 11) { throw new ArgumentError(type.getRuntime(), "Argument out of range."); } } int[] int_args = { 1, 0, 0, 0, 0 }; for (int i = 0; len > i + 2; i++) { if (!args[i + 2].isNil()) { int_args[i] = RubyNumeric.fix2int(args[i + 2]); if (time_min[i] > int_args[i] || int_args[i] > time_max[i]) { throw new ArgumentError(type.getRuntime(), "Argument out of range."); } } } RubyTime time = new RubyTime(type.getRuntime(), (RubyClass) type); if (gmt) { time.cal = Calendar.getInstance(TimeZone.getTimeZone(UTC)); } else { time.cal = Calendar.getInstance(); } time.cal.set(year, month, int_args[0], int_args[1], int_args[2], int_args[3]); time.cal.set(Calendar.MILLISECOND, int_args[4] / 1000); time.usec = int_args[4] % 1000; time.callInit(args); return time; }
3,228,624
public static RubyClass createTimeClass(Ruby runtime) { RubyClass rubyTimeClass = runtime.defineClass("Time", runtime.getClasses().getObjectClass()); CallbackFactory callbackFactory = runtime.callbackFactory(); rubyTimeClass.defineSingletonMethod("new", callbackFactory.getSingletonMethod(RubyTime.class, "s_new")); rubyTimeClass.defineSingletonMethod("now", callbackFactory.getSingletonMethod(RubyTime.class, "s_new")); rubyTimeClass.defineSingletonMethod("at", callbackFactory.getOptSingletonMethod(RubyTime.class, "new_at")); rubyTimeClass.defineSingletonMethod("local", callbackFactory.getOptSingletonMethod(RubyTime.class, "new_local")); rubyTimeClass.defineSingletonMethod("mktime", callbackFactory.getOptSingletonMethod(RubyTime.class, "new_local")); rubyTimeClass.defineSingletonMethod("utc", callbackFactory.getOptSingletonMethod(RubyTime.class, "new_utc")); rubyTimeClass.defineSingletonMethod("gm", callbackFactory.getOptSingletonMethod(RubyTime.class, "new_utc")); rubyTimeClass.defineMethod("<=>", callbackFactory.getMethod(RubyTime.class, "op_cmp", IRubyObject.class)); rubyTimeClass.defineMethod("-", callbackFactory.getMethod(RubyTime.class, "op_minus", IRubyObject.class)); rubyTimeClass.defineMethod("+", callbackFactory.getMethod(RubyTime.class, "op_plus", IRubyObject.class)); rubyTimeClass.defineMethod("sec", callbackFactory.getMethod(RubyTime.class, "sec")); rubyTimeClass.defineMethod("min", callbackFactory.getMethod(RubyTime.class, "min")); rubyTimeClass.defineMethod("hour", callbackFactory.getMethod(RubyTime.class, "hour")); rubyTimeClass.defineMethod("mday", callbackFactory.getMethod(RubyTime.class, "mday")); rubyTimeClass.defineMethod("day", callbackFactory.getMethod(RubyTime.class, "mday")); rubyTimeClass.defineMethod("month", callbackFactory.getMethod(RubyTime.class, "month")); rubyTimeClass.defineMethod("mon", callbackFactory.getMethod(RubyTime.class, "month")); rubyTimeClass.defineMethod("year", callbackFactory.getMethod(RubyTime.class, "year")); rubyTimeClass.defineMethod("wday", callbackFactory.getMethod(RubyTime.class, "wday")); rubyTimeClass.defineMethod("yday", callbackFactory.getMethod(RubyTime.class, "yday")); rubyTimeClass.defineMethod("isdst", callbackFactory.getMethod(RubyTime.class, "isdst")); rubyTimeClass.defineMethod("zone", callbackFactory.getMethod(RubyTime.class, "zone")); rubyTimeClass.defineMethod("to_a", callbackFactory.getMethod(RubyTime.class, "to_a")); rubyTimeClass.defineMethod("to_f", callbackFactory.getMethod(RubyTime.class, "to_f")); rubyTimeClass.defineMethod("asctime", callbackFactory.getMethod(RubyTime.class, "asctime")); rubyTimeClass.defineMethod("ctime", callbackFactory.getMethod(RubyTime.class, "asctime")); rubyTimeClass.defineMethod("to_s", callbackFactory.getMethod(RubyTime.class, "to_s")); rubyTimeClass.defineMethod("inspect", callbackFactory.getMethod(RubyTime.class, "inspect")); rubyTimeClass.defineMethod("strftime", callbackFactory.getMethod(RubyTime.class, "strftime", IRubyObject.class)); rubyTimeClass.defineMethod("usec", callbackFactory.getMethod(RubyTime.class, "usec")); rubyTimeClass.defineMethod("tv_usec", callbackFactory.getMethod(RubyTime.class, "usec")); rubyTimeClass.defineMethod("to_i", callbackFactory.getMethod(RubyTime.class, "to_i")); rubyTimeClass.defineMethod("tv_sec", callbackFactory.getMethod(RubyTime.class, "to_i")); rubyTimeClass.defineMethod("gmtime", callbackFactory.getMethod(RubyTime.class, "gmtime")); rubyTimeClass.defineMethod("utc", callbackFactory.getMethod(RubyTime.class, "gmtime")); rubyTimeClass.defineMethod("gmt?", callbackFactory.getMethod(RubyTime.class, "gmt")); rubyTimeClass.defineMethod("gmtime?", callbackFactory.getMethod(RubyTime.class, "gmt")); rubyTimeClass.defineMethod("utc?", callbackFactory.getMethod(RubyTime.class, "gmt")); rubyTimeClass.defineMethod("localtime", callbackFactory.getMethod(RubyTime.class, "localtime")); rubyTimeClass.defineMethod("hash", callbackFactory.getMethod(RubyTime.class, "hash")); return rubyTimeClass; }
public static RubyClass createTimeClass(Ruby runtime) { RubyClass rubyTimeClass = runtime.defineClass("Time", runtime.getClasses().getObjectClass()); CallbackFactory callbackFactory = runtime.callbackFactory(); rubyTimeClass.defineSingletonMethod("new", callbackFactory.getSingletonMethod(RubyTime.class, "s_new")); rubyTimeClass.defineSingletonMethod("now", callbackFactory.getSingletonMethod(RubyTime.class, "s_new")); rubyTimeClass.defineSingletonMethod("at", callbackFactory.getOptSingletonMethod(RubyTime.class, "new_at")); rubyTimeClass.defineSingletonMethod("local", callbackFactory.getOptSingletonMethod(RubyTime.class, "new_local")); rubyTimeClass.defineSingletonMethod("mktime", callbackFactory.getOptSingletonMethod(RubyTime.class, "new_local")); rubyTimeClass.defineSingletonMethod("utc", callbackFactory.getOptSingletonMethod(RubyTime.class, "new_utc")); rubyTimeClass.defineSingletonMethod("gm", callbackFactory.getOptSingletonMethod(RubyTime.class, "new_utc")); rubyTimeClass.defineMethod("<=>", callbackFactory.getMethod(RubyTime.class, "op_cmp", IRubyObject.class)); rubyTimeClass.defineMethod("-", callbackFactory.getMethod(RubyTime.class, "op_minus", IRubyObject.class)); rubyTimeClass.defineMethod("+", callbackFactory.getMethod(RubyTime.class, "op_plus", IRubyObject.class)); rubyTimeClass.defineMethod("sec", callbackFactory.getMethod(RubyTime.class, "sec")); rubyTimeClass.defineMethod("min", callbackFactory.getMethod(RubyTime.class, "min")); rubyTimeClass.defineMethod("hour", callbackFactory.getMethod(RubyTime.class, "hour")); rubyTimeClass.defineMethod("mday", callbackFactory.getMethod(RubyTime.class, "mday")); rubyTimeClass.defineMethod("day", callbackFactory.getMethod(RubyTime.class, "mday")); rubyTimeClass.defineMethod("month", callbackFactory.getMethod(RubyTime.class, "month")); rubyTimeClass.defineMethod("mon", callbackFactory.getMethod(RubyTime.class, "month")); rubyTimeClass.defineMethod("year", callbackFactory.getMethod(RubyTime.class, "year")); rubyTimeClass.defineMethod("wday", callbackFactory.getMethod(RubyTime.class, "wday")); rubyTimeClass.defineMethod("yday", callbackFactory.getMethod(RubyTime.class, "yday")); rubyTimeClass.defineMethod("isdst", callbackFactory.getMethod(RubyTime.class, "isdst")); rubyTimeClass.defineMethod("zone", callbackFactory.getMethod(RubyTime.class, "zone")); rubyTimeClass.defineMethod("to_a", callbackFactory.getMethod(RubyTime.class, "to_a")); rubyTimeClass.defineMethod("to_f", callbackFactory.getMethod(RubyTime.class, "to_f")); rubyTimeClass.defineMethod("asctime", callbackFactory.getMethod(RubyTime.class, "asctime")); rubyTimeClass.defineMethod("ctime", callbackFactory.getMethod(RubyTime.class, "asctime")); rubyTimeClass.defineMethod("to_s", callbackFactory.getMethod(RubyTime.class, "to_s")); rubyTimeClass.defineMethod("inspect", callbackFactory.getMethod(RubyTime.class, "inspect")); rubyTimeClass.defineMethod("strftime", callbackFactory.getMethod(RubyTime.class, "strftime", IRubyObject.class)); rubyTimeClass.defineMethod("usec", callbackFactory.getMethod(RubyTime.class, "usec")); rubyTimeClass.defineMethod("tv_usec", callbackFactory.getMethod(RubyTime.class, "usec")); rubyTimeClass.defineMethod("to_i", callbackFactory.getMethod(RubyTime.class, "to_i")); rubyTimeClass.defineMethod("tv_sec", callbackFactory.getMethod(RubyTime.class, "to_i")); rubyTimeClass.defineMethod("gmtime", callbackFactory.getMethod(RubyTime.class, "gmtime")); rubyTimeClass.defineMethod("utc", callbackFactory.getMethod(RubyTime.class, "gmtime")); rubyTimeClass.defineMethod("gmt?", callbackFactory.getMethod(RubyTime.class, "gmt")); rubyTimeClass.defineMethod("gmtime?", callbackFactory.getMethod(RubyTime.class, "gmt")); rubyTimeClass.defineMethod("utc?", callbackFactory.getMethod(RubyTime.class, "gmt")); rubyTimeClass.defineMethod("localtime", callbackFactory.getMethod(RubyTime.class, "localtime")); rubyTimeClass.defineMethod("hash", callbackFactory.getMethod(RubyTime.class, "hash")); return rubyTimeClass; }
3,228,625
public RubyBoolean gmt() { return RubyBoolean.newBoolean(runtime, cal.getTimeZone().getID().equals("GMT")); }
public RubyBoolean gmt() { return RubyBoolean.newBoolean(runtime, cal.getTimeZone().getID().equals(UTC)); }
3,228,626
public RubyTime gmtime() { cal.setTimeZone(TimeZone.getTimeZone("GMT")); return this; }
public RubyTime gmtime() { cal.setTimeZone(TimeZone.getTimeZone(UTC)); return this; }
3,228,627
public RubyFixnum hash() { return RubyFixnum.newFixnum(runtime, (int)(cal.get(Calendar.SECOND) ^ usec)); }
public RubyFixnum hash() { return RubyFixnum.newFixnum(runtime, (int)(((cal.getTimeInMillis() / 1000) ^ microseconds()) << 1) >> 1); }
3,228,628
public RubyFloat to_f() { return RubyFloat.newFloat(runtime, getTimeInMillis() / 1000.0); }
public RubyFloat to_f() { return RubyFloat.newFloat(runtime, getTimeInMillis() / 1000 + microseconds() / 1000000.0); }
3,228,629
public RubyInteger usec() { return RubyFixnum.newFixnum(runtime, getTimeInMillis() % 1000 * 1000 + usec); }
public RubyInteger usec() { return RubyFixnum.newFixnum(runtime, microseconds()); }
3,228,630
TreePopupMenuMng(TreePopupMenu view, ClipBoardUI clipBoard) { if (view == null) throw new IllegalArgumentException("No view."); if (clipBoard == null) throw new IllegalArgumentException("No clipBoard."); this.clipBoard = clipBoard; attachItemListener(view.properties, PROPERTIES); attachItemListener(view.annotate, ANNOTATE); attachItemListener(view.classify, CLASSIFY); attachItemListener(view.declassify, DECLASSIFY); attachItemListener(view.view, VIEW); }
TreePopupMenuMng(TreePopupMenu view, ClipBoardUI clipBoard, ClipBoardModel model) { if (view == null) throw new IllegalArgumentException("No view."); if (clipBoard == null) throw new IllegalArgumentException("No clipBoard."); this.clipBoard = clipBoard; attachItemListener(view.properties, PROPERTIES); attachItemListener(view.annotate, ANNOTATE); attachItemListener(view.classify, CLASSIFY); attachItemListener(view.declassify, DECLASSIFY); attachItemListener(view.view, VIEW); }
3,228,631
TreePopupMenuMng(TreePopupMenu view, ClipBoardUI clipBoard) { if (view == null) throw new IllegalArgumentException("No view."); if (clipBoard == null) throw new IllegalArgumentException("No clipBoard."); this.clipBoard = clipBoard; attachItemListener(view.properties, PROPERTIES); attachItemListener(view.annotate, ANNOTATE); attachItemListener(view.classify, CLASSIFY); attachItemListener(view.declassify, DECLASSIFY); attachItemListener(view.view, VIEW); }
TreePopupMenuMng(TreePopupMenu view, ClipBoardUI clipBoard) { if (view == null) throw new IllegalArgumentException("No view."); if (clipBoard == null) throw new IllegalArgumentException("No clipBoard."); this.clipBoard = clipBoard; attachItemListener(view.properties, PROPERTIES); attachItemListener(view.classify, CLASSIFY); attachItemListener(view.declassify, DECLASSIFY); attachItemListener(view.view, VIEW); }
3,228,632
public void actionPerformed(ActionEvent e) { int index = -1; DataObject object; try { index = Integer.parseInt(e.getActionCommand()); object = clipBoard.getDataObject(); switch (index) { case PROPERTIES: if (object != null) new PropertiesCmd(object).execute(); break; case ANNOTATE: if (object != null) new AnnotateCmd(object).execute(); break; case CLASSIFY: if (object instanceof ImageData) { ClassifyCmd cmd = new ClassifyCmd((ImageData) object, Classifier.CLASSIFICATION_MODE, null); cmd.execute(); } break; case DECLASSIFY: if (object instanceof ImageData) { ClassifyCmd cmd = new ClassifyCmd((ImageData) object, Classifier.DECLASSIFICATION_MODE, null); cmd.execute(); } break; case VIEW: if (object != null) new ViewCmd(object).execute(); break; } } catch(NumberFormatException nfe) { throw new Error("Invalid Action ID "+index, nfe); } }
public void actionPerformed(ActionEvent e) { int index = -1; DataObject object; try { index = Integer.parseInt(e.getActionCommand()); object = clipBoard.getDataObject(); switch (index) { case PROPERTIES: if (object != null) new PropertiesCmd(object).execute(); break; case ANNOTATE: if (object != null) { AnnotateCmd cmd = new AnnotateCmd(model.getParentModel(), clipBoard.getSelectedNode()); cmd.execute(); } break; case CLASSIFY: if (object instanceof ImageData) { ClassifyCmd cmd = new ClassifyCmd((ImageData) object, Classifier.CLASSIFICATION_MODE, null); cmd.execute(); } break; case DECLASSIFY: if (object instanceof ImageData) { ClassifyCmd cmd = new ClassifyCmd((ImageData) object, Classifier.DECLASSIFICATION_MODE, null); cmd.execute(); } break; case VIEW: if (object != null) new ViewCmd(object).execute(); break; } } catch(NumberFormatException nfe) { throw new Error("Invalid Action ID "+index, nfe); } }
3,228,634
public void execute() { if (model != null) { ImageDisplay selectedDisplay = model.getBrowser(). getSelectedDisplay(); hierarchyObject = (DataObject) selectedDisplay.getHierarchyObject(); } if (hierarchyObject == null) return; //post a show properties event. model.moveToBack(); //move the window to the back. EventBus eventBus = HiViewerAgent.getRegistry().getEventBus(); eventBus.post(new ShowProperties(hierarchyObject, ShowProperties.EDIT)); }
public void execute() { if (model != null && hierarchyObject == null) { ImageDisplay selectedDisplay = model.getBrowser(). getSelectedDisplay(); hierarchyObject = (DataObject) selectedDisplay.getHierarchyObject(); } if (hierarchyObject == null) return; //post a show properties event. model.moveToBack(); //move the window to the back. EventBus eventBus = HiViewerAgent.getRegistry().getEventBus(); eventBus.post(new ShowProperties(hierarchyObject, ShowProperties.EDIT)); }
3,228,635
public void execute() { if (model != null) { ImageDisplay selectedDisplay = model.getBrowser(). getSelectedDisplay(); hierarchyObject = (DataObject) selectedDisplay.getHierarchyObject(); } if (hierarchyObject == null) return; //post a show properties event. model.moveToBack(); //move the window to the back. EventBus eventBus = HiViewerAgent.getRegistry().getEventBus(); eventBus.post(new ShowProperties(hierarchyObject, ShowProperties.EDIT)); }
public void execute() { if (model != null) { ImageDisplay selectedDisplay = model.getBrowser(). getSelectedDisplay(); hierarchyObject = (DataObject) selectedDisplay.getHierarchyObject(); } if (hierarchyObject == null) return; //post a show properties event. if (model != null) model.moveToBack(); //move the window to the back. EventBus eventBus = HiViewerAgent.getRegistry().getEventBus(); eventBus.post(new ShowProperties(hierarchyObject, ShowProperties.EDIT)); }
3,228,636
public static String getVersion() { return "1.1.9.2"; }
public static String getVersion() { return "1.1.9.3"; }
3,228,638
ColorChooserManager(ColorChooser view, HSBPaneManager hsbManager, int[] rgba, int alpha, int index) { this.view = view; this.hsbManager = hsbManager; this.alpha = alpha; this.rgba = rgba; this.index = index; initColor(); }
ColorChooserManager(ColorChooser view, HSBPaneManager hsbManager, int[] rgba, int alpha, int index) { this.view = view; this.hsbManager = hsbManager; this.alpha = alpha; this.rgba = rgba; this.index = index; initColor(); }
3,228,639
ColorChooserManager(ColorChooser view, HSBPaneManager hsbManager, int[] rgba, int alpha, int index) { this.view = view; this.hsbManager = hsbManager; this.alpha = alpha; this.rgba = rgba; this.index = index; initColor(); }
ColorChooserManager(ColorChooser view, HSBPaneManager hsbManager, int[] rgba, int alpha, int index) { this.view = view; this.hsbManager = hsbManager; this.alpha = alpha; this.rgba = rgba; this.index = index; initColor(); }
3,228,640
public void copy(IObject model, ModelMapper mapper) { if (model instanceof Dataset) { Dataset d = (Dataset) model; super.copy(model,mapper); // Details if (d.getDetails() != null){ Details details = d.getDetails(); this.setOwner((ExperimenterData)mapper.findTarget( details.getOwner())); if ( details.getCounts() != null ) { Object annotationCount = details.getCounts().get( Dataset.ANNOTATIONS ); if ( annotationCount instanceof Integer ) this.setAnnotationCount( (Integer) annotationCount ); } } // Fields this.setName(d.getName()); this.setDescription(d.getDescription()); // Collections MapperBlock block = new MapperBlock( mapper ); setImages( new HashSet( d.eachLinkedImage( block ))); setProjects( new HashSet( d.eachLinkedProject( block ))); setAnnotations( new HashSet( d.collectAnnotations( block ))); } else { throw new IllegalArgumentException( "DatasetData can only copy from Dataset"); } }
public void copy(IObject model, ModelMapper mapper) { if (model instanceof Dataset) { Dataset d = (Dataset) model; super.copy(model,mapper); // Details if (d.getDetails() != null){ Details details = d.getDetails(); this.setOwner((ExperimenterData)mapper.findTarget( details.getOwner())); if ( details.getCounts() != null ) { Object annotationCount = details.getCounts().get( Dataset.ANNOTATIONS ); if ( annotationCount instanceof Integer ) this.setAnnotationCount( (Integer) annotationCount ); } } // Fields this.setName(d.getName()); this.setDescription(d.getDescription()); // Collections MapperBlock block = new MapperBlock( mapper ); setImages( new HashSet( d.eachLinkedImage( block ))); setProjects( new HashSet( d.eachLinkedProject( block ))); setAnnotations( new HashSet( d.collectAnnotations( block ))); } else { throw new IllegalArgumentException( "DatasetData can only copy from Dataset"); } }
3,228,641
public DatasetAnnotation(Integer attributeId, String content, Boolean valid, org.openmicroscopy.omero.model.Dataset dataset, org.openmicroscopy.omero.model.ModuleExecution moduleExecution) { this.attributeId = attributeId; this.content = content; this.valid = valid; this.dataset = dataset; this.moduleExecution = moduleExecution; }
public DatasetAnnotation(Integer attributeId, String content, Boolean valid, org.openmicroscopy.omero.model.Dataset dataset, org.openmicroscopy.omero.model.ModuleExecution moduleExecution) { this.attributeId = attributeId; this.content = content; this.valid = valid; this.dataset = dataset; this.moduleExecution = moduleExecution; }
3,228,644
public org.openmicroscopy.omero.model.Dataset getDataset() { return this.dataset; }
public Dataset getDataset() { return this.dataset; }
3,228,645
public org.openmicroscopy.omero.model.ModuleExecution getModuleExecution() { return this.moduleExecution; }
public ModuleExecution getModuleExecution() { return this.moduleExecution; }
3,228,646
public void setDataset(org.openmicroscopy.omero.model.Dataset dataset) { this.dataset = dataset; }
public void setDataset(Dataset dataset) { this.dataset = dataset; }
3,228,647
public void setModuleExecution(org.openmicroscopy.omero.model.ModuleExecution moduleExecution) { this.moduleExecution = moduleExecution; }
public void setModuleExecution(ModuleExecution moduleExecution) { this.moduleExecution = moduleExecution; }
3,228,648
private static IRubyObject evalInternal(ThreadContext context, Node node, IRubyObject self) { IRuby runtime = context.getRuntime(); bigloop: do { if (node == null) return runtime.getNil(); switch (node.nodeId) { case NodeTypes.ALIASNODE: { AliasNode iVisited = (AliasNode) node; if (context.getRubyClass() == null) { throw runtime.newTypeError("no class to make alias"); } context.getRubyClass().defineAlias(iVisited.getNewName(), iVisited.getOldName()); context.getRubyClass().callMethod(context, "method_added", runtime.newSymbol(iVisited.getNewName())); return runtime.getNil(); } case NodeTypes.ANDNODE: { BinaryOperatorNode iVisited = (BinaryOperatorNode) node; IRubyObject result = evalInternal(context, iVisited.getFirstNode(), self); if (!result.isTrue()) return result; node = iVisited.getSecondNode(); continue bigloop; } case NodeTypes.ARGSCATNODE: { ArgsCatNode iVisited = (ArgsCatNode) node; IRubyObject args = evalInternal(context, iVisited.getFirstNode(), self); IRubyObject secondArgs = splatValue(evalInternal(context, iVisited.getSecondNode(), self)); RubyArray list = args instanceof RubyArray ? (RubyArray) args : runtime.newArray(args); return list.concat(secondArgs); } // case NodeTypes.ARGSNODE: // EvaluateVisitor.argsNodeVisitor.execute(this, node); // break; // case NodeTypes.ARGUMENTNODE: // EvaluateVisitor.argumentNodeVisitor.execute(this, node); // break; case NodeTypes.ARRAYNODE: { ArrayNode iVisited = (ArrayNode) node; IRubyObject[] array = new IRubyObject[iVisited.size()]; int i = 0; for (Iterator iterator = iVisited.iterator(); iterator.hasNext();) { Node next = (Node) iterator.next(); array[i++] = evalInternal(context, next, self); } return runtime.newArray(array); } // case NodeTypes.ASSIGNABLENODE: // EvaluateVisitor.assignableNodeVisitor.execute(this, node); // break; case NodeTypes.BACKREFNODE: { BackRefNode iVisited = (BackRefNode) node; IRubyObject backref = context.getBackref(); switch (iVisited.getType()) { case '~': return backref; case '&': return RubyRegexp.last_match(backref); case '`': return RubyRegexp.match_pre(backref); case '\'': return RubyRegexp.match_post(backref); case '+': return RubyRegexp.match_last(backref); } break; } case NodeTypes.BEGINNODE: { BeginNode iVisited = (BeginNode) node; node = iVisited.getBodyNode(); continue bigloop; } case NodeTypes.BIGNUMNODE: { BignumNode iVisited = (BignumNode) node; return RubyBignum.newBignum(runtime, iVisited.getValue()); } // case NodeTypes.BINARYOPERATORNODE: // EvaluateVisitor.binaryOperatorNodeVisitor.execute(this, node); // break; // case NodeTypes.BLOCKARGNODE: // EvaluateVisitor.blockArgNodeVisitor.execute(this, node); // break; case NodeTypes.BLOCKNODE: { BlockNode iVisited = (BlockNode) node; IRubyObject result = runtime.getNil(); for (Iterator iter = iVisited.iterator(); iter.hasNext();) { result = evalInternal(context, (Node) iter.next(), self); } return result; } case NodeTypes.BLOCKPASSNODE: { BlockPassNode iVisited = (BlockPassNode) node; IRubyObject proc = evalInternal(context, iVisited.getBodyNode(), self); if (proc.isNil()) { context.setNoBlock(); try { return evalInternal(context, iVisited.getIterNode(), self); } finally { context.clearNoBlock(); } } // If not already a proc then we should try and make it one. if (!(proc instanceof RubyProc)) { proc = proc.convertToType("Proc", "to_proc", false); if (!(proc instanceof RubyProc)) { throw runtime.newTypeError("wrong argument type " + proc.getMetaClass().getName() + " (expected Proc)"); } } // TODO: Add safety check for taintedness Block block = (Block) context.getCurrentBlock(); if (block != null) { IRubyObject blockObject = block.getBlockObject(); // The current block is already associated with the proc. No need to create new // block for it. Just eval! if (blockObject != null && blockObject == proc) { try { context.setBlockAvailable(); return evalInternal(context, iVisited.getIterNode(), self); } finally { context.clearBlockAvailable(); } } } context.preBlockPassEval(((RubyProc) proc).getBlock()); try { return evalInternal(context, iVisited.getIterNode(), self); } finally { context.postBlockPassEval(); } } case NodeTypes.BREAKNODE: { BreakNode iVisited = (BreakNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); JumpException je = new JumpException(JumpException.JumpType.BreakJump); je.setPrimaryData(result); je.setSecondaryData(node); throw je; } case NodeTypes.CALLNODE: { CallNode iVisited = (CallNode) node; context.beginCallArgs(); IRubyObject receiver = null; IRubyObject[] args = null; try { receiver = evalInternal(context, iVisited.getReceiverNode(), self); args = setupArgs(context, iVisited.getArgsNode(), self); } finally { context.endCallArgs(); } assert receiver.getMetaClass() != null : receiver.getClass().getName(); // If reciever is self then we do the call the same way as vcall CallType callType = (receiver == self ? CallType.VARIABLE : CallType.NORMAL); return receiver.callMethod(context, iVisited.getName(), args, callType); } case NodeTypes.CASENODE: { CaseNode iVisited = (CaseNode) node; IRubyObject expression = null; if (iVisited.getCaseNode() != null) { expression = evalInternal(context, iVisited.getCaseNode(), self); } context.pollThreadEvents(); IRubyObject result = runtime.getNil(); Node firstWhenNode = iVisited.getFirstWhenNode(); while (firstWhenNode != null) { if (!(firstWhenNode instanceof WhenNode)) { node = firstWhenNode; continue bigloop; } WhenNode whenNode = (WhenNode) firstWhenNode; if (whenNode.getExpressionNodes() instanceof ArrayNode) { for (Iterator iter = ((ArrayNode) whenNode.getExpressionNodes()).iterator(); iter .hasNext();) { Node tag = (Node) iter.next(); context.setPosition(tag.getPosition()); if (isTrace(runtime)) { callTraceFunction(context, "line", self); } // Ruby grammar has nested whens in a case body because of // productions case_body and when_args. if (tag instanceof WhenNode) { RubyArray expressions = (RubyArray) evalInternal(context, ((WhenNode) tag) .getExpressionNodes(), self); for (int j = 0; j < expressions.getLength(); j++) { IRubyObject condition = expressions.entry(j); if ((expression != null && condition.callMethod(context, "===", expression) .isTrue()) || (expression == null && condition.isTrue())) { node = ((WhenNode) firstWhenNode).getBodyNode(); continue bigloop; } } continue; } result = evalInternal(context, tag, self); if ((expression != null && result.callMethod(context, "===", expression).isTrue()) || (expression == null && result.isTrue())) { node = whenNode.getBodyNode(); continue bigloop; } } } else { result = evalInternal(context, whenNode.getExpressionNodes(), self); if ((expression != null && result.callMethod(context, "===", expression).isTrue()) || (expression == null && result.isTrue())) { node = ((WhenNode) firstWhenNode).getBodyNode(); continue bigloop; } } context.pollThreadEvents(); firstWhenNode = whenNode.getNextCase(); } return runtime.getNil(); } case NodeTypes.CLASSNODE: { ClassNode iVisited = (ClassNode) node; Node superNode = iVisited.getSuperNode(); RubyClass superClass = superNode == null ? null : (RubyClass) evalInternal(context, superNode, self); Node classNameNode = iVisited.getCPath(); String name = ((INameNode) classNameNode).getName(); RubyModule enclosingClass = getEnclosingModule(context, classNameNode, self); RubyClass rubyClass = enclosingClass.defineOrGetClassUnder(name, superClass); if (context.getWrapper() != null) { rubyClass.extendObject(context.getWrapper()); rubyClass.includeModule(context.getWrapper()); } return evalClassDefinitionBody(context, iVisited.getScope(), iVisited.getBodyNode(), rubyClass, self); } case NodeTypes.CLASSVARASGNNODE: { ClassVarAsgnNode iVisited = (ClassVarAsgnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); RubyModule rubyClass = (RubyModule) context.peekCRef().getValue(); if (rubyClass == null) { rubyClass = self.getMetaClass(); } else if (rubyClass.isSingleton()) { rubyClass = (RubyModule) rubyClass.getInstanceVariable("__attached__"); } rubyClass.setClassVar(iVisited.getName(), result); return result; } case NodeTypes.CLASSVARDECLNODE: { ClassVarDeclNode iVisited = (ClassVarDeclNode) node; // FIXME: shouldn't we use cref here? if (context.getRubyClass() == null) { throw runtime.newTypeError("no class/module to define class variable"); } IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); ((RubyModule) context.peekCRef().getValue()).setClassVar(iVisited.getName(), result); return runtime.getNil(); } case NodeTypes.CLASSVARNODE: { ClassVarNode iVisited = (ClassVarNode) node; RubyModule rubyClass = (RubyModule) context.peekCRef().getValue(); if (rubyClass == null) { rubyClass = self.getMetaClass(); } else if (rubyClass.isSingleton()) { rubyClass = (RubyModule)rubyClass.getInstanceVariable("__attached__"); } return rubyClass.getClassVar(iVisited.getName()); } case NodeTypes.COLON2NODE: { Colon2Node iVisited = (Colon2Node) node; Node leftNode = iVisited.getLeftNode(); // TODO: Made this more colon3 friendly because of cpath production // rule in grammar (it is convenient to think of them as the same thing // at a grammar level even though evaluation is). if (leftNode == null) { return runtime.getObject().getConstantFrom(iVisited.getName()); } else { IRubyObject result = evalInternal(context, iVisited.getLeftNode(), self); if (result instanceof RubyModule) { return ((RubyModule) result).getConstantFrom(iVisited.getName()); } else { return result.callMethod(context, iVisited.getName()); } } } case NodeTypes.COLON3NODE: { Colon3Node iVisited = (Colon3Node) node; return runtime.getObject().getConstantFrom(iVisited.getName()); } case NodeTypes.CONSTDECLNODE: { ConstDeclNode iVisited = (ConstDeclNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); IRubyObject module; if (iVisited.getPathNode() != null) { module = evalInternal(context, iVisited.getPathNode(), self); } else { // FIXME: why do we check RubyClass and then use CRef? if (context.getRubyClass() == null) { // TODO: wire into new exception handling mechanism throw runtime.newTypeError("no class/module to define constant"); } module = (RubyModule) context.peekCRef().getValue(); } // FIXME: shouldn't we use the result of this set in setResult? ((RubyModule) module).setConstant(iVisited.getName(), result); return result; } case NodeTypes.CONSTNODE: { ConstNode iVisited = (ConstNode) node; return context.getConstant(iVisited.getName()); } case NodeTypes.DASGNNODE: { DAsgnNode iVisited = (DAsgnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); // System.out.println("DSetting: " + iVisited.getName() + " at index " + iVisited.getIndex() + " and at depth " + iVisited.getDepth() + " and set " + result); context.getCurrentScope().setValue(iVisited.getIndex(), result, iVisited.getDepth()); return result; } case NodeTypes.DEFINEDNODE: { DefinedNode iVisited = (DefinedNode) node; String definition = getDefinition(context, iVisited.getExpressionNode(), self); if (definition != null) { return runtime.newString(definition); } else { return runtime.getNil(); } } case NodeTypes.DEFNNODE: { DefnNode iVisited = (DefnNode) node; RubyModule containingClass = context.getRubyClass(); if (containingClass == null) { throw runtime.newTypeError("No class to add method."); } String name = iVisited.getName(); if (containingClass == runtime.getObject() && name.equals("initialize")) { runtime.getWarnings().warn("redefining Object#initialize may cause infinite loop"); } Visibility visibility = context.getCurrentVisibility(); if (name.equals("initialize") || visibility.isModuleFunction()) { visibility = Visibility.PRIVATE; } DefaultMethod newMethod = new DefaultMethod(containingClass, iVisited.getScope(), iVisited.getBodyNode(), (ArgsNode) iVisited.getArgsNode(), visibility, context.peekCRef()); if (iVisited.getBodyNode() != null) { iVisited.getBodyNode().accept(new CreateJumpTargetVisitor(newMethod)); } containingClass.addMethod(name, newMethod); if (context.getCurrentVisibility().isModuleFunction()) { containingClass.getSingletonClass().addMethod( name, new WrapperCallable(containingClass.getSingletonClass(), newMethod, Visibility.PUBLIC)); containingClass.callMethod(context, "singleton_method_added", runtime.newSymbol(name)); } // 'class << state.self' and 'class << obj' uses defn as opposed to defs if (containingClass.isSingleton()) { ((MetaClass) containingClass).getAttachedObject().callMethod( context, "singleton_method_added", runtime.newSymbol(iVisited.getName())); } else { containingClass.callMethod(context, "method_added", runtime.newSymbol(name)); } return runtime.getNil(); } case NodeTypes.DEFSNODE: { DefsNode iVisited = (DefsNode) node; IRubyObject receiver = evalInternal(context, iVisited.getReceiverNode(), self); RubyClass rubyClass; if (receiver.isNil()) { rubyClass = runtime.getNilClass(); } else if (receiver == runtime.getTrue()) { rubyClass = runtime.getClass("TrueClass"); } else if (receiver == runtime.getFalse()) { rubyClass = runtime.getClass("FalseClass"); } else { if (runtime.getSafeLevel() >= 4 && !receiver.isTaint()) { throw runtime.newSecurityError("Insecure; can't define singleton method."); } if (receiver.isFrozen()) { throw runtime.newFrozenError("object"); } if (!receiver.singletonMethodsAllowed()) { throw runtime.newTypeError("can't define singleton method \"" + iVisited.getName() + "\" for " + receiver.getType()); } rubyClass = receiver.getSingletonClass(); } if (runtime.getSafeLevel() >= 4) { ICallable method = (ICallable) rubyClass.getMethods().get(iVisited.getName()); if (method != null) { throw runtime.newSecurityError("Redefining method prohibited."); } } DefaultMethod newMethod = new DefaultMethod(rubyClass, iVisited.getScope(), iVisited.getBodyNode(), (ArgsNode) iVisited.getArgsNode(), Visibility.PUBLIC, context.peekCRef()); if (iVisited.getBodyNode() != null) { iVisited.getBodyNode().accept(new CreateJumpTargetVisitor(newMethod)); } rubyClass.addMethod(iVisited.getName(), newMethod); receiver.callMethod(context, "singleton_method_added", runtime.newSymbol(iVisited.getName())); return runtime.getNil(); } case NodeTypes.DOTNODE: { DotNode iVisited = (DotNode) node; return RubyRange.newRange(runtime, evalInternal(context, iVisited.getBeginNode(), self), evalInternal(context, iVisited .getEndNode(), self), iVisited.isExclusive()); } case NodeTypes.DREGEXPNODE: { DRegexpNode iVisited = (DRegexpNode) node; StringBuffer sb = new StringBuffer(); for (Iterator iterator = iVisited.iterator(); iterator.hasNext();) { Node iterNode = (Node) iterator.next(); sb.append(evalInternal(context, iterNode, self).toString()); } String lang = null; int opts = iVisited.getOptions(); if((opts & 16) != 0) { // param n lang = "n"; } else if((opts & 48) != 0) { // param s lang = "s"; } else if((opts & 64) != 0) { // param s lang = "u"; } return RubyRegexp.newRegexp(runtime, sb.toString(), iVisited.getOptions(), lang); } case NodeTypes.DSTRNODE: { DStrNode iVisited = (DStrNode) node; StringBuffer sb = new StringBuffer(); for (Iterator iterator = iVisited.iterator(); iterator.hasNext();) { Node iterNode = (Node) iterator.next(); sb.append(evalInternal(context, iterNode, self).toString()); } return runtime.newString(sb.toString()); } case NodeTypes.DSYMBOLNODE: { DSymbolNode iVisited = (DSymbolNode) node; StringBuffer sb = new StringBuffer(); for (Iterator iterator = iVisited.getNode().iterator(); iterator.hasNext();) { Node iterNode = (Node) iterator.next(); sb.append(evalInternal(context, iterNode, self).toString()); } return runtime.newSymbol(sb.toString()); } case NodeTypes.DVARNODE: { DVarNode iVisited = (DVarNode) node; // System.out.println("DGetting: " + iVisited.getName() + " at index " + iVisited.getIndex() + " and at depth " + iVisited.getDepth()); IRubyObject obj = context.getCurrentScope().getValue(iVisited.getIndex(), iVisited.getDepth()); // FIXME: null check is removable once we figure out how to assign to unset named block args return obj == null ? runtime.getNil() : obj; } case NodeTypes.DXSTRNODE: { DXStrNode iVisited = (DXStrNode) node; StringBuffer sb = new StringBuffer(); for (Iterator iterator = iVisited.iterator(); iterator.hasNext();) { Node iterNode = (Node) iterator.next(); sb.append(evalInternal(context, iterNode, self).toString()); } return self.callMethod(context, "`", runtime.newString(sb.toString())); } case NodeTypes.ENSURENODE: { EnsureNode iVisited = (EnsureNode) node; // save entering the try if there's nothing to ensure if (iVisited.getEnsureNode() != null) { IRubyObject result = runtime.getNil(); try { result = evalInternal(context, iVisited.getBodyNode(), self); } finally { evalInternal(context, iVisited.getEnsureNode(), self); } return result; } node = iVisited.getBodyNode(); continue bigloop; } case NodeTypes.EVSTRNODE: { EvStrNode iVisited = (EvStrNode) node; node = iVisited.getBody(); continue bigloop; } case NodeTypes.FALSENODE: { context.pollThreadEvents(); return runtime.getFalse(); } case NodeTypes.FCALLNODE: { FCallNode iVisited = (FCallNode) node; context.beginCallArgs(); IRubyObject[] args; try { args = setupArgs(context, iVisited.getArgsNode(), self); } finally { context.endCallArgs(); } return self.callMethod(context, iVisited.getName(), args, CallType.FUNCTIONAL); } case NodeTypes.FIXNUMNODE: { FixnumNode iVisited = (FixnumNode) node; return runtime.newFixnum(iVisited.getValue()); } case NodeTypes.FLIPNODE: { FlipNode iVisited = (FlipNode) node; IRubyObject result = runtime.getNil(); if (iVisited.isExclusive()) { if (!context.getCurrentScope().getValue(iVisited.getIndex(), iVisited.getDepth()).isTrue()) { result = evalInternal(context, iVisited.getBeginNode(), self).isTrue() ? runtime.getFalse() : runtime.getTrue(); context.getCurrentScope().setValue(iVisited.getIndex(), result, iVisited.getDepth()); return result; } else { if (evalInternal(context, iVisited.getEndNode(), self).isTrue()) { context.getCurrentScope().setValue(iVisited.getIndex(), runtime.getFalse(), iVisited.getDepth()); } return runtime.getTrue(); } } else { if (!context.getCurrentScope().getValue(iVisited.getIndex(), iVisited.getDepth()).isTrue()) { if (evalInternal(context, iVisited.getBeginNode(), self).isTrue()) { context.getCurrentScope().setValue( iVisited.getIndex(), evalInternal(context, iVisited.getEndNode(), self).isTrue() ? runtime.getFalse() : runtime.getTrue(), iVisited.getDepth()); return runtime.getTrue(); } else { return runtime.getFalse(); } } else { if (evalInternal(context, iVisited.getEndNode(), self).isTrue()) { context.getCurrentScope().setValue(iVisited.getIndex(), runtime.getFalse(), iVisited.getDepth()); } return runtime.getTrue(); } } } case NodeTypes.FLOATNODE: { FloatNode iVisited = (FloatNode) node; return RubyFloat.newFloat(runtime, iVisited.getValue()); } case NodeTypes.FORNODE: { ForNode iVisited = (ForNode) node; // For nodes do not have to create an addition scope so we just pass null context.preForLoopEval(Block.createBlock(iVisited.getVarNode(), null, iVisited.getCallable(), self)); try { while (true) { try { ISourcePosition position = context.getPosition(); context.beginCallArgs(); IRubyObject recv = null; try { recv = evalInternal(context, iVisited.getIterNode(), self); } finally { context.setPosition(position); context.endCallArgs(); } return recv.callMethod(context, "each", IRubyObject.NULL_ARRAY, CallType.NORMAL); } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.RETRY: // do nothing, allow loop to retry break; default: throw je; } } } } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.BREAK: IRubyObject breakValue = (IRubyObject) je.getPrimaryData(); return breakValue == null ? runtime.getNil() : breakValue; default: throw je; } } finally { context.postForLoopEval(); } } case NodeTypes.GLOBALASGNNODE: { GlobalAsgnNode iVisited = (GlobalAsgnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); runtime.getGlobalVariables().set(iVisited.getName(), result); return result; } case NodeTypes.GLOBALVARNODE: { GlobalVarNode iVisited = (GlobalVarNode) node; return runtime.getGlobalVariables().get(iVisited.getName()); } case NodeTypes.HASHNODE: { HashNode iVisited = (HashNode) node; Map hash = null; if (iVisited.getListNode() != null) { hash = new HashMap(iVisited.getListNode().size() / 2); for (Iterator iterator = iVisited.getListNode().iterator(); iterator.hasNext();) { // insert all nodes in sequence, hash them in the final instruction // KEY IRubyObject key = evalInternal(context, (Node) iterator.next(), self); IRubyObject value = evalInternal(context, (Node) iterator.next(), self); hash.put(key, value); } } if (hash == null) { return RubyHash.newHash(runtime); } return RubyHash.newHash(runtime, hash, runtime.getNil()); } case NodeTypes.IFNODE: { IfNode iVisited = (IfNode) node; IRubyObject result = evalInternal(context, iVisited.getCondition(), self); if (result.isTrue()) { node = iVisited.getThenBody(); continue bigloop; } else { node = iVisited.getElseBody(); continue bigloop; } } case NodeTypes.INSTASGNNODE: { InstAsgnNode iVisited = (InstAsgnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); self.setInstanceVariable(iVisited.getName(), result); return result; } case NodeTypes.INSTVARNODE: { InstVarNode iVisited = (InstVarNode) node; IRubyObject variable = self.getInstanceVariable(iVisited.getName()); return variable == null ? runtime.getNil() : variable; } // case NodeTypes.ISCOPINGNODE: // EvaluateVisitor.iScopingNodeVisitor.execute(this, node); // break; case NodeTypes.ITERNODE: { IterNode iVisited = (IterNode) node; context.preIterEval(Block.createBlock(iVisited.getVarNode(), new DynamicScope(iVisited.getScope(), context.getCurrentScope()), iVisited.getCallable(), self)); try { while (true) { try { context.setBlockAvailable(); return evalInternal(context, iVisited.getIterNode(), self); } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.RETRY: // allow loop to retry break; default: throw je; } } finally { context.clearBlockAvailable(); } } } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.BREAK: IRubyObject breakValue = (IRubyObject) je.getPrimaryData(); return breakValue == null ? runtime.getNil() : breakValue; default: throw je; } } finally { context.postIterEval(); } } case NodeTypes.LOCALASGNNODE: { LocalAsgnNode iVisited = (LocalAsgnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); // System.out.println("LSetting: " + iVisited.getName() + " at index " + iVisited.getIndex() + " and at depth " + iVisited.getDepth() + " and set " + result); context.getCurrentScope().setValue(iVisited.getIndex(), result, iVisited.getDepth()); return result; } case NodeTypes.LOCALVARNODE: { LocalVarNode iVisited = (LocalVarNode) node; //System.out.println("DGetting: " + iVisited.getName() + " at index " + iVisited.getIndex() + " and at depth " + iVisited.getDepth()); IRubyObject result = context.getCurrentScope().getValue(iVisited.getIndex(), iVisited.getDepth()); return result == null ? runtime.getNil() : result; } case NodeTypes.MATCH2NODE: { Match2Node iVisited = (Match2Node) node; IRubyObject recv = evalInternal(context, iVisited.getReceiverNode(), self); IRubyObject value = evalInternal(context, iVisited.getValueNode(), self); return ((RubyRegexp) recv).match(value); } case NodeTypes.MATCH3NODE: { Match3Node iVisited = (Match3Node) node; IRubyObject recv = evalInternal(context, iVisited.getReceiverNode(), self); IRubyObject value = evalInternal(context, iVisited.getValueNode(), self); if (value instanceof RubyString) { return ((RubyRegexp) recv).match(value); } else { return value.callMethod(context, "=~", recv); } } case NodeTypes.MATCHNODE: { MatchNode iVisited = (MatchNode) node; return ((RubyRegexp) evalInternal(context, iVisited.getRegexpNode(), self)).match2(); } case NodeTypes.MODULENODE: { ModuleNode iVisited = (ModuleNode) node; Node classNameNode = iVisited.getCPath(); String name = ((INameNode) classNameNode).getName(); RubyModule enclosingModule = getEnclosingModule(context, classNameNode, self); if (enclosingModule == null) { throw runtime.newTypeError("no outer class/module"); } RubyModule module; if (enclosingModule == runtime.getObject()) { module = runtime.getOrCreateModule(name); } else { module = enclosingModule.defineModuleUnder(name); } return evalClassDefinitionBody(context, iVisited.getScope(), iVisited.getBodyNode(), module, self); } case NodeTypes.MULTIPLEASGNNODE: { MultipleAsgnNode iVisited = (MultipleAsgnNode) node; return AssignmentVisitor.assign(context, self, iVisited, evalInternal(context, iVisited.getValueNode(), self), false); } case NodeTypes.NEWLINENODE: { NewlineNode iVisited = (NewlineNode) node; // something in here is used to build up ruby stack trace... context.setPosition(iVisited.getPosition()); if (isTrace(runtime)) { callTraceFunction(context, "line", self); } // TODO: do above but not below for additional newline nodes node = iVisited.getNextNode(); continue bigloop; } case NodeTypes.NEXTNODE: { NextNode iVisited = (NextNode) node; context.pollThreadEvents(); IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); // now used as an interpreter event JumpException je = new JumpException(JumpException.JumpType.NextJump); je.setPrimaryData(result); je.setSecondaryData(iVisited); //state.setCurrentException(je); throw je; } case NodeTypes.NILNODE: return runtime.getNil(); case NodeTypes.NOTNODE: { NotNode iVisited = (NotNode) node; IRubyObject result = evalInternal(context, iVisited.getConditionNode(), self); return result.isTrue() ? runtime.getFalse() : runtime.getTrue(); } case NodeTypes.NTHREFNODE: { NthRefNode iVisited = (NthRefNode) node; return RubyRegexp.nth_match(iVisited.getMatchNumber(), context.getBackref()); } case NodeTypes.OPASGNANDNODE: { BinaryOperatorNode iVisited = (BinaryOperatorNode) node; // add in reverse order IRubyObject result = evalInternal(context, iVisited.getFirstNode(), self); if (!result.isTrue()) return result; node = iVisited.getSecondNode(); continue bigloop; } case NodeTypes.OPASGNNODE: { OpAsgnNode iVisited = (OpAsgnNode) node; IRubyObject receiver = evalInternal(context, iVisited.getReceiverNode(), self); IRubyObject value = receiver.callMethod(context, iVisited.getVariableName()); if (iVisited.getOperatorName().equals("||")) { if (value.isTrue()) { return value; } value = evalInternal(context, iVisited.getValueNode(), self); } else if (iVisited.getOperatorName().equals("&&")) { if (!value.isTrue()) { return value; } value = evalInternal(context, iVisited.getValueNode(), self); } else { value = value.callMethod(context, iVisited.getOperatorName(), evalInternal(context, iVisited.getValueNode(), self)); } receiver.callMethod(context, iVisited.getVariableName() + "=", value); context.pollThreadEvents(); return value; } case NodeTypes.OPASGNORNODE: { OpAsgnOrNode iVisited = (OpAsgnOrNode) node; String def = getDefinition(context, iVisited.getFirstNode(), self); IRubyObject result = runtime.getNil(); if (def != null) { result = evalInternal(context, iVisited.getFirstNode(), self); } if (!result.isTrue()) { result = evalInternal(context, iVisited.getSecondNode(), self); } return result; } case NodeTypes.OPELEMENTASGNNODE: { OpElementAsgnNode iVisited = (OpElementAsgnNode) node; IRubyObject receiver = evalInternal(context, iVisited.getReceiverNode(), self); IRubyObject[] args = setupArgs(context, iVisited.getArgsNode(), self); IRubyObject firstValue = receiver.callMethod(context, "[]", args); if (iVisited.getOperatorName().equals("||")) { if (firstValue.isTrue()) { return firstValue; } firstValue = evalInternal(context, iVisited.getValueNode(), self); } else if (iVisited.getOperatorName().equals("&&")) { if (!firstValue.isTrue()) { return firstValue; } firstValue = evalInternal(context, iVisited.getValueNode(), self); } else { firstValue = firstValue.callMethod(context, iVisited.getOperatorName(), evalInternal(context, iVisited .getValueNode(), self)); } IRubyObject[] expandedArgs = new IRubyObject[args.length + 1]; System.arraycopy(args, 0, expandedArgs, 0, args.length); expandedArgs[expandedArgs.length - 1] = firstValue; return receiver.callMethod(context, "[]=", expandedArgs); } case NodeTypes.OPTNNODE: { OptNNode iVisited = (OptNNode) node; IRubyObject result = runtime.getNil(); while (RubyKernel.gets(runtime.getTopSelf(), IRubyObject.NULL_ARRAY).isTrue()) { loop: while (true) { // Used for the 'redo' command try { result = evalInternal(context, iVisited.getBodyNode(), self); break; } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.REDO: // do nothing, this iteration restarts break; case JumpType.NEXT: // recheck condition break loop; case JumpType.BREAK: // end loop return (IRubyObject) je.getPrimaryData(); default: throw je; } } } } return result; } case NodeTypes.ORNODE: { OrNode iVisited = (OrNode) node; IRubyObject result = evalInternal(context, iVisited.getFirstNode(), self); if (!result.isTrue()) { result = evalInternal(context, iVisited.getSecondNode(), self); } return result; } // case NodeTypes.POSTEXENODE: // EvaluateVisitor.postExeNodeVisitor.execute(this, node); // break; case NodeTypes.REDONODE: { context.pollThreadEvents(); // now used as an interpreter event JumpException je = new JumpException(JumpException.JumpType.RedoJump); je.setSecondaryData(node); throw je; } case NodeTypes.REGEXPNODE: { RegexpNode iVisited = (RegexpNode) node; String lang = null; int opts = iVisited.getOptions(); if((opts & 16) != 0) { // param n lang = "n"; } else if((opts & 48) != 0) { // param s lang = "s"; } else if((opts & 64) != 0) { // param s lang = "u"; } try { return RubyRegexp.newRegexp(runtime, iVisited.getPattern(), lang); } catch(java.util.regex.PatternSyntaxException e) { throw runtime.newSyntaxError(e.getMessage()); } } case NodeTypes.RESCUEBODYNODE: { RescueBodyNode iVisited = (RescueBodyNode) node; node = iVisited.getBodyNode(); continue bigloop; } case NodeTypes.RESCUENODE: { RescueNode iVisited = (RescueNode)node; RescuedBlock : while (true) { try { // Execute rescue block IRubyObject result = evalInternal(context, iVisited.getBodyNode(), self); // If no exception is thrown execute else block if (iVisited.getElseNode() != null) { if (iVisited.getRescueNode() == null) { runtime.getWarnings().warn(iVisited.getElseNode().getPosition(), "else without rescue is useless"); } result = evalInternal(context, iVisited.getElseNode(), self); } return result; } catch (RaiseException raiseJump) { RubyException raisedException = raiseJump.getException(); // TODO: Rubicon TestKernel dies without this line. A cursory glance implies we // falsely set $! to nil and this sets it back to something valid. This should // get fixed at the same time we address bug #1296484. runtime.getGlobalVariables().set("$!", raisedException); RescueBodyNode rescueNode = iVisited.getRescueNode(); while (rescueNode != null) { Node exceptionNodes = rescueNode.getExceptionNodes(); ListNode exceptionNodesList; if (exceptionNodes instanceof SplatNode) { exceptionNodesList = (ListNode) evalInternal(context, exceptionNodes, self); } else { exceptionNodesList = (ListNode) exceptionNodes; } if (isRescueHandled(context, raisedException, exceptionNodesList, self)) { try { return evalInternal(context, rescueNode, self); } catch (JumpException je) { if (je.getJumpType() == JumpException.JumpType.RetryJump) { // should be handled in the finally block below //state.runtime.getGlobalVariables().set("$!", state.runtime.getNil()); //state.threadContext.setRaisedException(null); continue RescuedBlock; } else { throw je; } } } rescueNode = rescueNode.getOptRescueNode(); } // no takers; bubble up throw raiseJump; } finally { // clear exception when handled or retried runtime.getGlobalVariables().set("$!", runtime.getNil()); } } } case NodeTypes.RETRYNODE: { context.pollThreadEvents(); JumpException je = new JumpException(JumpException.JumpType.RetryJump); throw je; } case NodeTypes.RETURNNODE: { ReturnNode iVisited = (ReturnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); JumpException je = new JumpException(JumpException.JumpType.ReturnJump); je.setPrimaryData(iVisited.getTarget()); je.setSecondaryData(result); je.setTertiaryData(iVisited); throw je; } case NodeTypes.ROOTNODE: { RootNode iVisited = (RootNode) node; DynamicScope scope = iVisited.getScope(); // Serialization killed our dynamic scope. We can just create an empty one // since serialization cannot serialize an eval (which is the only thing // which is capable of having a non-empty dynamic scope). if (scope == null) { scope = new DynamicScope(iVisited.getStaticScope(), null); } // Each root node has a top-level scope that we need to push context.preRootNode(scope); // FIXME: Wire up BEGIN and END nodes try { return eval(context, iVisited.getBodyNode(), self); } finally { context.postRootNode(); } } case NodeTypes.SCLASSNODE: { SClassNode iVisited = (SClassNode) node; IRubyObject receiver = evalInternal(context, iVisited.getReceiverNode(), self); RubyClass singletonClass; if (receiver.isNil()) { singletonClass = runtime.getNilClass(); } else if (receiver == runtime.getTrue()) { singletonClass = runtime.getClass("TrueClass"); } else if (receiver == runtime.getFalse()) { singletonClass = runtime.getClass("FalseClass"); } else { if (runtime.getSafeLevel() >= 4 && !receiver.isTaint()) { throw runtime.newSecurityError("Insecure: can't extend object."); } singletonClass = receiver.getSingletonClass(); } if (context.getWrapper() != null) { singletonClass.extendObject(context.getWrapper()); singletonClass.includeModule(context.getWrapper()); } return evalClassDefinitionBody(context, iVisited.getScope(), iVisited.getBodyNode(), singletonClass, self); } case NodeTypes.SELFNODE: return self; case NodeTypes.SPLATNODE: { SplatNode iVisited = (SplatNode) node; return splatValue(evalInternal(context, iVisited.getValue(), self)); } //// case NodeTypes.STARNODE: //// EvaluateVisitor.starNodeVisitor.execute(this, node); //// break; case NodeTypes.STRNODE: { StrNode iVisited = (StrNode) node; return runtime.newString(iVisited.getValue()); } case NodeTypes.SUPERNODE: { SuperNode iVisited = (SuperNode) node; if (context.getFrameLastClass() == null) { String name = context.getFrameLastFunc(); throw runtime.newNameError("Superclass method '" + name + "' disabled.", name); } context.beginCallArgs(); IRubyObject[] args = null; try { args = setupArgs(context, iVisited.getArgsNode(), self); } finally { context.endCallArgs(); } return context.callSuper(args); } case NodeTypes.SVALUENODE: { SValueNode iVisited = (SValueNode) node; return aValueSplat(evalInternal(context, iVisited.getValue(), self)); } case NodeTypes.SYMBOLNODE: { SymbolNode iVisited = (SymbolNode) node; return runtime.newSymbol(iVisited.getName()); } case NodeTypes.TOARYNODE: { ToAryNode iVisited = (ToAryNode) node; return aryToAry(evalInternal(context, iVisited.getValue(), self)); } case NodeTypes.TRUENODE: { context.pollThreadEvents(); return runtime.getTrue(); } case NodeTypes.UNDEFNODE: { UndefNode iVisited = (UndefNode) node; if (context.getRubyClass() == null) { throw runtime .newTypeError("No class to undef method '" + iVisited.getName() + "'."); } context.getRubyClass().undef(iVisited.getName()); return runtime.getNil(); } case NodeTypes.UNTILNODE: { UntilNode iVisited = (UntilNode) node; IRubyObject result = runtime.getNil(); while (!(result = evalInternal(context, iVisited.getConditionNode(), self)).isTrue()) { loop: while (true) { // Used for the 'redo' command try { result = evalInternal(context, iVisited.getBodyNode(), self); break loop; } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.REDO: continue; case JumpType.NEXT: break loop; case JumpType.BREAK: return (IRubyObject) je.getPrimaryData(); default: throw je; } } } } return result; } case NodeTypes.VALIASNODE: { VAliasNode iVisited = (VAliasNode) node; runtime.getGlobalVariables().alias(iVisited.getNewName(), iVisited.getOldName()); return runtime.getNil(); } case NodeTypes.VCALLNODE: { VCallNode iVisited = (VCallNode) node; return self.callMethod(context, iVisited.getName(), IRubyObject.NULL_ARRAY, CallType.VARIABLE); } case NodeTypes.WHENNODE: assert false; return null; case NodeTypes.WHILENODE: { WhileNode iVisited = (WhileNode) node; IRubyObject result = runtime.getNil(); boolean firstTest = iVisited.evaluateAtStart(); while (!firstTest || (result = evalInternal(context, iVisited.getConditionNode(), self)).isTrue()) { firstTest = true; loop: while (true) { // Used for the 'redo' command try { evalInternal(context, iVisited.getBodyNode(), self); break loop; } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.REDO: continue; case JumpType.NEXT: break loop; case JumpType.BREAK: return result; default: throw je; } } } } return result; } case NodeTypes.XSTRNODE: { XStrNode iVisited = (XStrNode) node; return self.callMethod(context, "`", runtime.newString(iVisited.getValue())); } case NodeTypes.YIELDNODE: { YieldNode iVisited = (YieldNode) node; IRubyObject result = evalInternal(context, iVisited.getArgsNode(), self); if (iVisited.getArgsNode() == null) { result = null; } return context.yieldCurrentBlock(result, null, null, iVisited.getCheckState()); } case NodeTypes.ZARRAYNODE: { return runtime.newArray(); } case NodeTypes.ZSUPERNODE: { if (context.getFrameLastClass() == null) { String name = context.getFrameLastFunc(); throw runtime.newNameError("superclass method '" + name + "' disabled", name); } return context.callSuper(context.getFrameArgs(), true); } } } while (true); }
private static IRubyObject evalInternal(ThreadContext context, Node node, IRubyObject self) { IRuby runtime = context.getRuntime(); bigloop: do { if (node == null) return runtime.getNil(); switch (node.nodeId) { case NodeTypes.ALIASNODE: { AliasNode iVisited = (AliasNode) node; if (context.getRubyClass() == null) { throw runtime.newTypeError("no class to make alias"); } context.getRubyClass().defineAlias(iVisited.getNewName(), iVisited.getOldName()); context.getRubyClass().callMethod(context, "method_added", runtime.newSymbol(iVisited.getNewName())); return runtime.getNil(); } case NodeTypes.ANDNODE: { BinaryOperatorNode iVisited = (BinaryOperatorNode) node; IRubyObject result = evalInternal(context, iVisited.getFirstNode(), self); if (!result.isTrue()) return result; node = iVisited.getSecondNode(); continue bigloop; } case NodeTypes.ARGSCATNODE: { ArgsCatNode iVisited = (ArgsCatNode) node; IRubyObject args = evalInternal(context, iVisited.getFirstNode(), self); IRubyObject secondArgs = splatValue(evalInternal(context, iVisited.getSecondNode(), self)); RubyArray list = args instanceof RubyArray ? (RubyArray) args : runtime.newArray(args); return list.concat(secondArgs); } // case NodeTypes.ARGSNODE: // EvaluateVisitor.argsNodeVisitor.execute(this, node); // break; // case NodeTypes.ARGUMENTNODE: // EvaluateVisitor.argumentNodeVisitor.execute(this, node); // break; case NodeTypes.ARRAYNODE: { ArrayNode iVisited = (ArrayNode) node; IRubyObject[] array = new IRubyObject[iVisited.size()]; int i = 0; for (Iterator iterator = iVisited.iterator(); iterator.hasNext();) { Node next = (Node) iterator.next(); array[i++] = evalInternal(context, next, self); } return runtime.newArray(array); } // case NodeTypes.ASSIGNABLENODE: // EvaluateVisitor.assignableNodeVisitor.execute(this, node); // break; case NodeTypes.BACKREFNODE: { BackRefNode iVisited = (BackRefNode) node; IRubyObject backref = context.getBackref(); switch (iVisited.getType()) { case '~': return backref; case '&': return RubyRegexp.last_match(backref); case '`': return RubyRegexp.match_pre(backref); case '\'': return RubyRegexp.match_post(backref); case '+': return RubyRegexp.match_last(backref); } break; } case NodeTypes.BEGINNODE: { BeginNode iVisited = (BeginNode) node; node = iVisited.getBodyNode(); continue bigloop; } case NodeTypes.BIGNUMNODE: { BignumNode iVisited = (BignumNode) node; return RubyBignum.newBignum(runtime, iVisited.getValue()); } // case NodeTypes.BINARYOPERATORNODE: // EvaluateVisitor.binaryOperatorNodeVisitor.execute(this, node); // break; // case NodeTypes.BLOCKARGNODE: // EvaluateVisitor.blockArgNodeVisitor.execute(this, node); // break; case NodeTypes.BLOCKNODE: { BlockNode iVisited = (BlockNode) node; IRubyObject result = runtime.getNil(); for (Iterator iter = iVisited.iterator(); iter.hasNext();) { result = evalInternal(context, (Node) iter.next(), self); } return result; } case NodeTypes.BLOCKPASSNODE: { BlockPassNode iVisited = (BlockPassNode) node; IRubyObject proc = evalInternal(context, iVisited.getBodyNode(), self); if (proc.isNil()) { context.setNoBlock(); try { return evalInternal(context, iVisited.getIterNode(), self); } finally { context.clearNoBlock(); } } // If not already a proc then we should try and make it one. if (!(proc instanceof RubyProc)) { proc = proc.convertToType("Proc", "to_proc", false); if (!(proc instanceof RubyProc)) { throw runtime.newTypeError("wrong argument type " + proc.getMetaClass().getName() + " (expected Proc)"); } } // TODO: Add safety check for taintedness Block block = (Block) context.getCurrentBlock(); if (block != null) { IRubyObject blockObject = block.getBlockObject(); // The current block is already associated with the proc. No need to create new // block for it. Just eval! if (blockObject != null && blockObject == proc) { try { context.setBlockAvailable(); return evalInternal(context, iVisited.getIterNode(), self); } finally { context.clearBlockAvailable(); } } } context.preBlockPassEval(((RubyProc) proc).getBlock()); try { return evalInternal(context, iVisited.getIterNode(), self); } finally { context.postBlockPassEval(); } } case NodeTypes.BREAKNODE: { BreakNode iVisited = (BreakNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); JumpException je = new JumpException(JumpException.JumpType.BreakJump); je.setPrimaryData(result); je.setSecondaryData(node); throw je; } case NodeTypes.CALLNODE: { CallNode iVisited = (CallNode) node; context.beginCallArgs(); IRubyObject receiver = null; IRubyObject[] args = null; try { receiver = evalInternal(context, iVisited.getReceiverNode(), self); args = setupArgs(context, iVisited.getArgsNode(), self); } finally { context.endCallArgs(); } assert receiver.getMetaClass() != null : receiver.getClass().getName(); // If reciever is self then we do the call the same way as vcall CallType callType = (receiver == self ? CallType.VARIABLE : CallType.NORMAL); return receiver.callMethod(context, iVisited.getName(), args, callType); } case NodeTypes.CASENODE: { CaseNode iVisited = (CaseNode) node; IRubyObject expression = null; if (iVisited.getCaseNode() != null) { expression = evalInternal(context, iVisited.getCaseNode(), self); } context.pollThreadEvents(); IRubyObject result = runtime.getNil(); Node firstWhenNode = iVisited.getFirstWhenNode(); while (firstWhenNode != null) { if (!(firstWhenNode instanceof WhenNode)) { node = firstWhenNode; continue bigloop; } WhenNode whenNode = (WhenNode) firstWhenNode; if (whenNode.getExpressionNodes() instanceof ArrayNode) { for (Iterator iter = ((ArrayNode) whenNode.getExpressionNodes()).iterator(); iter .hasNext();) { Node tag = (Node) iter.next(); context.setPosition(tag.getPosition()); if (isTrace(runtime)) { callTraceFunction(context, "line", self); } // Ruby grammar has nested whens in a case body because of // productions case_body and when_args. if (tag instanceof WhenNode) { RubyArray expressions = (RubyArray) evalInternal(context, ((WhenNode) tag) .getExpressionNodes(), self); for (int j = 0; j < expressions.getLength(); j++) { IRubyObject condition = expressions.entry(j); if ((expression != null && condition.callMethod(context, "===", expression) .isTrue()) || (expression == null && condition.isTrue())) { node = ((WhenNode) firstWhenNode).getBodyNode(); continue bigloop; } } continue; } result = evalInternal(context, tag, self); if ((expression != null && result.callMethod(context, "===", expression).isTrue()) || (expression == null && result.isTrue())) { node = whenNode.getBodyNode(); continue bigloop; } } } else { result = evalInternal(context, whenNode.getExpressionNodes(), self); if ((expression != null && result.callMethod(context, "===", expression).isTrue()) || (expression == null && result.isTrue())) { node = ((WhenNode) firstWhenNode).getBodyNode(); continue bigloop; } } context.pollThreadEvents(); firstWhenNode = whenNode.getNextCase(); } return runtime.getNil(); } case NodeTypes.CLASSNODE: { ClassNode iVisited = (ClassNode) node; Node superNode = iVisited.getSuperNode(); RubyClass superClass = superNode == null ? null : (RubyClass) evalInternal(context, superNode, self); Node classNameNode = iVisited.getCPath(); String name = ((INameNode) classNameNode).getName(); RubyModule enclosingClass = getEnclosingModule(context, classNameNode, self); RubyClass rubyClass = enclosingClass.defineOrGetClassUnder(name, superClass); if (context.getWrapper() != null) { rubyClass.extendObject(context.getWrapper()); rubyClass.includeModule(context.getWrapper()); } return evalClassDefinitionBody(context, iVisited.getScope(), iVisited.getBodyNode(), rubyClass, self); } case NodeTypes.CLASSVARASGNNODE: { ClassVarAsgnNode iVisited = (ClassVarAsgnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); RubyModule rubyClass = (RubyModule) context.peekCRef().getValue(); if (rubyClass == null) { rubyClass = self.getMetaClass(); } else if (rubyClass.isSingleton()) { rubyClass = (RubyModule) rubyClass.getInstanceVariable("__attached__"); } rubyClass.setClassVar(iVisited.getName(), result); return result; } case NodeTypes.CLASSVARDECLNODE: { ClassVarDeclNode iVisited = (ClassVarDeclNode) node; // FIXME: shouldn't we use cref here? if (context.getRubyClass() == null) { throw runtime.newTypeError("no class/module to define class variable"); } IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); ((RubyModule) context.peekCRef().getValue()).setClassVar(iVisited.getName(), result); return runtime.getNil(); } case NodeTypes.CLASSVARNODE: { ClassVarNode iVisited = (ClassVarNode) node; RubyModule rubyClass = (RubyModule) context.peekCRef().getValue(); if (rubyClass == null) { rubyClass = self.getMetaClass(); } else if (rubyClass.isSingleton()) { rubyClass = (RubyModule)rubyClass.getInstanceVariable("__attached__"); } return rubyClass.getClassVar(iVisited.getName()); } case NodeTypes.COLON2NODE: { Colon2Node iVisited = (Colon2Node) node; Node leftNode = iVisited.getLeftNode(); // TODO: Made this more colon3 friendly because of cpath production // rule in grammar (it is convenient to think of them as the same thing // at a grammar level even though evaluation is). if (leftNode == null) { return runtime.getObject().getConstantFrom(iVisited.getName()); } else { IRubyObject result = evalInternal(context, iVisited.getLeftNode(), self); if (result instanceof RubyModule) { return ((RubyModule) result).getConstantFrom(iVisited.getName()); } else { return result.callMethod(context, iVisited.getName()); } } } case NodeTypes.COLON3NODE: { Colon3Node iVisited = (Colon3Node) node; return runtime.getObject().getConstantFrom(iVisited.getName()); } case NodeTypes.CONSTDECLNODE: { ConstDeclNode iVisited = (ConstDeclNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); IRubyObject module; if (iVisited.getPathNode() != null) { module = evalInternal(context, iVisited.getPathNode(), self); } else { // FIXME: why do we check RubyClass and then use CRef? if (context.getRubyClass() == null) { // TODO: wire into new exception handling mechanism throw runtime.newTypeError("no class/module to define constant"); } module = (RubyModule) context.peekCRef().getValue(); } // FIXME: shouldn't we use the result of this set in setResult? ((RubyModule) module).setConstant(iVisited.getName(), result); return result; } case NodeTypes.CONSTNODE: { ConstNode iVisited = (ConstNode) node; return context.getConstant(iVisited.getName()); } case NodeTypes.DASGNNODE: { DAsgnNode iVisited = (DAsgnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); // System.out.println("DSetting: " + iVisited.getName() + " at index " + iVisited.getIndex() + " and at depth " + iVisited.getDepth() + " and set " + result); context.getCurrentScope().setValue(iVisited.getIndex(), result, iVisited.getDepth()); return result; } case NodeTypes.DEFINEDNODE: { DefinedNode iVisited = (DefinedNode) node; String definition = getDefinition(context, iVisited.getExpressionNode(), self); if (definition != null) { return runtime.newString(definition); } else { return runtime.getNil(); } } case NodeTypes.DEFNNODE: { DefnNode iVisited = (DefnNode) node; RubyModule containingClass = context.getRubyClass(); if (containingClass == null) { throw runtime.newTypeError("No class to add method."); } String name = iVisited.getName(); if (containingClass == runtime.getObject() && name.equals("initialize")) { runtime.getWarnings().warn("redefining Object#initialize may cause infinite loop"); } Visibility visibility = context.getCurrentVisibility(); if (name.equals("initialize") || visibility.isModuleFunction()) { visibility = Visibility.PRIVATE; } DefaultMethod newMethod = new DefaultMethod(containingClass, iVisited.getScope(), iVisited.getBodyNode(), (ArgsNode) iVisited.getArgsNode(), visibility, context.peekCRef()); if (iVisited.getBodyNode() != null) { iVisited.getBodyNode().accept(new CreateJumpTargetVisitor(newMethod)); } containingClass.addMethod(name, newMethod); if (context.getCurrentVisibility().isModuleFunction()) { containingClass.getSingletonClass().addMethod( name, new WrapperCallable(containingClass.getSingletonClass(), newMethod, Visibility.PUBLIC)); containingClass.callMethod(context, "singleton_method_added", runtime.newSymbol(name)); } // 'class << state.self' and 'class << obj' uses defn as opposed to defs if (containingClass.isSingleton()) { ((MetaClass) containingClass).getAttachedObject().callMethod( context, "singleton_method_added", runtime.newSymbol(iVisited.getName())); } else { containingClass.callMethod(context, "method_added", runtime.newSymbol(name)); } return runtime.getNil(); } case NodeTypes.DEFSNODE: { DefsNode iVisited = (DefsNode) node; IRubyObject receiver = evalInternal(context, iVisited.getReceiverNode(), self); RubyClass rubyClass; if (receiver.isNil()) { rubyClass = runtime.getNilClass(); } else if (receiver == runtime.getTrue()) { rubyClass = runtime.getClass("TrueClass"); } else if (receiver == runtime.getFalse()) { rubyClass = runtime.getClass("FalseClass"); } else { if (runtime.getSafeLevel() >= 4 && !receiver.isTaint()) { throw runtime.newSecurityError("Insecure; can't define singleton method."); } if (receiver.isFrozen()) { throw runtime.newFrozenError("object"); } if (!receiver.singletonMethodsAllowed()) { throw runtime.newTypeError("can't define singleton method \"" + iVisited.getName() + "\" for " + receiver.getType()); } rubyClass = receiver.getSingletonClass(); } if (runtime.getSafeLevel() >= 4) { ICallable method = (ICallable) rubyClass.getMethods().get(iVisited.getName()); if (method != null) { throw runtime.newSecurityError("Redefining method prohibited."); } } DefaultMethod newMethod = new DefaultMethod(rubyClass, iVisited.getScope(), iVisited.getBodyNode(), (ArgsNode) iVisited.getArgsNode(), Visibility.PUBLIC, context.peekCRef()); if (iVisited.getBodyNode() != null) { iVisited.getBodyNode().accept(new CreateJumpTargetVisitor(newMethod)); } rubyClass.addMethod(iVisited.getName(), newMethod); receiver.callMethod(context, "singleton_method_added", runtime.newSymbol(iVisited.getName())); return runtime.getNil(); } case NodeTypes.DOTNODE: { DotNode iVisited = (DotNode) node; return RubyRange.newRange(runtime, evalInternal(context, iVisited.getBeginNode(), self), evalInternal(context, iVisited .getEndNode(), self), iVisited.isExclusive()); } case NodeTypes.DREGEXPNODE: { DRegexpNode iVisited = (DRegexpNode) node; StringBuffer sb = new StringBuffer(); for (Iterator iterator = iVisited.iterator(); iterator.hasNext();) { Node iterNode = (Node) iterator.next(); sb.append(evalInternal(context, iterNode, self).toString()); } String lang = null; int opts = iVisited.getOptions(); if((opts & 16) != 0) { // param n lang = "n"; } else if((opts & 48) != 0) { // param s lang = "s"; } else if((opts & 64) != 0) { // param s lang = "u"; } return RubyRegexp.newRegexp(runtime, sb.toString(), iVisited.getOptions(), lang); } case NodeTypes.DSTRNODE: { DStrNode iVisited = (DStrNode) node; StringBuffer sb = new StringBuffer(); for (Iterator iterator = iVisited.iterator(); iterator.hasNext();) { Node iterNode = (Node) iterator.next(); sb.append(evalInternal(context, iterNode, self).toString()); } return runtime.newString(sb.toString()); } case NodeTypes.DSYMBOLNODE: { DSymbolNode iVisited = (DSymbolNode) node; StringBuffer sb = new StringBuffer(); for (Iterator iterator = iVisited.getNode().iterator(); iterator.hasNext();) { Node iterNode = (Node) iterator.next(); sb.append(evalInternal(context, iterNode, self).toString()); } return runtime.newSymbol(sb.toString()); } case NodeTypes.DVARNODE: { DVarNode iVisited = (DVarNode) node; // System.out.println("DGetting: " + iVisited.getName() + " at index " + iVisited.getIndex() + " and at depth " + iVisited.getDepth()); IRubyObject obj = context.getCurrentScope().getValue(iVisited.getIndex(), iVisited.getDepth()); // FIXME: null check is removable once we figure out how to assign to unset named block args return obj == null ? runtime.getNil() : obj; } case NodeTypes.DXSTRNODE: { DXStrNode iVisited = (DXStrNode) node; StringBuffer sb = new StringBuffer(); for (Iterator iterator = iVisited.iterator(); iterator.hasNext();) { Node iterNode = (Node) iterator.next(); sb.append(evalInternal(context, iterNode, self).toString()); } return self.callMethod(context, "`", runtime.newString(sb.toString())); } case NodeTypes.ENSURENODE: { EnsureNode iVisited = (EnsureNode) node; // save entering the try if there's nothing to ensure if (iVisited.getEnsureNode() != null) { IRubyObject result = runtime.getNil(); try { result = evalInternal(context, iVisited.getBodyNode(), self); } finally { evalInternal(context, iVisited.getEnsureNode(), self); } return result; } node = iVisited.getBodyNode(); continue bigloop; } case NodeTypes.EVSTRNODE: { EvStrNode iVisited = (EvStrNode) node; node = iVisited.getBody(); continue bigloop; } case NodeTypes.FALSENODE: { context.pollThreadEvents(); return runtime.getFalse(); } case NodeTypes.FCALLNODE: { FCallNode iVisited = (FCallNode) node; context.beginCallArgs(); IRubyObject[] args; try { args = setupArgs(context, iVisited.getArgsNode(), self); } finally { context.endCallArgs(); } return self.callMethod(context, iVisited.getName(), args, CallType.FUNCTIONAL); } case NodeTypes.FIXNUMNODE: { FixnumNode iVisited = (FixnumNode) node; return iVisited.getFixnum(runtime); } case NodeTypes.FLIPNODE: { FlipNode iVisited = (FlipNode) node; IRubyObject result = runtime.getNil(); if (iVisited.isExclusive()) { if (!context.getCurrentScope().getValue(iVisited.getIndex(), iVisited.getDepth()).isTrue()) { result = evalInternal(context, iVisited.getBeginNode(), self).isTrue() ? runtime.getFalse() : runtime.getTrue(); context.getCurrentScope().setValue(iVisited.getIndex(), result, iVisited.getDepth()); return result; } else { if (evalInternal(context, iVisited.getEndNode(), self).isTrue()) { context.getCurrentScope().setValue(iVisited.getIndex(), runtime.getFalse(), iVisited.getDepth()); } return runtime.getTrue(); } } else { if (!context.getCurrentScope().getValue(iVisited.getIndex(), iVisited.getDepth()).isTrue()) { if (evalInternal(context, iVisited.getBeginNode(), self).isTrue()) { context.getCurrentScope().setValue( iVisited.getIndex(), evalInternal(context, iVisited.getEndNode(), self).isTrue() ? runtime.getFalse() : runtime.getTrue(), iVisited.getDepth()); return runtime.getTrue(); } else { return runtime.getFalse(); } } else { if (evalInternal(context, iVisited.getEndNode(), self).isTrue()) { context.getCurrentScope().setValue(iVisited.getIndex(), runtime.getFalse(), iVisited.getDepth()); } return runtime.getTrue(); } } } case NodeTypes.FLOATNODE: { FloatNode iVisited = (FloatNode) node; return RubyFloat.newFloat(runtime, iVisited.getValue()); } case NodeTypes.FORNODE: { ForNode iVisited = (ForNode) node; // For nodes do not have to create an addition scope so we just pass null context.preForLoopEval(Block.createBlock(iVisited.getVarNode(), null, iVisited.getCallable(), self)); try { while (true) { try { ISourcePosition position = context.getPosition(); context.beginCallArgs(); IRubyObject recv = null; try { recv = evalInternal(context, iVisited.getIterNode(), self); } finally { context.setPosition(position); context.endCallArgs(); } return recv.callMethod(context, "each", IRubyObject.NULL_ARRAY, CallType.NORMAL); } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.RETRY: // do nothing, allow loop to retry break; default: throw je; } } } } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.BREAK: IRubyObject breakValue = (IRubyObject) je.getPrimaryData(); return breakValue == null ? runtime.getNil() : breakValue; default: throw je; } } finally { context.postForLoopEval(); } } case NodeTypes.GLOBALASGNNODE: { GlobalAsgnNode iVisited = (GlobalAsgnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); runtime.getGlobalVariables().set(iVisited.getName(), result); return result; } case NodeTypes.GLOBALVARNODE: { GlobalVarNode iVisited = (GlobalVarNode) node; return runtime.getGlobalVariables().get(iVisited.getName()); } case NodeTypes.HASHNODE: { HashNode iVisited = (HashNode) node; Map hash = null; if (iVisited.getListNode() != null) { hash = new HashMap(iVisited.getListNode().size() / 2); for (Iterator iterator = iVisited.getListNode().iterator(); iterator.hasNext();) { // insert all nodes in sequence, hash them in the final instruction // KEY IRubyObject key = evalInternal(context, (Node) iterator.next(), self); IRubyObject value = evalInternal(context, (Node) iterator.next(), self); hash.put(key, value); } } if (hash == null) { return RubyHash.newHash(runtime); } return RubyHash.newHash(runtime, hash, runtime.getNil()); } case NodeTypes.IFNODE: { IfNode iVisited = (IfNode) node; IRubyObject result = evalInternal(context, iVisited.getCondition(), self); if (result.isTrue()) { node = iVisited.getThenBody(); continue bigloop; } else { node = iVisited.getElseBody(); continue bigloop; } } case NodeTypes.INSTASGNNODE: { InstAsgnNode iVisited = (InstAsgnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); self.setInstanceVariable(iVisited.getName(), result); return result; } case NodeTypes.INSTVARNODE: { InstVarNode iVisited = (InstVarNode) node; IRubyObject variable = self.getInstanceVariable(iVisited.getName()); return variable == null ? runtime.getNil() : variable; } // case NodeTypes.ISCOPINGNODE: // EvaluateVisitor.iScopingNodeVisitor.execute(this, node); // break; case NodeTypes.ITERNODE: { IterNode iVisited = (IterNode) node; context.preIterEval(Block.createBlock(iVisited.getVarNode(), new DynamicScope(iVisited.getScope(), context.getCurrentScope()), iVisited.getCallable(), self)); try { while (true) { try { context.setBlockAvailable(); return evalInternal(context, iVisited.getIterNode(), self); } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.RETRY: // allow loop to retry break; default: throw je; } } finally { context.clearBlockAvailable(); } } } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.BREAK: IRubyObject breakValue = (IRubyObject) je.getPrimaryData(); return breakValue == null ? runtime.getNil() : breakValue; default: throw je; } } finally { context.postIterEval(); } } case NodeTypes.LOCALASGNNODE: { LocalAsgnNode iVisited = (LocalAsgnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); // System.out.println("LSetting: " + iVisited.getName() + " at index " + iVisited.getIndex() + " and at depth " + iVisited.getDepth() + " and set " + result); context.getCurrentScope().setValue(iVisited.getIndex(), result, iVisited.getDepth()); return result; } case NodeTypes.LOCALVARNODE: { LocalVarNode iVisited = (LocalVarNode) node; //System.out.println("DGetting: " + iVisited.getName() + " at index " + iVisited.getIndex() + " and at depth " + iVisited.getDepth()); IRubyObject result = context.getCurrentScope().getValue(iVisited.getIndex(), iVisited.getDepth()); return result == null ? runtime.getNil() : result; } case NodeTypes.MATCH2NODE: { Match2Node iVisited = (Match2Node) node; IRubyObject recv = evalInternal(context, iVisited.getReceiverNode(), self); IRubyObject value = evalInternal(context, iVisited.getValueNode(), self); return ((RubyRegexp) recv).match(value); } case NodeTypes.MATCH3NODE: { Match3Node iVisited = (Match3Node) node; IRubyObject recv = evalInternal(context, iVisited.getReceiverNode(), self); IRubyObject value = evalInternal(context, iVisited.getValueNode(), self); if (value instanceof RubyString) { return ((RubyRegexp) recv).match(value); } else { return value.callMethod(context, "=~", recv); } } case NodeTypes.MATCHNODE: { MatchNode iVisited = (MatchNode) node; return ((RubyRegexp) evalInternal(context, iVisited.getRegexpNode(), self)).match2(); } case NodeTypes.MODULENODE: { ModuleNode iVisited = (ModuleNode) node; Node classNameNode = iVisited.getCPath(); String name = ((INameNode) classNameNode).getName(); RubyModule enclosingModule = getEnclosingModule(context, classNameNode, self); if (enclosingModule == null) { throw runtime.newTypeError("no outer class/module"); } RubyModule module; if (enclosingModule == runtime.getObject()) { module = runtime.getOrCreateModule(name); } else { module = enclosingModule.defineModuleUnder(name); } return evalClassDefinitionBody(context, iVisited.getScope(), iVisited.getBodyNode(), module, self); } case NodeTypes.MULTIPLEASGNNODE: { MultipleAsgnNode iVisited = (MultipleAsgnNode) node; return AssignmentVisitor.assign(context, self, iVisited, evalInternal(context, iVisited.getValueNode(), self), false); } case NodeTypes.NEWLINENODE: { NewlineNode iVisited = (NewlineNode) node; // something in here is used to build up ruby stack trace... context.setPosition(iVisited.getPosition()); if (isTrace(runtime)) { callTraceFunction(context, "line", self); } // TODO: do above but not below for additional newline nodes node = iVisited.getNextNode(); continue bigloop; } case NodeTypes.NEXTNODE: { NextNode iVisited = (NextNode) node; context.pollThreadEvents(); IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); // now used as an interpreter event JumpException je = new JumpException(JumpException.JumpType.NextJump); je.setPrimaryData(result); je.setSecondaryData(iVisited); //state.setCurrentException(je); throw je; } case NodeTypes.NILNODE: return runtime.getNil(); case NodeTypes.NOTNODE: { NotNode iVisited = (NotNode) node; IRubyObject result = evalInternal(context, iVisited.getConditionNode(), self); return result.isTrue() ? runtime.getFalse() : runtime.getTrue(); } case NodeTypes.NTHREFNODE: { NthRefNode iVisited = (NthRefNode) node; return RubyRegexp.nth_match(iVisited.getMatchNumber(), context.getBackref()); } case NodeTypes.OPASGNANDNODE: { BinaryOperatorNode iVisited = (BinaryOperatorNode) node; // add in reverse order IRubyObject result = evalInternal(context, iVisited.getFirstNode(), self); if (!result.isTrue()) return result; node = iVisited.getSecondNode(); continue bigloop; } case NodeTypes.OPASGNNODE: { OpAsgnNode iVisited = (OpAsgnNode) node; IRubyObject receiver = evalInternal(context, iVisited.getReceiverNode(), self); IRubyObject value = receiver.callMethod(context, iVisited.getVariableName()); if (iVisited.getOperatorName().equals("||")) { if (value.isTrue()) { return value; } value = evalInternal(context, iVisited.getValueNode(), self); } else if (iVisited.getOperatorName().equals("&&")) { if (!value.isTrue()) { return value; } value = evalInternal(context, iVisited.getValueNode(), self); } else { value = value.callMethod(context, iVisited.getOperatorName(), evalInternal(context, iVisited.getValueNode(), self)); } receiver.callMethod(context, iVisited.getVariableName() + "=", value); context.pollThreadEvents(); return value; } case NodeTypes.OPASGNORNODE: { OpAsgnOrNode iVisited = (OpAsgnOrNode) node; String def = getDefinition(context, iVisited.getFirstNode(), self); IRubyObject result = runtime.getNil(); if (def != null) { result = evalInternal(context, iVisited.getFirstNode(), self); } if (!result.isTrue()) { result = evalInternal(context, iVisited.getSecondNode(), self); } return result; } case NodeTypes.OPELEMENTASGNNODE: { OpElementAsgnNode iVisited = (OpElementAsgnNode) node; IRubyObject receiver = evalInternal(context, iVisited.getReceiverNode(), self); IRubyObject[] args = setupArgs(context, iVisited.getArgsNode(), self); IRubyObject firstValue = receiver.callMethod(context, "[]", args); if (iVisited.getOperatorName().equals("||")) { if (firstValue.isTrue()) { return firstValue; } firstValue = evalInternal(context, iVisited.getValueNode(), self); } else if (iVisited.getOperatorName().equals("&&")) { if (!firstValue.isTrue()) { return firstValue; } firstValue = evalInternal(context, iVisited.getValueNode(), self); } else { firstValue = firstValue.callMethod(context, iVisited.getOperatorName(), evalInternal(context, iVisited .getValueNode(), self)); } IRubyObject[] expandedArgs = new IRubyObject[args.length + 1]; System.arraycopy(args, 0, expandedArgs, 0, args.length); expandedArgs[expandedArgs.length - 1] = firstValue; return receiver.callMethod(context, "[]=", expandedArgs); } case NodeTypes.OPTNNODE: { OptNNode iVisited = (OptNNode) node; IRubyObject result = runtime.getNil(); while (RubyKernel.gets(runtime.getTopSelf(), IRubyObject.NULL_ARRAY).isTrue()) { loop: while (true) { // Used for the 'redo' command try { result = evalInternal(context, iVisited.getBodyNode(), self); break; } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.REDO: // do nothing, this iteration restarts break; case JumpType.NEXT: // recheck condition break loop; case JumpType.BREAK: // end loop return (IRubyObject) je.getPrimaryData(); default: throw je; } } } } return result; } case NodeTypes.ORNODE: { OrNode iVisited = (OrNode) node; IRubyObject result = evalInternal(context, iVisited.getFirstNode(), self); if (!result.isTrue()) { result = evalInternal(context, iVisited.getSecondNode(), self); } return result; } // case NodeTypes.POSTEXENODE: // EvaluateVisitor.postExeNodeVisitor.execute(this, node); // break; case NodeTypes.REDONODE: { context.pollThreadEvents(); // now used as an interpreter event JumpException je = new JumpException(JumpException.JumpType.RedoJump); je.setSecondaryData(node); throw je; } case NodeTypes.REGEXPNODE: { RegexpNode iVisited = (RegexpNode) node; String lang = null; int opts = iVisited.getOptions(); if((opts & 16) != 0) { // param n lang = "n"; } else if((opts & 48) != 0) { // param s lang = "s"; } else if((opts & 64) != 0) { // param s lang = "u"; } try { return RubyRegexp.newRegexp(runtime, iVisited.getPattern(), lang); } catch(java.util.regex.PatternSyntaxException e) { throw runtime.newSyntaxError(e.getMessage()); } } case NodeTypes.RESCUEBODYNODE: { RescueBodyNode iVisited = (RescueBodyNode) node; node = iVisited.getBodyNode(); continue bigloop; } case NodeTypes.RESCUENODE: { RescueNode iVisited = (RescueNode)node; RescuedBlock : while (true) { try { // Execute rescue block IRubyObject result = evalInternal(context, iVisited.getBodyNode(), self); // If no exception is thrown execute else block if (iVisited.getElseNode() != null) { if (iVisited.getRescueNode() == null) { runtime.getWarnings().warn(iVisited.getElseNode().getPosition(), "else without rescue is useless"); } result = evalInternal(context, iVisited.getElseNode(), self); } return result; } catch (RaiseException raiseJump) { RubyException raisedException = raiseJump.getException(); // TODO: Rubicon TestKernel dies without this line. A cursory glance implies we // falsely set $! to nil and this sets it back to something valid. This should // get fixed at the same time we address bug #1296484. runtime.getGlobalVariables().set("$!", raisedException); RescueBodyNode rescueNode = iVisited.getRescueNode(); while (rescueNode != null) { Node exceptionNodes = rescueNode.getExceptionNodes(); ListNode exceptionNodesList; if (exceptionNodes instanceof SplatNode) { exceptionNodesList = (ListNode) evalInternal(context, exceptionNodes, self); } else { exceptionNodesList = (ListNode) exceptionNodes; } if (isRescueHandled(context, raisedException, exceptionNodesList, self)) { try { return evalInternal(context, rescueNode, self); } catch (JumpException je) { if (je.getJumpType() == JumpException.JumpType.RetryJump) { // should be handled in the finally block below //state.runtime.getGlobalVariables().set("$!", state.runtime.getNil()); //state.threadContext.setRaisedException(null); continue RescuedBlock; } else { throw je; } } } rescueNode = rescueNode.getOptRescueNode(); } // no takers; bubble up throw raiseJump; } finally { // clear exception when handled or retried runtime.getGlobalVariables().set("$!", runtime.getNil()); } } } case NodeTypes.RETRYNODE: { context.pollThreadEvents(); JumpException je = new JumpException(JumpException.JumpType.RetryJump); throw je; } case NodeTypes.RETURNNODE: { ReturnNode iVisited = (ReturnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); JumpException je = new JumpException(JumpException.JumpType.ReturnJump); je.setPrimaryData(iVisited.getTarget()); je.setSecondaryData(result); je.setTertiaryData(iVisited); throw je; } case NodeTypes.ROOTNODE: { RootNode iVisited = (RootNode) node; DynamicScope scope = iVisited.getScope(); // Serialization killed our dynamic scope. We can just create an empty one // since serialization cannot serialize an eval (which is the only thing // which is capable of having a non-empty dynamic scope). if (scope == null) { scope = new DynamicScope(iVisited.getStaticScope(), null); } // Each root node has a top-level scope that we need to push context.preRootNode(scope); // FIXME: Wire up BEGIN and END nodes try { return eval(context, iVisited.getBodyNode(), self); } finally { context.postRootNode(); } } case NodeTypes.SCLASSNODE: { SClassNode iVisited = (SClassNode) node; IRubyObject receiver = evalInternal(context, iVisited.getReceiverNode(), self); RubyClass singletonClass; if (receiver.isNil()) { singletonClass = runtime.getNilClass(); } else if (receiver == runtime.getTrue()) { singletonClass = runtime.getClass("TrueClass"); } else if (receiver == runtime.getFalse()) { singletonClass = runtime.getClass("FalseClass"); } else { if (runtime.getSafeLevel() >= 4 && !receiver.isTaint()) { throw runtime.newSecurityError("Insecure: can't extend object."); } singletonClass = receiver.getSingletonClass(); } if (context.getWrapper() != null) { singletonClass.extendObject(context.getWrapper()); singletonClass.includeModule(context.getWrapper()); } return evalClassDefinitionBody(context, iVisited.getScope(), iVisited.getBodyNode(), singletonClass, self); } case NodeTypes.SELFNODE: return self; case NodeTypes.SPLATNODE: { SplatNode iVisited = (SplatNode) node; return splatValue(evalInternal(context, iVisited.getValue(), self)); } //// case NodeTypes.STARNODE: //// EvaluateVisitor.starNodeVisitor.execute(this, node); //// break; case NodeTypes.STRNODE: { StrNode iVisited = (StrNode) node; return runtime.newString(iVisited.getValue()); } case NodeTypes.SUPERNODE: { SuperNode iVisited = (SuperNode) node; if (context.getFrameLastClass() == null) { String name = context.getFrameLastFunc(); throw runtime.newNameError("Superclass method '" + name + "' disabled.", name); } context.beginCallArgs(); IRubyObject[] args = null; try { args = setupArgs(context, iVisited.getArgsNode(), self); } finally { context.endCallArgs(); } return context.callSuper(args); } case NodeTypes.SVALUENODE: { SValueNode iVisited = (SValueNode) node; return aValueSplat(evalInternal(context, iVisited.getValue(), self)); } case NodeTypes.SYMBOLNODE: { SymbolNode iVisited = (SymbolNode) node; return runtime.newSymbol(iVisited.getName()); } case NodeTypes.TOARYNODE: { ToAryNode iVisited = (ToAryNode) node; return aryToAry(evalInternal(context, iVisited.getValue(), self)); } case NodeTypes.TRUENODE: { context.pollThreadEvents(); return runtime.getTrue(); } case NodeTypes.UNDEFNODE: { UndefNode iVisited = (UndefNode) node; if (context.getRubyClass() == null) { throw runtime .newTypeError("No class to undef method '" + iVisited.getName() + "'."); } context.getRubyClass().undef(iVisited.getName()); return runtime.getNil(); } case NodeTypes.UNTILNODE: { UntilNode iVisited = (UntilNode) node; IRubyObject result = runtime.getNil(); while (!(result = evalInternal(context, iVisited.getConditionNode(), self)).isTrue()) { loop: while (true) { // Used for the 'redo' command try { result = evalInternal(context, iVisited.getBodyNode(), self); break loop; } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.REDO: continue; case JumpType.NEXT: break loop; case JumpType.BREAK: return (IRubyObject) je.getPrimaryData(); default: throw je; } } } } return result; } case NodeTypes.VALIASNODE: { VAliasNode iVisited = (VAliasNode) node; runtime.getGlobalVariables().alias(iVisited.getNewName(), iVisited.getOldName()); return runtime.getNil(); } case NodeTypes.VCALLNODE: { VCallNode iVisited = (VCallNode) node; return self.callMethod(context, iVisited.getName(), IRubyObject.NULL_ARRAY, CallType.VARIABLE); } case NodeTypes.WHENNODE: assert false; return null; case NodeTypes.WHILENODE: { WhileNode iVisited = (WhileNode) node; IRubyObject result = runtime.getNil(); boolean firstTest = iVisited.evaluateAtStart(); while (!firstTest || (result = evalInternal(context, iVisited.getConditionNode(), self)).isTrue()) { firstTest = true; loop: while (true) { // Used for the 'redo' command try { evalInternal(context, iVisited.getBodyNode(), self); break loop; } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.REDO: continue; case JumpType.NEXT: break loop; case JumpType.BREAK: return result; default: throw je; } } } } return result; } case NodeTypes.XSTRNODE: { XStrNode iVisited = (XStrNode) node; return self.callMethod(context, "`", runtime.newString(iVisited.getValue())); } case NodeTypes.YIELDNODE: { YieldNode iVisited = (YieldNode) node; IRubyObject result = evalInternal(context, iVisited.getArgsNode(), self); if (iVisited.getArgsNode() == null) { result = null; } return context.yieldCurrentBlock(result, null, null, iVisited.getCheckState()); } case NodeTypes.ZARRAYNODE: { return runtime.newArray(); } case NodeTypes.ZSUPERNODE: { if (context.getFrameLastClass() == null) { String name = context.getFrameLastFunc(); throw runtime.newNameError("superclass method '" + name + "' disabled", name); } return context.callSuper(context.getFrameArgs(), true); } } } while (true); }
3,228,649
public boolean isDefined(String name) { Asserts.notNull(name); Asserts.isTrue(name.startsWith("$")); GlobalVariable variable = (GlobalVariable)globalVariables.get(name); return variable == null || variable.getAccessor() instanceof UndefinedAccessor; }
public boolean isDefined(String name) { Asserts.notNull(name); Asserts.isTrue(name.startsWith("$")); GlobalVariable variable = (GlobalVariable)globalVariables.get(name); return variable != null && variable.getAccessor() instanceof UndefinedAccessor; }
3,228,650
public List listArticles() throws XmlException, IOException{ List list = new ArrayList(); IWContext iwc = IWContext.getInstance(); try { String scope = ArticleUtil.getArticleRootPath(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwc,IWSlideSession.class); if(scope != null){ if(scope.startsWith(session.getWebdavServerURI())){ scope = scope.substring(session.getWebdavServerURI().length()); } if(scope.startsWith("/")){ scope = scope.substring(1); } } ContentSearch searchBusiness = new ContentSearch(iwc.getIWMainApplication()); Search search = searchBusiness.createSearch(getSearchRequest(scope, iwc.getCurrentLocale())); Collection results = search.getSearchResults(); if(results!=null){ for (Iterator iter = results.iterator(); iter.hasNext();) { SearchResult result = (SearchResult) iter.next(); try { System.out.println("Attempting to load "+result.getSearchResultURI()); ArticleItemBean article = new ArticleSearchResultBean(); article.load(result.getSearchResultURI()); list.add(article); }catch(Exception e) { e.printStackTrace(); } } } } catch (SearchException e1) { e1.printStackTrace(); } return list; }
public List listArticles() throws XmlException, IOException{ List list = new ArrayList(); IWContext iwc = IWContext.getInstance(); try { String scope = ArticleUtil.getArticleRootPath(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwc,IWSlideSession.class); if(scope != null){ if(scope.startsWith(session.getWebdavServerURI())){ scope = scope.substring(session.getWebdavServerURI().length()); } if(scope.startsWith("/")){ scope = scope.substring(1); } } ContentSearch searchBusiness = new ContentSearch(iwc.getIWMainApplication()); Search search = searchBusiness.createSearch(getSearchRequest(scope, iwc.getCurrentLocale())); Collection results = search.getSearchResults(); if(results!=null){ for (Iterator iter = results.iterator(); iter.hasNext();) { SearchResult result = (SearchResult) iter.next(); try { System.out.println("Attempting to load "+result.getSearchResultURI()); ArticleItemBean article = new ArticleSearchResultBean(); article.load(result.getSearchResultURI()); list.add(article); }catch(Exception e) { e.printStackTrace(); } } } } catch (SearchException e1) { e1.printStackTrace(); } return list; }
3,228,651
ViewerUIF(ViewerCtrl control, Registry registry) { //name, resizable, closable, maximizable, iconifiable. super("Viewer", true, true, true, true); this.control = control; this.registry = registry; setJMenuBar(createMenuBar()); buildGUI(); //set the size and position the window. setBounds(X_LOCATION, Y_LOCATION, WIN_WIDTH, WIN_HEIGHT); }
ViewerUIF(ViewerCtrl control, Registry registry) { //name, resizable, closable, maximizable, iconifiable. super("Viewer", true, true, true, true); this.control = control; this.registry = registry; setJMenuBar(createMenuBar()); buildGUI(); //set the size and position the window. setBounds(X_LOCATION, Y_LOCATION, WIN_WIDTH, WIN_HEIGHT); }
3,228,652
public ImageCanvas(ViewerUIF view, ViewerCtrl control) { this.view = view; this.control = control; filters = new ArrayList(); manager = new ImageCanvasMng(this); magFactor = 1.0; setBackground(Viewer.BACKGROUND_COLOR); setDoubleBuffered(true); }
public ImageCanvas(ViewerUIF view, ViewerCtrl control) { this.view = view; this.control = control; filters = new ArrayList(); manager = new ImageCanvasMng(this, control); magFactor = 1.0; setBackground(Viewer.BACKGROUND_COLOR); setDoubleBuffered(true); }
3,228,654
private void buildUI() { setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); setBorder(BorderFactory.createEtchedBorder()); JPanel p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); p.add(statusButton); p.add(status); add(UIUtilities.buildComponentPanel(p)); JPanel progress = new JPanel(); progress.setLayout(new BoxLayout(progress, BoxLayout.X_AXIS)); progress.add(progressBar); IconManager icons = IconManager.getInstance(); progressLabel = new JLabel(icons.getIcon(IconManager.PROGRESS)); progress.add(progressLabel); add(UIUtilities.buildComponentPanelRight(progress)); }
private void buildUI() { setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); setBorder(BorderFactory.createEtchedBorder()); JPanel p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); p.add(statusButton); p.add(status); add(UIUtilities.buildComponentPanel(p)); JPanel progress = new JPanel(); progress.setLayout(new BoxLayout(progress, BoxLayout.X_AXIS)); progress.add(progressBar); IconManager icons = IconManager.getInstance(); progressLabel = new JLabel(icons.getIcon(IconManager.PROGRESS)); progress.add(progressLabel); add(UIUtilities.buildComponentPanelRight(progress)); }
3,228,655
private void initComponents() { IconManager icons = IconManager.getInstance(); progressBar = new JProgressBar(); progressBar.setIndeterminate(true); progressBar.setVisible(false); status = new JLabel(); statusButton = new JButton(icons.getIcon(IconManager.INFO)); statusButton.setBorder(null); statusButton.setBorderPainted(false); statusButton.setFocusPainted(false); statusButton.setOpaque(false); }
private void initComponents() { IconManager icons = IconManager.getInstance(); progressBar = new JProgressBar(); progressBar.setIndeterminate(true); progressBar.setVisible(false); status = new JLabel(); statusButton = new JButton(icons.getIcon(IconManager.INFO)); statusButton.setBorder(null); statusButton.setBorderPainted(false); statusButton.setFocusPainted(false); statusButton.setOpaque(false); }
3,228,656
void writeEntry(int tag, int fieldType, int count, int value) throws IOException { output.writeShort(tag); output.writeShort(fieldType); output.writeInt(count); if (count == 1 && fieldType == TIFFEncoderCst.SHORT) value <<= 16; //left justify 16-bit values output.writeInt(value); // may be an offset }
private void writeEntry(int tag, int fieldType, int count, int value) throws IOException { output.writeShort(tag); output.writeShort(fieldType); output.writeInt(count); if (count == 1 && fieldType == TIFFEncoderCst.SHORT) value <<= 16; //left justify 16-bit values output.writeInt(value); // may be an offset }
3,228,657
private void writeRGBPixels() throws IOException { int bytesWritten = 0; int size = imageWidth*imageHeight*3; int count = imageWidth*24; //3*8 byte[] buffer = new byte[count]; int i, j; DataBufferByte bufferByte = (DataBufferByte) image.getRaster().getDataBuffer(); //model chosen byte[] red = bufferByte.getData(Encoder.RED_BAND); byte[] green = bufferByte.getData(Encoder.GREEN_BAND); byte[] blue = bufferByte.getData(Encoder.BLUE_BAND); while (bytesWritten < size) { if ((bytesWritten+count) > size) count = size - bytesWritten; j = bytesWritten/3; //TIFF save as BRG and not RGB. for (i = 0; i < count; i += 3) { buffer[i] = red[j]; buffer[i+1] = green[j]; buffer[i+2] = blue[j]; j++; } output.write(buffer, 0, count); bytesWritten += count; } writeColorMap(red, green, blue); }
private void writeRGBPixels() throws IOException { int bytesWritten = 0; int size = imageWidth*imageHeight*3; int count = imageWidth*24; //3*8 byte[] buffer = new byte[count]; int i, j; DataBufferByte bufferByte = (DataBufferByte) image.getRaster().getDataBuffer(); //model chosen byte[] red = bufferByte.getData(Encoder.RED_BAND); byte[] green = bufferByte.getData(Encoder.GREEN_BAND); byte[] blue = bufferByte.getData(Encoder.BLUE_BAND); while (bytesWritten < size) { if ((bytesWritten+count) > size) count = size - bytesWritten; j = bytesWritten/3; //TIFF save as BRG and not RGB. for (i = 0; i < count; i += 3) { buffer[i] = red[j]; buffer[i+1] = green[j]; buffer[i+2] = blue[j]; j++; } output.write(buffer, 0, count); bytesWritten += count; } writeColorMap(red, green, blue); }
3,228,658
private void writeScale() throws IOException { double xscale = 1.0/imageWidth; double yscale = 1.0/imageHeight; double scale = 1000000.0; if (xscale > 1000.0) scale = 1000.0; output.writeInt((int)(xscale*scale)); output.writeInt((int)scale); output.writeInt((int)(yscale*scale)); output.writeInt((int)scale); }
private void writeScale() throws IOException { double xscale = 1.0/imageWidth; double yscale = 1.0/imageHeight; double scale = 1000000.0; if (xscale > 1000.0) scale = 1000.0; output.writeInt((int)(xscale*scale)); output.writeInt((int)scale); output.writeInt((int)(yscale*scale)); output.writeInt((int)scale); }
3,228,659
public void actionPerformed(ActionEvent e) { int index = Integer.parseInt(e.getActionCommand()); try { switch (index) { case SAVE: saveDisplayOptions(); break; case RESET_DEFAULTS: resetDefaults(); break; case GREY: case RGB: case HSB: activateRenderingModel(index); break; } } catch(NumberFormatException nfe) { throw new Error("Invalid Action ID "+index, nfe); } }
public void actionPerformed(ActionEvent e) { int index = Integer.parseInt(e.getActionCommand()); try { switch (index) { case SAVE: saveDisplayOptions(); break; case RESET_DEFAULTS: resetDefaults(); break; case GREY: case RGB: case HSB: activateRenderingModel(index); break; } } catch(NumberFormatException nfe) { throw new Error("Invalid Action ID "+index, nfe); } }
3,228,660
private ModelPane activate(Class c) { ModelPane rnd = (ModelPane) renderersPool.get(c); if (rnd == null) { rnd = createRenderer(c); rnd.setEventManager(this); renderersPool.put(c, rnd); } return rnd; }
private ModelPane activate(Class c) { ModelPane rnd = (ModelPane) renderersPool.get(c); if (rnd == null) { rnd = createRenderer(c); rnd.setEventManager(this); renderersPool.put(c, rnd); } return rnd; }
3,228,661
public void activateRenderingModel(int i) { Class c = getRendererClass(i); presentation.setModelPane(activate(c), true); QuantumPane qp = presentation.getQuantumPane(); if (i == GREY) { qp.setSelectionWavelengthsEnable(false); ChannelData[] channelData = getChannelData(); for (int j = 0; j < channelData.length; j++) { if (isActive(j)) { qp.setSelectedWavelength(j); presentation.getTabs().setSelectedIndex( RenderingAgtUIF.POS_MODEL); break; } } } else qp.setSelectionWavelengthsEnable(true); abstraction.setModel(i); }
public void activateRenderingModel(int i) { Class c = getRendererClass(i); presentation.setModelPane(activate(c), true); QuantumPane qp = presentation.getQuantumPane(); if (i == GREY) { qp.setSelectionWavelengthsEnable(false); ChannelData[] channelData = getChannelData(); for (int j = 0; j < channelData.length; j++) { if (isActive(j)) { qp.setSelectedWavelength(j); presentation.getTabs().setSelectedIndex( RenderingAgtUIF.POS_MODEL); break; } } } else qp.setSelectionWavelengthsEnable(true); abstraction.setModel(i); }
3,228,662
public void addCodomainMap(CodomainMapContext ctx) { abstraction.addCodomainMap(ctx); }
public void addCodomainMap(CodomainMapContext ctx) { abstraction.addCodomainMap(ctx); }
3,228,663
private ModelPane createRenderer(Class c) { ModelPane model = null; try { model = (ModelPane) c.newInstance(); } catch(Exception e) { String msg = "Can't create an instance of "+c.getName(); throw new InternalError(msg, e); } return model; }
private ModelPane createRenderer(Class c) { ModelPane model = null; try { model = (ModelPane) c.newInstance(); } catch(Exception e) { String msg = "Can't create an instance of "+c.getName(); throw new InternalError(msg, e); } return model; }
3,228,664