bugged
stringlengths 6
599k
| fixed
stringlengths 6
40.8M
| __index_level_0__
int64 0
3.24M
|
|---|---|---|
public void testAndHeresHowWeUnlinkThings() throws Exception { // Method 1: saveImage(); List updated = unlinkImage(); iUpdate.saveCollection( updated ); fail("test that row is gone."); // Method 2: saveImage(); updated = unlinkImage(); iPojos.udpateDataObjects( (IObject[]) updated.toArray(new IObject[updated.size()]), null); // Method 3: Dataset d = new Dataset(); Project p = new Project(); p = (Project) iPojos.createDataObject( p, null ); d = (Dataset) iPojos.createDataObject( d, null ); ProjectDatasetLink link = new ProjectDatasetLink(); link.setParent( p ); link.setChild( d ); }
|
public void testAndHeresHowWeUnlinkThings() throws Exception { // Method 1: saveImage(); List updated = unlinkImage(); iUpdate.saveCollection( updated ); List list = iQuery.getListByFieldEq( DatasetImageLink.class, "child.id", img.getId() ); assertTrue( list.size() == 0 ); // Method 2: saveImage(); updated = unlinkImage(); iPojos.udpateDataObjects( (IObject[]) updated.toArray(new IObject[updated.size()]), null); // Method 3: Dataset d = new Dataset(); Project p = new Project(); p = (Project) iPojos.createDataObject( p, null ); d = (Dataset) iPojos.createDataObject( d, null ); ProjectDatasetLink link = new ProjectDatasetLink(); link.setParent( p ); link.setChild( d ); }
| 3,228,344
|
public void testAndHeresHowWeUnlinkThings() throws Exception { // Method 1: saveImage(); List updated = unlinkImage(); iUpdate.saveCollection( updated ); fail("test that row is gone."); // Method 2: saveImage(); updated = unlinkImage(); iPojos.udpateDataObjects( (IObject[]) updated.toArray(new IObject[updated.size()]), null); // Method 3: Dataset d = new Dataset(); Project p = new Project(); p = (Project) iPojos.createDataObject( p, null ); d = (Dataset) iPojos.createDataObject( d, null ); ProjectDatasetLink link = new ProjectDatasetLink(); link.setParent( p ); link.setChild( d ); }
|
public void testAndHeresHowWeUnlinkThings() throws Exception { // Method 1: saveImage(); List updated = unlinkImage(); iUpdate.saveCollection( updated ); fail("test that row is gone."); // Method 2: saveImage(); updated = unlinkImage(); iPojos.udpateDataObjects( (IObject[]) updated.toArray(new IObject[updated.size()]), null); // Method 3: Dataset d = new Dataset(); Project p = new Project(); p = (Project) iPojos.createDataObject( p, null ); d = (Dataset) iPojos.createDataObject( d, null ); ProjectDatasetLink link = new ProjectDatasetLink(); link.setParent( p ); link.setChild( d ); }
| 3,228,345
|
public void testAndSaveSomtheingWithParents() throws Exception { saveImage(); ds = (Dataset) img.iterateOverDatasetLinks().next(); Long id = ds.getId(); // another copy Image img2 = (Image) iQuery.queryUnique( "select i from Image i " + "left outer join fetch i.datasetLinks " + "where i.id = ?", new Object[]{img.getId()}); assertTrue("It better have a dataset link too", img2.sizeOfDatasetLinks()>0); Dataset ds2 = (Dataset) img2.iterateOverDatasetLinks().next(); assertTrue("And the ids have to be the same",id.equals(ds2.getId())); }
|
public void testAndSaveSomtheingWithParents() throws Exception { saveImage(); ds = (Dataset) img.linkedDatasetIterator().next(); Long id = ds.getId(); // another copy Image img2 = (Image) iQuery.queryUnique( "select i from Image i " + "left outer join fetch i.datasetLinks " + "where i.id = ?", new Object[]{img.getId()}); assertTrue("It better have a dataset link too", img2.sizeOfDatasetLinks()>0); Dataset ds2 = (Dataset) img2.iterateOverDatasetLinks().next(); assertTrue("And the ids have to be the same",id.equals(ds2.getId())); }
| 3,228,346
|
public void testAndSaveSomtheingWithParents() throws Exception { saveImage(); ds = (Dataset) img.iterateOverDatasetLinks().next(); Long id = ds.getId(); // another copy Image img2 = (Image) iQuery.queryUnique( "select i from Image i " + "left outer join fetch i.datasetLinks " + "where i.id = ?", new Object[]{img.getId()}); assertTrue("It better have a dataset link too", img2.sizeOfDatasetLinks()>0); Dataset ds2 = (Dataset) img2.iterateOverDatasetLinks().next(); assertTrue("And the ids have to be the same",id.equals(ds2.getId())); }
|
public void testAndSaveSomtheingWithParents() throws Exception { saveImage(); ds = (Dataset) img.iterateOverDatasetLinks().next(); Long id = ds.getId(); // another copy Image img2 = (Image) iQuery.queryUnique( "select i from Image i " + "left outer join fetch i.datasetLinks " + "where i.id = ?", new Object[]{img.getId()}); assertTrue("It better have a dataset link too", img2.sizeOfDatasetLinks()>0); Dataset ds2 = (Dataset) img2.linkedDatasetIterator().next(); assertTrue("And the ids have to be the same",id.equals(ds2.getId())); }
| 3,228,347
|
private List unlinkImage() { List updated = img.collectFromDatasetLinks( new CBlock() { public Object call(IObject arg0) { img.unlinkDataset( (Dataset) arg0 ); return arg0; } }); updated.add( img ); return updated; }
|
private List unlinkImage() { List updated = img.eachLinkedDataset( new CBlock() { public Object call(IObject arg0) { img.unlinkDataset( (Dataset) arg0 ); return arg0; } }); updated.add( img ); return updated; }
| 3,228,348
|
private void mousePressedLinkingModules(PNode node,PInputEvent e) { int count = e.getClickCount(); if (count ==2) { if (node instanceof FormalParameter) { FormalParameter p = (FormalParameter) node; ModuleView mod = p.getModuleView(); finishModuleLinks(mod); } else if (node instanceof ModuleView) { finishModuleLinks((ModuleView) node); } else cancelModuleLinks(); } else if (node instanceof PCamera){ // single click on camera //when linking modules.. Iterator iter = links.iterator(); Point2D pos = e.getPosition(); ParamLink lnk; int size = links.size(); float y = ((float) pos.getY()) - size/2*SPACING; while (iter.hasNext()) { lnk = (ParamLink) iter.next(); lnk.setIntermediatePoint((float) pos.getX(),y); y += SPACING; } } e.setHandled(true); }
|
private void mousePressedLinkingModules(PNode node,PInputEvent e) { int count = e.getClickCount(); if (count ==2) { if (node instanceof FormalParameter) { FormalParameter p = (FormalParameter) node; ModuleView mod = p.getModuleView(); finishModuleLinks(mod); } else if (node instanceof ModuleView) { finishModuleLinks((ModuleView) node); } else cancelModuleLinks(); } else if (node instanceof PCamera){ System.err.println("on camera"); // single click on camera //when linking modules.. Iterator iter = links.iterator(); Point2D pos = e.getPosition(); ParamLink lnk; int size = links.size(); float y = ((float) pos.getY()) - size/2*SPACING; while (iter.hasNext()) { lnk = (ParamLink) iter.next(); lnk.setIntermediatePoint((float) pos.getX(),y); y += SPACING; } } e.setHandled(true); }
| 3,228,352
|
public IRubyObject initialize(IRubyObject[] args) { int count = checkArgumentCount(args, 1, 2); int newFileno = RubyNumeric.fix2int(args[0]); String mode = null; if (count > 1) { mode = args[1].convertToString().getValue(); } // See if we already have this descriptor open. // If so then we can mostly share the handler (keep open // file, but possibly change the mode). IOHandler existingIOHandler = getIOHandlerByFileno(newFileno); if (existingIOHandler == null) { if (mode == null) { mode = "r"; } try { handler = new IOHandlerUnseekable(getRuntime(), newFileno, mode); } catch (IOException e) { throw getRuntime().newIOError(e.getMessage()); } modes = new IOModes(getRuntime(), mode); registerIOHandler(handler); } else { // We are creating a new IO object that shares the same // IOHandler (and fileno). handler = existingIOHandler; // Inherit if no mode specified otherwise create new one modes = mode == null ? handler.getModes() : new IOModes(getRuntime(), mode); // Reset file based on modes. try { handler.reset(modes); } catch (IOHandler.InvalidValueException e) { throw getRuntime().newErrnoEINVALError(); } catch (IOException e) { throw getRuntime().newIOError(e.getMessage()); } } return this; }
|
public IRubyObject initialize(IRubyObject[] args) { int count = checkArgumentCount(args, 1, 2); int newFileno = RubyNumeric.fix2int(args[0]); String mode = null; if (count > 1) { mode = args[1].convertToString().toString(); } // See if we already have this descriptor open. // If so then we can mostly share the handler (keep open // file, but possibly change the mode). IOHandler existingIOHandler = getIOHandlerByFileno(newFileno); if (existingIOHandler == null) { if (mode == null) { mode = "r"; } try { handler = new IOHandlerUnseekable(getRuntime(), newFileno, mode); } catch (IOException e) { throw getRuntime().newIOError(e.getMessage()); } modes = new IOModes(getRuntime(), mode); registerIOHandler(handler); } else { // We are creating a new IO object that shares the same // IOHandler (and fileno). handler = existingIOHandler; // Inherit if no mode specified otherwise create new one modes = mode == null ? handler.getModes() : new IOModes(getRuntime(), mode); // Reset file based on modes. try { handler.reset(modes); } catch (IOHandler.InvalidValueException e) { throw getRuntime().newErrnoEINVALError(); } catch (IOException e) { throw getRuntime().newIOError(e.getMessage()); } } return this; }
| 3,228,354
|
public IRubyObject internalGets(IRubyObject[] args) { checkReadable(); IRubyObject sepVal = getRuntime().getGlobalVariables().get("$/"); if (args.length > 0) { sepVal = args[0]; } String separator = sepVal.isNil() ? null : ((RubyString) sepVal).getValue(); if (separator != null && separator.length() == 0) { separator = IOHandler.PARAGRAPH_DELIMETER; } try { String newLine = handler.gets(separator); if (newLine != null) { lineNumber++; getRuntime().getGlobalVariables().set("$.", getRuntime().newFixnum(lineNumber)); RubyString result = getRuntime().newString(newLine); result.taint(); return result; } return getRuntime().getNil(); } catch (IOHandler.BadDescriptorException e) { throw getRuntime().newErrnoEBADFError(); } catch (IOException e) { throw getRuntime().newIOError(e.getMessage()); } }
|
public IRubyObject internalGets(IRubyObject[] args) { checkReadable(); IRubyObject sepVal = getRuntime().getGlobalVariables().get("$/"); if (args.length > 0) { sepVal = args[0]; } String separator = sepVal.isNil() ? null : ((RubyString) sepVal).toString(); if (separator != null && separator.length() == 0) { separator = IOHandler.PARAGRAPH_DELIMETER; } try { String newLine = handler.gets(separator); if (newLine != null) { lineNumber++; getRuntime().getGlobalVariables().set("$.", getRuntime().newFixnum(lineNumber)); RubyString result = getRuntime().newString(newLine); result.taint(); return result; } return getRuntime().getNil(); } catch (IOHandler.BadDescriptorException e) { throw getRuntime().newErrnoEBADFError(); } catch (IOException e) { throw getRuntime().newIOError(e.getMessage()); } }
| 3,228,355
|
public IRubyObject reopen(IRubyObject[] args) { if (args.length < 1) { throw getRuntime().newArgumentError("wrong number of arguments"); } if (args[0].isKindOf(getRuntime().getClass("IO"))) { RubyIO ios = (RubyIO) args[0]; int keepFileno = handler.getFileno(); // close the old handler before it gets overwritten if (handler.isOpen()) { try { handler.close(); } catch (IOHandler.BadDescriptorException e) { throw getRuntime().newErrnoEBADFError(); } catch (IOException e) { throw getRuntime().newIOError(e.getMessage()); } } // When we reopen, we want our fileno to be preserved even // though we have a new IOHandler. // Note: When we clone we get a new fileno...then we replace it. // This ends up incrementing our fileno index up, which makes the // fileno we choose different from ruby. Since this seems a bit // too implementation specific, I did not bother trying to get // these to agree (what scary code would depend on fileno generating // a particular way?) try { handler = ios.handler.cloneIOHandler(); } catch (IOHandler.InvalidValueException e) { throw getRuntime().newErrnoEINVALError(); } catch (IOHandler.PipeException e) { throw getRuntime().newErrnoESPIPEError(); } catch (FileNotFoundException e) { throw getRuntime().newErrnoENOENTError(); } catch (IOException e) { throw getRuntime().newIOError(e.getMessage()); } handler.setFileno(keepFileno); // Update fileno list with our new handler registerIOHandler(handler); } else if (args[0].isKindOf(getRuntime().getClass("String"))) { String path = ((RubyString) args[0]).getValue(); String mode = "r"; if (args.length > 1) { if (!args[1].isKindOf(getRuntime().getClass("String"))) { throw getRuntime().newTypeError(args[1], getRuntime().getClass("String")); } mode = ((RubyString) args[1]).getValue(); } try { if (handler != null) { close(); } modes = new IOModes(getRuntime(), mode); handler = new IOHandlerSeekable(getRuntime(), path, modes); registerIOHandler(handler); } catch (IOHandler.InvalidValueException e) { throw getRuntime().newErrnoEINVALError(); } catch (IOException e) { throw getRuntime().newIOError(e.toString()); } } // A potentially previously close IO is being 'reopened'. isOpen = true; return this; }
|
public IRubyObject reopen(IRubyObject[] args) { if (args.length < 1) { throw getRuntime().newArgumentError("wrong number of arguments"); } if (args[0].isKindOf(getRuntime().getClass("IO"))) { RubyIO ios = (RubyIO) args[0]; int keepFileno = handler.getFileno(); // close the old handler before it gets overwritten if (handler.isOpen()) { try { handler.close(); } catch (IOHandler.BadDescriptorException e) { throw getRuntime().newErrnoEBADFError(); } catch (IOException e) { throw getRuntime().newIOError(e.getMessage()); } } // When we reopen, we want our fileno to be preserved even // though we have a new IOHandler. // Note: When we clone we get a new fileno...then we replace it. // This ends up incrementing our fileno index up, which makes the // fileno we choose different from ruby. Since this seems a bit // too implementation specific, I did not bother trying to get // these to agree (what scary code would depend on fileno generating // a particular way?) try { handler = ios.handler.cloneIOHandler(); } catch (IOHandler.InvalidValueException e) { throw getRuntime().newErrnoEINVALError(); } catch (IOHandler.PipeException e) { throw getRuntime().newErrnoESPIPEError(); } catch (FileNotFoundException e) { throw getRuntime().newErrnoENOENTError(); } catch (IOException e) { throw getRuntime().newIOError(e.getMessage()); } handler.setFileno(keepFileno); // Update fileno list with our new handler registerIOHandler(handler); } else if (args[0].isKindOf(getRuntime().getClass("String"))) { String path = ((RubyString) args[0]).toString(); String mode = "r"; if (args.length > 1) { if (!args[1].isKindOf(getRuntime().getClass("String"))) { throw getRuntime().newTypeError(args[1], getRuntime().getClass("String")); } mode = ((RubyString) args[1]).getValue(); } try { if (handler != null) { close(); } modes = new IOModes(getRuntime(), mode); handler = new IOHandlerSeekable(getRuntime(), path, modes); registerIOHandler(handler); } catch (IOHandler.InvalidValueException e) { throw getRuntime().newErrnoEINVALError(); } catch (IOException e) { throw getRuntime().newIOError(e.toString()); } } // A potentially previously close IO is being 'reopened'. isOpen = true; return this; }
| 3,228,356
|
public IRubyObject reopen(IRubyObject[] args) { if (args.length < 1) { throw getRuntime().newArgumentError("wrong number of arguments"); } if (args[0].isKindOf(getRuntime().getClass("IO"))) { RubyIO ios = (RubyIO) args[0]; int keepFileno = handler.getFileno(); // close the old handler before it gets overwritten if (handler.isOpen()) { try { handler.close(); } catch (IOHandler.BadDescriptorException e) { throw getRuntime().newErrnoEBADFError(); } catch (IOException e) { throw getRuntime().newIOError(e.getMessage()); } } // When we reopen, we want our fileno to be preserved even // though we have a new IOHandler. // Note: When we clone we get a new fileno...then we replace it. // This ends up incrementing our fileno index up, which makes the // fileno we choose different from ruby. Since this seems a bit // too implementation specific, I did not bother trying to get // these to agree (what scary code would depend on fileno generating // a particular way?) try { handler = ios.handler.cloneIOHandler(); } catch (IOHandler.InvalidValueException e) { throw getRuntime().newErrnoEINVALError(); } catch (IOHandler.PipeException e) { throw getRuntime().newErrnoESPIPEError(); } catch (FileNotFoundException e) { throw getRuntime().newErrnoENOENTError(); } catch (IOException e) { throw getRuntime().newIOError(e.getMessage()); } handler.setFileno(keepFileno); // Update fileno list with our new handler registerIOHandler(handler); } else if (args[0].isKindOf(getRuntime().getClass("String"))) { String path = ((RubyString) args[0]).getValue(); String mode = "r"; if (args.length > 1) { if (!args[1].isKindOf(getRuntime().getClass("String"))) { throw getRuntime().newTypeError(args[1], getRuntime().getClass("String")); } mode = ((RubyString) args[1]).getValue(); } try { if (handler != null) { close(); } modes = new IOModes(getRuntime(), mode); handler = new IOHandlerSeekable(getRuntime(), path, modes); registerIOHandler(handler); } catch (IOHandler.InvalidValueException e) { throw getRuntime().newErrnoEINVALError(); } catch (IOException e) { throw getRuntime().newIOError(e.toString()); } } // A potentially previously close IO is being 'reopened'. isOpen = true; return this; }
|
public IRubyObject reopen(IRubyObject[] args) { if (args.length < 1) { throw getRuntime().newArgumentError("wrong number of arguments"); } if (args[0].isKindOf(getRuntime().getClass("IO"))) { RubyIO ios = (RubyIO) args[0]; int keepFileno = handler.getFileno(); // close the old handler before it gets overwritten if (handler.isOpen()) { try { handler.close(); } catch (IOHandler.BadDescriptorException e) { throw getRuntime().newErrnoEBADFError(); } catch (IOException e) { throw getRuntime().newIOError(e.getMessage()); } } // When we reopen, we want our fileno to be preserved even // though we have a new IOHandler. // Note: When we clone we get a new fileno...then we replace it. // This ends up incrementing our fileno index up, which makes the // fileno we choose different from ruby. Since this seems a bit // too implementation specific, I did not bother trying to get // these to agree (what scary code would depend on fileno generating // a particular way?) try { handler = ios.handler.cloneIOHandler(); } catch (IOHandler.InvalidValueException e) { throw getRuntime().newErrnoEINVALError(); } catch (IOHandler.PipeException e) { throw getRuntime().newErrnoESPIPEError(); } catch (FileNotFoundException e) { throw getRuntime().newErrnoENOENTError(); } catch (IOException e) { throw getRuntime().newIOError(e.getMessage()); } handler.setFileno(keepFileno); // Update fileno list with our new handler registerIOHandler(handler); } else if (args[0].isKindOf(getRuntime().getClass("String"))) { String path = ((RubyString) args[0]).getValue(); String mode = "r"; if (args.length > 1) { if (!args[1].isKindOf(getRuntime().getClass("String"))) { throw getRuntime().newTypeError(args[1], getRuntime().getClass("String")); } mode = ((RubyString) args[1]).toString(); } try { if (handler != null) { close(); } modes = new IOModes(getRuntime(), mode); handler = new IOHandlerSeekable(getRuntime(), path, modes); registerIOHandler(handler); } catch (IOHandler.InvalidValueException e) { throw getRuntime().newErrnoEINVALError(); } catch (IOException e) { throw getRuntime().newIOError(e.toString()); } } // A potentially previously close IO is being 'reopened'. isOpen = true; return this; }
| 3,228,357
|
public IOModes(IRuby runtime, String modesString) { this(runtime, convertModesStringToModesInt(runtime, modesString)); }
|
public IOModes(IRuby runtime, String modesString) { this(runtime, convertModesStringToModesInt(runtime, modesString)); }
| 3,228,358
|
public int getc() throws IOException, BadDescriptorException { checkReadable(); int c = read(); if (c == -1) { return c; } return c & 0xff; }
|
public int getc() throws IOException, BadDescriptorException { checkReadable(); int c = read(); if (c == -1) { return c; } return c & 0xff; }
| 3,228,359
|
public abstract void sync() throws IOException;
|
public abstract void sync() throws IOException, BadDescriptorException;
| 3,228,360
|
public String gets(String separatorString) throws IOException, BadDescriptorException { checkReadable(); if (separatorString == null) { return getsEntireStream(); } final char[] separator = separatorString.equals(PARAGRAPH_DELIMETER) ? "\n\n".toCharArray() : separatorString.toCharArray(); int c = read(); if (c == -1) { return null; } StringBuffer buffer = new StringBuffer(); LineLoop : while (true) { while (c != separator[0] && c != -1) { buffer.append((char) c); c = read(); } for (int i = 0; i < separator.length; i++) { if (c == -1) { break LineLoop; } else if (c != separator[i]) { continue LineLoop; } buffer.append((char) c); if (i < separator.length - 1) { c = read(); } } break; } if (separatorString.equals(PARAGRAPH_DELIMETER)) { while (c == separator[0]) { c = read(); } ungetc(c); } return buffer.toString(); }
|
public String gets(String separatorString) throws IOException, BadDescriptorException { checkReadable(); if (separatorString == null) { return getsEntireStream(); } final char[] separator = separatorString.equals(PARAGRAPH_DELIMETER) ? "\n\n".toCharArray() : separatorString.toCharArray(); int c = read(); if (c == -1) { return null; } StringBuffer buffer = new StringBuffer(); LineLoop : while (true) { while (c != separator[0] && c != -1) { buffer.append((char) c); c = read(); } for (int i = 0; i < separator.length; i++) { if (c == -1) { break LineLoop; } else if (c != separator[i]) { continue LineLoop; } buffer.append((char) c); if (i < separator.length - 1) { c = read(); } } break; } if (separatorString.equals(PARAGRAPH_DELIMETER)) { while (c == separator[0]) { c = read(); } ungetc(c); } return buffer.toString(); }
| 3,228,361
|
public void putc(int c) throws IOException, BadDescriptorException { try { syswrite("" + (char) c); // LAME } catch (IOException e) { } }
|
public void putc(int c) throws IOException, BadDescriptorException { try { syswrite("" + (char) c); // LAME } catch (IOException e) { } }
| 3,228,362
|
public String read(int number) throws IOException, BadDescriptorException { try { if (ungotc >= 0) { String buf2 = sysread(number - 1); int c = ungotc; ungotc = -1; return c + buf2; } return sysread(number); } catch (EOFException e) { return null; } }
|
public String read(int number) throws IOException, BadDescriptorException { try { if (ungotc >= 0) { String buf2 = sysread(number - 1); int c = ungotc; ungotc = -1; return c + buf2; } return sysread(number); } catch (EOFException e) { return null; } }
| 3,228,363
|
public String getsEntireStream() throws IOException { StringBuffer result = new StringBuffer(); int c; while ((c = read()) != -1) { result.append((char) c); } // We are already at EOF if (result.length() == 0) { return null; } return result.toString(); }
|
public String getsEntireStream() throws IOException { StringBuffer result = new StringBuffer(); int c; while ((c = read()) != -1) { result.append((char) c); } // We are already at EOF if (result.length() == 0) { return null; } return result.toString(); }
| 3,228,364
|
public IOHandlerSeekable(IRuby runtime, String path, IOModes modes) throws IOException, InvalidValueException { super(runtime); this.path = path; this.modes = modes; NormalizedFile theFile = (NormalizedFile)new NormalizedFile(path).getAbsoluteFile(); if (theFile.exists()) { if (modes.shouldTruncate()) { // If we only want to open for writing we should remove // the old file before opening the fresh one. If it fails // to remove it we should do something? if (!theFile.delete()) { } } } else { if (modes.isReadable() && !modes.isWriteable()) { throw new FileNotFoundException(); } } // Do not open as 'rw' if we don't need to since a file with permissions for read-only // will barf if opened 'rw'. String javaMode = "r"; if (modes.isWriteable()) { javaMode += "w"; } // We always open this rw since we can only open it r or rw. file = new RandomAccessFile(theFile, javaMode); isOpen = true; if (modes.isAppendable()) { seek(0, SEEK_END); } // We give a fileno last so that we do not consume these when // we have a problem opening a file. fileno = RubyIO.getNewFileno(); }
|
public IOHandlerSeekable(IRuby runtime, String path, IOModes modes) throws IOException, InvalidValueException { super(runtime); this.path = path; this.modes = modes; NormalizedFile theFile = new NormalizedFile(path); if (!theFile.isAbsolute()) { theFile = (NormalizedFile)new NormalizedFile(getRuntime().getCurrentDirectory(), path).getAbsoluteFile(); } if (theFile.exists()) { if (modes.shouldTruncate()) { // If we only want to open for writing we should remove // the old file before opening the fresh one. If it fails // to remove it we should do something? if (!theFile.delete()) { } } } else { if (modes.isReadable() && !modes.isWriteable()) { throw new FileNotFoundException(); } } // Do not open as 'rw' if we don't need to since a file with permissions for read-only // will barf if opened 'rw'. String javaMode = "r"; if (modes.isWriteable()) { javaMode += "w"; } // We always open this rw since we can only open it r or rw. file = new RandomAccessFile(theFile, javaMode); isOpen = true; if (modes.isAppendable()) { seek(0, SEEK_END); } // We give a fileno last so that we do not consume these when // we have a problem opening a file. fileno = RubyIO.getNewFileno(); }
| 3,228,365
|
public String sysread(int number) throws IOException, BadDescriptorException { if (!isOpen()) { throw new IOException("File not open"); } checkReadable(); StringBuffer buf = new StringBuffer(); int position = 0; while (position < number) { int s = sysread(buf, number - position); if (s == -1) { if (position <= 0) { throw new EOFException(); } break; } position += s; } return buf.toString(); }
|
public String sysread(int number) throws IOException, BadDescriptorException { if (!isOpen()) { throw new IOException("File not open"); } checkReadable(); StringBuffer buf = new StringBuffer(); int position = 0; while (position < number) { int s = sysread(buf, number - position); if (s == -1) { if (position <= 0) { throw new EOFException(); } break; } position += s; } return buf.toString(); }
| 3,228,366
|
public void ungetc(int c) { // Ruby silently ignores negative ints for some reason? if (c >= 0) { ungotc = c; } }
|
public void ungetc(int c) { // Ruby silently ignores negative ints for some reason? if (c >= 0) { ungotc = c; } }
| 3,228,367
|
public int write(String string) throws IOException, BadDescriptorException { return syswrite(string); }
|
public int write(String string) throws IOException, BadDescriptorException { return syswrite(string); }
| 3,228,368
|
public BrowserInternalFrame(BrowserController theController) { setSize(600,600); setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE); if(theController != null) { this.controller = theController; String title = controller.getName(); setTitle("Image Browser: "+title); this.embeddedView = controller.getView(); embeddedView.setZoomToScale(true); this.env = BrowserEnvironment.getInstance(); } setJMenuBar(new BrowserMenuBar(theController.getBrowserModel())); JPanel toolbarPanel = new JPanel(); toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); IconManager manager = env.getIconManager(); JButton optionsButton = new JButton(manager.getSmallIcon(IconManager.OPTIONS_BAR)); optionsButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { controller.getOverlayModel().showPalette(UIConstants.OPTIONS_PALETTE_NAME); } }); optionsButton.setToolTipText("Show Options Menu"); toolbarPanel.add(optionsButton); toolbarPanel.add(new JSeparator(JSeparator.HORIZONTAL)); ZoomButtonPanel panel = new ZoomButtonPanel(embeddedView); toolbarPanel.add(panel); Container container = getContentPane(); container.setLayout(new BorderLayout()); final JScrollBar horizontalBar = new JScrollBar(JScrollBar.HORIZONTAL); final JScrollBar verticalBar = new JScrollBar(JScrollBar.VERTICAL); embeddedView.getViewCamera().addCameraListener(new CameraListener() { /* (non-Javadoc) * @see org.openmicroscopy.shoola.agents.browser.ui.CameraListener#cameraBoundsChanged(double, double, double, double, double, double) */ public void cameraBoundsChanged(double valueX, double valueY, double extentX, double extentY, double width, double height) { int iX = (int)Math.round(valueX); int iY = (int)Math.round(valueY); int iEX = (int)Math.round(extentX); int iEY = (int)Math.round(extentY); int iW = (int)Math.round(width); int iH = (int)Math.round(height); BoundedRangeModel horizModel = horizontalBar.getModel(); BoundedRangeModel vertModel = verticalBar.getModel(); if(iEX+iX > iW) horizontalBar.setEnabled(false); else { horizontalBar.setEnabled(true); if(iW != horizModel.getMaximum() || iEX != horizModel.getExtent()) { BoundedRangeModel hModel = new DefaultBoundedRangeModel(iX,iEX,0,iW); horizontalBar.setModel(hModel); } else { horizModel.setValue(iX); } } if(iEY+iY > iH) verticalBar.setEnabled(false); else { verticalBar.setEnabled(true); if(iH != vertModel.getMaximum() || iEY != vertModel.getExtent()) { BoundedRangeModel vModel = new DefaultBoundedRangeModel(iY,iEY,0,iH); verticalBar.setModel(vModel); } else { vertModel.setValue(iY); } } } }); horizontalBar.setEnabled(false); horizontalBar.setModel(new DefaultBoundedRangeModel(0,0,0,0)); horizontalBar.addAdjustmentListener(new AdjustmentListener() { public void adjustmentValueChanged(AdjustmentEvent e) { int value = e.getValue(); embeddedView.getViewCamera().setX(value); } }); verticalBar.setEnabled(false); verticalBar.setModel(new DefaultBoundedRangeModel(0,0,0,0)); verticalBar.addAdjustmentListener(new AdjustmentListener() { public void adjustmentValueChanged(AdjustmentEvent e) { int value = e.getValue(); embeddedView.getViewCamera().setY(value); } }); JPanel fakeScrollPane = new JPanel(); JPanel verticalPanel = new JPanel(); verticalPanel.setLayout(new BorderLayout()); verticalPanel.add(embeddedView,BorderLayout.CENTER); verticalPanel.add(verticalBar,BorderLayout.EAST); JPanel horizontalPanel = new JPanel(); horizontalPanel.setLayout(new BorderLayout()); horizontalPanel.add(horizontalBar,BorderLayout.CENTER); horizontalPanel.add(Box.createHorizontalStrut(verticalBar.getPreferredSize().width), BorderLayout.EAST); verticalPanel.add(horizontalPanel,BorderLayout.SOUTH); fakeScrollPane.setLayout(new BorderLayout()); fakeScrollPane.add(verticalPanel,BorderLayout.CENTER); container.add(fakeScrollPane,BorderLayout.CENTER); container.add(toolbarPanel,BorderLayout.NORTH); if(controller.getStatusView() != null) { container.add(controller.getStatusView(),BorderLayout.SOUTH); } this.addFocusListener(new CommonFocusAdapter(this)); final UIWrapper refCopy = this; this.addInternalFrameListener(new InternalFrameAdapter() { /* (non-Javadoc) * @see javax.swing.event.InternalFrameAdapter#internalFrameClosing(javax.swing.event.InternalFrameEvent) */ public void internalFrameClosing(InternalFrameEvent arg0) { env.getBrowserManager().removeBrowser(refCopy); } }); }
|
public BrowserInternalFrame(BrowserController theController) { setSize(600,600); setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE); if(theController != null) { this.controller = theController; String title = controller.getName(); setTitle("Image Browser: "+title); this.embeddedView = controller.getView(); embeddedView.setZoomToScale(true); this.env = BrowserEnvironment.getInstance(); } setJMenuBar(new BrowserMenuBar(theController.getBrowserModel())); JPanel toolbarPanel = new JPanel(); toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); IconManager manager = env.getIconManager(); JButton optionsButton = new JButton(manager.getSmallIcon(IconManager.OPTIONS_BAR)); optionsButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { controller.getOverlayModel().showPalette(UIConstants.OPTIONS_PALETTE_NAME); } }); optionsButton.setToolTipText("Show Options Menu"); toolbarPanel.add(optionsButton); toolbarPanel.add(new JSeparator(JSeparator.HORIZONTAL)); ZoomButtonPanel panel = new ZoomButtonPanel(embeddedView); toolbarPanel.add(panel); Container container = getContentPane(); container.setLayout(new BorderLayout()); final JScrollBar horizontalBar = new JScrollBar(JScrollBar.HORIZONTAL); final JScrollBar verticalBar = new JScrollBar(JScrollBar.VERTICAL); embeddedView.getViewCamera().addCameraListener(new CameraListener() { /* (non-Javadoc) * @see org.openmicroscopy.shoola.agents.browser.ui.CameraListener#cameraBoundsChanged(double, double, double, double, double, double) */ public void cameraBoundsChanged(double valueX, double valueY, double extentX, double extentY, double width, double height) { int iX = (int)Math.round(valueX); int iY = (int)Math.round(valueY); int iEX = (int)Math.round(extentX); int iEY = (int)Math.round(extentY); int iW = (int)Math.round(width); int iH = (int)Math.round(height); BoundedRangeModel horizModel = horizontalBar.getModel(); BoundedRangeModel vertModel = verticalBar.getModel(); if(iEX+iX > iW) horizontalBar.setEnabled(false); else { horizontalBar.setEnabled(true); if(iW != horizModel.getMaximum() || iEX != horizModel.getExtent()) { BoundedRangeModel hModel = new DefaultBoundedRangeModel(iX,iEX,0,iW); horizontalBar.setModel(hModel); } else { horizModel.setValue(iX); } } if(iEY+iY > iH) verticalBar.setEnabled(false); else { verticalBar.setEnabled(true); if(iH != vertModel.getMaximum() || iEY != vertModel.getExtent()) { BoundedRangeModel vModel = new DefaultBoundedRangeModel(iY,iEY,0,iH); verticalBar.setModel(vModel); } else { vertModel.setValue(iY); } } } }); horizontalBar.setEnabled(false); horizontalBar.setModel(new DefaultBoundedRangeModel(0,0,0,0)); horizontalBar.addAdjustmentListener(new AdjustmentListener() { public void adjustmentValueChanged(AdjustmentEvent e) { int value = e.getValue(); embeddedView.getViewCamera().setX(value); } }); verticalBar.setEnabled(false); verticalBar.setModel(new DefaultBoundedRangeModel(0,0,0,0)); verticalBar.addAdjustmentListener(new AdjustmentListener() { public void adjustmentValueChanged(AdjustmentEvent e) { int value = e.getValue(); embeddedView.getViewCamera().setY(value); } }); JPanel fakeScrollPane = new JPanel(); JPanel verticalPanel = new JPanel(); verticalPanel.setLayout(new BorderLayout()); verticalPanel.add(embeddedView,BorderLayout.CENTER); verticalPanel.add(verticalBar,BorderLayout.EAST); JPanel horizontalPanel = new JPanel(); horizontalPanel.setLayout(new BorderLayout()); horizontalPanel.add(horizontalBar,BorderLayout.CENTER); horizontalPanel.add(Box.createHorizontalStrut(verticalBar.getPreferredSize().width), BorderLayout.EAST); verticalPanel.add(horizontalPanel,BorderLayout.SOUTH); fakeScrollPane.setLayout(new BorderLayout()); fakeScrollPane.add(verticalPanel,BorderLayout.CENTER); container.add(fakeScrollPane,BorderLayout.CENTER); container.add(toolbarPanel,BorderLayout.NORTH); if(controller.getStatusView() != null) { container.add(controller.getStatusView(),BorderLayout.SOUTH); } this.addFocusListener(new CommonFocusAdapter(this)); final UIWrapper refCopy = this; this.addInternalFrameListener(new InternalFrameAdapter() { /* (non-Javadoc) * @see javax.swing.event.InternalFrameAdapter#internalFrameClosing(javax.swing.event.InternalFrameEvent) */ public void internalFrameClosing(InternalFrameEvent arg0) { env.getBrowserManager().removeBrowser(refCopy); } }); }
| 3,228,369
|
public BrowserInternalFrame(BrowserController theController) { setSize(600,600); setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE); if(theController != null) { this.controller = theController; String title = controller.getName(); setTitle("Image Browser: "+title); this.embeddedView = controller.getView(); embeddedView.setZoomToScale(true); this.env = BrowserEnvironment.getInstance(); } setJMenuBar(new BrowserMenuBar(theController.getBrowserModel())); JPanel toolbarPanel = new JPanel(); toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); IconManager manager = env.getIconManager(); JButton optionsButton = new JButton(manager.getSmallIcon(IconManager.OPTIONS_BAR)); optionsButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { controller.getOverlayModel().showPalette(UIConstants.OPTIONS_PALETTE_NAME); } }); optionsButton.setToolTipText("Show Options Menu"); toolbarPanel.add(optionsButton); toolbarPanel.add(new JSeparator(JSeparator.HORIZONTAL)); ZoomButtonPanel panel = new ZoomButtonPanel(embeddedView); toolbarPanel.add(panel); Container container = getContentPane(); container.setLayout(new BorderLayout()); final JScrollBar horizontalBar = new JScrollBar(JScrollBar.HORIZONTAL); final JScrollBar verticalBar = new JScrollBar(JScrollBar.VERTICAL); embeddedView.getViewCamera().addCameraListener(new CameraListener() { /* (non-Javadoc) * @see org.openmicroscopy.shoola.agents.browser.ui.CameraListener#cameraBoundsChanged(double, double, double, double, double, double) */ public void cameraBoundsChanged(double valueX, double valueY, double extentX, double extentY, double width, double height) { int iX = (int)Math.round(valueX); int iY = (int)Math.round(valueY); int iEX = (int)Math.round(extentX); int iEY = (int)Math.round(extentY); int iW = (int)Math.round(width); int iH = (int)Math.round(height); BoundedRangeModel horizModel = horizontalBar.getModel(); BoundedRangeModel vertModel = verticalBar.getModel(); if(iEX+iX > iW) horizontalBar.setEnabled(false); else { horizontalBar.setEnabled(true); if(iW != horizModel.getMaximum() || iEX != horizModel.getExtent()) { BoundedRangeModel hModel = new DefaultBoundedRangeModel(iX,iEX,0,iW); horizontalBar.setModel(hModel); } else { horizModel.setValue(iX); } } if(iEY+iY > iH) verticalBar.setEnabled(false); else { verticalBar.setEnabled(true); if(iH != vertModel.getMaximum() || iEY != vertModel.getExtent()) { BoundedRangeModel vModel = new DefaultBoundedRangeModel(iY,iEY,0,iH); verticalBar.setModel(vModel); } else { vertModel.setValue(iY); } } } }); horizontalBar.setEnabled(false); horizontalBar.setModel(new DefaultBoundedRangeModel(0,0,0,0)); horizontalBar.addAdjustmentListener(new AdjustmentListener() { public void adjustmentValueChanged(AdjustmentEvent e) { int value = e.getValue(); embeddedView.getViewCamera().setX(value); } }); verticalBar.setEnabled(false); verticalBar.setModel(new DefaultBoundedRangeModel(0,0,0,0)); verticalBar.addAdjustmentListener(new AdjustmentListener() { public void adjustmentValueChanged(AdjustmentEvent e) { int value = e.getValue(); embeddedView.getViewCamera().setY(value); } }); JPanel fakeScrollPane = new JPanel(); JPanel verticalPanel = new JPanel(); verticalPanel.setLayout(new BorderLayout()); verticalPanel.add(embeddedView,BorderLayout.CENTER); verticalPanel.add(verticalBar,BorderLayout.EAST); JPanel horizontalPanel = new JPanel(); horizontalPanel.setLayout(new BorderLayout()); horizontalPanel.add(horizontalBar,BorderLayout.CENTER); horizontalPanel.add(Box.createHorizontalStrut(verticalBar.getPreferredSize().width), BorderLayout.EAST); verticalPanel.add(horizontalPanel,BorderLayout.SOUTH); fakeScrollPane.setLayout(new BorderLayout()); fakeScrollPane.add(verticalPanel,BorderLayout.CENTER); container.add(fakeScrollPane,BorderLayout.CENTER); container.add(toolbarPanel,BorderLayout.NORTH); if(controller.getStatusView() != null) { container.add(controller.getStatusView(),BorderLayout.SOUTH); } this.addFocusListener(new CommonFocusAdapter(this)); final UIWrapper refCopy = this; this.addInternalFrameListener(new InternalFrameAdapter() { /* (non-Javadoc) * @see javax.swing.event.InternalFrameAdapter#internalFrameClosing(javax.swing.event.InternalFrameEvent) */ public void internalFrameClosing(InternalFrameEvent arg0) { env.getBrowserManager().removeBrowser(refCopy); } }); }
|
public BrowserInternalFrame(BrowserController theController) { setSize(600,600); setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE); if(theController != null) { this.controller = theController; String title = controller.getName(); setTitle("Image Browser: "+title); this.embeddedView = controller.getView(); embeddedView.setZoomToScale(true); this.env = BrowserEnvironment.getInstance(); } setJMenuBar(new BrowserMenuBar(theController.getBrowserModel())); JPanel toolbarPanel = new JPanel(); toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); IconManager manager = env.getIconManager(); JButton optionsButton = new JButton(manager.getSmallIcon(IconManager.OPTIONS_BAR)); optionsButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { controller.getOverlayModel().showPalette(UIConstants.OPTIONS_PALETTE_NAME); } }); optionsButton.setToolTipText("Show Options Menu"); toolbarPanel.add(optionsButton); toolbarPanel.add(new JSeparator(JSeparator.HORIZONTAL)); ZoomButtonPanel panel = new ZoomButtonPanel(embeddedView); toolbarPanel.add(panel); Container container = getContentPane(); container.setLayout(new BorderLayout()); final JScrollBar horizontalBar = new JScrollBar(JScrollBar.HORIZONTAL); final JScrollBar verticalBar = new JScrollBar(JScrollBar.VERTICAL); embeddedView.getViewCamera().addCameraListener(new CameraListener() { /* (non-Javadoc) * @see org.openmicroscopy.shoola.agents.browser.ui.CameraListener#cameraBoundsChanged(double, double, double, double, double, double) */ public void cameraBoundsChanged(double valueX, double valueY, double extentX, double extentY, double width, double height) { int iX = (int)Math.round(valueX); int iY = (int)Math.round(valueY); int iEX = (int)Math.round(extentX); int iEY = (int)Math.round(extentY); int iW = (int)Math.round(width); int iH = (int)Math.round(height); BoundedRangeModel horizModel = horizontalBar.getModel(); BoundedRangeModel vertModel = verticalBar.getModel(); if(iEX+iX > iW) horizontalBar.setEnabled(false); else { horizontalBar.setEnabled(true); if(iW != horizModel.getMaximum() || iEX != horizModel.getExtent()) { BoundedRangeModel hModel = new DefaultBoundedRangeModel(iX,iEX,0,iW); horizontalBar.setModel(hModel); } else { horizModel.setValue(iX); } } if(iEY+iY > iH) verticalBar.setEnabled(false); else { verticalBar.setEnabled(true); if(iH != vertModel.getMaximum() || iEY != vertModel.getExtent()) { BoundedRangeModel vModel = new DefaultBoundedRangeModel(iY,iEY,0,iH); verticalBar.setModel(vModel); } else { vertModel.setValue(iY); } } } }); horizontalBar.setEnabled(false); horizontalBar.setModel(new DefaultBoundedRangeModel(0,0,0,0)); horizontalBar.addAdjustmentListener(new AdjustmentListener() { public void adjustmentValueChanged(AdjustmentEvent e) { int value = e.getValue(); embeddedView.getViewCamera().setX(value); } }); verticalBar.setEnabled(false); verticalBar.setModel(new DefaultBoundedRangeModel(0,0,0,0)); verticalBar.addAdjustmentListener(new AdjustmentListener() { public void adjustmentValueChanged(AdjustmentEvent e) { int value = e.getValue(); embeddedView.getViewCamera().setY(value); } }); JPanel fakeScrollPane = new JPanel(); JPanel verticalPanel = new JPanel(); verticalPanel.setLayout(new BorderLayout()); verticalPanel.add(embeddedView,BorderLayout.CENTER); verticalPanel.add(verticalBar,BorderLayout.EAST); JPanel horizontalPanel = new JPanel(); horizontalPanel.setLayout(new BorderLayout()); horizontalPanel.add(horizontalBar,BorderLayout.CENTER); horizontalPanel.add(Box.createHorizontalStrut(verticalBar.getPreferredSize().width), BorderLayout.EAST); verticalPanel.add(horizontalPanel,BorderLayout.SOUTH); fakeScrollPane.setLayout(new BorderLayout()); fakeScrollPane.add(verticalPanel,BorderLayout.CENTER); container.add(fakeScrollPane,BorderLayout.CENTER); container.add(toolbarPanel,BorderLayout.NORTH); if(controller.getStatusView() != null) { container.add(controller.getStatusView(),BorderLayout.SOUTH); } this.addFocusListener(new CommonFocusAdapter(this)); final UIWrapper refCopy = this; this.addInternalFrameListener(new InternalFrameAdapter() { /* (non-Javadoc) * @see javax.swing.event.InternalFrameAdapter#internalFrameClosing(javax.swing.event.InternalFrameEvent) */ public void internalFrameClosing(InternalFrameEvent arg0) { env.getBrowserManager().removeBrowser(refCopy); } }); }
| 3,228,370
|
public void cameraBoundsChanged(double valueX, double valueY, double extentX, double extentY, double width, double height) { int iX = (int)Math.round(valueX); int iY = (int)Math.round(valueY); int iEX = (int)Math.round(extentX); int iEY = (int)Math.round(extentY); int iW = (int)Math.round(width); int iH = (int)Math.round(height); BoundedRangeModel horizModel = horizontalBar.getModel(); BoundedRangeModel vertModel = verticalBar.getModel(); if(iEX+iX > iW) horizontalBar.setEnabled(false); else { horizontalBar.setEnabled(true); if(iW != horizModel.getMaximum() || iEX != horizModel.getExtent()) { BoundedRangeModel hModel = new DefaultBoundedRangeModel(iX,iEX,0,iW); horizontalBar.setModel(hModel); } else { horizModel.setValue(iX); } } if(iEY+iY > iH) verticalBar.setEnabled(false); else { verticalBar.setEnabled(true); if(iH != vertModel.getMaximum() || iEY != vertModel.getExtent()) { BoundedRangeModel vModel = new DefaultBoundedRangeModel(iY,iEY,0,iH); verticalBar.setModel(vModel); } else { vertModel.setValue(iY); } } }
|
public void cameraBoundsChanged(double valueX, double valueY, double extentX, double extentY, double width, double height) { int iX = (int)Math.round(valueX); int iY = (int)Math.round(valueY); int iEX = (int)Math.round(extentX); int iEY = (int)Math.round(extentY); int iW = (int)Math.round(width); int iH = (int)Math.round(height); BoundedRangeModel horizModel = horizontalBar.getModel(); BoundedRangeModel vertModel = verticalBar.getModel(); if(iEX+iX > iW) horizontalBar.setEnabled(false); else { horizontalBar.setEnabled(true); if(iW != horizModel.getMaximum() || iEX != horizModel.getExtent()) { BoundedRangeModel hModel = new DefaultBoundedRangeModel(iX,iEX,0,iW); horizontalBar.setModel(hModel); } else { horizModel.setValue(iX); } } if(iEY+iY > iH) verticalBar.setEnabled(false); else { verticalBar.setEnabled(true); if(iH != vertModel.getMaximum() || iEY != vertModel.getExtent()) { BoundedRangeModel vModel = new DefaultBoundedRangeModel(iY,iEY,0,iH); verticalBar.setModel(vModel); } else { vertModel.setValue(iY); } } }
| 3,228,371
|
public void cameraBoundsChanged(double valueX, double valueY, double extentX, double extentY, double width, double height) { int iX = (int)Math.round(valueX); int iY = (int)Math.round(valueY); int iEX = (int)Math.round(extentX); int iEY = (int)Math.round(extentY); int iW = (int)Math.round(width); int iH = (int)Math.round(height); BoundedRangeModel horizModel = horizontalBar.getModel(); BoundedRangeModel vertModel = verticalBar.getModel(); if(iEX+iX > iW) horizontalBar.setEnabled(false); else { horizontalBar.setEnabled(true); if(iW != horizModel.getMaximum() || iEX != horizModel.getExtent()) { BoundedRangeModel hModel = new DefaultBoundedRangeModel(iX,iEX,0,iW); horizontalBar.setModel(hModel); } else { horizModel.setValue(iX); } } if(iEY+iY > iH) verticalBar.setEnabled(false); else { verticalBar.setEnabled(true); if(iH != vertModel.getMaximum() || iEY != vertModel.getExtent()) { BoundedRangeModel vModel = new DefaultBoundedRangeModel(iY,iEY,0,iH); verticalBar.setModel(vModel); } else { vertModel.setValue(iY); } } }
|
public void cameraBoundsChanged(double valueX, double valueY, double extentX, double extentY, double width, double height) { int iX = (int)Math.round(valueX); int iY = (int)Math.round(valueY); int iEX = (int)Math.round(extentX); int iEY = (int)Math.round(extentY); int iW = (int)Math.round(width); int iH = (int)Math.round(height); BoundedRangeModel horizModel = horizontalBar.getModel(); BoundedRangeModel vertModel = verticalBar.getModel(); if(iEX+iX > iW) horizontalBar.setEnabled(false); else { horizontalBar.setEnabled(true); if(iW != horizModel.getMaximum() || iEX != horizModel.getExtent()) { BoundedRangeModel hModel = new DefaultBoundedRangeModel(iX,iEX,0,iW); horizontalBar.setModel(hModel); } else { horizModel.setValue(iX); } } if(iEY+iY > iH) verticalBar.setEnabled(false); else { verticalBar.setEnabled(true); if(iH != vertModel.getMaximum() || iEY != vertModel.getExtent()) { BoundedRangeModel vModel = new DefaultBoundedRangeModel(iY,iEY,0,iH); verticalBar.setModel(vModel); } else { vertModel.setValue(iY); } } }
| 3,228,372
|
public void removeBrowser(BrowserController browser) { if (browser != null && browserList.contains(browser)) { browserList.remove(browser); } }
|
public void removeBrowser(UIWrapper browser) { if (browser != null && browserList.contains(browser)) { browserList.remove(browser); } }
| 3,228,377
|
public void test_IObjectClassQuery_unique() throws Exception { p = new Parameters() .addClass( Project.class ); p.getFilter().unique(); Query q = new IObjectClassQuery(p); iQuery.execute( q ); }
|
public void test_IObjectClassQuery_unique() throws Exception { p = new Parameters() .addClass( Project.class ) .addLong( "id", getNewProjects(1,TICKET_83).iterator().next()); p.getFilter().unique(); Query q = new IObjectClassQuery(p); iQuery.execute( q ); }
| 3,228,378
|
public PojosLoadHierarchyQueryDefinition(Parameters parameters) { super( parameters); }
|
public PojosLoadHierarchyQueryDefinition(Parameters parameters) { super( defs, parameters ); }
| 3,228,379
|
public StringQuery(QueryParameter...parameters ){ super(parameters); }
|
public StringQuery(QueryParameter...parameters ){ super( defs, parameters ); }
| 3,228,380
|
public void setAnnotations(Map map) { if (model.getState() == LOADING_ANNOTATION) { if (map == null) throw new IllegalArgumentException("No annotations."); model.setAnnotations(map); view.showAnnotations(); if (model.hasThumbnail()) firePropertyChange(TreeViewer.THUMBNAIL_LOADING_PROPERTY, null, model.getHierarchyObject()); model.setState(READY); fireStateChange(); } }
|
public void setAnnotations(Map map) { if (model.getState() == LOADING_ANNOTATION) { if (map == null) throw new IllegalArgumentException("No annotations."); model.setAnnotations(map); view.showAnnotations(); if (model.hasThumbnail()) firePropertyChange(TreeViewer.THUMBNAIL_LOADING_PROPERTY, null, model.getHierarchyObject()); model.setState(READY); fireStateChange(); } }
| 3,228,381
|
public Node block_append(Node head, Node tail) { if (tail == null || head == null) { return tail; } Node end; if (head instanceof BlockNode) { end = ((BlockNode)head).getEndNode(); } else { end = nf.newBlock(head); end.setEndNode(end); fixpos(end, head); head = end; } if (ruby.isVerbose()) { Node nd = end.getHeadNode(); while (true) { switch (nd.getType()) { case Constants.NODE_RETURN: case Constants.NODE_BREAK: case Constants.NODE_NEXT: case Constants.NODE_REDO: case Constants.NODE_RETRY: rb_warning("statement not reached"); break; case Constants.NODE_NEWLINE: nd = nd.getNextNode(); continue; default: break; } break; } } if (!(tail instanceof BlockNode)) { tail = nf.newBlock(tail); tail.setEndNode(tail); } end.setNextNode(tail); head.setEndNode(tail.getEndNode()); return head; }
|
public Node block_append(Node head, Node tail) { if (tail == null) { return head; } else if (head == null) { return tail; } Node end; if (head instanceof BlockNode) { end = ((BlockNode)head).getEndNode(); } else { end = nf.newBlock(head); end.setEndNode(end); fixpos(end, head); head = end; } if (ruby.isVerbose()) { Node nd = end.getHeadNode(); while (true) { switch (nd.getType()) { case Constants.NODE_RETURN: case Constants.NODE_BREAK: case Constants.NODE_NEXT: case Constants.NODE_REDO: case Constants.NODE_RETRY: rb_warning("statement not reached"); break; case Constants.NODE_NEWLINE: nd = nd.getNextNode(); continue; default: break; } break; } } if (!(tail instanceof BlockNode)) { tail = nf.newBlock(tail); tail.setEndNode(tail); } end.setNextNode(tail); head.setEndNode(tail.getEndNode()); return head; }
| 3,228,382
|
protected Object initialValue() { return new ThreadContext(Ruby.this); }
|
protected Object initialValue() { return mainContext; }
| 3,228,383
|
public Parser(Ruby ruby) { this.ruby = ruby; internalParser.setErrorHandler(ruby.getErrorHandler()); }
|
public Parser(Ruby ruby) { this.ruby = ruby; internalParser.setErrorHandler(ruby.getErrorHandler()); }
| 3,228,384
|
public static ILoadService createLoadService() { return new LoadService(); }
|
public static ILoadService createLoadService() { return new LoadService(); }
| 3,228,385
|
public void push() { this.push(new Scope(ruby)); }
|
public void push() { this.push(new Scope(ruby)); }
| 3,228,387
|
public RubyClasses(Ruby ruby) { this.ruby = ruby; classMap = new RubyHashMap(); initCoreClasses(); }
|
public RubyClasses(Ruby ruby) { this.ruby = ruby; classMap = new RubyHashMap(); }
| 3,228,388
|
private void initCoreClasses() { RubyClass metaClass; objectClass = defineBootClass("Object", null); moduleClass = defineBootClass("Module", objectClass); classClass = defineBootClass("Class", moduleClass); metaClass = classClass.newSingletonClass(); objectClass.setRubyClass(metaClass); metaClass.attachSingletonClass(objectClass); metaClass = metaClass.newSingletonClass(); moduleClass.setRubyClass(metaClass); metaClass.attachSingletonClass(moduleClass); metaClass = metaClass.newSingletonClass(); classClass.setRubyClass(metaClass); metaClass.attachSingletonClass(classClass); kernelModule = RBKernel.createKernelModule(ruby); objectClass.includeModule(kernelModule); objectClass.definePrivateMethod("initialize", DefaultCallbackMethods.getMethodNil()); classClass.definePrivateMethod("inherited", DefaultCallbackMethods.getMethodNil()); /* * * Ruby's Class Hierarchy Chart * * +------------------+ * | | * Object---->(Object) | * ^ ^ ^ ^ | * | | | | | * | | +-----+ +---------+ | * | | | | | * | +-----------+ | | * | | | | | * +------+ | Module--->(Module) | * | | ^ ^ | * OtherClass-->(OtherClass) | | | * | | | * Class---->(Class) | * ^ | * | | * +----------------+ * * + All metaclasses are instances of the class `Class'. */ RbObject.initObjectClass(objectClass); RbClass.initClassClass(classClass); RbModule.initModuleClass(moduleClass); /*rubyTopSelf = objectClass.m_new((RubyObject[])null); rubyTopSelf.defineSingletonMethod("to_s", new RubyCallbackMethod() { public RubyObject execute(RubyObject recv, RubyObject[] args, Ruby ruby) { return RubyString.m_newString(ruby, "main"); } });*/ symbolClass = RbSymbol.createSymbolClass(ruby); nilClass = RbNilClass.createNilClass(ruby); falseClass = RbFalseClass.createFalseClass(ruby); trueClass = RbTrueClass.createTrueClass(ruby); comparableModule = RbComparable.createComparable(ruby); enumerableModule = RbEnumerable.createEnumerableModule(ruby); numericClass = RbNumeric.createNumericClass(ruby); integerClass = RbInteger.createIntegerClass(ruby); fixnumClass = RbFixnum.createFixnum(ruby); floatClass = RbFloat.createFloat(ruby); stringClass = RbString.createStringClass(ruby); arrayClass = RbArray.createArrayClass(ruby); rangeClass = RbRange.createRangeClass(ruby); javaObjectClass = RbJavaObject.createJavaObjectClass(ruby); }
|
public void initCoreClasses() { RubyClass metaClass; objectClass = defineBootClass("Object", null); moduleClass = defineBootClass("Module", objectClass); classClass = defineBootClass("Class", moduleClass); metaClass = classClass.newSingletonClass(); objectClass.setRubyClass(metaClass); metaClass.attachSingletonClass(objectClass); metaClass = metaClass.newSingletonClass(); moduleClass.setRubyClass(metaClass); metaClass.attachSingletonClass(moduleClass); metaClass = metaClass.newSingletonClass(); classClass.setRubyClass(metaClass); metaClass.attachSingletonClass(classClass); kernelModule = RBKernel.createKernelModule(ruby); objectClass.includeModule(kernelModule); objectClass.definePrivateMethod("initialize", DefaultCallbackMethods.getMethodNil()); classClass.definePrivateMethod("inherited", DefaultCallbackMethods.getMethodNil()); /* * * Ruby's Class Hierarchy Chart * * +------------------+ * | | * Object---->(Object) | * ^ ^ ^ ^ | * | | | | | * | | +-----+ +---------+ | * | | | | | * | +-----------+ | | * | | | | | * +------+ | Module--->(Module) | * | | ^ ^ | * OtherClass-->(OtherClass) | | | * | | | * Class---->(Class) | * ^ | * | | * +----------------+ * * + All metaclasses are instances of the class `Class'. */ RbObject.initObjectClass(objectClass); RbClass.initClassClass(classClass); RbModule.initModuleClass(moduleClass); /*rubyTopSelf = objectClass.m_new((RubyObject[])null); rubyTopSelf.defineSingletonMethod("to_s", new RubyCallbackMethod() { public RubyObject execute(RubyObject recv, RubyObject[] args, Ruby ruby) { return RubyString.m_newString(ruby, "main"); } });*/ symbolClass = RbSymbol.createSymbolClass(ruby); nilClass = RbNilClass.createNilClass(ruby); falseClass = RbFalseClass.createFalseClass(ruby); trueClass = RbTrueClass.createTrueClass(ruby); comparableModule = RbComparable.createComparable(ruby); enumerableModule = RbEnumerable.createEnumerableModule(ruby); numericClass = RbNumeric.createNumericClass(ruby); integerClass = RbInteger.createIntegerClass(ruby); fixnumClass = RbFixnum.createFixnum(ruby); floatClass = RbFloat.createFloat(ruby); stringClass = RbString.createStringClass(ruby); arrayClass = RbArray.createArrayClass(ruby); rangeClass = RbRange.createRangeClass(ruby); javaObjectClass = RbJavaObject.createJavaObjectClass(ruby); }
| 3,228,389
|
private void initCoreClasses() { RubyClass metaClass; objectClass = defineBootClass("Object", null); moduleClass = defineBootClass("Module", objectClass); classClass = defineBootClass("Class", moduleClass); metaClass = classClass.newSingletonClass(); objectClass.setRubyClass(metaClass); metaClass.attachSingletonClass(objectClass); metaClass = metaClass.newSingletonClass(); moduleClass.setRubyClass(metaClass); metaClass.attachSingletonClass(moduleClass); metaClass = metaClass.newSingletonClass(); classClass.setRubyClass(metaClass); metaClass.attachSingletonClass(classClass); kernelModule = RBKernel.createKernelModule(ruby); objectClass.includeModule(kernelModule); objectClass.definePrivateMethod("initialize", DefaultCallbackMethods.getMethodNil()); classClass.definePrivateMethod("inherited", DefaultCallbackMethods.getMethodNil()); /* * * Ruby's Class Hierarchy Chart * * +------------------+ * | | * Object---->(Object) | * ^ ^ ^ ^ | * | | | | | * | | +-----+ +---------+ | * | | | | | * | +-----------+ | | * | | | | | * +------+ | Module--->(Module) | * | | ^ ^ | * OtherClass-->(OtherClass) | | | * | | | * Class---->(Class) | * ^ | * | | * +----------------+ * * + All metaclasses are instances of the class `Class'. */ RbObject.initObjectClass(objectClass); RbClass.initClassClass(classClass); RbModule.initModuleClass(moduleClass); /*rubyTopSelf = objectClass.m_new((RubyObject[])null); rubyTopSelf.defineSingletonMethod("to_s", new RubyCallbackMethod() { public RubyObject execute(RubyObject recv, RubyObject[] args, Ruby ruby) { return RubyString.m_newString(ruby, "main"); } });*/ symbolClass = RbSymbol.createSymbolClass(ruby); nilClass = RbNilClass.createNilClass(ruby); falseClass = RbFalseClass.createFalseClass(ruby); trueClass = RbTrueClass.createTrueClass(ruby); comparableModule = RbComparable.createComparable(ruby); enumerableModule = RbEnumerable.createEnumerableModule(ruby); numericClass = RbNumeric.createNumericClass(ruby); integerClass = RbInteger.createIntegerClass(ruby); fixnumClass = RbFixnum.createFixnum(ruby); floatClass = RbFloat.createFloat(ruby); stringClass = RbString.createStringClass(ruby); arrayClass = RbArray.createArrayClass(ruby); rangeClass = RbRange.createRangeClass(ruby); javaObjectClass = RbJavaObject.createJavaObjectClass(ruby); }
|
private void initCoreClasses() { RubyClass metaClass; objectClass = defineBootClass("Object", null); moduleClass = defineBootClass("Module", objectClass); classClass = defineBootClass("Class", moduleClass); metaClass = classClass.newSingletonClass(); objectClass.setRubyClass(metaClass); metaClass.attachSingletonClass(objectClass); metaClass = metaClass.newSingletonClass(); moduleClass.setRubyClass(metaClass); metaClass.attachSingletonClass(moduleClass); metaClass = metaClass.newSingletonClass(); classClass.setRubyClass(metaClass); metaClass.attachSingletonClass(classClass); kernelModule = RBKernel.createKernelModule(ruby); objectClass.includeModule(kernelModule); objectClass.definePrivateMethod("initialize", DefaultCallbackMethods.getMethodNil()); classClass.definePrivateMethod("inherited", DefaultCallbackMethods.getMethodNil()); /* * * Ruby's Class Hierarchy Chart * * +------------------+ * | | * Object---->(Object) | * ^ ^ ^ ^ | * | | | | | * | | +-----+ +---------+ | * | | | | | * | +-----------+ | | * | | | | | * +------+ | Module--->(Module) | * | | ^ ^ | * OtherClass-->(OtherClass) | | | * | | | * Class---->(Class) | * ^ | * | | * +----------------+ * * + All metaclasses are instances of the class `Class'. */ RbObject.initObjectClass(objectClass); RbClass.initClassClass(classClass); RbModule.initModuleClass(moduleClass); /*rubyTopSelf = objectClass.m_new((RubyObject[])null); rubyTopSelf.defineSingletonMethod("to_s", new RubyCallbackMethod() { public RubyObject execute(RubyObject recv, RubyObject[] args, Ruby ruby) { return RubyString.m_newString(ruby, "main"); } });*/ symbolClass = RbSymbol.createSymbolClass(ruby); nilClass = RbNilClass.createNilClass(ruby); falseClass = RbFalseClass.createFalseClass(ruby); trueClass = RbTrueClass.createTrueClass(ruby); comparableModule = RbComparable.createComparable(ruby); enumerableModule = RbEnumerable.createEnumerableModule(ruby); numericClass = RbNumeric.createNumericClass(ruby); integerClass = RbInteger.createIntegerClass(ruby); fixnumClass = RbFixnum.createFixnum(ruby); floatClass = RbFloat.createFloat(ruby); stringClass = RbString.createStringClass(ruby); arrayClass = RbArray.createArrayClass(ruby); rangeClass = RbRange.createRangeClass(ruby); javaObjectClass = RbJavaObject.createJavaObjectClass(ruby); }
| 3,228,390
|
public RubyExceptions(Ruby ruby) { this.ruby = ruby; }
|
public RubyExceptions(Ruby ruby) { this.ruby = ruby; }
| 3,228,391
|
public void initDefaultExceptionClasses() { RubyClass exceptionClass = ruby.getClasses().getExceptionClass(); systemExit = ruby.defineClass("SystemExit", exceptionClass); fatal = ruby.defineClass("Fatal", exceptionClass); interrupt = ruby.defineClass("Interrupt", exceptionClass); signalException = ruby.defineClass("SignalException", exceptionClass); standardError = ruby.defineClass("StandardError", exceptionClass); typeError = ruby.defineClass("TypeError", standardError); argumentError = ruby.defineClass("ArgumentError", standardError); indexError = ruby.defineClass("IndexError", standardError); rangeError = ruby.defineClass("RangeError", standardError); scriptError = ruby.defineClass("ScriptError", exceptionClass); syntaxError = ruby.defineClass("SyntaxError", scriptError); nameError = ruby.defineClass("NameError", scriptError); loadError = ruby.defineClass("LoadError", scriptError); notImplementedError = ruby.defineClass("NotImplementedError", scriptError); runtimeError = ruby.defineClass("RuntimeError", standardError); securityError = ruby.defineClass("SecurityError", standardError); noMemError = ruby.defineClass("NoMemError", exceptionClass); regexpError = ruby.defineClass("RegexpError", standardError); }
|
public void initDefaultExceptionClasses() { RubyClass exceptionClass = ruby.getClasses().getExceptionClass(); systemExit = ruby.defineClass("SystemExit", exceptionClass); fatal = ruby.defineClass("Fatal", exceptionClass); interrupt = ruby.defineClass("Interrupt", exceptionClass); signalException = ruby.defineClass("SignalException", exceptionClass); standardError = ruby.defineClass("StandardError", exceptionClass); typeError = ruby.defineClass("TypeError", standardError); argumentError = ruby.defineClass("ArgumentError", standardError); indexError = ruby.defineClass("IndexError", standardError); rangeError = ruby.defineClass("RangeError", standardError); scriptError = ruby.defineClass("ScriptError", exceptionClass); syntaxError = ruby.defineClass("SyntaxError", scriptError); nameError = ruby.defineClass("NameError", scriptError); loadError = ruby.defineClass("LoadError", scriptError); notImplementedError = ruby.defineClass("NotImplementedError", scriptError); runtimeError = ruby.defineClass("RuntimeError", standardError); securityError = ruby.defineClass("SecurityError", standardError); noMemError = ruby.defineClass("NoMemError", exceptionClass); regexpError = ruby.defineClass("RegexpError", standardError); }
| 3,228,392
|
public static IRubyObject createTopSelf(final Ruby runtime) { IRubyObject topSelf = runtime.getFactory().newObject(runtime.getClasses().getObjectClass()); topSelf.defineSingletonMethod("to_s", new Callback() { /** * @see org.jruby.runtime.Callback#execute(IRubyObject, IRubyObject[]) */ public IRubyObject execute(IRubyObject recv, IRubyObject[] args) { return RubyString.newString(runtime, "main"); } /** * @see org.jruby.runtime.Callback#getArity() */ public int getArity() { return 0; } }); topSelf.defineSingletonMethod("include", new Callback() { /** * @see org.jruby.runtime.Callback#execute(IRubyObject, IRubyObject[]) */ public IRubyObject execute(IRubyObject recv, IRubyObject[] args) { runtime.secure(4); return runtime.getClasses().getObjectClass().include(args); } /** * @see org.jruby.runtime.Callback#getArity() */ public int getArity() { return 0; } }); topSelf.defineSingletonMethod("public", new Callback() { /** * @see org.jruby.runtime.Callback#execute(IRubyObject, IRubyObject[]) */ public IRubyObject execute(IRubyObject recv, IRubyObject[] args) { return runtime.getClasses().getObjectClass().rbPublic(args); } /** * @see org.jruby.runtime.Callback#getArity() */ public int getArity() { return 0; } }); topSelf.defineSingletonMethod("private", new Callback() { /** * @see org.jruby.runtime.Callback#execute(IRubyObject, IRubyObject[]) */ public IRubyObject execute(IRubyObject recv, IRubyObject[] args) { return runtime.getClasses().getObjectClass().rbPrivate(args); } /** * @see org.jruby.runtime.Callback#getArity() */ public int getArity() { return 0; } }); return topSelf; }
|
public static IRubyObject createTopSelf(final Ruby runtime) { IRubyObject topSelf = runtime.getFactory().newObject(runtime.getClasses().getObjectClass()); topSelf.defineSingletonMethod("to_s", new Callback() { /** * @see org.jruby.runtime.Callback#execute(IRubyObject, IRubyObject[]) */ public IRubyObject execute(IRubyObject recv, IRubyObject[] args) { return RubyString.newString(runtime, "main"); } /** * @see org.jruby.runtime.Callback#getArity() */ public int getArity() { return -1; } }); topSelf.defineSingletonMethod("include", new Callback() { /** * @see org.jruby.runtime.Callback#execute(IRubyObject, IRubyObject[]) */ public IRubyObject execute(IRubyObject recv, IRubyObject[] args) { runtime.secure(4); return runtime.getClasses().getObjectClass().include(args); } /** * @see org.jruby.runtime.Callback#getArity() */ public int getArity() { return -1; } }); topSelf.defineSingletonMethod("public", new Callback() { /** * @see org.jruby.runtime.Callback#execute(IRubyObject, IRubyObject[]) */ public IRubyObject execute(IRubyObject recv, IRubyObject[] args) { return runtime.getClasses().getObjectClass().rbPublic(args); } /** * @see org.jruby.runtime.Callback#getArity() */ public int getArity() { return -1; } }); topSelf.defineSingletonMethod("private", new Callback() { /** * @see org.jruby.runtime.Callback#execute(IRubyObject, IRubyObject[]) */ public IRubyObject execute(IRubyObject recv, IRubyObject[] args) { return runtime.getClasses().getObjectClass().rbPrivate(args); } /** * @see org.jruby.runtime.Callback#getArity() */ public int getArity() { return -1; } }); return topSelf; }
| 3,228,393
|
public static IRubyObject createTopSelf(final Ruby runtime) { IRubyObject topSelf = runtime.getFactory().newObject(runtime.getClasses().getObjectClass()); topSelf.defineSingletonMethod("to_s", new Callback() { /** * @see org.jruby.runtime.Callback#execute(IRubyObject, IRubyObject[]) */ public IRubyObject execute(IRubyObject recv, IRubyObject[] args) { return RubyString.newString(runtime, "main"); } /** * @see org.jruby.runtime.Callback#getArity() */ public int getArity() { return 0; } }); topSelf.defineSingletonMethod("include", new Callback() { /** * @see org.jruby.runtime.Callback#execute(IRubyObject, IRubyObject[]) */ public IRubyObject execute(IRubyObject recv, IRubyObject[] args) { runtime.secure(4); return runtime.getClasses().getObjectClass().include(args); } /** * @see org.jruby.runtime.Callback#getArity() */ public int getArity() { return 0; } }); topSelf.defineSingletonMethod("public", new Callback() { /** * @see org.jruby.runtime.Callback#execute(IRubyObject, IRubyObject[]) */ public IRubyObject execute(IRubyObject recv, IRubyObject[] args) { return runtime.getClasses().getObjectClass().rbPublic(args); } /** * @see org.jruby.runtime.Callback#getArity() */ public int getArity() { return 0; } }); topSelf.defineSingletonMethod("private", new Callback() { /** * @see org.jruby.runtime.Callback#execute(IRubyObject, IRubyObject[]) */ public IRubyObject execute(IRubyObject recv, IRubyObject[] args) { return runtime.getClasses().getObjectClass().rbPrivate(args); } /** * @see org.jruby.runtime.Callback#getArity() */ public int getArity() { return 0; } }); return topSelf; }
|
public static IRubyObject createTopSelf(final Ruby runtime) { IRubyObject topSelf = runtime.getFactory().newObject(runtime.getClasses().getObjectClass()); topSelf.defineSingletonMethod("to_s", new Callback() { /** * @see org.jruby.runtime.Callback#execute(IRubyObject, IRubyObject[]) */ public IRubyObject execute(IRubyObject recv, IRubyObject[] args) { return RubyString.newString(runtime, "main"); } /** * @see org.jruby.runtime.Callback#getArity() */ public int getArity() { return -1; } }); topSelf.defineSingletonMethod("include", new Callback() { /** * @see org.jruby.runtime.Callback#execute(IRubyObject, IRubyObject[]) */ public IRubyObject execute(IRubyObject recv, IRubyObject[] args) { runtime.secure(4); return runtime.getClasses().getObjectClass().include(args); } /** * @see org.jruby.runtime.Callback#getArity() */ public int getArity() { return -1; } }); topSelf.defineSingletonMethod("public", new Callback() { /** * @see org.jruby.runtime.Callback#execute(IRubyObject, IRubyObject[]) */ public IRubyObject execute(IRubyObject recv, IRubyObject[] args) { return runtime.getClasses().getObjectClass().rbPublic(args); } /** * @see org.jruby.runtime.Callback#getArity() */ public int getArity() { return -1; } }); topSelf.defineSingletonMethod("private", new Callback() { /** * @see org.jruby.runtime.Callback#execute(IRubyObject, IRubyObject[]) */ public IRubyObject execute(IRubyObject recv, IRubyObject[] args) { return runtime.getClasses().getObjectClass().rbPrivate(args); } /** * @see org.jruby.runtime.Callback#getArity() */ public int getArity() { return -1; } }); return topSelf; }
| 3,228,394
|
public static IRubyObject createTopSelf(final Ruby runtime) { IRubyObject topSelf = runtime.getFactory().newObject(runtime.getClasses().getObjectClass()); topSelf.defineSingletonMethod("to_s", new Callback() { /** * @see org.jruby.runtime.Callback#execute(IRubyObject, IRubyObject[]) */ public IRubyObject execute(IRubyObject recv, IRubyObject[] args) { return RubyString.newString(runtime, "main"); } /** * @see org.jruby.runtime.Callback#getArity() */ public int getArity() { return 0; } }); topSelf.defineSingletonMethod("include", new Callback() { /** * @see org.jruby.runtime.Callback#execute(IRubyObject, IRubyObject[]) */ public IRubyObject execute(IRubyObject recv, IRubyObject[] args) { runtime.secure(4); return runtime.getClasses().getObjectClass().include(args); } /** * @see org.jruby.runtime.Callback#getArity() */ public int getArity() { return 0; } }); topSelf.defineSingletonMethod("public", new Callback() { /** * @see org.jruby.runtime.Callback#execute(IRubyObject, IRubyObject[]) */ public IRubyObject execute(IRubyObject recv, IRubyObject[] args) { return runtime.getClasses().getObjectClass().rbPublic(args); } /** * @see org.jruby.runtime.Callback#getArity() */ public int getArity() { return 0; } }); topSelf.defineSingletonMethod("private", new Callback() { /** * @see org.jruby.runtime.Callback#execute(IRubyObject, IRubyObject[]) */ public IRubyObject execute(IRubyObject recv, IRubyObject[] args) { return runtime.getClasses().getObjectClass().rbPrivate(args); } /** * @see org.jruby.runtime.Callback#getArity() */ public int getArity() { return 0; } }); return topSelf; }
|
public static IRubyObject createTopSelf(final Ruby runtime) { IRubyObject topSelf = runtime.getFactory().newObject(runtime.getClasses().getObjectClass()); topSelf.defineSingletonMethod("to_s", new Callback() { /** * @see org.jruby.runtime.Callback#execute(IRubyObject, IRubyObject[]) */ public IRubyObject execute(IRubyObject recv, IRubyObject[] args) { return RubyString.newString(runtime, "main"); } /** * @see org.jruby.runtime.Callback#getArity() */ public int getArity() { return -1; } }); topSelf.defineSingletonMethod("include", new Callback() { /** * @see org.jruby.runtime.Callback#execute(IRubyObject, IRubyObject[]) */ public IRubyObject execute(IRubyObject recv, IRubyObject[] args) { runtime.secure(4); return runtime.getClasses().getObjectClass().include(args); } /** * @see org.jruby.runtime.Callback#getArity() */ public int getArity() { return -1; } }); topSelf.defineSingletonMethod("public", new Callback() { /** * @see org.jruby.runtime.Callback#execute(IRubyObject, IRubyObject[]) */ public IRubyObject execute(IRubyObject recv, IRubyObject[] args) { return runtime.getClasses().getObjectClass().rbPublic(args); } /** * @see org.jruby.runtime.Callback#getArity() */ public int getArity() { return -1; } }); topSelf.defineSingletonMethod("private", new Callback() { /** * @see org.jruby.runtime.Callback#execute(IRubyObject, IRubyObject[]) */ public IRubyObject execute(IRubyObject recv, IRubyObject[] args) { return runtime.getClasses().getObjectClass().rbPrivate(args); } /** * @see org.jruby.runtime.Callback#getArity() */ public int getArity() { return -1; } }); return topSelf; }
| 3,228,395
|
public INode parse(String file, Reader content) { return parse(file, content, new RubyParserConfiguration()); }
|
public INode parse(String file, Reader content) { return parse(file, content, new RubyParserConfiguration()); }
| 3,228,396
|
public Set<Token> allTokens() { if ( tokens.get() == null) return Collections.emptySet(); return tokens.get().keySet(); }
|
public Set<Token> allTokens() { if ( tokens.get() == null) return Collections.emptySet(); return tokens.get().keySet(); }
| 3,228,397
|
public Token find(GraphHolder gh) { if ( tokens.get() == null ) return null; for (Token t : allTokens()) { if (gh.tokenMatches(t)) { return t; } } return null; }
|
public Token find(GraphHolder gh) { if ( tokens.get() == null ) return null; for (Token t : allTokens()) { if (gh.tokenMatches(t)) { return t; } } return null; }
| 3,228,398
|
public Token find(GraphHolder gh) { if ( tokens.get() == null ) return null; for (Token t : allTokens()) { if (gh.tokenMatches(t)) { return t; } } return null; }
|
public Token find(GraphHolder gh) { if ( tokens.get() == null ) return null; for (Token t : allTokens()) { if (gh.tokenMatches(t)) { return t; } } return null; }
| 3,228,399
|
public void put(Token token) { if ( tokens.get() == null ) tokens.set( new IdentityHashMap<Token,Token>() ); tokens.get().put(token, token); }
|
public void put(Token token) { if ( tokens.get() == null ) tokens.set( new IdentityHashMap<Token,Token>() ); tokens.get().put(token, token); }
| 3,228,400
|
public void remove(Token t) { if ( tokens.get() == null ) return; tokens.get().remove(t); }
|
public void remove(Token t) { if ( tokens.get() == null ) return; tokens.get().remove(t); }
| 3,228,401
|
public BasicSecuritySystem( ServiceFactory factory, EventContext eventContext) { Assert.notNull(factory); Assert.notNull(eventContext); this.sf = factory; this.ec = eventContext; }
|
public BasicSecuritySystem( ServiceFactory factory, EventContext eventContext) { Assert.notNull(factory); Assert.notNull(eventContext); this.sf = factory; this.ec = eventContext; }
| 3,228,402
|
public void addLog( String action, Class klass, Long id ) { Assert.notNull(action); Assert.notNull(klass); Assert.notNull(id); if ( Event.class.isAssignableFrom( klass ) || EventLog.class.isAssignableFrom( klass ) || EventDiff.class.isAssignableFrom( klass ) ) { log.debug( "Not logging creation of logging type:"+klass); } else { checkReady("addLog"); log.info("Adding log:"+action+","+klass+","+id); EventLog l = new EventLog(); l.setAction(action); l.setType(klass.getName()); // TODO could be id to Type entity l.setIdList(id.toString()); l.setDetails(CurrentDetails.createDetails()); l.getGraphHolder().setToken(null, token); CurrentDetails.getCreationEvent().addEventLog( l ); } }
|
public void addLog( String action, Class klass, Long id ) { Assert.notNull(action); Assert.notNull(klass); Assert.notNull(id); if ( Event.class.isAssignableFrom( klass ) || EventLog.class.isAssignableFrom( klass ) || EventDiff.class.isAssignableFrom( klass ) ) { log.debug( "Not logging creation of logging type:"+klass); } else { checkReady("addLog"); log.info("Adding log:"+action+","+klass+","+id); EventLog l = new EventLog(); l.setAction(action); l.setType(klass.getName()); // TODO could be id to Type entity l.setIdList(id.toString()); l.setDetails(CurrentDetails.createDetails()); l.getGraphHolder().setToken(null, token); CurrentDetails.getCreationEvent().addEventLog( l ); } }
| 3,228,403
|
public void addLog( String action, Class klass, Long id ) { Assert.notNull(action); Assert.notNull(klass); Assert.notNull(id); if ( Event.class.isAssignableFrom( klass ) || EventLog.class.isAssignableFrom( klass ) || EventDiff.class.isAssignableFrom( klass ) ) { log.debug( "Not logging creation of logging type:"+klass); } else { checkReady("addLog"); log.info("Adding log:"+action+","+klass+","+id); EventLog l = new EventLog(); l.setAction(action); l.setType(klass.getName()); // TODO could be id to Type entity l.setIdList(id.toString()); l.setDetails(CurrentDetails.createDetails()); l.getGraphHolder().setToken(null, token); CurrentDetails.getCreationEvent().addEventLog( l ); } }
|
public void addLog( String action, Class klass, Long id ) { Assert.notNull(action); Assert.notNull(klass); Assert.notNull(id); if ( Event.class.isAssignableFrom( klass ) || EventLog.class.isAssignableFrom( klass ) || EventDiff.class.isAssignableFrom( klass ) ) { log.debug( "Not logging creation of logging type:"+klass); } else { checkReady("addLog"); log.info("Adding log:"+action+","+klass+","+id); EventLog l = new EventLog(); l.setAction(action); l.setType(klass.getName()); // TODO could be id to Type entity l.setIdList(id.toString()); l.setDetails(CurrentDetails.createDetails()); l.getGraphHolder().setToken(null, token); CurrentDetails.getCreationEvent().addEventLog( l ); } }
| 3,228,404
|
public boolean allowCreation( IObject iObject ) { Assert.notNull(iObject); Class cls = iObject.getClass(); if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) { return true; } else if ( isSystemType( (Class<? extends IObject>) cls )) { return false; } return true; }
|
public boolean allowCreation( IObject iObject ) { Assert.notNull(iObject); Class cls = iObject.getClass(); if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) { return true; } else if ( isSystemType( (Class<? extends IObject>) cls )) { return false; } return true; }
| 3,228,405
|
public boolean allowCreation( IObject iObject ) { Assert.notNull(iObject); Class cls = iObject.getClass(); if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) { return true; } else if ( isSystemType( (Class<? extends IObject>) cls )) { return false; } return true; }
|
public boolean allowCreation( IObject iObject ) { Assert.notNull(iObject); Class cls = iObject.getClass(); if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) { return true; } else if ( isSystemType( (Class<? extends IObject>) cls )) { return false; } return true; }
| 3,228,406
|
public boolean allowCreation( IObject iObject ) { Assert.notNull(iObject); Class cls = iObject.getClass(); if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) { return true; } else if ( isSystemType( (Class<? extends IObject>) cls )) { return false; } return true; }
|
public boolean allowCreation( IObject iObject ) { Assert.notNull(iObject); Class cls = iObject.getClass(); if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) { return true; } else if ( isSystemType( (Class<? extends IObject>) cls )) { return false; } return true; }
| 3,228,407
|
public boolean allowCreation( IObject iObject ) { Assert.notNull(iObject); Class cls = iObject.getClass(); if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) { return true; } else if ( isSystemType( (Class<? extends IObject>) cls )) { return false; } return true; }
|
public boolean allowCreation( IObject iObject ) { Assert.notNull(iObject); Class cls = iObject.getClass(); if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) { return true; } else if ( isSystemType( (Class<? extends IObject>) cls )) { return false; } return true; }
| 3,228,408
|
public boolean allowDelete( IObject iObject, Details trustedDetails ) { return allowUpdateOrDelete(iObject,trustedDetails); }
|
public boolean allowDelete( IObject iObject, Details trustedDetails ) { return allowUpdateOrDelete(iObject,trustedDetails); }
| 3,228,409
|
public boolean allowLoad( Class<? extends IObject> klass, Details d ) { Assert.notNull(klass); Assert.notNull(d); if ( isSystemType(klass)) return true; return SecurityFilter.passesFilter(this, d); }
|
public boolean allowLoad( Class<? extends IObject> klass, Details d ) { Assert.notNull(klass); Assert.notNull(d); if ( isSystemType(klass)) return true; return SecurityFilter.passesFilter(this, d); }
| 3,228,410
|
public boolean allowLoad( Class<? extends IObject> klass, Details d ) { Assert.notNull(klass); Assert.notNull(d); if ( isSystemType(klass)) return true; return SecurityFilter.passesFilter(this, d); }
|
public boolean allowLoad( Class<? extends IObject> klass, Details d ) { Assert.notNull(klass); Assert.notNull(d); if ( isSystemType(klass)) return true; return SecurityFilter.passesFilter(this, d); }
| 3,228,411
|
public boolean allowUpdate( IObject iObject, Details trustedDetails ) { return allowUpdateOrDelete(iObject,trustedDetails); }
|
public boolean allowUpdate( IObject iObject, Details trustedDetails ) { return allowUpdateOrDelete(iObject,trustedDetails); }
| 3,228,412
|
private boolean allowUpdateOrDelete(IObject iObject, Details trustedDetails) { Assert.notNull(iObject); // needs no details info if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) return true; else if ( isSystemType( (Class<? extends IObject>) iObject.getClass())) { return false; } // previously we were taking the details directly from iObject // iObject, however, is in a critical state. Values such as // Permissions, owner, and group may have been changed. Details d = trustedDetails; // this can now only happen if a table doesn't have permissions // and there aren't any of those. so let it be updated. if ( d == null ) return true; Long o = d.getOwner() == null ? null : d.getOwner().getId(); Long g = d.getGroup() == null ? null : d.getGroup().getId(); // needs no permissions info if ( g != null && leaderOfGroups().contains(g)) return true; Permissions p = d.getPermissions(); // this should never occur. if (p == null) { throw new InternalException( "Permissions null! Security system " + "failure -- refusing to continue. The Permissions should " + "be set to a default value."); } // standard if ( p.isGranted(WORLD,WRITE)) return true; if ( p.isGranted(USER, WRITE) && o!=null && o.equals(currentUserId())) return true; if ( p.isGranted(GROUP, WRITE) && g!=null && memberOfGroups().contains(g)) return true; return false; }
|
private boolean allowUpdateOrDelete(IObject iObject, Details trustedDetails) { Assert.notNull(iObject); // needs no details info if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) return true; else if ( isSystemType( (Class<? extends IObject>) iObject.getClass())) { return false; } // previously we were taking the details directly from iObject // iObject, however, is in a critical state. Values such as // Permissions, owner, and group may have been changed. Details d = trustedDetails; // this can now only happen if a table doesn't have permissions // and there aren't any of those. so let it be updated. if ( d == null ) return true; Long o = d.getOwner() == null ? null : d.getOwner().getId(); Long g = d.getGroup() == null ? null : d.getGroup().getId(); // needs no permissions info if ( g != null && leaderOfGroups().contains(g)) return true; Permissions p = d.getPermissions(); // this should never occur. if (p == null) { throw new InternalException( "Permissions null! Security system " + "failure -- refusing to continue. The Permissions should " + "be set to a default value."); } // standard if ( p.isGranted(WORLD,WRITE)) return true; if ( p.isGranted(USER, WRITE) && o!=null && o.equals(currentUserId())) return true; if ( p.isGranted(GROUP, WRITE) && g!=null && memberOfGroups().contains(g)) return true; return false; }
| 3,228,413
|
private boolean allowUpdateOrDelete(IObject iObject, Details trustedDetails) { Assert.notNull(iObject); // needs no details info if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) return true; else if ( isSystemType( (Class<? extends IObject>) iObject.getClass())) { return false; } // previously we were taking the details directly from iObject // iObject, however, is in a critical state. Values such as // Permissions, owner, and group may have been changed. Details d = trustedDetails; // this can now only happen if a table doesn't have permissions // and there aren't any of those. so let it be updated. if ( d == null ) return true; Long o = d.getOwner() == null ? null : d.getOwner().getId(); Long g = d.getGroup() == null ? null : d.getGroup().getId(); // needs no permissions info if ( g != null && leaderOfGroups().contains(g)) return true; Permissions p = d.getPermissions(); // this should never occur. if (p == null) { throw new InternalException( "Permissions null! Security system " + "failure -- refusing to continue. The Permissions should " + "be set to a default value."); } // standard if ( p.isGranted(WORLD,WRITE)) return true; if ( p.isGranted(USER, WRITE) && o!=null && o.equals(currentUserId())) return true; if ( p.isGranted(GROUP, WRITE) && g!=null && memberOfGroups().contains(g)) return true; return false; }
|
private boolean allowUpdateOrDelete(IObject iObject, Details trustedDetails) { Assert.notNull(iObject); // needs no details info if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) return true; else if ( isSystemType( (Class<? extends IObject>) iObject.getClass())) { return false; } // previously we were taking the details directly from iObject // iObject, however, is in a critical state. Values such as // Permissions, owner, and group may have been changed. Details d = trustedDetails; // this can now only happen if a table doesn't have permissions // and there aren't any of those. so let it be updated. if ( d == null ) return true; Long o = d.getOwner() == null ? null : d.getOwner().getId(); Long g = d.getGroup() == null ? null : d.getGroup().getId(); // needs no permissions info if ( g != null && leaderOfGroups().contains(g)) return true; Permissions p = d.getPermissions(); // this should never occur. if (p == null) { throw new InternalException( "Permissions null! Security system " + "failure -- refusing to continue. The Permissions should " + "be set to a default value."); } // standard if ( p.isGranted(WORLD,WRITE)) return true; if ( p.isGranted(USER, WRITE) && o!=null && o.equals(currentUserId())) return true; if ( p.isGranted(GROUP, WRITE) && g!=null && memberOfGroups().contains(g)) return true; return false; }
| 3,228,414
|
private boolean allowUpdateOrDelete(IObject iObject, Details trustedDetails) { Assert.notNull(iObject); // needs no details info if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) return true; else if ( isSystemType( (Class<? extends IObject>) iObject.getClass())) { return false; } // previously we were taking the details directly from iObject // iObject, however, is in a critical state. Values such as // Permissions, owner, and group may have been changed. Details d = trustedDetails; // this can now only happen if a table doesn't have permissions // and there aren't any of those. so let it be updated. if ( d == null ) return true; Long o = d.getOwner() == null ? null : d.getOwner().getId(); Long g = d.getGroup() == null ? null : d.getGroup().getId(); // needs no permissions info if ( g != null && leaderOfGroups().contains(g)) return true; Permissions p = d.getPermissions(); // this should never occur. if (p == null) { throw new InternalException( "Permissions null! Security system " + "failure -- refusing to continue. The Permissions should " + "be set to a default value."); } // standard if ( p.isGranted(WORLD,WRITE)) return true; if ( p.isGranted(USER, WRITE) && o!=null && o.equals(currentUserId())) return true; if ( p.isGranted(GROUP, WRITE) && g!=null && memberOfGroups().contains(g)) return true; return false; }
|
private boolean allowUpdateOrDelete(IObject iObject, Details trustedDetails) { Assert.notNull(iObject); // needs no details info if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) return true; else if ( isSystemType( (Class<? extends IObject>) iObject.getClass())) { return false; } // previously we were taking the details directly from iObject // iObject, however, is in a critical state. Values such as // Permissions, owner, and group may have been changed. Details d = trustedDetails; // this can now only happen if a table doesn't have permissions // and there aren't any of those. so let it be updated. if ( d == null ) return true; Long o = d.getOwner() == null ? null : d.getOwner().getId(); Long g = d.getGroup() == null ? null : d.getGroup().getId(); // needs no permissions info if ( g != null && leaderOfGroups().contains(g)) return true; Permissions p = d.getPermissions(); // this should never occur. if (p == null) { throw new InternalException( "Permissions null! Security system " + "failure -- refusing to continue. The Permissions should " + "be set to a default value."); } // standard if ( p.isGranted(WORLD,WRITE)) return true; if ( p.isGranted(USER, WRITE) && o!=null && o.equals(currentUserId())) return true; if ( p.isGranted(GROUP, WRITE) && g!=null && memberOfGroups().contains(g)) return true; return false; }
| 3,228,415
|
private boolean allowUpdateOrDelete(IObject iObject, Details trustedDetails) { Assert.notNull(iObject); // needs no details info if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) return true; else if ( isSystemType( (Class<? extends IObject>) iObject.getClass())) { return false; } // previously we were taking the details directly from iObject // iObject, however, is in a critical state. Values such as // Permissions, owner, and group may have been changed. Details d = trustedDetails; // this can now only happen if a table doesn't have permissions // and there aren't any of those. so let it be updated. if ( d == null ) return true; Long o = d.getOwner() == null ? null : d.getOwner().getId(); Long g = d.getGroup() == null ? null : d.getGroup().getId(); // needs no permissions info if ( g != null && leaderOfGroups().contains(g)) return true; Permissions p = d.getPermissions(); // this should never occur. if (p == null) { throw new InternalException( "Permissions null! Security system " + "failure -- refusing to continue. The Permissions should " + "be set to a default value."); } // standard if ( p.isGranted(WORLD,WRITE)) return true; if ( p.isGranted(USER, WRITE) && o!=null && o.equals(currentUserId())) return true; if ( p.isGranted(GROUP, WRITE) && g!=null && memberOfGroups().contains(g)) return true; return false; }
|
private boolean allowUpdateOrDelete(IObject iObject, Details trustedDetails) { Assert.notNull(iObject); // needs no details info if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) return true; else if ( isSystemType( (Class<? extends IObject>) iObject.getClass())) { return false; } // previously we were taking the details directly from iObject // iObject, however, is in a critical state. Values such as // Permissions, owner, and group may have been changed. Details d = trustedDetails; // this can now only happen if a table doesn't have permissions // and there aren't any of those. so let it be updated. if ( d == null ) return true; Long o = d.getOwner() == null ? null : d.getOwner().getId(); Long g = d.getGroup() == null ? null : d.getGroup().getId(); // needs no permissions info if ( g != null && leaderOfGroups().contains(g)) return true; Permissions p = d.getPermissions(); // this should never occur. if (p == null) { throw new InternalException( "Permissions null! Security system " + "failure -- refusing to continue. The Permissions should " + "be set to a default value."); } // standard if ( p.isGranted(WORLD,WRITE)) return true; if ( p.isGranted(USER, WRITE) && o!=null && o.equals(currentUserId())) return true; if ( p.isGranted(GROUP, WRITE) && g!=null && memberOfGroups().contains(g)) return true; return false; }
| 3,228,416
|
private boolean allowUpdateOrDelete(IObject iObject, Details trustedDetails) { Assert.notNull(iObject); // needs no details info if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) return true; else if ( isSystemType( (Class<? extends IObject>) iObject.getClass())) { return false; } // previously we were taking the details directly from iObject // iObject, however, is in a critical state. Values such as // Permissions, owner, and group may have been changed. Details d = trustedDetails; // this can now only happen if a table doesn't have permissions // and there aren't any of those. so let it be updated. if ( d == null ) return true; Long o = d.getOwner() == null ? null : d.getOwner().getId(); Long g = d.getGroup() == null ? null : d.getGroup().getId(); // needs no permissions info if ( g != null && leaderOfGroups().contains(g)) return true; Permissions p = d.getPermissions(); // this should never occur. if (p == null) { throw new InternalException( "Permissions null! Security system " + "failure -- refusing to continue. The Permissions should " + "be set to a default value."); } // standard if ( p.isGranted(WORLD,WRITE)) return true; if ( p.isGranted(USER, WRITE) && o!=null && o.equals(currentUserId())) return true; if ( p.isGranted(GROUP, WRITE) && g!=null && memberOfGroups().contains(g)) return true; return false; }
|
private boolean allowUpdateOrDelete(IObject iObject, Details trustedDetails) { Assert.notNull(iObject); // needs no details info if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) return true; else if ( isSystemType( (Class<? extends IObject>) iObject.getClass())) { return false; } // previously we were taking the details directly from iObject // iObject, however, is in a critical state. Values such as // Permissions, owner, and group may have been changed. Details d = trustedDetails; // this can now only happen if a table doesn't have permissions // and there aren't any of those. so let it be updated. if ( d == null ) return true; Long o = d.getOwner() == null ? null : d.getOwner().getId(); Long g = d.getGroup() == null ? null : d.getGroup().getId(); // needs no permissions info if ( g != null && leaderOfGroups().contains(g)) return true; Permissions p = d.getPermissions(); // this should never occur. if (p == null) { throw new InternalException( "Permissions null! Security system " + "failure -- refusing to continue. The Permissions should " + "be set to a default value."); } // standard if ( p.isGranted(WORLD,WRITE)) return true; if ( p.isGranted(USER, WRITE) && o!=null && o.equals(currentUserId())) return true; if ( p.isGranted(GROUP, WRITE) && g!=null && memberOfGroups().contains(g)) return true; return false; }
| 3,228,417
|
private boolean allowUpdateOrDelete(IObject iObject, Details trustedDetails) { Assert.notNull(iObject); // needs no details info if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) return true; else if ( isSystemType( (Class<? extends IObject>) iObject.getClass())) { return false; } // previously we were taking the details directly from iObject // iObject, however, is in a critical state. Values such as // Permissions, owner, and group may have been changed. Details d = trustedDetails; // this can now only happen if a table doesn't have permissions // and there aren't any of those. so let it be updated. if ( d == null ) return true; Long o = d.getOwner() == null ? null : d.getOwner().getId(); Long g = d.getGroup() == null ? null : d.getGroup().getId(); // needs no permissions info if ( g != null && leaderOfGroups().contains(g)) return true; Permissions p = d.getPermissions(); // this should never occur. if (p == null) { throw new InternalException( "Permissions null! Security system " + "failure -- refusing to continue. The Permissions should " + "be set to a default value."); } // standard if ( p.isGranted(WORLD,WRITE)) return true; if ( p.isGranted(USER, WRITE) && o!=null && o.equals(currentUserId())) return true; if ( p.isGranted(GROUP, WRITE) && g!=null && memberOfGroups().contains(g)) return true; return false; }
|
private boolean allowUpdateOrDelete(IObject iObject, Details trustedDetails) { Assert.notNull(iObject); // needs no details info if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) return true; else if ( isSystemType( (Class<? extends IObject>) iObject.getClass())) { return false; } // previously we were taking the details directly from iObject // iObject, however, is in a critical state. Values such as // Permissions, owner, and group may have been changed. Details d = trustedDetails; // this can now only happen if a table doesn't have permissions // and there aren't any of those. so let it be updated. if ( d == null ) return true; Long o = d.getOwner() == null ? null : d.getOwner().getId(); Long g = d.getGroup() == null ? null : d.getGroup().getId(); // needs no permissions info if ( g != null && leaderOfGroups().contains(g)) return true; Permissions p = d.getPermissions(); // this should never occur. if (p == null) { throw new InternalException( "Permissions null! Security system " + "failure -- refusing to continue. The Permissions should " + "be set to a default value."); } // standard if ( p.isGranted(WORLD,WRITE)) return true; if ( p.isGranted(USER, WRITE) && o!=null && o.equals(currentUserId())) return true; if ( p.isGranted(GROUP, WRITE) && g!=null && memberOfGroups().contains(g)) return true; return false; }
| 3,228,418
|
private boolean allowUpdateOrDelete(IObject iObject, Details trustedDetails) { Assert.notNull(iObject); // needs no details info if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) return true; else if ( isSystemType( (Class<? extends IObject>) iObject.getClass())) { return false; } // previously we were taking the details directly from iObject // iObject, however, is in a critical state. Values such as // Permissions, owner, and group may have been changed. Details d = trustedDetails; // this can now only happen if a table doesn't have permissions // and there aren't any of those. so let it be updated. if ( d == null ) return true; Long o = d.getOwner() == null ? null : d.getOwner().getId(); Long g = d.getGroup() == null ? null : d.getGroup().getId(); // needs no permissions info if ( g != null && leaderOfGroups().contains(g)) return true; Permissions p = d.getPermissions(); // this should never occur. if (p == null) { throw new InternalException( "Permissions null! Security system " + "failure -- refusing to continue. The Permissions should " + "be set to a default value."); } // standard if ( p.isGranted(WORLD,WRITE)) return true; if ( p.isGranted(USER, WRITE) && o!=null && o.equals(currentUserId())) return true; if ( p.isGranted(GROUP, WRITE) && g!=null && memberOfGroups().contains(g)) return true; return false; }
|
private boolean allowUpdateOrDelete(IObject iObject, Details trustedDetails) { Assert.notNull(iObject); // needs no details info if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) return true; else if ( isSystemType( (Class<? extends IObject>) iObject.getClass())) { return false; } // previously we were taking the details directly from iObject // iObject, however, is in a critical state. Values such as // Permissions, owner, and group may have been changed. Details d = trustedDetails; // this can now only happen if a table doesn't have permissions // and there aren't any of those. so let it be updated. if ( d == null ) return true; Long o = d.getOwner() == null ? null : d.getOwner().getId(); Long g = d.getGroup() == null ? null : d.getGroup().getId(); // needs no permissions info if ( g != null && leaderOfGroups().contains(g)) return true; Permissions p = d.getPermissions(); // this should never occur. if (p == null) { throw new InternalException( "Permissions null! Security system " + "failure -- refusing to continue. The Permissions should " + "be set to a default value."); } // standard if ( p.isGranted(WORLD,WRITE)) return true; if ( p.isGranted(USER, WRITE) && o!=null && o.equals(currentUserId())) return true; if ( p.isGranted(GROUP, WRITE) && g!=null && memberOfGroups().contains(g)) return true; return false; }
| 3,228,419
|
private boolean allowUpdateOrDelete(IObject iObject, Details trustedDetails) { Assert.notNull(iObject); // needs no details info if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) return true; else if ( isSystemType( (Class<? extends IObject>) iObject.getClass())) { return false; } // previously we were taking the details directly from iObject // iObject, however, is in a critical state. Values such as // Permissions, owner, and group may have been changed. Details d = trustedDetails; // this can now only happen if a table doesn't have permissions // and there aren't any of those. so let it be updated. if ( d == null ) return true; Long o = d.getOwner() == null ? null : d.getOwner().getId(); Long g = d.getGroup() == null ? null : d.getGroup().getId(); // needs no permissions info if ( g != null && leaderOfGroups().contains(g)) return true; Permissions p = d.getPermissions(); // this should never occur. if (p == null) { throw new InternalException( "Permissions null! Security system " + "failure -- refusing to continue. The Permissions should " + "be set to a default value."); } // standard if ( p.isGranted(WORLD,WRITE)) return true; if ( p.isGranted(USER, WRITE) && o!=null && o.equals(currentUserId())) return true; if ( p.isGranted(GROUP, WRITE) && g!=null && memberOfGroups().contains(g)) return true; return false; }
|
private boolean allowUpdateOrDelete(IObject iObject, Details trustedDetails) { Assert.notNull(iObject); // needs no details info if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) return true; else if ( isSystemType( (Class<? extends IObject>) iObject.getClass())) { return false; } // previously we were taking the details directly from iObject // iObject, however, is in a critical state. Values such as // Permissions, owner, and group may have been changed. Details d = trustedDetails; // this can now only happen if a table doesn't have permissions // and there aren't any of those. so let it be updated. if ( d == null ) return true; Long o = d.getOwner() == null ? null : d.getOwner().getId(); Long g = d.getGroup() == null ? null : d.getGroup().getId(); // needs no permissions info if ( g != null && leaderOfGroups().contains(g)) return true; Permissions p = d.getPermissions(); // this should never occur. if (p == null) { throw new InternalException( "Permissions null! Security system " + "failure -- refusing to continue. The Permissions should " + "be set to a default value."); } // standard if ( p.isGranted(WORLD,WRITE)) return true; if ( p.isGranted(USER, WRITE) && o!=null && o.equals(currentUserId())) return true; if ( p.isGranted(GROUP, WRITE) && g!=null && memberOfGroups().contains(g)) return true; return false; }
| 3,228,420
|
private boolean allowUpdateOrDelete(IObject iObject, Details trustedDetails) { Assert.notNull(iObject); // needs no details info if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) return true; else if ( isSystemType( (Class<? extends IObject>) iObject.getClass())) { return false; } // previously we were taking the details directly from iObject // iObject, however, is in a critical state. Values such as // Permissions, owner, and group may have been changed. Details d = trustedDetails; // this can now only happen if a table doesn't have permissions // and there aren't any of those. so let it be updated. if ( d == null ) return true; Long o = d.getOwner() == null ? null : d.getOwner().getId(); Long g = d.getGroup() == null ? null : d.getGroup().getId(); // needs no permissions info if ( g != null && leaderOfGroups().contains(g)) return true; Permissions p = d.getPermissions(); // this should never occur. if (p == null) { throw new InternalException( "Permissions null! Security system " + "failure -- refusing to continue. The Permissions should " + "be set to a default value."); } // standard if ( p.isGranted(WORLD,WRITE)) return true; if ( p.isGranted(USER, WRITE) && o!=null && o.equals(currentUserId())) return true; if ( p.isGranted(GROUP, WRITE) && g!=null && memberOfGroups().contains(g)) return true; return false; }
|
private boolean allowUpdateOrDelete(IObject iObject, Details trustedDetails) { Assert.notNull(iObject); // needs no details info if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) return true; else if ( isSystemType( (Class<? extends IObject>) iObject.getClass())) { return false; } // previously we were taking the details directly from iObject // iObject, however, is in a critical state. Values such as // Permissions, owner, and group may have been changed. Details d = trustedDetails; // this can now only happen if a table doesn't have permissions // and there aren't any of those. so let it be updated. if ( d == null ) return true; Long o = d.getOwner() == null ? null : d.getOwner().getId(); Long g = d.getGroup() == null ? null : d.getGroup().getId(); // needs no permissions info if ( g != null && leaderOfGroups().contains(g)) return true; Permissions p = d.getPermissions(); // this should never occur. if (p == null) { throw new InternalException( "Permissions null! Security system " + "failure -- refusing to continue. The Permissions should " + "be set to a default value."); } // standard if ( p.isGranted(WORLD,WRITE)) return true; if ( p.isGranted(USER, WRITE) && o!=null && o.equals(currentUserId())) return true; if ( p.isGranted(GROUP, WRITE) && g!=null && memberOfGroups().contains(g)) return true; return false; }
| 3,228,421
|
private boolean allowUpdateOrDelete(IObject iObject, Details trustedDetails) { Assert.notNull(iObject); // needs no details info if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) return true; else if ( isSystemType( (Class<? extends IObject>) iObject.getClass())) { return false; } // previously we were taking the details directly from iObject // iObject, however, is in a critical state. Values such as // Permissions, owner, and group may have been changed. Details d = trustedDetails; // this can now only happen if a table doesn't have permissions // and there aren't any of those. so let it be updated. if ( d == null ) return true; Long o = d.getOwner() == null ? null : d.getOwner().getId(); Long g = d.getGroup() == null ? null : d.getGroup().getId(); // needs no permissions info if ( g != null && leaderOfGroups().contains(g)) return true; Permissions p = d.getPermissions(); // this should never occur. if (p == null) { throw new InternalException( "Permissions null! Security system " + "failure -- refusing to continue. The Permissions should " + "be set to a default value."); } // standard if ( p.isGranted(WORLD,WRITE)) return true; if ( p.isGranted(USER, WRITE) && o!=null && o.equals(currentUserId())) return true; if ( p.isGranted(GROUP, WRITE) && g!=null && memberOfGroups().contains(g)) return true; return false; }
|
private boolean allowUpdateOrDelete(IObject iObject, Details trustedDetails) { Assert.notNull(iObject); // needs no details info if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) return true; else if ( isSystemType( (Class<? extends IObject>) iObject.getClass())) { return false; } // previously we were taking the details directly from iObject // iObject, however, is in a critical state. Values such as // Permissions, owner, and group may have been changed. Details d = trustedDetails; // this can now only happen if a table doesn't have permissions // and there aren't any of those. so let it be updated. if ( d == null ) return true; Long o = d.getOwner() == null ? null : d.getOwner().getId(); Long g = d.getGroup() == null ? null : d.getGroup().getId(); // needs no permissions info if ( g != null && leaderOfGroups().contains(g)) return true; Permissions p = d.getPermissions(); // this should never occur. if (p == null) { throw new InternalException( "Permissions null! Security system " + "failure -- refusing to continue. The Permissions should " + "be set to a default value."); } // standard if ( p.isGranted(WORLD,WRITE)) return true; if ( p.isGranted(USER, WRITE) && o!=null && o.equals(currentUserId())) return true; if ( p.isGranted(GROUP, WRITE) && g!=null && memberOfGroups().contains(g)) return true; return false; }
| 3,228,422
|
private boolean allowUpdateOrDelete(IObject iObject, Details trustedDetails) { Assert.notNull(iObject); // needs no details info if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) return true; else if ( isSystemType( (Class<? extends IObject>) iObject.getClass())) { return false; } // previously we were taking the details directly from iObject // iObject, however, is in a critical state. Values such as // Permissions, owner, and group may have been changed. Details d = trustedDetails; // this can now only happen if a table doesn't have permissions // and there aren't any of those. so let it be updated. if ( d == null ) return true; Long o = d.getOwner() == null ? null : d.getOwner().getId(); Long g = d.getGroup() == null ? null : d.getGroup().getId(); // needs no permissions info if ( g != null && leaderOfGroups().contains(g)) return true; Permissions p = d.getPermissions(); // this should never occur. if (p == null) { throw new InternalException( "Permissions null! Security system " + "failure -- refusing to continue. The Permissions should " + "be set to a default value."); } // standard if ( p.isGranted(WORLD,WRITE)) return true; if ( p.isGranted(USER, WRITE) && o!=null && o.equals(currentUserId())) return true; if ( p.isGranted(GROUP, WRITE) && g!=null && memberOfGroups().contains(g)) return true; return false; }
|
private boolean allowUpdateOrDelete(IObject iObject, Details trustedDetails) { Assert.notNull(iObject); // needs no details info if ( hasPrivilegedToken( iObject ) || currentUserIsAdmin() ) return true; else if ( isSystemType( (Class<? extends IObject>) iObject.getClass())) { return false; } // previously we were taking the details directly from iObject // iObject, however, is in a critical state. Values such as // Permissions, owner, and group may have been changed. Details d = trustedDetails; // this can now only happen if a table doesn't have permissions // and there aren't any of those. so let it be updated. if ( d == null ) return true; Long o = d.getOwner() == null ? null : d.getOwner().getId(); Long g = d.getGroup() == null ? null : d.getGroup().getId(); // needs no permissions info if ( g != null && leaderOfGroups().contains(g)) return true; Permissions p = d.getPermissions(); // this should never occur. if (p == null) { throw new InternalException( "Permissions null! Security system " + "failure -- refusing to continue. The Permissions should " + "be set to a default value."); } // standard if ( p.isGranted(WORLD,WRITE)) return true; if ( p.isGranted(USER, WRITE) && o!=null && o.equals(currentUserId())) return true; if ( p.isGranted(GROUP, WRITE) && g!=null && memberOfGroups().contains(g)) return true; return false; }
| 3,228,423
|
void applyUmaskIfNecessary( Details d ) { Permissions p = d.getPermissions(); if ( p.isSet( Flag.SOFT) ) { if ( ec.getPrincipal().hasUmask() ) { p.grantAll( ec.getPrincipal().getUmask() ); p.revokeAll( ec.getPrincipal().getUmask() ); } // don't store it in the DB. p.unSet( Flag.SOFT ); } }
|
void applyUmaskIfNecessary( Details d ) { Permissions p = d.getPermissions(); if ( p.isSet( Flag.SOFT) ) { if ( ec.getPrincipal().hasUmask() ) { p.grantAll( ec.getPrincipal().getUmask() ); p.revokeAll( ec.getPrincipal().getUmask() ); } // don't store it in the DB. p.unSet( Flag.SOFT ); } }
| 3,228,424
|
protected void checkReady(String method) { if (!isReady()) { throw new ApiUsageException("The security system is not ready.\n" + "Cannot execute: "+method); } }
|
protected void checkReady(String method) { if (!isReady()) { throw new ApiUsageException("The security system is not ready.\n" + "Cannot execute: "+method); } }
| 3,228,425
|
protected void checkReady(String method) { if (!isReady()) { throw new ApiUsageException("The security system is not ready.\n" + "Cannot execute: "+method); } }
|
protected void checkReady(String method) { if (!isReady()) { throw new ApiUsageException("The security system is not ready.\n" + "Cannot execute: "+method); } }
| 3,228,426
|
public void clearCurrentDetails() { CurrentDetails.clear(); }
|
public void clearCurrentDetails() { CurrentDetails.clear(); }
| 3,228,427
|
boolean copyNonNullPermissions( Details target, Permissions p ) { if (p != null ) { target.setPermissions( p ); return true; } return false; }
|
boolean copyNonNullPermissions( Details target, Permissions p ) { if (p != null ) { target.setPermissions( p ); return true; } return false; }
| 3,228,428
|
public void copyToken(IObject source, IObject copy) { if ( source == null || copy == null || source == copy) return; GraphHolder gh1 = source.getGraphHolder(); GraphHolder gh2 = copy.getGraphHolder(); // try our token first if ( gh1.tokenMatches(token)) { gh2.setToken(token,token); } else // now we'll have to loop through { Token t = oneTimeTokens.find(gh1); if ( t != null ) { gh2.setToken(t, t); } } }
|
public void copyToken(IObject source, IObject copy) { if ( source == null || copy == null || source == copy) return; GraphHolder gh1 = source.getGraphHolder(); GraphHolder gh2 = copy.getGraphHolder(); // try our token first if ( gh1.tokenMatches(token)) { gh2.setToken(token,token); } else // now we'll have to loop through { Token t = oneTimeTokens.find(gh1); if ( t != null ) { gh2.setToken(t, t); } } }
| 3,228,429
|
public void copyToken(IObject source, IObject copy) { if ( source == null || copy == null || source == copy) return; GraphHolder gh1 = source.getGraphHolder(); GraphHolder gh2 = copy.getGraphHolder(); // try our token first if ( gh1.tokenMatches(token)) { gh2.setToken(token,token); } else // now we'll have to loop through { Token t = oneTimeTokens.find(gh1); if ( t != null ) { gh2.setToken(t, t); } } }
|
public void copyToken(IObject source, IObject copy) { if ( source == null || copy == null || source == copy) return; GraphHolder gh1 = source.getGraphHolder(); GraphHolder gh2 = copy.getGraphHolder(); // try our token first if ( gh1.tokenMatches(token)) { gh2.setToken(token,token); } else // now we'll have to loop through { Token t = oneTimeTokens.find(gh1); if ( t != null ) { gh2.setToken(t, t); } } }
| 3,228,430
|
public void copyToken(IObject source, IObject copy) { if ( source == null || copy == null || source == copy) return; GraphHolder gh1 = source.getGraphHolder(); GraphHolder gh2 = copy.getGraphHolder(); // try our token first if ( gh1.tokenMatches(token)) { gh2.setToken(token,token); } else // now we'll have to loop through { Token t = oneTimeTokens.find(gh1); if ( t != null ) { gh2.setToken(t, t); } } }
|
public void copyToken(IObject source, IObject copy) { if ( source == null || copy == null || source == copy) return; GraphHolder gh1 = source.getGraphHolder(); GraphHolder gh2 = copy.getGraphHolder(); // try our token first if ( gh1.tokenMatches(token)) { gh2.setToken(token,token); } else // now we'll have to loop through { Token t = oneTimeTokens.find(gh1); if ( t != null ) { gh2.setToken(t, t); } } }
| 3,228,431
|
public void copyToken(IObject source, IObject copy) { if ( source == null || copy == null || source == copy) return; GraphHolder gh1 = source.getGraphHolder(); GraphHolder gh2 = copy.getGraphHolder(); // try our token first if ( gh1.tokenMatches(token)) { gh2.setToken(token,token); } else // now we'll have to loop through { Token t = oneTimeTokens.find(gh1); if ( t != null ) { gh2.setToken(t, t); } } }
|
public void copyToken(IObject source, IObject copy) { if ( source == null || copy == null || source == copy) return; GraphHolder gh1 = source.getGraphHolder(); GraphHolder gh2 = copy.getGraphHolder(); // try our token first if ( gh1.tokenMatches(token)) { gh2.setToken(token,token); } else // now we'll have to loop through { Token t = oneTimeTokens.find(gh1); if ( t != null ) { gh2.setToken(t, t); } } }
| 3,228,432
|
public void copyToken(IObject source, IObject copy) { if ( source == null || copy == null || source == copy) return; GraphHolder gh1 = source.getGraphHolder(); GraphHolder gh2 = copy.getGraphHolder(); // try our token first if ( gh1.tokenMatches(token)) { gh2.setToken(token,token); } else // now we'll have to loop through { Token t = oneTimeTokens.find(gh1); if ( t != null ) { gh2.setToken(t, t); } } }
|
public void copyToken(IObject source, IObject copy) { if ( source == null || copy == null || source == copy) return; GraphHolder gh1 = source.getGraphHolder(); GraphHolder gh2 = copy.getGraphHolder(); // try our token first if ( gh1.tokenMatches(token)) { gh2.setToken(token,token); } else // now we'll have to loop through { Token t = oneTimeTokens.find(gh1); if ( t != null ) { gh2.setToken(t, t); } } }
| 3,228,433
|
public void copyToken(IObject source, IObject copy) { if ( source == null || copy == null || source == copy) return; GraphHolder gh1 = source.getGraphHolder(); GraphHolder gh2 = copy.getGraphHolder(); // try our token first if ( gh1.tokenMatches(token)) { gh2.setToken(token,token); } else // now we'll have to loop through { Token t = oneTimeTokens.find(gh1); if ( t != null ) { gh2.setToken(t, t); } } }
|
public void copyToken(IObject source, IObject copy) { if ( source == null || copy == null || source == copy) return; GraphHolder gh1 = source.getGraphHolder(); GraphHolder gh2 = copy.getGraphHolder(); // try our token first if ( gh1.tokenMatches(token)) { gh2.setToken(token,token); } else // now we'll have to loop through { Token t = oneTimeTokens.find(gh1); if ( t != null ) { gh2.setToken(t, t); } } }
| 3,228,434
|
public Event currentEvent() { checkReady("currentEvent"); return CurrentDetails.getCreationEvent(); }
|
public Event currentEvent() { checkReady("currentEvent"); return CurrentDetails.getCreationEvent(); }
| 3,228,435
|
public ExperimenterGroup currentGroup() { checkReady("currentGroup"); return CurrentDetails.getGroup(); }
|
public ExperimenterGroup currentGroup() { checkReady("currentGroup"); return CurrentDetails.getGroup(); }
| 3,228,436
|
public Long currentGroupId() { checkReady("currentGroupId"); return CurrentDetails.getGroup().getId(); }
|
public Long currentGroupId() { checkReady("currentGroupId"); return CurrentDetails.getGroup().getId(); }
| 3,228,437
|
public Experimenter currentUser() { checkReady("currentUser"); return CurrentDetails.getOwner(); }
|
public Experimenter currentUser() { checkReady("currentUser"); return CurrentDetails.getOwner(); }
| 3,228,438
|
public Long currentUserId() { checkReady("currentUserId"); return CurrentDetails.getOwner().getId(); }
|
public Long currentUserId() { checkReady("currentUserId"); return CurrentDetails.getOwner().getId(); }
| 3,228,439
|
public boolean currentUserIsAdmin() { checkReady("currentUserIsAdmin"); return CurrentDetails.isAdmin(); }
|
public boolean currentUserIsAdmin() { checkReady("currentUserIsAdmin"); return CurrentDetails.isAdmin(); }
| 3,228,440
|
public void disable(String...ids) { if (ids==null || ids.length==0) throw new ApiUsageException("Ids should not be empty."); CurrentDetails.addAllDisabled(ids); }
|
public void disable(String...ids) { if (ids==null || ids.length==0) throw new ApiUsageException("Ids should not be empty."); CurrentDetails.addAllDisabled(ids); }
| 3,228,441
|
public void disableReadFilter( Object session ) { checkReady("disableReadFilter"); Session sess = (Session) session; sess.disableFilter(SecurityFilter.filterName); }
|
public void disableReadFilter( Object session ) { checkReady("disableReadFilter"); Session sess = (Session) session; sess.disableFilter(SecurityFilter.filterName); }
| 3,228,442
|
public void disableReadFilter( Object session ) { checkReady("disableReadFilter"); Session sess = (Session) session; sess.disableFilter(SecurityFilter.filterName); }
|
public void disableReadFilter( Object session ) { checkReady("disableReadFilter"); Session sess = (Session) session; sess.disableFilter(SecurityFilter.filterName); }
| 3,228,443
|
public <T extends IObject> T doAction(T obj, SecureAction action) { Assert.notNull(obj); Assert.notNull(action);// FIXME// Token oneTimeToken = new Token();// oneTimeTokens.put(oneTimeToken); obj.getGraphHolder().setToken(token,token);//oneTimeToken); T retVal; try { retVal = action.updateObject(obj); } finally { obj.getGraphHolder().setToken(token,null); } return retVal; }
|
public <T extends IObject> T doAction(T obj, SecureAction action) { Assert.notNull(obj); Assert.notNull(action);// FIXME// Token oneTimeToken = new Token();// oneTimeTokens.put(oneTimeToken); obj.getGraphHolder().setToken(token,token);//oneTimeToken); T retVal; try { retVal = action.updateObject(obj); } finally { obj.getGraphHolder().setToken(token,null); } return retVal; }
| 3,228,444
|
public <T extends IObject> T doAction(T obj, SecureAction action) { Assert.notNull(obj); Assert.notNull(action);// FIXME// Token oneTimeToken = new Token();// oneTimeTokens.put(oneTimeToken); obj.getGraphHolder().setToken(token,token);//oneTimeToken); T retVal; try { retVal = action.updateObject(obj); } finally { obj.getGraphHolder().setToken(token,null); } return retVal; }
|
public <T extends IObject> T doAction(T obj, SecureAction action) { Assert.notNull(obj); Assert.notNull(action);// FIXME// Token oneTimeToken = new Token();// oneTimeTokens.put(oneTimeToken); obj.getGraphHolder().setToken(token,token);//oneTimeToken); T retVal; try { retVal = action.updateObject(obj); } finally { obj.getGraphHolder().setToken(token,null); } return retVal; }
| 3,228,445
|
public <T extends IObject> T doAction(T obj, SecureAction action) { Assert.notNull(obj); Assert.notNull(action);// FIXME// Token oneTimeToken = new Token();// oneTimeTokens.put(oneTimeToken); obj.getGraphHolder().setToken(token,token);//oneTimeToken); T retVal; try { retVal = action.updateObject(obj); } finally { obj.getGraphHolder().setToken(token,null); } return retVal; }
|
public <T extends IObject> T doAction(T obj, SecureAction action) { Assert.notNull(obj); Assert.notNull(action);// FIXME// Token oneTimeToken = new Token();// oneTimeTokens.put(oneTimeToken); obj.getGraphHolder().setToken(token,token);//oneTimeToken); T retVal; try { retVal = action.updateObject(obj); } finally { obj.getGraphHolder().setToken(token,null); } return retVal; }
| 3,228,446
|
public boolean emptyDetails( ) { return CurrentDetails.getOwner() == null && CurrentDetails.getGroup() == null && CurrentDetails.getCreationEvent() == null; }
|
public boolean emptyDetails( ) { return CurrentDetails.getOwner() == null && CurrentDetails.getGroup() == null && CurrentDetails.getCreationEvent() == null; }
| 3,228,447
|
public void enable(String... ids) { if (ids==null || ids.length==0 ) CurrentDetails.clearDisabled(); CurrentDetails.removeAllDisabled(ids); }
|
public void enable(String... ids) { if (ids==null || ids.length==0 ) CurrentDetails.clearDisabled(); CurrentDetails.removeAllDisabled(ids); }
| 3,228,448
|
public void enableReadFilter( Object session ) { if ( session == null || ! (session instanceof Session) ) { throw new ApiUsageException("The Object argument to enableReadFilter" + " in the BasicSystemSecurity implementation must be a " + " non-null org.hibernate.Session."); } checkReady("enableReadFilter"); // beware http://opensource.atlassian.com/projects/hibernate/browse/HHH-1932 Session sess = (Session) session; sess.enableFilter(SecurityFilter.filterName) .setParameter( SecurityFilter.is_admin, currentUserIsAdmin()) .setParameter( SecurityFilter.current_user, currentUserId()) .setParameterList( SecurityFilter.current_groups, memberOfGroups()) .setParameterList( SecurityFilter.leader_of_groups, leaderOfGroups()); }
|
public void enableReadFilter( Object session ) { if ( session == null || ! (session instanceof Session) ) { throw new ApiUsageException("The Object argument to enableReadFilter" + " in the BasicSystemSecurity implementation must be a " + " non-null org.hibernate.Session."); } checkReady("enableReadFilter"); // beware http://opensource.atlassian.com/projects/hibernate/browse/HHH-1932 Session sess = (Session) session; sess.enableFilter(SecurityFilter.filterName) .setParameter( SecurityFilter.is_admin, currentUserIsAdmin()) .setParameter( SecurityFilter.current_user, currentUserId()) .setParameterList( SecurityFilter.current_groups, memberOfGroups()) .setParameterList( SecurityFilter.leader_of_groups, leaderOfGroups()); }
| 3,228,449
|
public void enableReadFilter( Object session ) { if ( session == null || ! (session instanceof Session) ) { throw new ApiUsageException("The Object argument to enableReadFilter" + " in the BasicSystemSecurity implementation must be a " + " non-null org.hibernate.Session."); } checkReady("enableReadFilter"); // beware http://opensource.atlassian.com/projects/hibernate/browse/HHH-1932 Session sess = (Session) session; sess.enableFilter(SecurityFilter.filterName) .setParameter( SecurityFilter.is_admin, currentUserIsAdmin()) .setParameter( SecurityFilter.current_user, currentUserId()) .setParameterList( SecurityFilter.current_groups, memberOfGroups()) .setParameterList( SecurityFilter.leader_of_groups, leaderOfGroups()); }
|
public void enableReadFilter( Object session ) { if ( session == null || ! (session instanceof Session) ) { throw new ApiUsageException("The Object argument to enableReadFilter" + " in the BasicSystemSecurity implementation must be a " + " non-null org.hibernate.Session."); } checkReady("enableReadFilter"); // beware http://opensource.atlassian.com/projects/hibernate/browse/HHH-1932 Session sess = (Session) session; sess.enableFilter(SecurityFilter.filterName) .setParameter( SecurityFilter.is_admin, currentUserIsAdmin()) .setParameter( SecurityFilter.current_user, currentUserId()) .setParameterList( SecurityFilter.current_groups, memberOfGroups()) .setParameterList( SecurityFilter.leader_of_groups, leaderOfGroups()); }
| 3,228,450
|
public void enableReadFilter( Object session ) { if ( session == null || ! (session instanceof Session) ) { throw new ApiUsageException("The Object argument to enableReadFilter" + " in the BasicSystemSecurity implementation must be a " + " non-null org.hibernate.Session."); } checkReady("enableReadFilter"); // beware http://opensource.atlassian.com/projects/hibernate/browse/HHH-1932 Session sess = (Session) session; sess.enableFilter(SecurityFilter.filterName) .setParameter( SecurityFilter.is_admin, currentUserIsAdmin()) .setParameter( SecurityFilter.current_user, currentUserId()) .setParameterList( SecurityFilter.current_groups, memberOfGroups()) .setParameterList( SecurityFilter.leader_of_groups, leaderOfGroups()); }
|
public void enableReadFilter( Object session ) { if ( session == null || ! (session instanceof Session) ) { throw new ApiUsageException("The Object argument to enableReadFilter" + " in the BasicSystemSecurity implementation must be a " + " non-null org.hibernate.Session."); } checkReady("enableReadFilter"); // beware http://opensource.atlassian.com/projects/hibernate/browse/HHH-1932 Session sess = (Session) session; sess.enableFilter(SecurityFilter.filterName) .setParameter( SecurityFilter.is_admin, currentUserIsAdmin()) .setParameter( SecurityFilter.current_user, currentUserId()) .setParameterList( SecurityFilter.current_groups, memberOfGroups()) .setParameterList( SecurityFilter.leader_of_groups, leaderOfGroups()); }
| 3,228,451
|
public void enableReadFilter( Object session ) { if ( session == null || ! (session instanceof Session) ) { throw new ApiUsageException("The Object argument to enableReadFilter" + " in the BasicSystemSecurity implementation must be a " + " non-null org.hibernate.Session."); } checkReady("enableReadFilter"); // beware http://opensource.atlassian.com/projects/hibernate/browse/HHH-1932 Session sess = (Session) session; sess.enableFilter(SecurityFilter.filterName) .setParameter( SecurityFilter.is_admin, currentUserIsAdmin()) .setParameter( SecurityFilter.current_user, currentUserId()) .setParameterList( SecurityFilter.current_groups, memberOfGroups()) .setParameterList( SecurityFilter.leader_of_groups, leaderOfGroups()); }
|
public void enableReadFilter( Object session ) { if ( session == null || ! (session instanceof Session) ) { throw new ApiUsageException("The Object argument to enableReadFilter" + " in the BasicSystemSecurity implementation must be a " + " non-null org.hibernate.Session."); } checkReady("enableReadFilter"); // beware http://opensource.atlassian.com/projects/hibernate/browse/HHH-1932 Session sess = (Session) session; sess.enableFilter(SecurityFilter.filterName) .setParameter( SecurityFilter.is_admin, currentUserIsAdmin()) .setParameter( SecurityFilter.current_user, currentUserId()) .setParameterList( SecurityFilter.current_groups, memberOfGroups()) .setParameterList( SecurityFilter.leader_of_groups, leaderOfGroups()); }
| 3,228,452
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.