rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
insert_new.setInt(1, feature_id); insert_new.setString(2, keyString); insert_new.setInt(3, 1); insert_new.setString(4, value.toString()); insert_new.executeUpdate(); } insert_new.close(); } else { insert_new = conn.prepareStatement("insert into seqfeature_qualifier_value " + " (seqfeature_id, term_id, rank, value... | insert_new = conn.prepareStatement("insert into seqfeature_qualifier_value " + " (seqfeature_id, term_id, rank, value) " + "values (?, ?, ?, ?)"); | void persistProperty(Connection conn, int feature_id, Object key, Object value, boolean removeFirst) throws SQLException { String keyString = key.toString(); if (removeFirst) { int id = seqDB.intern_ontology_term(conn, keyString); PreparedStatement remove_old_value = conn.prepareStatem... |
if (value instanceof Collection) { int cnt = 0; for (Iterator i = ((Collection) value).iterator(); i.hasNext(); ) { | if (value instanceof Collection) { int cnt = 0; for (Iterator i = ((Collection) value).iterator(); i.hasNext(); ) { insert_new.setInt(1, feature_id); insert_new.setInt(2, sfq); insert_new.setInt(3, ++cnt); insert_new.setString(4, i.next().toString()); insert_new.executeUpdate(); } } else { | void persistProperty(Connection conn, int feature_id, Object key, Object value, boolean removeFirst) throws SQLException { String keyString = key.toString(); if (removeFirst) { int id = seqDB.intern_ontology_term(conn, keyString); PreparedStatement remove_old_value = conn.prepareStatem... |
} else { insert_new.setInt(1, feature_id); insert_new.setInt(2, sfq); insert_new.setInt(3, 1); insert_new.setString(4, value.toString()); insert_new.executeUpdate(); | insert_new.close(); | void persistProperty(Connection conn, int feature_id, Object key, Object value, boolean removeFirst) throws SQLException { String keyString = key.toString(); if (removeFirst) { int id = seqDB.intern_ontology_term(conn, keyString); PreparedStatement remove_old_value = conn.prepareStatem... |
insert_new.close(); | void persistProperty(Connection conn, int feature_id, Object key, Object value, boolean removeFirst) throws SQLException { String keyString = key.toString(); if (removeFirst) { int id = seqDB.intern_ontology_term(conn, keyString); PreparedStatement remove_old_value = conn.prepareStatem... | |
} | void persistProperty(Connection conn, int feature_id, Object key, Object value, boolean removeFirst) throws SQLException { String keyString = key.toString(); if (removeFirst) { int id = seqDB.intern_ontology_term(conn, keyString); PreparedStatement remove_old_value = conn.prepareStatem... | |
else if(lFam!=null ^ rFam!=null) { throw new InconsistencyException("(error required here)... trying to assign an object with family to an object without family"); | else { check( context, !(lFam!=null ^ rFam!=null), CaesarMessages.ASSIGNMENT_MIXEDTYPES ); | public JExpression analyse(CExpressionContext context) throws PositionedError { TypeFactory factory = context.getTypeFactory(); if (left instanceof JParenthesedExpression) { context.reportTrouble(new CWarning(getTokenReference(), KjcMessages.PARENTHESED_LVALUE)); } left = left.analyse(new CEx... |
Integer.valueOf(rank), Integer.valueOf(this.rank) | new Integer(rank), new Integer(this.rank) | public void setRank(int rank) throws ChangeVetoException { if(!this.hasListeners(RichFeatureRelationship.RANK)) { this.rank = rank; } else { ChangeEvent ce = new ChangeEvent( this, RichFeatureRelationship.RANK, Integer.valu... |
for(int i = 0; i < n; i++) { raf.readChar(); } return n; } | for(int i = 0; i < n; i++) { raf.read(); } return n; } | public long skip(long n) throws IOException { for(int i = 0; i < n; i++) { raf.readChar(); } return n; } |
public static IndexedSequenceDB createDB( String name, File indexFile, SequenceFormat format, SequenceFactory sFact, SymbolParser symParser, IDMaker idMaker ) throws IOException, BioException { if(!indexFile.exists()) { try { IndexedSequenceDB isd = new IndexedSequenceDB( name, indexFile, format, sFact, symParser, idMa... | public static IndexedSequenceDB createDB(String name, File indexFile, SequenceFormat format, SequenceBuilderFactory sbFact, SymbolParser symParser, IDMaker idMaker) throws IOException, BioException { if(!indexFile.exists()) { try { IndexedSequenceDB isd = new IndexedSequenceDB(name, indexFile, format, sbFact, symParser... | public static IndexedSequenceDB createDB( String name, File indexFile, SequenceFormat format, SequenceFactory sFact, SymbolParser symParser, IDMaker idMaker ) throws IOException, BioException { if(!indexFile.exists()) { try { IndexedSequenceDB isd = new IndexedSequenceDB( ... |
} | public static IndexedSequenceDB createDB( String name, File indexFile, SequenceFormat format, SequenceFactory sFact, SymbolParser symParser, IDMaker idMaker ) throws IOException, BioException { if(!indexFile.exists()) { try { IndexedSequenceDB isd = new IndexedSequenceDB( ... | |
if(fileToReaders == null) { fileToReaders = new HashMap(); | if(fileToReaders == null) { fileToReaders = new HashMap(); } synchronized(fileToReaders) { Set readers = (Set) fileToReaders.get(f); if(readers == null) { fileToReaders.put(f, readers = new HashSet()); } if(readers.isEmpty()) { return new RandomAccessFile(f, "r"); } else { RandomAccessFile raf = (RandomAccessFile) read... | private RandomAccessFile getReader(File f) throws IOException { if(fileToReaders == null) { fileToReaders = new HashMap(); } synchronized(fileToReaders) { Set readers = (Set) fileToReaders.get(f); if(readers == null) { fileToReaders.put(f, readers = new HashSet()); } if(reader... |
synchronized(fileToReaders) { Set readers = (Set) fileToReaders.get(f); if(readers == null) { fileToReaders.put(f, readers = new HashSet()); } if(readers.isEmpty()) { return new RandomAccessFile(f, "r"); } else { RandomAccessFile raf = (RandomAccessFile) readers.iterator().next(); readers.remove(raf); return raf; } } } | private RandomAccessFile getReader(File f) throws IOException { if(fileToReaders == null) { fileToReaders = new HashMap(); } synchronized(fileToReaders) { Set readers = (Set) fileToReaders.get(f); if(readers == null) { fileToReaders.put(f, readers = new HashSet()); } if(reader... | |
try { Source s = (Source) idToSource.get(id); if(s == null) { throw new BioException("Couldn't find sequence for id " + id); } RandomAccessFile raf = getReader(s.file); raf.seek(s.start); HackedBufferedReader hbr = new HackedBufferedReader(raf); StreamReader.Context context = new StreamReader.Context(hbr); Sequence seq... | try { Source s = (Source) idToSource.get(id); if(s == null) { throw new BioException("Couldn't find sequence for id " + id); } RandomAccessFile raf = getReader(s.file); raf.seek(s.start); HackedBufferedReader hbr = new HackedBufferedReader(raf); SequenceBuilder sb = sbFact.makeSequenceBuilder(); format.readSequence(hbr... | public Sequence getSequence(String id) throws BioException { try { Source s = (Source) idToSource.get(id); if(s == null) { throw new BioException("Couldn't find sequence for id " + id); } RandomAccessFile raf = getReader(s.file); raf.seek(s.start); HackedBufferedReader hbr = ne... |
} | public Sequence getSequence(String id) throws BioException { try { Source s = (Source) idToSource.get(id); if(s == null) { throw new BioException("Couldn't find sequence for id " + id); } RandomAccessFile raf = getReader(s.file); raf.seek(s.start); HackedBufferedReader hbr = ne... | |
throws IOException, BioException { if(indexFile.exists()) { FileInputStream fis = new FileInputStream( indexFile ); try { ObjectInputStream p = new ObjectInputStream(fis); IndexedSequenceDB isd = (IndexedSequenceDB) p.readObject(); fis.close(); return isd; } catch (ClassNotFoundException cnfe) { throw new BioException(... | throws IOException, BioException { if(indexFile.exists()) { FileInputStream fis = new FileInputStream( indexFile ); try { ObjectInputStream p = new ObjectInputStream(fis); IndexedSequenceDB isd = (IndexedSequenceDB) p.readObject(); fis.close(); return isd; } catch (ClassNotFoundException cnfe) { throw new BioException(... | public static IndexedSequenceDB openDB(File indexFile) throws IOException, BioException { if(indexFile.exists()) { FileInputStream fis = new FileInputStream( indexFile ); try { ObjectInputStream p = new ObjectInputStream(fis); IndexedSequenceDB isd = (IndexedSequenceDB) p.readO... |
} | public static IndexedSequenceDB openDB(File indexFile) throws IOException, BioException { if(indexFile.exists()) { FileInputStream fis = new FileInputStream( indexFile ); try { ObjectInputStream p = new ObjectInputStream(fis); IndexedSequenceDB isd = (IndexedSequenceDB) p.readO... | |
if(fileToReaders == null) { fileToReaders = new HashMap(); | if(fileToReaders == null) { fileToReaders = new HashMap(); } synchronized(fileToReaders) { Set readers = (Set) fileToReaders.get(f); if(readers == null) { fileToReaders.put(f, readers = new HashSet()); } readers.add(raf); } | private void putReader(File f, RandomAccessFile raf) { if(fileToReaders == null) { fileToReaders = new HashMap(); } synchronized(fileToReaders) { Set readers = (Set) fileToReaders.get(f); if(readers == null) { fileToReaders.put(f, readers = new HashSet()); } readers.add(raf); ... |
synchronized(fileToReaders) { Set readers = (Set) fileToReaders.get(f); if(readers == null) { fileToReaders.put(f, readers = new HashSet()); } readers.add(raf); } } | private void putReader(File f, RandomAccessFile raf) { if(fileToReaders == null) { fileToReaders = new HashMap(); } synchronized(fileToReaders) { Set readers = (Set) fileToReaders.get(f); if(readers == null) { fileToReaders.put(f, readers = new HashSet()); } readers.add(raf); ... | |
setFault(e); | recordFault(e); | public void execute() { assertNotCompleted(); try { setSessionIndex(getTheConnection().createSessionAndReturnItsIndex(isTransacted(), getAcknowledgementMode())); } catch (RuntimeException e) { set... |
} else if (filt instanceof OverlapsLocation) { Location filtL = ((OverlapsLocation) filt).getLocation(); return !filtL.overlaps(this.getLocation()); | public boolean isDisjoint(FeatureFilter filt) { if (filt instanceof ContainedByLocation) { Location loc = ((ContainedByLocation) filt).getLocation(); return !getLocation().overlaps(loc); } return (filt instanceof AcceptNoneFilter); } | |
throws HttpException, IOException | throws IOException | public CorrectedWebdavResource( HttpURL url ) throws HttpException, IOException { super( url ); } |
headers.put( header, value ); | getHeaders().put( header, value ); | public void addRequestHeader( String header, String value ) { headers.put( header, value ); } |
for ( Iterator iterator = headers.keySet().iterator(); iterator.hasNext(); ) | Iterator iterator = getHeaders().keySet().iterator(); while ( iterator.hasNext() ) | protected void generateAdditionalHeaders( HttpMethod method ) { for ( Iterator iterator = headers.keySet().iterator(); iterator.hasNext(); ) { String header = (String) iterator.next(); method.setRequestHeader( header, (String) headers.get( header ) ); } } |
method.setRequestHeader( header, (String) headers.get( header ) ); | method.setRequestHeader( header, (String) getHeaders().get( header ) ); | protected void generateAdditionalHeaders( HttpMethod method ) { for ( Iterator iterator = headers.keySet().iterator(); iterator.hasNext(); ) { String header = (String) iterator.next(); method.setRequestHeader( header, (String) headers.get( header ) ); } } |
throws HttpException, IOException | throws IOException | public InputStream getMethodData( String path ) throws HttpException, IOException { setClient(); GetMethod method = new GetMethod( URIUtil.encodePathQuery( path ) ); generateTransactionHeader( method ); generateAdditionalHeaders( method ); client.executeMethod( method );... |
if ( statusCode >= 200 && statusCode < 300 ) | if ( isHttpSuccess( statusCode ) ) { | public InputStream getMethodData( String path ) throws HttpException, IOException { setClient(); GetMethod method = new GetMethod( URIUtil.encodePathQuery( path ) ); generateTransactionHeader( method ); generateAdditionalHeaders( method ); client.executeMethod( method );... |
} | public InputStream getMethodData( String path ) throws HttpException, IOException { setClient(); GetMethod method = new GetMethod( URIUtil.encodePathQuery( path ) ); generateTransactionHeader( method ); generateAdditionalHeaders( method ); client.executeMethod( method );... | |
throws HttpException, IOException | throws IOException | public boolean putMethod( String path, InputStream is, int contentLength ) throws HttpException, IOException { setClient(); PutMethod method = new PutMethod( URIUtil.encodePathQuery( path ) ); generateIfHeader( method ); if ( getGetContentType() != null && !getGetContentType().... |
return ( statusCode >= 200 && statusCode < 300 ) ? true : false; | return isHttpSuccess( statusCode ); | public boolean putMethod( String path, InputStream is, int contentLength ) throws HttpException, IOException { setClient(); PutMethod method = new PutMethod( URIUtil.encodePathQuery( path ) ); generateIfHeader( method ); if ( getGetContentType() != null && !getGetContentType().... |
while (Character.isWhitespace(document.getChar(index))) { | char c = document.getChar(index); while (Character.isWhitespace(c) && !(c == '\n' || c == '\r')) { | private static void removeExtraWhitespace(IDocument document, int lineLastChar) throws BadLocationException { ITypedRegion partition; int index = lineLastChar; partition = document.getPartition(index); if (partition.getType() == IDocument.DEFAULT_CONTENT_TYPE) { whi... |
c = document.getChar(index); | private static void removeExtraWhitespace(IDocument document, int lineLastChar) throws BadLocationException { ITypedRegion partition; int index = lineLastChar; partition = document.getPartition(index); if (partition.getType() == IDocument.DEFAULT_CONTENT_TYPE) { whi... | |
LOG.info("Created HJB message: " + result); | String message = strings().getString(HJBStrings.RECEIVED_HJB_MESSAGE, result); LOG.info(message); | protected HJBMessage processReceivedMessage(Message asJMS) throws HJBException { try { if (null == asJMS) { String message = strings().getString(HJBStrings.NO_MESSAGE_AVAILABLE, new Integer(getSessionIndex())); ... |
String message = strings().getString(HJBStrings.FOUND_N_MESSAGES, new Integer(result.size())); LOG.info(message); | public HJBMessage[] viewQueue(int index) throws HJBException { try { List inQueue = Collections.list(getBrowserFor(index).getEnumeration()); List result = new ArrayList(); for (Iterator i = inQueue.iterator(); i.hasNext();) { Message asJMS = (Message) i.next();... | |
Message testMessage = messageBuilder.throwsExceptionOnMethodNamed("getBoolean", ex); | Mock mockMessage = new Mock(MapMessage.class); mockMessage.stubs() .method("getString") .with(eq("testName")) .will(throwException(ex)); Message testMessage = (Message) mockMessage.proxy(); | public void testCanBeEncodedReturnsFalseOnPossibleExceptions() { Exception[] possibleExceptions = new Exception[] { new JMSException("Thrown as a test"), new NumberFormatException("Thrown as a test"), }; for (int i = 0; i < possibleExceptions.length; i++) { ... |
Message testMessage = messageBuilder.returnsExpectedValueFromNamedMethod("getBoolean", "testMessage" + i, "testName", new Boolean(EXPECTED_DECODED_BOOLEANS[i])); | Mock mockMessage = new Mock(MapMessage.class); mockMessage.expects(atLeastOnce()) .method("getString") .with(eq("testName")) .will(returnValue("" + new Boolean(EXPECTED_DECODED_BOOLEANS[i]))); mockMessage.expects(atLeastOnce()) .method("getBoolean") .with(eq("testName")) .will(returnValue(new Boolean(EXPECTED_DECODED_B... | public void testCanBeEncodedReturnsTrueForCorrectValues() { MapMessageBooleanValueCopier testCopier = new MapMessageBooleanValueCopier(); for (int i = 0; i < EXPECTED_DECODED_BOOLEANS.length; i++) { Message testMessage = messageBuilder.returnsExpectedValueFromNamedMethod("getBoolean", ... |
Message testMessage = messageBuilder.returnsExpectedValueFromNamedMethod("getBoolean", "testMessage" + i, "testName", new Boolean(EXPECTED_DECODED_BOOLEANS[i])); | Mock mockMessage = new Mock(MapMessage.class); mockMessage.expects(atLeastOnce()) .method("getString") .with(eq("testName")) .will(returnValue("" + new Boolean(EXPECTED_DECODED_BOOLEANS[i]))); mockMessage.expects(atLeastOnce()) .method("getBoolean") .with(eq("testName")) .will(returnValue(new Boolean(EXPECTED_DECODED_B... | public void testGetAsEncodedValueReturnsValuesCorrectlyEncoded() { MapMessageBooleanValueCopier testCopier = new MapMessageBooleanValueCopier(); for (int i = 0; i < EXPECTED_DECODED_BOOLEANS.length; i++) { Message testMessage = messageBuilder.returnsExpectedValueFromNamedMethod("getBoolean"... |
Message testMessage = messageBuilder.throwsExceptionOnMethodNamed("getBoolean", ex); | Mock mockMessage = new Mock(MapMessage.class); mockMessage.stubs() .method("getString") .with(eq("testName")) .will(throwException(ex)); Message testMessage = (Message) mockMessage.proxy(); | public void testGetAsEncodedValueThrowsExceptionOnPossibleExceptions() { Exception[] possibleExceptions = new Exception[] { new JMSException("Thrown as a test"), new NumberFormatException("Thrown as a test"), }; for (int i = 0; i < possibleExceptions.length; i++) {... |
private String getTimeStamp(){ | protected String getTimeStamp(){ | private String getTimeStamp(){ Calendar cal = Calendar.getInstance() ; // Get the components of the time int hour24 = cal.get(Calendar.HOUR_OF_DAY); // 0..23 int min = cal.get(Calendar.MINUTE); // 0..59 int sec = cal.get(Calendar.SECOND); // 0..59 String s = "time: "+hour24+" "+min+" "+s... |
System.out.println(line); | private void pdb_HEADER_Handler(String line) { //System.out.println(line); String classification = line.substring (10, 50).trim() ; String deposition_date = line.substring (50, 59).trim() ; String idCode = line.substring (62, 66).trim() ; header.put("idCode",idCode); ... | |
structure.setPDBCode(idCode); | private void pdb_HEADER_Handler(String line) { //System.out.println(line); String classification = line.substring (10, 50).trim() ; String deposition_date = line.substring (50, 59).trim() ; String idCode = line.substring (62, 66).trim() ; header.put("idCode",idCode); ... | |
float res = Float.parseFloat(resolution); | float res = 99 ; try { res = Float.parseFloat(resolution); } catch (NumberFormatException e) { e.printStackTrace() ; return ; } | private void pdb_REMARK_2_Handler(String line) { int i = line.indexOf("ANGSTROM"); if ( i != -1) { // line contains ANGSTROM info... String resolution = line.substring(22,27).trim(); // convert string to float float res = Float.parseFloat(resolution); header.put("resolution",new Float(res)); } ... |
CMethod mixinMethods[] = mixinClass.getMethods(); | int i; JMethodDeclaration mixinMethodsDecl[] = mixinClass.getTypeDeclaration().getMethods(); CMethod mixinMethod = null; | private void completeMixinCloneCClass(JavaTypeNode node, CContext context) { try { CCjSourceClass sourceClass = (CCjSourceClass)node.getCClass(); // get mixin export // mixins are always generated from Caesar source classes CCjSourceClass mixinClass = (... |
int i; for (i = 0; i < mixinMethods.length; i++) { | for (i = 0; i < mixinMethodsDecl.length; i++) { mixinMethod = mixinMethodsDecl[i].getMethod(); | private void completeMixinCloneCClass(JavaTypeNode node, CContext context) { try { CCjSourceClass sourceClass = (CCjSourceClass)node.getCClass(); // get mixin export // mixins are always generated from Caesar source classes CCjSourceClass mixinClass = (... |
mixinMethods[i].isConstructor() | mixinMethod.isConstructor() | private void completeMixinCloneCClass(JavaTypeNode node, CContext context) { try { CCjSourceClass sourceClass = (CCjSourceClass)node.getCClass(); // get mixin export // mixins are always generated from Caesar source classes CCjSourceClass mixinClass = (... |
mixinMethods[i].getModifiers(), mixinMethods[i].getIdent(), mixinMethods[i].getReturnType(), mixinMethods[i].getParameters(), mixinMethods[i].getThrowables(), mixinMethods[i].isDeprecated(), mixinMethods[i].isSynthetic(), | mixinMethod.getModifiers(), mixinMethod.getIdent(), mixinMethod.getReturnType(), mixinMethodsDecl[i].getParameters(), mixinMethod.getParameters(), mixinMethod.getThrowables(), mixinMethod.isDeprecated(), mixinMethod.isSynthetic(), | private void completeMixinCloneCClass(JavaTypeNode node, CContext context) { try { CCjSourceClass sourceClass = (CCjSourceClass)node.getCClass(); // get mixin export // mixins are always generated from Caesar source classes CCjSourceClass mixinClass = (... |
new JFormalParameter[0], | private void completeMixinCloneCClass(JavaTypeNode node, CContext context) { try { CCjSourceClass sourceClass = (CCjSourceClass)node.getCClass(); // get mixin export // mixins are always generated from Caesar source classes CCjSourceClass mixinClass = (... | |
decl.setGenerated(); | public void generateWrapperSupport( KjcEnvironment environment, JavaTypeNode inner, CjVirtualClassDeclaration decl ) { TypeFactory typeFactory = environment.getTypeFactory(); CjVirtualClassDeclaration innerDecl = inner.getDeclaration(); CjInterfaceDeclaration innerIfcDecl = ... | |
String newTargetClass = Tools.getNewOuterName( oldClassName, targetClassName, outerClasses); | protected void modifyMethodAndFieldRefs( JavaClass clazz ){ ConstantPool cp = clazz.getConstantPool(); for (int i=1; i<cp.getLength(); i++){ Constant c = cp.getConstant(i); if(c == null) continue; if (c.getTag() == Constants.CONSTANT_Fieldref){ ConstantFieldref fieldR... | |
cp.setConstant(nameIndex, new ConstantUtf8(newTargetClass)); | cp.setConstant(nameIndex, new ConstantUtf8(newOuterClassName)); | protected void modifyMethodAndFieldRefs( JavaClass clazz ){ ConstantPool cp = clazz.getConstantPool(); for (int i=1; i<cp.getLength(); i++){ Constant c = cp.getConstant(i); if(c == null) continue; if (c.getTag() == Constants.CONSTANT_Fieldref){ ConstantFieldref fieldR... |
KawaProxy.loadFile(find (new Path(filename)). toString()); | KawaProxy.loadFile(findFile(new Path(filename)).toString()); | protected void loadConfigFile(String filename) { if (filename != null) { KawaProxy.loadFile(find (new Path(filename)). toString()); } } |
Assert.isNotNull(type); | public void setInterpreter(InterpreterType type) { Assert.isNotNull(type); mCurrentInterpreter = type; getPreferenceStore().setValue(INTERNAL_INTERPRETER_PREF, type.getID()); } | |
private void addDefinitions(List sections) throws BadLocationException { | private void addDefinitions(List topNodes) throws BadLocationException { | private void addDefinitions(List sections) throws BadLocationException { IDocument document = mEditor.getDocument(); IEditorInput input = mEditor.getEditorInput(); HashMap entriesAdded = new HashMap(); if (input instanceof IFileEditorInput) { IFileEditorInput editorInp... |
HashMap entriesAdded = new HashMap(); | HashMap entriesProcessed = new HashMap(); | private void addDefinitions(List sections) throws BadLocationException { IDocument document = mEditor.getDocument(); IEditorInput input = mEditor.getEditorInput(); HashMap entriesAdded = new HashMap(); if (input instanceof IFileEditorInput) { IFileEditorInput editorInp... |
Section section = (Section) entriesAdded.get(entry); if (section != null) continue; section = createSectionForEntry(document, entry); entriesAdded.put(entry , section); SymbolEntry parent = entry.getParent(); while (parent != null) { Section parentSection = (Section) entriesAdded.get(parent); if (parentSection == nu... | createNodesForEntryRecursively(document, entry, topNodes, entriesProcessed); | private void addDefinitions(List sections) throws BadLocationException { IDocument document = mEditor.getDocument(); IEditorInput input = mEditor.getEditorInput(); HashMap entriesAdded = new HashMap(); if (input instanceof IFileEditorInput) { IFileEditorInput editorInp... |
Section newSection = Section.createSection(text.substring(7), position); | Node newSection = Node.createSection(text.substring(7), position); | private void addSections(IDocument document, List nodes) throws BadLocationException, BadPositionCategoryException { Position position; int offset = 0; int documentLength = document.getLength(); while (offset < documentLength) { ITypedRegion partition = document.getPartitio... |
Section newSection = Section.createChapter(text.substring(5), position); | Node newSection = Node.createChapter(text.substring(5), position); | private void addSections(IDocument document, List nodes) throws BadLocationException, BadPositionCategoryException { Position position; int offset = 0; int documentLength = document.getLength(); while (offset < documentLength) { ITypedRegion partition = document.getPartitio... |
viewer.setContentProvider(new SectionContentProvider()); viewer.setLabelProvider(new SectionLabelProvider()); Section tree = createTree(); | viewer.setContentProvider(new NodeContentProvider()); viewer.setLabelProvider(new NodeLabelProvider()); Node tree = createTree(); | public void createControl(Composite parent) { super.createControl(parent); TreeViewer viewer = getTreeViewer(); viewer.setContentProvider(new SectionContentProvider()); viewer.setLabelProvider(new SectionLabelProvider()); Section tree = createTree(); viewer.setInput... |
private Section createRoot(IDocument document) throws BadLocationException, BadPositionCategoryException { Section root; | private Node createRoot(IDocument document) throws BadLocationException, BadPositionCategoryException { Node root; | private Section createRoot(IDocument document) throws BadLocationException, BadPositionCategoryException { Section root; Position position; position = new Position(0,0); document.addPosition(CHAPTER_CATEGORY, position); root = Section.createChapter("Root", position); return root; } |
root = Section.createChapter("Root", position); | root = Node.createChapter("Root", position); | private Section createRoot(IDocument document) throws BadLocationException, BadPositionCategoryException { Section root; Position position; position = new Position(0,0); document.addPosition(CHAPTER_CATEGORY, position); root = Section.createChapter("Root", position); return root; } |
private Section createTree() { Section root = null; | private Node createTree() { Node root = null; | private Section createTree() { Section root = null; try { IDocument document = mEditor.getDocument(); cleanPositions(document); document.addPositionUpdater(mPositionUpdater); document.addPositionCategory(CHAPTER_CATEGORY); root = creat... |
Collections.sort(nodes, SECTION_COMPARATOR); | Collections.sort(nodes, NODE_COMPARATOR); | private Section createTree() { Section root = null; try { IDocument document = mEditor.getDocument(); cleanPositions(document); document.addPositionUpdater(mPositionUpdater); document.addPositionCategory(CHAPTER_CATEGORY); root = creat... |
private void populateTree(Section root, List nodes) | private void populateTree(Node root, List nodes) | private void populateTree(Section root, List nodes) { Section current = root; for (Iterator entries = nodes.iterator(); entries.hasNext();) { Section node = (Section) entries.next(); if (node.type == CHAPTER) { root.addSubsection(node); ... |
Section current = root; | Node current = root; | private void populateTree(Section root, List nodes) { Section current = root; for (Iterator entries = nodes.iterator(); entries.hasNext();) { Section node = (Section) entries.next(); if (node.type == CHAPTER) { root.addSubsection(node); ... |
Section node = (Section) entries.next(); | Node node = (Node) entries.next(); | private void populateTree(Section root, List nodes) { Section current = root; for (Iterator entries = nodes.iterator(); entries.hasNext();) { Section node = (Section) entries.next(); if (node.type == CHAPTER) { root.addSubsection(node); ... |
Section section = (Section) ((IStructuredSelection) selection).getFirstElement(); | Node section = (Node) ((IStructuredSelection) selection).getFirstElement(); | public void selectionChanged(SelectionChangedEvent event) { super.selectionChanged(event); ISelection selection= event.getSelection(); if (selection.isEmpty()) mEditor.resetHighlightRange(); else { Section section = (Section) ((IStructuredSelection) selection).getFi... |
this.sourceContext = tokenSource.getSourceContext(); | public CaesarWrapperPatternParser(ITokenSource tokenSource) { super(tokenSource); this.tokenSource = tokenSource; } | |
ArrayList names = new ArrayList(); | ArrayList<NamePattern> names = new ArrayList<NamePattern>(); | protected TypePatternList createObjectTypeList() { ArrayList names = new ArrayList(); names.add(new NamePattern("java.lang.Object")); return new TypePatternList( new TypePattern[] { new WildTypePattern(names, false, 0)} ); } |
new TypePattern[] { new WildTypePattern(names, false, 0)} ); | new TypePattern[] { new CaesarWildTypePattern(names, false, 0)} ); | protected TypePatternList createObjectTypeList() { ArrayList names = new ArrayList(); names.add(new NamePattern("java.lang.Object")); return new TypePatternList( new TypePattern[] { new WildTypePattern(names, false, 0)} ); } |
if(Shadow.MethodCall.equals(shadowKind) || Shadow.MethodExecution.equals(shadowKind)) { CaesarKindedPointcut p = new CaesarKindedPointcut(shadowKind, sig); registerPointcut(new CaesarPointcutWrapper(p)); Pointcut andPointcut = new AndPointcut( p, new NotPointcut( new CaesarKindedPointcut( shadowKind, this.createCon... | private CaesarPointcutWrapper parseKindedPointcut() { String kind = parseIdentifier(); eat("("); SignaturePattern sig; Shadow.Kind shadowKind = null; if (kind.equals("execution")) { sig = parseMethodOrConstructorSignaturePattern(); if (sig.getKind() == Member.METHOD) { shadowKind = Shadow.MethodExecution... | |
CaesarPointcutWrapper wrapper = new CaesarPointcutWrapper(p); return wrapper; | return new CaesarPointcutWrapper(p); | private CaesarPointcutWrapper parseKindedPointcut() { String kind = parseIdentifier(); eat("("); SignaturePattern sig; Shadow.Kind shadowKind = null; if (kind.equals("execution")) { sig = parseMethodOrConstructorSignaturePattern(); if (sig.getKind() == Member.METHOD) { shadowKind = Shadow.MethodExecution... |
wrapper.addInfo(CaesarPointcutWrapper.INFO_EXCEPTION_TYPE, typePat); | wrapper.setExceptionType(typePat); | public CaesarPointcutWrapper parsePointcutWrapper() { int start = tokenSource.getIndex(); IToken t = tokenSource.peek(); Pointcut p = t.maybeGetParsedPointcut(); if (p != null) { tokenSource.next(); return new CaesarPointcutWrapper(p); } String kind = parseIdentifier(); tokenSource.setIndex(start); if ... |
CaesarPointcutWrapper wrapper = new CaesarPointcutWrapper(pointcut); return wrapper; | return new CaesarPointcutWrapper(pointcut); | public CaesarPointcutWrapper parsePointcutWrapper() { int start = tokenSource.getIndex(); IToken t = tokenSource.peek(); Pointcut p = t.maybeGetParsedPointcut(); if (p != null) { tokenSource.next(); return new CaesarPointcutWrapper(p); } String kind = parseIdentifier(); tokenSource.setIndex(start); if ... |
CaesarKindedPointcut pointcut = new CaesarKindedPointcut(Shadow.StaticInitialization, sig); CaesarPointcutWrapper wrapper = new CaesarPointcutWrapper(pointcut); return wrapper; | TypePattern mixinType = createMixinType(sig.getDeclaringType()); SignaturePattern mixinSignature = createMixinSignature(sig, mixinType); CaesarKindedPointcut mixin = new CaesarKindedPointcut(Shadow.StaticInitialization, mixinSignature); wrapper = new CaesarPointcutWrapper(mixin, sig.getDeclaringType()); wrapper.setD... | public CaesarPointcutWrapper parsePointcutWrapper() { int start = tokenSource.getIndex(); IToken t = tokenSource.peek(); Pointcut p = t.maybeGetParsedPointcut(); if (p != null) { tokenSource.next(); return new CaesarPointcutWrapper(p); } String kind = parseIdentifier(); tokenSource.setIndex(start); if ... |
CaesarKindedPointcut pointcut = new CaesarKindedPointcut(Shadow.PreInitialization, sig); CaesarPointcutWrapper wrapper = new CaesarPointcutWrapper(pointcut); return wrapper; | sig = new SignaturePattern(Member.CONSTRUCTOR, sig.getModifiers(), sig.getReturnType(), sig.getDeclaringType(), sig.getName(), createObjectTypeList(), sig.getThrowsPattern()); CaesarKindedPointcut pointcut = new CaesarKindedPointcut(Shadow.PreInitialization, sig); return new CaesarPointcutWrapper(pointcut); | public CaesarPointcutWrapper parsePointcutWrapper() { int start = tokenSource.getIndex(); IToken t = tokenSource.peek(); Pointcut p = t.maybeGetParsedPointcut(); if (p != null) { tokenSource.next(); return new CaesarPointcutWrapper(p); } String kind = parseIdentifier(); tokenSource.setIndex(start); if ... |
wrapper.addInfo(CaesarPointcutWrapper.INFO_ON_TYPE_SYMBOLIC, p.onTypeSymbolic); | wrapper.setOnTypeSymbolic(p.onTypeSymbolic); | private CaesarPointcutWrapper parseReferencePointcut() { TypePattern onType = parseTypePattern(); NamePattern name = tryToExtractName(onType); if (name == null) { throw new ParserException("name pattern", tokenSource.peek()); } if (onType.toString().equals("")) { onType = null; } TypePatter... |
WithincodePointcut p = new WithincodePointcut(sig);; | WithincodePointcut p = new WithincodePointcut(sig); | private CaesarPointcutWrapper parseWithinCodePointcut() { parseIdentifier(); eat("("); SignaturePattern sig = parseMethodOrConstructorSignaturePattern(); eat(")"); // Creates the wrapper WithincodePointcut p = new WithincodePointcut(sig);; CaesarPointcutWrapper wrapper = new CaesarPointcutWrapper(p); wrappe... |
wrapper.addInfo(CaesarPointcutWrapper.INFO_DECLARING_TYPE, sig.getDeclaringType()); return wrapper; | wrapper.setDeclaringType(type); registerPointcut(wrapper); TypePattern mixinType = createMixinType(type); SignaturePattern mixinSignature = createMixinSignature(sig, mixinType); WithincodePointcut mixin = new WithincodePointcut(mixinSignature); wrapper = new CaesarPointcutWrapper(mixin, sig.getDeclaringType()); wr... | private CaesarPointcutWrapper parseWithinCodePointcut() { parseIdentifier(); eat("("); SignaturePattern sig = parseMethodOrConstructorSignaturePattern(); eat(")"); // Creates the wrapper WithincodePointcut p = new WithincodePointcut(sig);; CaesarPointcutWrapper wrapper = new CaesarPointcutWrapper(p); wrappe... |
wrapper.addInfo(CaesarPointcutWrapper.INFO_TYPE_PATTERN, type); return wrapper; | wrapper.setTypePattern(type); registerPointcut(wrapper); TypePattern mixinType = createMixinType(type); WithinPointcut mixin = new WithinPointcut(mixinType); wrapper = new CaesarPointcutWrapper(mixin, type); wrapper.setDeclaringType(mixinType); registerPointcut(wrapper); Pointcut orPointcut = new OrPointcut( p, ... | private CaesarPointcutWrapper parseWithinPointcut() { parseIdentifier(); eat("("); TypePattern type = parseTypePattern(); eat(")"); // Creates the wrapper WithinPointcut p = new WithinPointcut(type); CaesarPointcutWrapper wrapper = new CaesarPointcutWrapper(p); wrapper.addInfo(CaesarPointcutWrapper.INFO_TYP... |
if (Shadow.ConstructorCall.equals(p.getKind())) { p.setKind(Shadow.MethodCall); p.setSignature(new SignaturePattern(Member.METHOD, p.signature.getModifiers(), p.signature.getReturnType(), p.signature.getDeclaringType(), new NamePattern("$constructor"), p.signature.getParameterTypes(), p.signature.getThrowsPattern())); ... | protected void registerPointcut(CaesarPointcutWrapper pointcut) { if (pointcut.isKinded()) { CaesarKindedPointcut p = (CaesarKindedPointcut) pointcut.getWrappee(); // Transform the constructor call to a method call, using $constructor // and the same parameters as the constructor if (Shadow.ConstructorCal... | |
pointcut.getWrappee()); | pointcut); | protected void registerPointcut(CaesarPointcutWrapper pointcut) { if (pointcut.isKinded()) { CaesarKindedPointcut p = (CaesarKindedPointcut) pointcut.getWrappee(); // Transform the constructor call to a method call, using $constructor // and the same parameters as the constructor if (Shadow.ConstructorCal... |
(TypePattern) pointcut.getInfo(CaesarPointcutWrapper.INFO_TYPE_PATTERN), pointcut.getWrappee()); | pointcut.getTypePattern(), pointcut); | protected void registerPointcut(CaesarPointcutWrapper pointcut) { if (pointcut.isKinded()) { CaesarKindedPointcut p = (CaesarKindedPointcut) pointcut.getWrappee(); // Transform the constructor call to a method call, using $constructor // and the same parameters as the constructor if (Shadow.ConstructorCal... |
(TypePattern) pointcut.getInfo(CaesarPointcutWrapper.INFO_DECLARING_TYPE), pointcut.getWrappee()); | pointcut.getDeclaringType(), pointcut); | protected void registerPointcut(CaesarPointcutWrapper pointcut) { if (pointcut.isKinded()) { CaesarKindedPointcut p = (CaesarKindedPointcut) pointcut.getWrappee(); // Transform the constructor call to a method call, using $constructor // and the same parameters as the constructor if (Shadow.ConstructorCal... |
(TypePattern) pointcut.getInfo(CaesarPointcutWrapper.INFO_EXCEPTION_TYPE), pointcut.getWrappee()); | pointcut.getExceptionType(), pointcut); | protected void registerPointcut(CaesarPointcutWrapper pointcut) { if (pointcut.isKinded()) { CaesarKindedPointcut p = (CaesarKindedPointcut) pointcut.getWrappee(); // Transform the constructor call to a method call, using $constructor // and the same parameters as the constructor if (Shadow.ConstructorCal... |
(TypePattern) pointcut.getInfo(CaesarPointcutWrapper.INFO_ON_TYPE_SYMBOLIC), pointcut.getWrappee()); | pointcut.getOnTypeSymbolic(), pointcut); | protected void registerPointcut(CaesarPointcutWrapper pointcut) { if (pointcut.isKinded()) { CaesarKindedPointcut p = (CaesarKindedPointcut) pointcut.getWrappee(); // Transform the constructor call to a method call, using $constructor // and the same parameters as the constructor if (Shadow.ConstructorCal... |
} else if (nextType instanceof CaesarWildTypePattern) { CaesarWildTypePattern p = (CaesarWildTypePattern)nextType; return p.extractName(); | private NamePattern tryToExtractName(TypePattern nextType) { if (nextType == TypePattern.ANY) { return NamePattern.ANY; } else if (nextType instanceof WildTypePattern) { WildTypePattern p = (WildTypePattern)nextType; return p.extractName(); } else { return null; } } | |
executeCommand( "cd " + path + "; unzip -o " + zipFile.getName() + "; rm -f " + zipFile.getName() ); | executeCommand( "cd " + path + "; unzip -q -o " + zipFile.getName() + "; rm -f " + zipFile.getName() ); | public void putDirectory( File sourceDirectory, String destinationDirectory ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { String basedir = getRepository().getBasedir(); destinationDirectory = StringUtils.replace( destinationDirectory, "\\", "/" ); ... |
return "250 Message ID <" + getMessageId(session) + "> accepted for delivery."; | return "250 Ok: message passed to handler"; | private String handleDataMode(String commandString, Session session) { if (".".equals(commandString)) { session.flush(SMTPServerContext); return "250 Message ID <" + getMessageId(session) + "> accepted for delivery."; } if (commandString.startsWith(".")) { commandString = commandString.substring(1); } ... |
getFeatures().addFeature(f); | if (features != null) { getFeatures().addFeature(f); } | public Feature createFeature(Feature.Template ft) throws ChangeVetoException, BioException { Feature f = realizeFeature(seq, ft); BioSQLEntryChangeHub entryHub = ((BioSQLSequenceI) seq).getSequenceDB().getEntryChangeHub(); ChangeEvent cev = new ChangeEvent(seq, FeatureHolder.FEATURES, f); synchronized (e... |
Alphabet alpha = model.queryAlphabet(); | Alphabet alpha = model.emissionAlphabet(); | public static void main(String args[]) throws Exception { if(args.length != 2) { throw new Exception("Use: ViterbiAlign model.xml sequence.fa"); } try { // parse the arguments URL baseURL = new URL("file:"); URL modelURL = new URL(baseURL, args[0]); File seqFile = new File(args[1... |
DP dp = new DP(new FlatModel(model)); | DP dp = DPFactory.createDP(model); | public static void main(String args[]) throws Exception { if(args.length != 2) { throw new Exception("Use: ViterbiAlign model.xml sequence.fa"); } try { // parse the arguments URL baseURL = new URL("file:"); URL modelURL = new URL(baseURL, args[0]); File seqFile = new File(args[1... |
StatePath statePath = dp.viterbi(seq); | StatePath statePath = dp.viterbi(new ResidueList [] { seq }); | public static void main(String args[]) throws Exception { if(args.length != 2) { throw new Exception("Use: ViterbiAlign model.xml sequence.fa"); } try { // parse the arguments URL baseURL = new URL("file:"); URL modelURL = new URL(baseURL, args[0]); File seqFile = new File(args[1... |
ResidueParser nameParser = seqAlpha.getParser("name"); | ResidueParser nameParser = null; ResidueParser symbolParser = null; try { nameParser = seqAlpha.getParser("name"); } catch (NoSuchElementException nsee) { } try { symbolParser = seqAlpha.getParser("symbol"); } catch (NoSuchElementException nsee) { } if(nameParser == null && symbolParser == null) { throw new SeqExcep... | public static MarkovModel readModel(Element root) throws SeqException, IllegalResidueException, IllegalAlphabetException { if(root.getTagName().equals("WeightMatrix")) { return new WMAsMM(readMatrix(root)); } int heads = Integer.parseInt(root.getAttribute("heads")); Element alphaE = (Element) ro... |
res = nameParser.parseToken(resName); | if(resName.length() == 1) { if(symbolParser != null) { res = symbolParser.parseToken(resName); } else { res = nameParser.parseToken(resName); } } else { if(nameParser != null) { res = nameParser.parseToken(resName); } else { res = symbolParser.parseToken(resName); } } | public static MarkovModel readModel(Element root) throws SeqException, IllegalResidueException, IllegalAlphabetException { if(root.getTagName().equals("WeightMatrix")) { return new WMAsMM(readMatrix(root)); } int heads = Integer.parseInt(root.getAttribute("heads")); Element alphaE = (Element) ro... |
return(handleDecorations()); | handleDecorations(); | public static Location intersection(Location locA, Location locB) { if(isDecorated(locA) || isDecorated(locB)) { return(handleDecorations()); } if(locA.isContiguous() && locB.isContiguous()) { // handle easy case of solid locations if(locA.overlaps(locB)) { int min = Math.max(locA.getMin(... |
return(theLocation.hasDecorator(circularDecoratorClass) || (theLocation.hasDecorator(betweenDecoratorClass))); | boolean hasCircular = theLocation.getDecorator(circularDecoratorClass) == null; boolean hasBetween = theLocation.getDecorator(betweenDecoratorClass) == null; return(hasCircular || hasBetween); | protected static boolean isDecorated(Location theLocation) { // If you know a cleaner way to do this, please change it and drop me a line // gcox@netgenics.com Class circularDecoratorClass; Class betweenDecoratorClass; try { circularDecoratorClass = Class.forName("org.biojava.bio.symbol.CircularLocation"); b... |
return(handleDecorations()); | handleDecorations(); | public static Location union(Location locA, Location locB) { if(isDecorated(locA) || isDecorated(locB)) { return(handleDecorations()); } if( locA.isContiguous() && locB.isContiguous() && locA.overlaps(locB) ) { // the simple case return buildLoc( Math.min(locA.getMin(), ... |
JForum.getContext().put("topic", DataAccessDriver.getInstance().newTopicModel().selectById(p.getTopicId())); | JForum.getContext().put("topic", topic); | public void quote() throws Exception { PostModel pm = DataAccessDriver.getInstance().newPostModel(); Post p = pm.selectById(Integer.parseInt(JForum.getRequest().getParameter("post_id"))); if (!this.anonymousPost(p.getForumId())) { return; } Topic t = DataAccessDriver.ge... |
JForum.getContext().put("htmlAllowed", SecurityRepository.canAccess( SecurityConstants.PERM_HTML_DISABLED, Integer.toString(topic.getForumId()))); | public void quote() throws Exception { PostModel pm = DataAccessDriver.getInstance().newPostModel(); Post p = pm.selectById(Integer.parseInt(JForum.getRequest().getParameter("post_id"))); if (!this.anonymousPost(p.getForumId())) { return; } Topic t = DataAccessDriver.ge... | |
beginAt("/list.page"); | beginAt(FORUMS_LIST); | public void testPasswordForgottenUserName() throws Exception { smtpServer = SimpleSmtpServer.start(); beginAt("/list.page"); clickLinkWithText(I18n.getMessage(language, "ForumBase.login")); clickLinkWithText(I18n.getMessage(language, "Login.lostPassword")); setFormElement("username", lastTestuser); submit(); Th... |
public boolean inject(String fromAddress, String toAddress, byte[] mailData) throws MessagingException | public boolean inject(String fromAddress, String toAddress, InputStream mailData) throws MessagingException, IOException | public boolean inject(String fromAddress, String toAddress, byte[] mailData) throws MessagingException { if (log.isDebugEnabled()) log.debug("Injecting message sent to " + toAddress); InternetAddress fromAddy = new InternetAddress(fromAddress); InternetAddress toAddy = new InternetAddress(toAddress); // Must... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.