rem
stringlengths
1
53.3k
add
stringlengths
0
80.5k
context
stringlengths
6
326k
meta
stringlengths
141
403
input_ids
list
attention_mask
list
labels
list
while (msg==null || (msg.getSpec() != DMT.FNPAccepted)) {
while ((msg==null) || (msg.getSpec() != DMT.FNPAccepted)) {
private void realRun() { HashSet nodesRoutedTo = new HashSet(); HashSet nodesNotIgnored = new HashSet(); while(true) { if(receiveFailed) return; // don't need to set status as killed by InsertHandler synchronized (this) { if(htl == 0) { // Send an InsertReply back finish(SUCCESS, null); return; } } // Route it PeerNode next; // Can backtrack, so only route to nodes closer than we are to target. double nextValue; next = node.peers.closerPeer(source, nodesRoutedTo, nodesNotIgnored, target, true); if(next != null) nextValue = next.getLocation().getValue(); else nextValue = -1.0; if(next == null) { // Backtrack finish(ROUTE_NOT_FOUND, null); return; } Logger.minor(this, "Routing insert to "+next); nodesRoutedTo.add(next); Message req; synchronized (this) { if(PeerManager.distance(target, nextValue) > PeerManager.distance(target, closestLocation)) { Logger.minor(this, "Backtracking: target="+target+" next="+nextValue+" closest="+closestLocation); htl = node.decrementHTL(source, htl); } req = DMT.createFNPInsertRequest(uid, htl, myKey, closestLocation); } // Wait for ack or reject... will come before even a locally generated DataReply MessageFilter mfAccepted = MessageFilter.create().setSource(next).setField(DMT.UID, uid).setTimeout(ACCEPTED_TIMEOUT).setType(DMT.FNPAccepted); MessageFilter mfRejectedLoop = MessageFilter.create().setSource(next).setField(DMT.UID, uid).setTimeout(ACCEPTED_TIMEOUT).setType(DMT.FNPRejectedLoop); MessageFilter mfRejectedOverload = MessageFilter.create().setSource(next).setField(DMT.UID, uid).setTimeout(ACCEPTED_TIMEOUT).setType(DMT.FNPRejectedOverload); // mfRejectedOverload must be the last thing in the or // So its or pointer remains null // Otherwise we need to recreate it below mfRejectedOverload.clearOr(); MessageFilter mf = mfAccepted.or(mfRejectedLoop.or(mfRejectedOverload)); // Send to next node try { next.send(req, this); } catch (NotConnectedException e1) { Logger.minor(this, "Not connected to "+next); continue; } synchronized (this) { sentRequest = true; } if(receiveFailed) return; // don't need to set status as killed by InsertHandler Message msg = null; /* * Because messages may be re-ordered, it is * entirely possible that we get a non-local RejectedOverload, * followed by an Accepted. So we must loop here. */ while (msg==null || (msg.getSpec() != DMT.FNPAccepted)) { try { msg = node.usm.waitFor(mf, this); } catch (DisconnectedException e) { Logger.normal(this, "Disconnected from " + next + " while waiting for Accepted"); break; } if (receiveFailed) return; // don't need to set status as killed by InsertHandler if (msg == null) { // Terminal overload // Try to propagate back to source Logger.minor(this, "Timeout"); next.localRejectedOverload("Timeout3"); finish(TIMED_OUT, next); return; } if (msg.getSpec() == DMT.FNPRejectedOverload) { // Non-fatal - probably still have time left if (msg.getBoolean(DMT.IS_LOCAL)) { next.localRejectedOverload("ForwardRejectedOverload5"); Logger.minor(this, "Local RejectedOverload, moving on to next peer"); // Give up on this one, try another break; } else { forwardRejectedOverload(); } continue; } if (msg.getSpec() == DMT.FNPRejectedLoop) { next.successNotOverload(); // Loop - we don't want to send the data to this one break; } if (msg.getSpec() != DMT.FNPAccepted) { Logger.error(this, "Unexpected message waiting for Accepted: " + msg); break; } // Otherwise is an FNPAccepted } if(msg == null || msg.getSpec() != DMT.FNPAccepted) continue; Logger.minor(this, "Got Accepted on "+this); // Send them the data. // Which might be the new data resulting from a collision... Message dataInsert; PartiallyReceivedBlock prbNow; prbNow = prb; dataInsert = DMT.createFNPDataInsert(uid, headers); /** What are we waiting for now??: * - FNPRouteNotFound - couldn't exhaust HTL, but send us the * data anyway please * - FNPInsertReply - used up all HTL, yay * - FNPRejectOverload - propagating an overload error :( * - FNPRejectTimeout - we took too long to send the DataInsert * - FNPDataInsertRejected - the insert was invalid */ MessageFilter mfInsertReply = MessageFilter.create().setSource(next).setField(DMT.UID, uid).setTimeout(SEARCH_TIMEOUT).setType(DMT.FNPInsertReply); mfRejectedOverload.setTimeout(SEARCH_TIMEOUT); mfRejectedOverload.clearOr(); MessageFilter mfRouteNotFound = MessageFilter.create().setSource(next).setField(DMT.UID, uid).setTimeout(SEARCH_TIMEOUT).setType(DMT.FNPRouteNotFound); MessageFilter mfDataInsertRejected = MessageFilter.create().setSource(next).setField(DMT.UID, uid).setTimeout(SEARCH_TIMEOUT).setType(DMT.FNPDataInsertRejected); MessageFilter mfTimeout = MessageFilter.create().setSource(next).setField(DMT.UID, uid).setTimeout(SEARCH_TIMEOUT).setType(DMT.FNPRejectedTimeout); mf = mfInsertReply.or(mfRouteNotFound.or(mfDataInsertRejected.or(mfTimeout.or(mfRejectedOverload)))); Logger.minor(this, "Sending DataInsert"); if(receiveFailed) return; try { next.send(dataInsert, this); } catch (NotConnectedException e1) { Logger.minor(this, "Not connected sending DataInsert: "+next+" for "+uid); continue; } Logger.minor(this, "Sending data"); if(receiveFailed) return; AwaitingCompletion ac = new AwaitingCompletion(next, prbNow); synchronized(nodesWaitingForCompletion) { nodesWaitingForCompletion.add(ac); nodesWaitingForCompletion.notifyAll(); } ac.start(); makeCompletionWaiter(); while (true) { if (receiveFailed) return; try { msg = node.usm.waitFor(mf, this); } catch (DisconnectedException e) { Logger.normal(this, "Disconnected from " + next + " while waiting for InsertReply on " + this); break; } if (receiveFailed) return; if (msg == null || msg.getSpec() == DMT.FNPRejectedTimeout) { // Timeout :( // Fairly serious problem Logger.error(this, "Timeout (" + msg + ") after Accepted in insert"); // Terminal overload // Try to propagate back to source next.localRejectedOverload("AfterInsertAcceptedTimeout2"); finish(TIMED_OUT, next); return; } if (msg.getSpec() == DMT.FNPRejectedOverload) { // Probably non-fatal, if so, we have time left, can try next one if (msg.getBoolean(DMT.IS_LOCAL)) { next.localRejectedOverload("ForwardRejectedOverload6"); Logger.minor(this, "Local RejectedOverload, moving on to next peer"); // Give up on this one, try another break; } else { forwardRejectedOverload(); } continue; // Wait for any further response } if (msg.getSpec() == DMT.FNPRouteNotFound) { Logger.minor(this, "Rejected: RNF"); short newHtl = msg.getShort(DMT.HTL); synchronized (this) { if (htl > newHtl) htl = newHtl; } // Finished as far as this node is concerned next.successNotOverload(); break; } if (msg.getSpec() == DMT.FNPDataInsertRejected) { next.successNotOverload(); short reason = msg .getShort(DMT.DATA_INSERT_REJECTED_REASON); Logger.minor(this, "DataInsertRejected: " + reason); if (reason == DMT.DATA_INSERT_REJECTED_VERIFY_FAILED) { if (fromStore) { // That's odd... Logger.error(this,"Verify failed on next node " + next + " for DataInsert but we were sending from the store!"); } else { try { if (!prb.allReceived()) Logger.error(this, "Did not receive all packets but next node says invalid anyway!"); else { // Check the data new CHKBlock(prb.getBlock(), headers, myKey); Logger.error(this, "Verify failed on " + next + " but data was valid!"); } } catch (CHKVerifyException e) { Logger .normal(this, "Verify failed because data was invalid"); } catch (AbortedException e) { receiveFailed = true; } } break; // What else can we do? } else if (reason == DMT.DATA_INSERT_REJECTED_RECEIVE_FAILED) { if (receiveFailed) { Logger.minor(this, "Failed to receive data, so failed to send data"); } else { try { if (prb.allReceived()) { Logger.error(this, "Received all data but send failed to " + next); } else { if (prb.isAborted()) { Logger.normal(this, "Send failed: aborted: " + prb.getAbortReason() + ": " + prb.getAbortDescription()); } else Logger.normal(this, "Send failed; have not yet received all data but not aborted: " + next); } } catch (AbortedException e) { receiveFailed = true; } } } Logger.error(this, "DataInsert rejected! Reason=" + DMT.getDataInsertRejectedReason(reason)); break; } if (msg.getSpec() != DMT.FNPInsertReply) { Logger.error(this, "Unknown reply: " + msg); finish(INTERNAL_ERROR, next); return; }else{ // Our task is complete next.successNotOverload(); finish(SUCCESS, next); return; } } } }
51834 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51834/ca136843ae9ecb30cadada58a33a5dc2cf8ad064/CHKInsertSender.java/clean/src/freenet/node/CHKInsertSender.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 918, 2863, 1997, 1435, 288, 3639, 6847, 2199, 4583, 329, 774, 273, 394, 6847, 5621, 3639, 6847, 2199, 1248, 15596, 273, 394, 6847, 5621, 7734, 1323, 12, 3767, 13, 288, 5411, 309, 12...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 918, 2863, 1997, 1435, 288, 3639, 6847, 2199, 4583, 329, 774, 273, 394, 6847, 5621, 3639, 6847, 2199, 1248, 15596, 273, 394, 6847, 5621, 7734, 1323, 12, 3767, 13, 288, 5411, 309, 12...
description = MarkerMessages.problemSeverity_description; }
description = MarkerMessages.problemSeverity_description; }
public FieldSeverity() { description = MarkerMessages.problemSeverity_description; }
56152 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56152/2bc2f7e05493c8f842d6d73cc7cb85357120cefd/FieldSeverity.java/clean/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/FieldSeverity.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 2286, 21630, 1435, 288, 3639, 2477, 273, 14742, 5058, 18, 18968, 21630, 67, 3384, 31, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 2286, 21630, 1435, 288, 3639, 2477, 273, 14742, 5058, 18, 18968, 21630, 67, 3384, 31, 565, 289, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
try {
try {
private Player[] createPlayers(Properties p) throws Exception { String sFactions = p.getProperty("Factions"); if (sFactions == null) { throw new Exception("Not a valid MMS file. No Factions"); } StringTokenizer st = new StringTokenizer(sFactions, ","); Player[] out = new Player[st.countTokens()]; for (int x = 0; x < out.length; x++) { out[x] = new Player(x, st.nextToken()); // scenario players start out as ghosts to be logged into out[x].setGhost(true); // check for initial placement String s = p.getProperty("Location_" + out[x].getName()); // default to any if (s == null) { s = "Any"; } int nDir = findIndex(IStartingPositions.START_LOCATION_NAMES, s); // if it's not set by now, make it any if (nDir == -1) { nDir = 0; } out[x].setStartingPos(nDir); //Check for team setup int team = Player.TEAM_NONE; try { team = Integer.parseInt(p.getProperty("Team_" + out[x].getName())); } catch ( Exception e ) { team = Player.TEAM_NONE; } out[x].setTeam(team); String minefields = p.getProperty("Minefields_" + out[x].getName()); if (minefields != null) { try { StringTokenizer mfs = new StringTokenizer(minefields, ","); out[x].setNbrMFConventional(Integer.parseInt(mfs.nextToken())); out[x].setNbrMFCommand(Integer.parseInt(mfs.nextToken())); out[x].setNbrMFVibra(Integer.parseInt(mfs.nextToken())); } catch (Exception e) { out[x].setNbrMFConventional(0); out[x].setNbrMFCommand(0); out[x].setNbrMFVibra(0); System.err.println("Something wrong with " + out[x].getName() + "s minefields."); } } } return out; }
4135 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4135/fdae4d707c5ec3d7bf267b1824ddb4a724bd071d/ScenarioLoader.java/buggy/megamek/src/megamek/server/ScenarioLoader.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 19185, 8526, 752, 1749, 3907, 12, 2297, 293, 13, 3639, 1216, 1185, 565, 288, 3639, 514, 272, 42, 4905, 273, 293, 18, 588, 1396, 2932, 42, 4905, 8863, 3639, 309, 261, 87, 42, 4905,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 19185, 8526, 752, 1749, 3907, 12, 2297, 293, 13, 3639, 1216, 1185, 565, 288, 3639, 514, 272, 42, 4905, 273, 293, 18, 588, 1396, 2932, 42, 4905, 8863, 3639, 309, 261, 87, 42, 4905,...
final MenuManager menuManager = window.getMenuManager();
final MenuManager menuManager = window.getMenuManager();
private void updateActiveWorkbenchWindowMenuManager(boolean textOnly) { final IWorkbenchWindow workbenchWindow = getActiveWorkbenchWindow(); if (workbenchWindow instanceof WorkbenchWindow) { final WorkbenchWindow window = (WorkbenchWindow) workbenchWindow; if (window.isClosing()) { return; } final MenuManager menuManager = window.getMenuManager(); if (textOnly) menuManager.update(IAction.TEXT); else menuManager.updateAll(true); } }
55805 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55805/9337b828e86179850647141c34d497be28275ed2/Workbench.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 918, 1089, 3896, 2421, 22144, 3829, 4599, 1318, 12, 6494, 977, 3386, 13, 288, 3639, 727, 467, 2421, 22144, 3829, 1440, 22144, 3829, 273, 11960, 2421, 22144, 3829, 5621, 3639, 309, 261...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 918, 1089, 3896, 2421, 22144, 3829, 4599, 1318, 12, 6494, 977, 3386, 13, 288, 3639, 727, 467, 2421, 22144, 3829, 1440, 22144, 3829, 273, 11960, 2421, 22144, 3829, 5621, 3639, 309, 261...
else {
else {
private SerialContext writeOpeningTag(Object child, String childtagname, SAXAccessMethod topgetmethod) { SerialContext top = null; try { SerialContext oldtop = getDeSAXingObject(); if (oldtop != null && !oldtop.writtenchild) { xmlw.writeRaw(">"); if (indentlevel != COMPACT_MODE) { xmlw.writeRaw("\n"); } oldtop.writtenchild = true; } xmlw.writeRaw("<" + childtagname, getIndent()); String genericdata = null; if (child instanceof GenericSAX) { GenericSAX generic = (GenericSAX) child; SAXAccessMethodSpec[] getmethods = generic.getSAXGetMethods(); // QQQQQ There may be getmethods defined by other means. // Generic needs review! if (generic.size() == 0 && (getmethods == null || getmethods.length == 0)) genericdata = generic.getData(); } boolean isleaf = mappingcontext.saxleafparser .isLeafType(child.getClass()); top = isleaf ? null : new SerialContext(child, mappingcontext); // leaf is NOT DeSAXalizable OR we found some valid text boolean closenow = (isleaf || genericdata != null); Logger.println("Got generic data |" + genericdata + "|", Logger.DEBUG_SUBATOMIC); if (closenow) { // it is a leaf object xmlw.writeRaw(">", 0); // NB - 10/11/05 - final end of support for "Generic" objects. Check SVN should it ever need to come back. // use leafparser to render it into text if (genericdata == null) { xmlw.write(mappingcontext.saxleafparser.render(child)); } // use writeRaw so that < is not deentitised xmlw.writeRaw("</" + childtagname + ">\n", 0); top = null; } else { // it is not a leaf object. writing it will require another pass around Logger.println("Pushed", Logger.DEBUG_EXTRA_INFO); String polynick = mappingcontext.classnamemanager.getClassName(child.getClass()); if (polynick != null && topgetmethod != null && topgetmethod.ispolymorphic) { appendAttr(Constants.TYPE_ATTRIBUTE_NAME, polynick); } SAMIterator getattrenum = top.ma.attrmethods .getGetEnumeration(); if (getattrenum.valid() || child instanceof SAXalizableExtraAttrs) { Logger.println("Child has attributes", Logger.DEBUG_SUBATOMIC); // renderinto.clear(); renderAttrs(child, getattrenum); // xmlw.write(renderinto.storage, renderinto.offset, renderinto.size); } //xmlw.writeRaw(">\n", 0); desaxingobjects.push(top); } // else not a leaf object } catch (Throwable t) { throw UniversalRuntimeException.accumulate(t, "Error while writing tag " + childtagname); } return top; }
29 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/29/db86bb35b5ded213d3d08b530d1c8fa0e9faed0b/DeSAXalizer.java/clean/rsf-core/ponderutilcore/src/uk/org/ponder/saxalizer/DeSAXalizer.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 3238, 7366, 1042, 1045, 21378, 1805, 12, 921, 1151, 16, 514, 1151, 2692, 529, 16, 10168, 1862, 1305, 1760, 588, 2039, 13, 288, 565, 7366, 1042, 1760, 273, 446, 31, 565, 775, 288, 1377, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 3238, 7366, 1042, 1045, 21378, 1805, 12, 921, 1151, 16, 514, 1151, 2692, 529, 16, 10168, 1862, 1305, 1760, 588, 2039, 13, 288, 565, 7366, 1042, 1760, 273, 446, 31, 565, 775, 288, 1377, ...
battleSkillIDs.setSelectedItem( getProperty( "battleAction" ) );
battleSkillIDs.setSelectedItem( CombatSettings.getShortCombatOptionName( getProperty( "battleAction" ) ) );
public static void setAvailableSkills( List availableSkills ) { if ( availableSkills == KoLCharacter.availableSkills ) { addDictionary(); return; } KoLCharacter.availableSkills.clear(); KoLCharacter.usableSkills.clear(); KoLCharacter.combatSkills.clear(); KoLCharacter.battleSkillIDs.clear(); KoLCharacter.battleSkillNames.clear(); // All characters get the option to // attack something. KoLCharacter.battleSkillIDs.add( "attack" ); KoLCharacter.battleSkillNames.add( "Normal: Attack with Weapon" ); // If the player has a dictionary, add it // to the available skills list. addDictionary(); // Add the three permanent starting items // which can be used to attack. KoLCharacter.battleSkillIDs.add( "item0002" ); KoLCharacter.battleSkillNames.add( "Item: Use a Seal Tooth" ); KoLCharacter.battleSkillIDs.add( "item0004" ); KoLCharacter.battleSkillNames.add( "Item: Use a Scroll of Turtle Summoning" ); KoLCharacter.battleSkillIDs.add( "item0008" ); KoLCharacter.battleSkillNames.add( "Item: Use Spices" ); // Add in moxious maneuver if the player // is of the appropriate class. if ( isMoxieClass() ) { battleSkillIDs.add( "moxman" ); battleSkillNames.add( "Special: Moxious Maneuver" ); } // Check all available skills to see if they // qualify to be added as combat or usables. UseSkillRequest [] skillArray = new UseSkillRequest[ availableSkills.size() ]; availableSkills.toArray( skillArray ); for ( int i = 0; i < skillArray.length; ++i ) addAvailableSkill( skillArray[i] ); // Superhuman Cocktailcrafting affects # of summons for // Advanced Cocktailcrafting if ( hasSkill( "Superhuman Cocktailcrafting" ) ) client.setBreakfastSummonings( KoLmafia.COCKTAILCRAFTING, 5 ); // Transcendental Noodlecraft affects # of summons for // Pastamastery if ( hasSkill( "Transcendental Noodlecraft" ) ) client.setBreakfastSummonings( KoLmafia.PASTAMASTERY, 5 ); // The Way of Sauce affects # of summons for // Advanced Saucecrafting if ( hasSkill( "The Way of Sauce" ) ) client.setBreakfastSummonings( KoLmafia.SAUCECRAFTING, 5 ); // Add derived skills based on base skills addDerivedSkills(); // Set the selected combat skill based on // the user's current setting. KoLCharacter.battleSkillIDs.add( "custom" ); KoLCharacter.battleSkillNames.add( "Custom: Use Combat Script" ); battleSkillIDs.setSelectedItem( getProperty( "battleAction" ) ); if ( battleSkillIDs.getSelectedIndex() != -1 ) battleSkillNames.setSelectedIndex( battleSkillIDs.getSelectedIndex() ); }
50364 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50364/622ab33083af86d6680a52188438327e50f0cfd3/KoLCharacter.java/clean/src/net/sourceforge/kolmafia/KoLCharacter.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 760, 918, 444, 5268, 20057, 12, 987, 2319, 20057, 262, 202, 95, 202, 202, 430, 261, 2319, 20057, 422, 1475, 83, 48, 7069, 18, 5699, 20057, 262, 202, 202, 95, 1082, 202, 1289, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 760, 918, 444, 5268, 20057, 12, 987, 2319, 20057, 262, 202, 95, 202, 202, 430, 261, 2319, 20057, 422, 1475, 83, 48, 7069, 18, 5699, 20057, 262, 202, 202, 95, 1082, 202, 1289, ...
if(currentLineIndex >= firstInvalid &&
/*if(currentLineIndex >= firstInvalid &&
public void _invalidateLineRange(int firstLine, int lastLine) { int firstVisible = textArea.getFirstLine(); int lastVisible = firstVisible + textArea.getVisibleLines(); if(firstLine > lastLine) { int tmp = firstLine; firstLine = lastLine; lastLine = tmp; } if(lastLine < firstVisible || firstLine > lastVisible) return; firstLine = Math.max(firstLine,firstVisible); lastLine = Math.min(lastLine,lastVisible); if(firstInvalid == -1 && lastInvalid == -1) { firstInvalid = firstLine; lastInvalid = lastLine; } else { if(firstLine > firstInvalid && lastLine < lastInvalid) return; firstInvalid = Math.min(firstInvalid,firstLine); lastInvalid = Math.max(lastInvalid,lastLine); } /* Because the model uses cached text and token lists * for the current line, we must invalidate that info * if the current line changes. */ if(currentLineIndex >= firstInvalid && currentLineIndex <= lastInvalid) currentLineIndex = -1; }
6564 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6564/88d53e8796c174dd5c1aa895cc2331dfab553744/TextAreaPainter.java/clean/org/gjt/sp/jedit/textarea/TextAreaPainter.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 389, 5387, 340, 1670, 2655, 12, 474, 24415, 16, 509, 31661, 13, 202, 95, 202, 202, 474, 1122, 6207, 273, 977, 5484, 18, 588, 3759, 1670, 5621, 202, 202, 474, 1142, 6207, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 389, 5387, 340, 1670, 2655, 12, 474, 24415, 16, 509, 31661, 13, 202, 95, 202, 202, 474, 1122, 6207, 273, 977, 5484, 18, 588, 3759, 1670, 5621, 202, 202, 474, 1142, 6207, ...
ExtensionPoint extensionPoint = PluginRepository.getInstance()
ExtensionPoint extensionPoint =repository
public void testGetExtensionAndAttributes() { String xpId = " sdsdsd"; ExtensionPoint extensionPoint = PluginRepository.getInstance() .getExtensionPoint(xpId); assertEquals(extensionPoint, null); Extension[] extension1 = PluginRepository.getInstance() .getExtensionPoint(getGetExtensionId()).getExtensions(); assertEquals(extension1.length, fPluginCount); for (int i = 0; i < extension1.length; i++) { Extension extension2 = extension1[i]; String string = extension2.getAttribute(getGetConfigElementName()); assertEquals(string, getAttributeValue()); } }
57484 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57484/329ff64e9d7295aff108f85e9a8103f5e5f8f398/TestPluginSystem.java/buggy/src/test/org/apache/nutch/plugin/TestPluginSystem.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1842, 967, 3625, 1876, 2498, 1435, 288, 3639, 514, 13681, 548, 273, 315, 272, 2377, 2377, 72, 14432, 3639, 10021, 2148, 2710, 2148, 273, 9071, 7734, 263, 588, 3625, 2148, 12, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1842, 967, 3625, 1876, 2498, 1435, 288, 3639, 514, 13681, 548, 273, 315, 272, 2377, 2377, 72, 14432, 3639, 10021, 2148, 2710, 2148, 273, 9071, 7734, 263, 588, 3625, 2148, 12, 2...
while (bi == null)
while (bi == null) { System.out.println(" bi = null ");
public Graphics2D getDrawingArea() { try { synchronized (lock) { // wait until there is something to read while (bi == null) lock.wait(); // we have the lock and state we're seeking Graphics2D g2; g2 = bi.createGraphics(); return g2; } } catch (InterruptedException ie) { System.out.println("getDrawingarea : " + ie.getMessage()); return null; } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/e95e8529e0583c40804063baff9fc99787c4f55b/GuiGraphicBuffer.java/clean/tn5250j/src/org/tn5250j/GuiGraphicBuffer.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 565, 1071, 16830, 22, 40, 2343, 1899, 310, 5484, 1435, 288, 1377, 775, 288, 540, 3852, 261, 739, 13, 288, 5411, 368, 2529, 3180, 1915, 353, 5943, 358, 855, 5411, 1323, 261, 13266, 422, 446, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 565, 1071, 16830, 22, 40, 2343, 1899, 310, 5484, 1435, 288, 1377, 775, 288, 540, 3852, 261, 739, 13, 288, 5411, 368, 2529, 3180, 1915, 353, 5943, 358, 855, 5411, 1323, 261, 13266, 422, 446, ...
this(new StringWriter()); sbuf = sout.getBuffer();
this(new CharArrayOutPort());
public TestSuite() { this(new StringWriter()); sbuf = sout.getBuffer(); }
36870 /local/tlutelli/issta_data/temp/all_java3context/java/2006_temp/2006/36870/c999787cfac3facb7cfcd70e59221eccd40aeede/TestSuite.java/buggy/gnu/xquery/testsuite/TestSuite.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 7766, 13587, 1435, 225, 288, 565, 333, 12, 2704, 17436, 10663, 565, 2393, 696, 273, 272, 659, 18, 588, 1892, 5621, 225, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 7766, 13587, 1435, 225, 288, 565, 333, 12, 2704, 17436, 10663, 565, 2393, 696, 273, 272, 659, 18, 588, 1892, 5621, 225, 289, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
if( finalEventList == null ) { finalEventList = getBaseEventList(); } return finalEventList; }
if (finalEventList == null) { finalEventList = getBaseEventList(); } return finalEventList; }
public EventList getFinalEventList() { if( finalEventList == null ) { finalEventList = getBaseEventList(); } return finalEventList; }
55916 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55916/2224b49c445911182579708c97cbe27050123ac6/AbstractObjectTable.java/buggy/sandbox/src/main/java/org/springframework/richclient/table/support/AbstractObjectTable.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 2587, 682, 2812, 1490, 1133, 682, 1435, 288, 3639, 309, 12, 727, 1133, 682, 422, 446, 262, 288, 5411, 727, 1133, 682, 273, 8297, 1133, 682, 5621, 3639, 289, 3639, 327, 727, 1133, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 2587, 682, 2812, 1490, 1133, 682, 1435, 288, 3639, 309, 12, 727, 1133, 682, 422, 446, 262, 288, 5411, 727, 1133, 682, 273, 8297, 1133, 682, 5621, 3639, 289, 3639, 327, 727, 1133, ...
public NewProjectAction(IWorkbenchWindow window) { super(WorkbenchMessages.getString("NewProjectAction.text")); Assert.isNotNull(window); this.window = window; ISharedImages images = PlatformUI.getWorkbench().getSharedImages(); setImageDescriptor( images.getImageDescriptor(ISharedImages.IMG_TOOL_NEW_WIZARD)); setHoverImageDescriptor( images.getImageDescriptor(ISharedImages.IMG_TOOL_NEW_WIZARD_HOVER)); setDisabledImageDescriptor( images.getImageDescriptor(ISharedImages.IMG_TOOL_NEW_WIZARD_DISABLED)); setToolTipText(WorkbenchMessages.getString("NewProjectAction.toolTip")); WorkbenchHelp.setHelp(this, IHelpContextIds.NEW_ACTION);
public NewProjectAction() { this(PlatformUI.getWorkbench().getActiveWorkbenchWindow());
public NewProjectAction(IWorkbenchWindow window) { super(WorkbenchMessages.getString("NewProjectAction.text")); //$NON-NLS-1$ Assert.isNotNull(window); this.window = window; ISharedImages images = PlatformUI.getWorkbench().getSharedImages(); setImageDescriptor( images.getImageDescriptor(ISharedImages.IMG_TOOL_NEW_WIZARD)); setHoverImageDescriptor( images.getImageDescriptor(ISharedImages.IMG_TOOL_NEW_WIZARD_HOVER)); setDisabledImageDescriptor( images.getImageDescriptor(ISharedImages.IMG_TOOL_NEW_WIZARD_DISABLED)); setToolTipText(WorkbenchMessages.getString("NewProjectAction.toolTip")); //$NON-NLS-1$ WorkbenchHelp.setHelp(this, IHelpContextIds.NEW_ACTION);}
58148 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/58148/0afae2d1a1ae06b1bdf37d656ba68793da325e38/NewProjectAction.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/NewProjectAction.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1071, 1166, 4109, 1803, 12, 45, 2421, 22144, 3829, 2742, 13, 288, 202, 9565, 12, 2421, 22144, 5058, 18, 588, 780, 2932, 1908, 4109, 1803, 18, 955, 7923, 1769, 4329, 3993, 17, 5106, 17, 21, 8...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1071, 1166, 4109, 1803, 12, 45, 2421, 22144, 3829, 2742, 13, 288, 202, 9565, 12, 2421, 22144, 5058, 18, 588, 780, 2932, 1908, 4109, 1803, 18, 955, 7923, 1769, 4329, 3993, 17, 5106, 17, 21, 8...
if ( endOfBaseName != -1 ) {
if (endOfBaseName != -1) {
protected String getJarBaseName(String descriptorFileName) { String baseName = null; if ( getConfig().namingScheme.getValue().equals(EjbJar.NamingScheme.DESCRIPTOR) ) { // try to find JOnAS specific convention name if ( descriptorFileName.indexOf(getConfig().baseNameTerminator) == -1 ) { // baseNameTerminator not found: the descriptor use the // JOnAS naming convention, ie [Foo.xml,jonas-Foo.xml] and // not [Foo<baseNameTerminator>-ejb-jar.xml, // Foo<baseNameTerminator>-jonas-ejb-jar.xml]. String aCanonicalDescriptor = descriptorFileName.replace('\\', '/'); int lastSeparatorIndex = aCanonicalDescriptor.lastIndexOf('/'); int endOfBaseName; if ( lastSeparatorIndex != -1 ) { endOfBaseName = descriptorFileName.indexOf(".xml", lastSeparatorIndex); } else { endOfBaseName = descriptorFileName.indexOf(".xml"); } if ( endOfBaseName != -1 ) { baseName = descriptorFileName.substring(0, endOfBaseName); } } } if ( baseName == null ) { // else get standard baseName baseName = super.getJarBaseName(descriptorFileName); } log("JAR base name: " + baseName, Project.MSG_VERBOSE); return baseName; }
639 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/639/6ee5317ca34e43ca1d62e890dcf034eb44cca649/JonasDeploymentTool.java/buggy/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 4750, 514, 9285, 297, 29907, 12, 780, 4950, 4771, 13, 288, 3639, 514, 16162, 273, 446, 31, 3639, 309, 261, 4367, 7675, 82, 7772, 9321, 18, 24805, 7675, 14963, 12, 41, 10649, 10813, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 4750, 514, 9285, 297, 29907, 12, 780, 4950, 4771, 13, 288, 3639, 514, 16162, 273, 446, 31, 3639, 309, 261, 4367, 7675, 82, 7772, 9321, 18, 24805, 7675, 14963, 12, 41, 10649, 10813, 18, ...
type = Type.int_type;
type = LangPrimType.intType;
public Expression inline (ApplyExp exp) { Expression folded = ApplyExp.inlineIfConstant(this, exp); if (folded != exp) return folded; Expression[] args = exp.getArgs(); if (args.length > 2) return pairwise(this, exp.getFunction(), args); if (args.length == 1 && plusOrMinus < 0) { Type type0 = args[0].getType(); if (type0 instanceof PrimType) { char sig0 = type0.getSignature().charAt(0); Type type = null; int opcode = 0; if (sig0 == 'V' || sig0 == 'Z' || sig0 == 'C') { // error } else if (sig0 == 'D') { opcode = 119 /* dneg */; type = Type.double_type; } else if (sig0 == 'F') { opcode = 118 /* fneg */; type = Type.float_type; } else if (sig0 == 'J') { opcode = 117 /* lneg */; type = Type.long_type; } else { opcode = 116 /* ineg */; type = Type.int_type; } if (type != null) { PrimProcedure prim = PrimProcedure.makeBuiltinBinary(opcode, type); return new ApplyExp(prim, args); } } } if (args.length == 2) { Type type0 = args[0].getType(); Type type1 = args[1].getType(); if (type0 instanceof PrimType && type1 instanceof PrimType) { char sig0 = type0.getSignature().charAt(0); char sig1 = type1.getSignature().charAt(0); Type type = null; int opcode = 0; if (sig0 == 'V' || sig0 == 'Z' || sig0 == 'C' || sig1 == 'V' || sig1 == 'Z' || sig1 == 'C') { // error } else if (sig0 == 'D' || sig1 == 'D') { opcode = plusOrMinus > 0 ? 99 /* dadd */ : 103 /* dsub */; type = Type.double_type; } else if (sig0 == 'F' || sig1 == 'F') { opcode = plusOrMinus > 0 ? 98 /* fadd */ : 102 /* fsub */; type = Type.float_type; } else if (sig0 == 'J' || sig1 == 'J') { opcode = plusOrMinus > 0 ? 97 /* ladd */ : 101 /* lsub */; type = Type.long_type; } else { opcode = plusOrMinus > 0 ? 96 /* iadd */ : 100 /* isub */; type = Type.int_type; } if (type != null) { PrimProcedure prim = PrimProcedure.makeBuiltinBinary(opcode, type); return new ApplyExp(prim, args); } } } return exp; }
36870 /local/tlutelli/issta_data/temp/all_java3context/java/2006_temp/2006/36870/bcb2d6c9163c02bcc78e2033f3f249047aa482ac/AddOp.java/buggy/gnu/kawa/functions/AddOp.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 5371, 6370, 261, 7001, 2966, 1329, 13, 225, 288, 565, 5371, 28420, 785, 273, 5534, 2966, 18, 10047, 2047, 6902, 12, 2211, 16, 1329, 1769, 565, 309, 261, 9002, 785, 480, 1329, 13, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 5371, 6370, 261, 7001, 2966, 1329, 13, 225, 288, 565, 5371, 28420, 785, 273, 5534, 2966, 18, 10047, 2047, 6902, 12, 2211, 16, 1329, 1769, 565, 309, 261, 9002, 785, 480, 1329, 13, ...
final TestStatisticsMap.Iterator iterator = m_testStatisticsMap.new Iterator();
m_testStatisticsMap.new ForEach() { public void next(Test test, StatisticsSet statistics) { out.print(formatter.format("Test " + test.getNumber(), statistics));
public final void print(PrintWriter out) { final ExpressionView[] expressionViews = m_statisticsView.getExpressionViews(); final int numberOfHeaderColumns = expressionViews.length + 1; StringBuffer[] cells = new StringBuffer[numberOfHeaderColumns]; StringBuffer[] remainders = new StringBuffer[numberOfHeaderColumns]; for (int i = 0; i < numberOfHeaderColumns; i++) { cells[i] = new StringBuffer( i == 0 ? "" : expressionViews[i - 1].getDisplayName()); remainders[i] = new StringBuffer(); } boolean wrapped = false; do { wrapped = false; for (int i = 0; i < numberOfHeaderColumns; ++i) { remainders[i].setLength(0); m_headingFormatter.transform(cells[i], remainders[i]); out.print(cells[i].toString()); out.print(COLUMN_SEPARATOR); if (remainders[i].length() > 0) { wrapped = true; } } out.println(); final StringBuffer[] otherArray = cells; cells = remainders; remainders = otherArray; } while (wrapped); out.println(); synchronized (m_testStatisticsMap) { final TestStatisticsMap.Iterator iterator = m_testStatisticsMap.new Iterator(); while (iterator.hasNext()) { final TestStatisticsMap.Pair pair = iterator.next(); final Test test = pair.getTest(); final StringBuffer output = formatLine("Test " + test.getNumber(), pair.getStatistics(), expressionViews); final String testDescription = test.getDescription(); if (testDescription != null) { output.append(" \"" + testDescription + "\""); } out.println(output.toString()); } out.println(); out.println(formatLine("Totals", m_testStatisticsMap.createTotalStatisticsSet(), expressionViews)); } }
7770 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7770/ed552fef82e98905225cf760fb70421ed264d363/StatisticsTable.java/buggy/src/net/grinder/statistics/StatisticsTable.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 727, 918, 1172, 12, 5108, 2289, 596, 13, 288, 565, 727, 5371, 1767, 8526, 2652, 9959, 273, 1377, 312, 67, 14438, 1767, 18, 588, 2300, 9959, 5621, 565, 727, 509, 7922, 1864, 3380, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 727, 918, 1172, 12, 5108, 2289, 596, 13, 288, 565, 727, 5371, 1767, 8526, 2652, 9959, 273, 1377, 312, 67, 14438, 1767, 18, 588, 2300, 9959, 5621, 565, 727, 509, 7922, 1864, 3380, ...
}
public void xmlReadPlayerSitRequest(Object o) { //en verdad jugador no se usa porque creemos que como el communicator ya tiene su player entonces con //ese player es suficiente String aux; if (o instanceof Element) { Element element = (Element) o; aux = element.getName(); if (aux.compareTo("Pos") == 0) { posAux = Integer.parseInt(element.getAttributeValue("pos")); } if (aux.compareTo("Player") == 0) { otroPlayerName = element.getAttributeValue("name"); } if (aux.compareTo("Table") == 0) { idAux = Integer.parseInt(element.getAttributeValue("id")); } List children = element.getContent(); Iterator iterator = children.iterator(); while (iterator.hasNext()) { Object child = iterator.next(); xmlReadPlayerSitRequest(child); } if (aux.compareTo("PlayerSitRequest") == 0) { System.out.println( "DENTRO DEL COMMUNICATOR SERVer carajo////////////////"); System.out.println("El table a sentarse es " + idAux); System.out.println("La posicion es " + posAux); //ATENCION ESTE TRY HAY QUE DESCOMENTAR PARA QUE FUNCIONE. ESTA COMOENTADO PORQUE EL TABLESERVER //TODAVIA NO TIENE UN Mtodo PlayerSit try { String tid = String.valueOf(idAux); //TableServer tabela = (TableServer) getTables().get(tid); //La linea de arrriba fue cambiada por cricco ahora se usa la de abajo TableServer tabela=(TableServer)(pieza.getHashTable().get(new Integer(tid))); System.out.println("********#######Dentro de sit 1\n"+tabela); tabela.sitPlayer(pieza.getPlayer(otroPlayerName), posAux); System.out.println("********#######Dentro de sit 2\n"+tabela); } catch (java.lang.NullPointerException e) { System.out.println( "LA TABLA ES NULL EN EL COMUNICATOR SERVER METODO xmlReadPlayerSitRequest "); e.printStackTrace(System.out); throw e; } } } }
1311 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1311/9044a55dab84893696ebf313d6aaf6a3f8d65d93/CommunicatorServer.java/clean/py/edu/uca/fcyt/toluca/net/CommunicatorServer.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 97, 918, 97, 2025, 1994, 12148, 55, 305, 691, 12, 921, 97, 320, 13, 202, 2916, 368, 275, 97, 1924, 72, 361, 97, 525, 637, 23671, 97, 1158, 97, 695, 97, 584, 69, 97, 22471,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 97, 918, 97, 2025, 1994, 12148, 55, 305, 691, 12, 921, 97, 320, 13, 202, 2916, 368, 275, 97, 1924, 72, 361, 97, 525, 637, 23671, 97, 1158, 97, 695, 97, 584, 69, 97, 22471,...
if (functionType != CONSTRUCTOR_ONLY) { return master.execMethod(methodId, this, cx, scope, thisObj, args); } else { return Undefined.instance; }
return master.execMethod(methodId, this, cx, scope, thisObj, args);
public Object call(Context cx, Scriptable scope, Scriptable thisObj, Object[] args) throws JavaScriptException { if (functionType != CONSTRUCTOR_ONLY) { return master.execMethod(methodId, this, cx, scope, thisObj, args); } else { return Undefined.instance; } }
47609 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47609/9aa69b8a87d4efbd57dc0e8f2c35494eefbcca0f/IdFunction.java/clean/js/rhino/src/org/mozilla/javascript/IdFunction.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 1033, 745, 12, 1042, 9494, 16, 22780, 2146, 16, 22780, 15261, 16, 15604, 1033, 8526, 833, 13, 3639, 1216, 11905, 503, 565, 288, 3639, 309, 261, 915, 559, 480, 3492, 13915, 916, 67, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 1033, 745, 12, 1042, 9494, 16, 22780, 2146, 16, 22780, 15261, 16, 15604, 1033, 8526, 833, 13, 3639, 1216, 11905, 503, 565, 288, 3639, 309, 261, 915, 559, 480, 3492, 13915, 916, 67, ...
_buildDir = FileOps.validate(dir);
_buildDir = dir;
public void setBuildDirectory(File dir) { // System.err.println("setBuildDirectory(" + dir + ") called"); _buildDir = FileOps.validate(dir); // System.err.println("Vaidated form is: " + _buildDir); }
11192 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/11192/b751c38fc70d22454ab93b852de5dd5f6f16d1ba/ProjectProfile.java/clean/drjava/src/edu/rice/cs/drjava/project/ProjectProfile.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 918, 444, 3116, 2853, 12, 812, 1577, 13, 288, 368, 565, 2332, 18, 370, 18, 8222, 2932, 542, 3116, 2853, 2932, 397, 1577, 397, 9369, 2566, 8863, 1377, 389, 3510, 1621, 273, 1577, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 918, 444, 3116, 2853, 12, 812, 1577, 13, 288, 368, 565, 2332, 18, 370, 18, 8222, 2932, 542, 3116, 2853, 2932, 397, 1577, 397, 9369, 2566, 8863, 1377, 389, 3510, 1621, 273, 1577, 3...
private void aSTRING(PrintStream ps, String value) { astring(ps, value, true); }
private static void aSTRING(PrintStream ps, String value) { if (value == null) ps.print("\"\""); else astring(ps, value, true); }
private void aSTRING(PrintStream ps, String value) { astring(ps, value, true); }
6965 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6965/61c80d8f0582e4148bb6a23589fb8ee96f3c7142/ImapMessage.java/buggy/ZimbraServer/src/java/com/zimbra/cs/imap/ImapMessage.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 918, 279, 5804, 12, 5108, 1228, 4250, 16, 514, 460, 13, 288, 487, 371, 12, 1121, 16, 460, 16, 638, 1769, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 918, 279, 5804, 12, 5108, 1228, 4250, 16, 514, 460, 13, 288, 487, 371, 12, 1121, 16, 460, 16, 638, 1769, 289, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
} else { fail( "Fail to extract filtered data" );
} else { fail("Fail to extract filtered data");
public void testDataExtractionWithFilter( ) { report_design = inputPath + "DataExtraction_table.rptdesign"; report_document = outputPath + "DataExtraction_table.rptdocument"; try { createReportDocument( report_design, report_document ); reportDoc = engine.openReportDocument( report_document ); IDataExtractionTask extractTask = engine .createDataExtractionTask( reportDoc ); extractTask.selectResultSet( "t1" ); IFilterDefinition[] filterExpression = new IFilterDefinition[1]; filterExpression[0] = new FilterDefinition( new ConditionalExpression( "row[\"territory\"]", ConditionalExpression.OP_EQ, "\"EMEA\"", null ) ); extractTask.setFilters( filterExpression ); IExtractionResults result = extractTask.extract( ); if ( result != null ) { int officecode = 0; IDataIterator data = result.nextResultIterator( ); if ( data != null ) { data.next( ); officecode = Integer.parseInt( data.getValue( "code" ) .toString( ) ); assertEquals( "Fail to extract filtered data", 4, officecode ); if ( data.next( ) ) { officecode = Integer.parseInt( data.getValue( "code" ) .toString( ) ); assertEquals( "Fail to extract filtered data", 7, officecode ); } } } else { fail( "Fail to extract filtered data" ); } } catch ( Exception e ) { e.printStackTrace( ); fail( "Fail to extract filtered data" ); } }
46013 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46013/4bce1ae0cad8677a83e260503bb7af276ddd5e48/DataExtractionTaskTest.java/buggy/testsuites/org.eclipse.birt.report.tests.engine/src/org/eclipse/birt/report/tests/engine/api/DataExtractionTaskTest.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 1842, 751, 25757, 1190, 1586, 12, 262, 202, 95, 202, 202, 6006, 67, 16934, 273, 810, 743, 397, 315, 751, 25757, 67, 2121, 18, 86, 337, 16934, 14432, 202, 202, 6006, 67, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 1842, 751, 25757, 1190, 1586, 12, 262, 202, 95, 202, 202, 6006, 67, 16934, 273, 810, 743, 397, 315, 751, 25757, 67, 2121, 18, 86, 337, 16934, 14432, 202, 202, 6006, 67, ...
case CommonarchivePackage.RAR_FILE__FILES :
case CommonarchivePackage.RAR_FILE__FILES:
public Object eGet(EStructuralFeature eFeature, boolean resolve) { switch (eDerivedStructuralFeatureID(eFeature)) { case CommonarchivePackage.RAR_FILE__URI : return getURI(); case CommonarchivePackage.RAR_FILE__LAST_MODIFIED : return new Long(getLastModified()); case CommonarchivePackage.RAR_FILE__SIZE : return new Long(getSize()); case CommonarchivePackage.RAR_FILE__DIRECTORY_ENTRY : return isDirectoryEntry() ? Boolean.TRUE : Boolean.FALSE; case CommonarchivePackage.RAR_FILE__ORIGINAL_URI : return getOriginalURI(); case CommonarchivePackage.RAR_FILE__LOADING_CONTAINER : if (resolve) return getLoadingContainer(); return basicGetLoadingContainer(); case CommonarchivePackage.RAR_FILE__CONTAINER : return getContainer(); case CommonarchivePackage.RAR_FILE__FILES : return getFiles(); case CommonarchivePackage.RAR_FILE__TYPES : return getTypes(); case CommonarchivePackage.RAR_FILE__DEPLOYMENT_DESCRIPTOR : if (resolve) return getDeploymentDescriptor(); return basicGetDeploymentDescriptor(); } return eDynamicGet(eFeature, resolve); }
8196 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8196/ebce0dfcf980c405fd07c019b6f4466152262cb7/RARFileImpl.java/buggy/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/RARFileImpl.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 1033, 15952, 12, 41, 14372, 4595, 425, 4595, 16, 1250, 2245, 13, 288, 202, 202, 9610, 261, 73, 21007, 14372, 4595, 734, 12, 73, 4595, 3719, 288, 1082, 202, 3593, 5658, 10686, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 1033, 15952, 12, 41, 14372, 4595, 425, 4595, 16, 1250, 2245, 13, 288, 202, 202, 9610, 261, 73, 21007, 14372, 4595, 734, 12, 73, 4595, 3719, 288, 1082, 202, 3593, 5658, 10686, ...
if (getRuby().getSecurityLevel() >= 4 && !isTaint()) { throw new RubySecurityException(getRuby(), "Insecure: can't define method"); } if (isFrozen()) { throw new RubyFrozenException(getRuby(), "class/module"); } Node body = new NodeFactory(getRuby()).newMethod(node, noex); methods.put(id, body); }
if (getRuby().getSecurityLevel() >= 4 && !isTaint()) { throw new RubySecurityException(getRuby(), "Insecure: can't define method"); } if (isFrozen()) { throw new RubyFrozenException(getRuby(), "class/module"); } Node body = new NodeFactory(getRuby()).newMethod(node, noex); methods.put(id, body); }
public void addMethod(RubyId id, Node node, int noex) { if (this == getRuby().getClasses().getObjectClass()) { getRuby().secure(4); } if (getRuby().getSecurityLevel() >= 4 && !isTaint()) { throw new RubySecurityException(getRuby(), "Insecure: can't define method"); } if (isFrozen()) { throw new RubyFrozenException(getRuby(), "class/module"); } Node body = new NodeFactory(getRuby()).newMethod(node, noex); methods.put(id, body); }
49687 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49687/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 18223, 12, 54, 10340, 548, 612, 16, 2029, 756, 16, 509, 1158, 338, 13, 288, 202, 202, 430, 261, 2211, 422, 4170, 10340, 7675, 588, 4818, 7675, 588, 921, 797, 10756, 288, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 18223, 12, 54, 10340, 548, 612, 16, 2029, 756, 16, 509, 1158, 338, 13, 288, 202, 202, 430, 261, 2211, 422, 4170, 10340, 7675, 588, 4818, 7675, 588, 921, 797, 10756, 288, ...
return myClass.getName();
return getElement().getName();
public String getPresentableText() { return myClass.getName(); }
56627 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56627/15b9bbdaaed4cfc2f81bd7bf63401f715c8ab921/JavaClassTreeElement.java/buggy/source/com/intellij/ide/structureView/impl/java/JavaClassTreeElement.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 514, 1689, 1581, 429, 1528, 1435, 288, 565, 327, 7426, 7675, 17994, 5621, 225, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 514, 1689, 1581, 429, 1528, 1435, 288, 565, 327, 7426, 7675, 17994, 5621, 225, 289, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
return getDateTruncated(-7);
return getDateTruncated( -7 );
private Date getDateOneWeekAgo() { return getDateTruncated(-7); }
8781 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8781/8a99201122e9ecb27b7c16b6fc12ce91d72dcd54/AdminManager.java/clean/server/src/com/imcode/imcms/servlet/superadmin/AdminManager.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 2167, 10713, 3335, 6630, 2577, 83, 1435, 288, 3639, 327, 10713, 23825, 12, 300, 27, 11272, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 2167, 10713, 3335, 6630, 2577, 83, 1435, 288, 3639, 327, 10713, 23825, 12, 300, 27, 11272, 565, 289, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
public UdpEventReceiver(int port)
public UdpEventReceiver()
public UdpEventReceiver(int port) { m_dgSock = null; m_dgPort = port; m_eventsIn = new LinkedList(); m_eventUuidsOut = new LinkedList(); m_handlers = new ArrayList(3); m_status = START_PENDING; m_dgSock = null; m_receiver = null; m_processor= null; m_output = null; m_logPrefix = null; }
11849 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/11849/b3612967cb053036bdb295ee74cb2e369c6ca18d/UdpEventReceiver.java/clean/src/services/org/opennms/netmgt/eventd/adaptors/udp/UdpEventReceiver.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 587, 9295, 1133, 12952, 12, 474, 1756, 13, 202, 95, 202, 202, 81, 67, 72, 75, 55, 975, 225, 273, 446, 31, 202, 202, 81, 67, 72, 75, 2617, 225, 273, 1756, 31, 202, 202, 8...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 587, 9295, 1133, 12952, 12, 474, 1756, 13, 202, 95, 202, 202, 81, 67, 72, 75, 55, 975, 225, 273, 446, 31, 202, 202, 81, 67, 72, 75, 2617, 225, 273, 1756, 31, 202, 202, 8...
return new FunDefBase(dummyFunDef) { final Exp valueFunCall = createValueFunCall();
return new AbstractAggregateFunDef(dummyFunDef) {
protected void defineFunctions() { defineReserved("NULL"); // first char: p=Property, m=Method, i=Infix, P=Prefix // 2nd: // ARRAY FUNCTIONS if (false) define(new FunDefBase( "SetToArray", "SetToArray(<Set>[, <Set>]...[, <Numeric Expression>])", "Converts one or more sets to an array for use in a user-if (false) defined function.", "fa*")); // // DIMENSION FUNCTIONS define(new FunDefBase( "Dimension", "<Hierarchy>.Dimension", "Returns the dimension that contains a specified hierarchy.", "pdh") { public Object evaluate(Evaluator evaluator, Exp[] args) { Hierarchy hierarchy = getHierarchyArg(evaluator, args, 0, true); return hierarchy.getDimension(); } }); //??Had to add this to get <Hierarchy>.Dimension to work? define(new FunDefBase( "Dimension", "<Dimension>.Dimension", "Returns the dimension that contains a specified hierarchy.", "pdd") { public Object evaluate(Evaluator evaluator, Exp[] args) { Dimension dimension = getDimensionArg(evaluator, args, 0, true); return dimension; } }); define(new FunDefBase( "Dimension", "<Level>.Dimension", "Returns the dimension that contains a specified level.", "pdl") { public Object evaluate(Evaluator evaluator, Exp[] args) { Level level = getLevelArg(evaluator, args, 0, true); return level.getDimension(); } }); define(new FunDefBase( "Dimension", "<Member>.Dimension", "Returns the dimension that contains a specified member.", "pdm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); return member.getDimension(); } }); define(new FunDefBase( "Dimensions", "Dimensions(<Numeric Expression>)", "Returns the dimension whose zero-based position within the cube is specified by a numeric expression.", "fdn") { public Type getResultType(Validator validator, Exp[] args) { return new mondrian.olap.type.DimensionType(null); } public Object evaluate(Evaluator evaluator, Exp[] args) { Cube cube = evaluator.getCube(); Dimension[] dimensions = cube.getDimensions(); int n = getIntArg(evaluator, args, 0); if ((n > dimensions.length) || (n < 1)) { throw newEvalException( this, "Index '" + n + "' out of bounds"); } return dimensions[n - 1]; } }); define(new FunDefBase( "Dimensions", "Dimensions(<String Expression>)", "Returns the dimension whose name is specified by a string.", "fdS") { public Type getResultType(Validator validator, Exp[] args) { return new mondrian.olap.type.DimensionType(null); } public Object evaluate(Evaluator evaluator, Exp[] args) { String defValue = "Default Value"; String s = getStringArg(evaluator, args, 0, defValue); if (s.indexOf("[") == -1) { s = Util.quoteMdxIdentifier(s); } OlapElement o = evaluator.getSchemaReader().lookupCompound( evaluator.getCube(), explode(s), false, Category.Dimension); if (o instanceof Dimension) { return (Dimension) o; } else if (o == null) { throw newEvalException(this, "Dimension '" + s + "' not found"); } else { throw newEvalException(this, "Dimensions(" + s + ") found " + o); } } }); // // HIERARCHY FUNCTIONS define(new FunDefBase( "Hierarchy", "<Level>.Hierarchy", "Returns a level's hierarchy.", "phl") { public Object evaluate(Evaluator evaluator, Exp[] args) { Level level = getLevelArg(evaluator, args, 0, true); return level.getHierarchy(); } }); define(new FunDefBase( "Hierarchy", "<Member>.Hierarchy", "Returns a member's hierarchy.", "phm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); return member.getHierarchy(); } }); // // LEVEL FUNCTIONS define(new FunDefBase( "Level", "<Member>.Level", "Returns a member's level.", "plm") { public Type getResultType(Validator validator, Exp[] args) { final Type argType = args[0].getTypeX(); return new mondrian.olap.type.LevelType(argType.getHierarchy(), argType.getLevel()); } public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); return member.getLevel(); } }); define(new FunDefBase( "Levels", "<Hierarchy>.Levels(<Numeric Expression>)", "Returns the level whose position in a hierarchy is specified by a numeric expression.", "mlhn") { public Type getResultType(Validator validator, Exp[] args) { final Type argType = args[0].getTypeX(); return new mondrian.olap.type.LevelType(argType.getHierarchy(), argType.getLevel()); } public Object evaluate(Evaluator evaluator, Exp[] args) { Hierarchy hierarchy = getHierarchyArg(evaluator, args, 0, true); Level[] levels = hierarchy.getLevels(); int n = getIntArg(evaluator, args, 1); if ((n >= levels.length) || (n < 0)) { throw newEvalException( this, "Index '" + n + "' out of bounds"); } return levels[n]; } }); define(new FunDefBase( "Levels", "Levels(<String Expression>)", "Returns the level whose name is specified by a string expression.", "flS") { public Type getResultType(Validator validator, Exp[] args) { final Type argType = args[0].getTypeX(); return new mondrian.olap.type.LevelType(argType.getHierarchy(), argType.getLevel()); } public Object evaluate(Evaluator evaluator, Exp[] args) { String s = getStringArg(evaluator, args, 0, null); Cube cube = evaluator.getCube(); OlapElement o = (s.startsWith("[")) ? evaluator.getSchemaReader().lookupCompound( cube, explode(s), false, Category.Level) : // lookupCompound barfs if "s" doesn't have matching // brackets, so don't even try null; if (o instanceof Level) { return (Level) o; } else if (o == null) { throw newEvalException(this, "Level '" + s + "' not found"); } else { throw newEvalException(this, "Levels('" + s + "') found " + o); } } }); // // LOGICAL FUNCTIONS define(new MultiResolver( "IsEmpty", "IsEmpty(<Value Expression>)", "Determines if an expression evaluates to the empty cell value.", new String[] {"fbS", "fbn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { Object o = getScalarArg(evaluator, args, 0); return Boolean.valueOf(o == Util.nullValue); } }; } }); // // MEMBER FUNCTIONS define(new MultiResolver( "Ancestor", "Ancestor(<Member>, {<Level>|<Numeric Expression>})", "Returns the ancestor of a member at a specified level.", new String[] {"fmml", "fmmn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, false); Object arg2 = getArg(evaluator, args, 1); Level level = null; int distance; if (arg2 instanceof Level) { level = (Level) arg2; distance = member.getLevel().getDepth() - level.getDepth(); } else { distance = ((Number)arg2).intValue(); } return ancestor(evaluator, member, distance, level); } }; } }); define(new FunDefBase( "Cousin", "Cousin(<member>, <ancestor member>)", "Returns the member with the same relative position under <ancestor member> as the member specified.", "fmmm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); Member ancestorMember = getMemberArg(evaluator, args, 1, true); Member cousin = cousin( evaluator.getSchemaReader(), member, ancestorMember); return cousin; } }); define(new FunDefBase( "CurrentMember", "<Dimension>.CurrentMember", "Returns the current member along a dimension during an iteration.", "pmd") { public Object evaluate(Evaluator evaluator, Exp[] args) { Dimension dimension = getDimensionArg(evaluator, args, 0, true); return evaluator.getContext(dimension); } }); define(new FunDefBase( "DataMember", "<Member>.DataMember", "Returns the system-generated data member that is associated with a nonleaf member of a dimension.", "pmm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); return member.getDataMember(); } }); define(new FunDefBase( "DefaultMember", "<Dimension>.DefaultMember", "Returns the default member of a dimension.", "pmd") { public Object evaluate(Evaluator evaluator, Exp[] args) { Dimension dimension = getDimensionArg(evaluator, args, 0, true); return evaluator.getSchemaReader().getHierarchyDefaultMember( dimension.getHierarchy()); } }); define(new FunDefBase( "FirstChild", "<Member>.FirstChild", "Returns the first child of a member.", "pmm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); Member[] children = evaluator.getSchemaReader().getMemberChildren(member); return (children.length == 0) ? member.getHierarchy().getNullMember() : children[0]; } }); define(new FunDefBase( "FirstSibling", "<Member>.FirstSibling", "Returns the first child of the parent of a member.", "pmm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); Member parent = member.getParentMember(); Member[] children; if (parent == null) { if (member.isNull()) { return member; } children = evaluator.getSchemaReader().getHierarchyRootMembers(member.getHierarchy()); } else { children = evaluator.getSchemaReader().getMemberChildren(parent); } return children[0]; } }); if (false) define(new FunDefBase( "Item", "<Tuple>.Item(<Numeric Expression>)", "Returns a member from a tuple.", "mm*")); define(new MultiResolver( "Lag", "<Member>.Lag(<Numeric Expression>)", "Returns a member further along the specified member's dimension.", new String[]{"mmmn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); int n = getIntArg(evaluator, args, 1); return evaluator.getSchemaReader().getLeadMember(member, -n); } }; } }); define(new FunDefBase( "LastChild", "<Member>.LastChild", "Returns the last child of a member.", "pmm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); Member[] children = evaluator.getSchemaReader().getMemberChildren(member); return (children.length == 0) ? member.getHierarchy().getNullMember() : children[children.length - 1]; } }); define(new FunDefBase( "LastSibling", "<Member>.LastSibling", "Returns the last child of the parent of a member.", "pmm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); Member parent = member.getParentMember(); Member[] children; final SchemaReader schemaReader = evaluator.getSchemaReader(); if (parent == null) { if (member.isNull()) { return member; } children = schemaReader.getHierarchyRootMembers( member.getHierarchy()); } else { children = schemaReader.getMemberChildren(parent); } return children[children.length - 1]; } }); define(new MultiResolver( "Lead", "<Member>.Lead(<Numeric Expression>)", "Returns a member further along the specified member's dimension.", new String[]{"mmmn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); int n = getIntArg(evaluator, args, 1); return evaluator.getSchemaReader().getLeadMember(member, n); } }; }}); define(new FunDefBase( "Members", "Members(<String Expression>)", "Returns the member whose name is specified by a string expression.", "fmS")); define(new FunDefBase( "NextMember", "<Member>.NextMember", "Returns the next member in the level that contains a specified member.", "pmm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); return evaluator.getSchemaReader().getLeadMember(member, +1); } }); define(new MultiResolver( "OpeningPeriod", "OpeningPeriod([<Level>[, <Member>]])", "Returns the first descendant of a member at a level.", new String[] {"fm", "fml", "fmlm"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { public Type getResultType(Validator validator, Exp[] args) { if (args.length == 0) { // With no args, the default implementation cannot // guess the hierarchy, so we supply the Time // dimension. Hierarchy hierarchy = validator.getQuery() .getCube().getTimeDimension() .getHierarchy(); return new MemberType(hierarchy, null, null); } return super.getResultType(validator, args); } public Object evaluate(Evaluator evaluator, Exp[] args) { return openingClosingPeriod(evaluator, args, true); } }; } }); define(new MultiResolver( "ClosingPeriod", "ClosingPeriod([<Level>[, <Member>]])", "Returns the last descendant of a member at a level.", new String[] {"fm", "fml", "fmlm", "fmm"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { public Type getResultType(Validator validator, Exp[] args) { if (args.length == 0) { // With no args, the default implementation cannot // guess the hierarchy, so we supply the Time // dimension. Hierarchy hierarchy = validator.getQuery() .getCube().getTimeDimension() .getHierarchy(); return new MemberType(hierarchy, null, null); } return super.getResultType(validator, args); } public Object evaluate(Evaluator evaluator, Exp[] args) { return openingClosingPeriod(evaluator, args, false); } }; } }); define(new MultiResolver( "ParallelPeriod", "ParallelPeriod([<Level>[, <Numeric Expression>[, <Member>]]])", "Returns a member from a prior period in the same relative position as a specified member.", new String[] {"fm", "fml", "fmln", "fmlnm"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { public Type getResultType(Validator validator, Exp[] args) { if (args.length == 0) { // With no args, the default implementation cannot // guess the hierarchy, so we supply the Time // dimension. Hierarchy hierarchy = validator.getQuery() .getCube().getTimeDimension() .getHierarchy(); return new MemberType(hierarchy, null, null); } return super.getResultType(validator, args); } public Object evaluate(Evaluator evaluator, Exp[] args) { // Member defaults to [Time].currentmember Member member = (args.length == 3) ? getMemberArg(evaluator, args, 2, true) : evaluator.getContext( evaluator.getCube().getTimeDimension()); // Numeric Expression defaults to 1. int lagValue = (args.length >= 2) ? getIntArg(evaluator, args, 1) : 1; Level ancestorLevel; if (args.length >= 1) { ancestorLevel = getLevelArg(evaluator, args, 0, true); } else { Member parent = member.getParentMember(); if (parent == null || parent.getCategory() != Category.Member) { // // The parent isn't a member (it's probably a hierarchy), // so there is no parallelperiod. // return member.getHierarchy().getNullMember(); } ancestorLevel = parent.getLevel(); } // // Now do some error checking. // The ancestorLevel and the member must be from the // same hierarchy. // if (member.getHierarchy() != ancestorLevel.getHierarchy()) { MondrianResource.instance().newFunctionMbrAndLevelHierarchyMismatch( "ParallelPeriod", ancestorLevel.getHierarchy().getUniqueName(), member.getHierarchy().getUniqueName() ); } int distance = member.getLevel().getDepth() - ancestorLevel.getDepth(); Member ancestor = ancestor(evaluator, member, distance, ancestorLevel); Member inLaw = evaluator.getSchemaReader().getLeadMember(ancestor, -lagValue); return cousin(evaluator.getSchemaReader(), member, inLaw); } }; } }); define(new FunDefBase( "Parent", "<Member>.Parent", "Returns the parent of a member.", "pmm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); Member parent = evaluator.getSchemaReader().getMemberParent(member); if (parent == null) { parent = member.getHierarchy().getNullMember(); } return parent; } }); define(new FunDefBase( "PrevMember", "<Member>.PrevMember", "Returns the previous member in the level that contains a specified member.", "pmm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); return evaluator.getSchemaReader().getLeadMember(member, -1); } }); define(new FunDefBase( "StrToMember", "StrToMember(<String Expression>)", "Returns a member from a unique name String in MDX format.", "fmS") { public Object evaluate(Evaluator evaluator, Exp[] args) { String mname = getStringArg(evaluator, args, 0, null); Cube cube = evaluator.getCube(); SchemaReader schemaReader = evaluator.getSchemaReader(); String[] uniqueNameParts = Util.explode(mname); Member member = (Member) schemaReader.lookupCompound(cube, uniqueNameParts, true, Category.Member); // Member member = schemaReader.getMemberByUniqueName(uniqueNameParts, false); return member; } }); if (false) define(new FunDefBase( "ValidMeasure", "ValidMeasure(<Tuple>)", "Returns a valid measure in a virtual cube by forcing inapplicable dimensions to their top level.", "fm*")); // // NUMERIC FUNCTIONS define(new MultiResolver( "Aggregate", "Aggregate(<Set>[, <Numeric Expression>])", "Returns a calculated value using the appropriate aggregate function, based on the context of the query.", new String[] {"fnx", "fnxn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { final Exp valueFunCall = createValueFunCall(); public Object evaluate(Evaluator evaluator, Exp[] args) { // compute members only if the context has changed List members = (List) evaluator.getCachedResult(args[0]); if (members == null) { members = (List) getArg(evaluator, args, 0); evaluator.setCachedResult(args[0], members); } ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); Aggregator aggregator = (Aggregator) evaluator.getProperty( Property.AGGREGATION_TYPE.name, null); if (aggregator == null) { throw newEvalException(null, "Could not find an aggregator in the current evaluation context"); } Aggregator rollup = aggregator.getRollup(); if (rollup == null) { throw newEvalException(null, "Don't know how to rollup aggregator '" + aggregator + "'"); } return rollup.aggregate(evaluator.push(), members, exp); } }; } }); define(new MultiResolver( "$AggregateChildren", "$AggregateChildren(<Hierarchy>)", "Equivalent to 'Aggregate(<Hierarchy>.CurrentMember.Children); for internal use.", new String[] {"Inh"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { final Exp valueFunCall = createValueFunCall(); public Object evaluate(Evaluator evaluator, Exp[] args) { Hierarchy hierarchy = getHierarchyArg(evaluator, args, 0, true); Member member = evaluator.getParent().getContext(hierarchy.getDimension()); List members = (List) member.getPropertyValue( Property.CONTRIBUTING_CHILDREN.name); Aggregator aggregator = (Aggregator) evaluator.getProperty( Property.AGGREGATION_TYPE.name, null); if (aggregator == null) { throw newEvalException(null, "Could not find an aggregator in the current evaluation context"); } Aggregator rollup = aggregator.getRollup(); if (rollup == null) { throw newEvalException(null, "Don't know how to rollup aggregator '" + aggregator + "'"); } return rollup.aggregate(evaluator.push(), members, valueFunCall); } }; } }); define(new MultiResolver( "Avg", "Avg(<Set>[, <Numeric Expression>])", "Returns the average value of a numeric expression evaluated over a set.", new String[]{"fnx", "fnxn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { final Exp valueFunCall = createValueFunCall(); public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); return avg(evaluator.push(), members, exp); } }; } }); define(new MultiResolver( "Correlation", "Correlation(<Set>, <Numeric Expression>[, <Numeric Expression>])", "Returns the correlation of two series evaluated over a set.", new String[]{"fnxn","fnxnn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { final Exp valueFunCall = createValueFunCall(); public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp1 = (ExpBase) getArgNoEval(args, 1); ExpBase exp2 = (ExpBase) getArgNoEval(args, 2, valueFunCall); return correlation(evaluator.push(), members, exp1, exp2); } }; } }); final String[] resWords = {"INCLUDEEMPTY", "EXCLUDEEMPTY"}; define(new MultiResolver( "Count", "Count(<Set>[, EXCLUDEEMPTY | INCLUDEEMPTY])", "Returns the number of tuples in a set, empty cells included unless the optional EXCLUDEEMPTY flag is used.", new String[]{"fnx", "fnxy"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); String empties = getLiteralArg(args, 1, "INCLUDEEMPTY", resWords, null); final boolean includeEmpty = empties.equals("INCLUDEEMPTY"); return count(evaluator, members, includeEmpty); } }; } public String[] getReservedWords() { return resWords; } }); define(new FunDefBase( "Count", "<Set>.Count", "Returns the number of tuples in a set including empty cells.", "pnx") { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); return count(evaluator, members, true); } }); define(new MultiResolver( "Covariance", "Covariance(<Set>, <Numeric Expression>[, <Numeric Expression>])", "Returns the covariance of two series evaluated over a set (biased).", new String[]{"fnxn","fnxnn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp1 = (ExpBase) getArgNoEval(args, 1); ExpBase exp2 = (ExpBase) getArgNoEval(args, 2); return covariance(evaluator.push(), members, exp1, exp2, true); } }; } }); define(new MultiResolver( "CovarianceN", "CovarianceN(<Set>, <Numeric Expression>[, <Numeric Expression>])", "Returns the covariance of two series evaluated over a set (unbiased).", new String[]{"fnxn","fnxnn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { final Exp valueFunCall = createValueFunCall(); public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp1 = (ExpBase) getArgNoEval(args, 1); ExpBase exp2 = (ExpBase) getArgNoEval(args, 2, valueFunCall); return covariance(evaluator.push(), members, exp1, exp2, false); } }; } }); define(new FunDefBase( "IIf", "IIf(<Logical Expression>, <Numeric Expression1>, <Numeric Expression2>)", "Returns one of two numeric values determined by a logical test.", "fnbnn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Boolean b = getBooleanArg(evaluator, args, 0); if (b == null) { // The result of the logical expression is not known, // probably because some necessary value is not in the // cache yet. Evaluate both expressions so that the cache // gets populated as soon as possible. getDoubleArg(evaluator, args, 1, null); getDoubleArg(evaluator, args, 2, null); return new Double(Double.NaN); } Object o = (b.booleanValue()) ? getDoubleArg(evaluator, args, 1, null) : getDoubleArg(evaluator, args, 2, null); return o; } }); define(new FunkResolver( "LinRegIntercept", "LinRegIntercept(<Set>, <Numeric Expression>[, <Numeric Expression>])", "Calculates the linear regression of a set and returns the value of b in the regression line y = ax + b.", new String[]{"fnxn","fnxnn"}, new LinReg.Intercept())); define(new FunkResolver( "LinRegPoint", "LinRegPoint(<Numeric Expression>, <Set>, <Numeric Expression>[, <Numeric Expression>])", "Calculates the linear regression of a set and returns the value of y in the regression line y = ax + b.", new String[]{"fnnxn","fnnxnn"}, new LinReg.Point())); define(new FunkResolver( "LinRegR2", "LinRegR2(<Set>, <Numeric Expression>[, <Numeric Expression>])", "Calculates the linear regression of a set and returns R2 (the coefficient of determination).", new String[]{"fnxn","fnxnn"}, new LinReg.R2())); define(new FunkResolver( "LinRegSlope", "LinRegSlope(<Set>, <Numeric Expression>[, <Numeric Expression>])", "Calculates the linear regression of a set and returns the value of a in the regression line y = ax + b.", new String[]{"fnxn","fnxnn"}, new LinReg.Slope())); define(new FunkResolver( "LinRegVariance", "LinRegVariance(<Set>, <Numeric Expression>[, <Numeric Expression>])", "Calculates the linear regression of a set and returns the variance associated with the regression line y = ax + b.", new String[]{"fnxn","fnxnn"}, new LinReg.Variance())); define(new MultiResolver( "Max", "Max(<Set>[, <Numeric Expression>])", "Returns the maximum value of a numeric expression evaluated over a set.", new String[]{"fnx", "fnxn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { final Exp valueFunCall = createValueFunCall(); public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); return max(evaluator.push(), members, exp); } }; } }); define(new MultiResolver( "Median", "Median(<Set>[, <Numeric Expression>])", "Returns the median value of a numeric expression evaluated over a set.", new String[]{"fnx", "fnxn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { final Exp valueFunCall = createValueFunCall(); public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); //todo: ignore nulls, do we need to ignore the List? return median(evaluator.push(), members, exp); } }; } }); define(new MultiResolver( "Min", "Min(<Set>[, <Numeric Expression>])", "Returns the minimum value of a numeric expression evaluated over a set.", new String[]{"fnx", "fnxn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { final Exp valueFunCall = createValueFunCall(); public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); return min(evaluator.push(), members, exp); } }; } }); define(new FunDefBase( "Ordinal", "<Level>.Ordinal", "Returns the zero-based ordinal value associated with a level.", "pnl") { public Object evaluate(Evaluator evaluator, Exp[] args) { Level level = getLevelArg(evaluator, args, 0, false); return new Double(level.getDepth()); } }); define(new FunkResolver( "Rank", "Rank(<Tuple>, <Set> [, <Calc Expression>])", "Returns the one-based rank of a tuple in a set.", new String[]{"fitx","fitxn", "fimx", "fimxn"}, new RankFunDef())); define(new MultiResolver( "Stddev", "Stddev(<Set>[, <Numeric Expression>])", "Alias for Stdev.", new String[]{"fnx", "fnxn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { final Exp valueFunCall = createValueFunCall(); public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); return stdev(evaluator.push(), members, exp, false); } }; } }); define(new MultiResolver( "Stdev", "Stdev(<Set>[, <Numeric Expression>])", "Returns the standard deviation of a numeric expression evaluated over a set (unbiased).", new String[]{"fnx", "fnxn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { final Exp valueFunCall = createValueFunCall(); public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); return stdev(evaluator.push(), members, exp, false); } }; } }); define(new MultiResolver( "StddevP", "StddevP(<Set>[, <Numeric Expression>])", "Alias for StdevP.", new String[]{"fnx", "fnxn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { final Exp valueFunCall = createValueFunCall(); public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); return stdev(evaluator.push(), members, exp, true); } }; } }); define(new MultiResolver( "StdevP", "StdevP(<Set>[, <Numeric Expression>])", "Returns the standard deviation of a numeric expression evaluated over a set (biased).", new String[]{"fnx", "fnxn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { final Exp valueFunCall = createValueFunCall(); public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); return stdev(evaluator.push(), members, exp, true); } }; } }); define(new MultiResolver( "Sum", "Sum(<Set>[, <Numeric Expression>])", "Returns the sum of a numeric expression evaluated over a set.", new String[]{"fnx", "fnxn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { final Exp valueFunCall = createValueFunCall(); public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); return sum(evaluator.push(), members, exp); } }; } }); define(new FunDefBase( "Value", "<Measure>.Value", "Returns the value of a measure.", "pnm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); return member.evaluateScalar(evaluator); } }); define(new FunDefBase( "_Value", "_Value(<Tuple>)", "Returns the value of the current measure within the context of a tuple.", "fnt") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member[] members = getTupleArg(evaluator, args, 0); Evaluator evaluator2 = evaluator.push(members); return evaluator2.evaluateCurrent(); } }); define(new FunDefBase( "_Value", "_Value()", "Returns the value of the current measure.", "fn") { public Object evaluate(Evaluator evaluator, Exp[] args) { return evaluator.evaluateCurrent(); } }); // _Value is a pseudo-function which evaluates a tuple to a number. // It needs a custom resolver. if (false) define(new ResolverBase( "_Value", null, null, Syntax.Parentheses) { public FunDef resolve(Exp[] args, int[] conversionCount) { if (args.length == 1 && args[0].getCategory() == Category.Tuple) { return new ValueFunDef(new int[] {Category.Tuple}); } for (int i = 0; i < args.length; i++) { Exp arg = args[i]; if (!canConvert(arg, Category.Member, conversionCount)) { return null; } } int[] argTypes = new int[args.length]; for (int i = 0; i < argTypes.length; i++) { argTypes[i] = Category.Member; } return new ValueFunDef(argTypes); } }); define(new MultiResolver( "Var", "Var(<Set>[, <Numeric Expression>])", "Returns the variance of a numeric expression evaluated over a set (unbiased).", new String[]{"fnx", "fnxn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { final Exp valueFunCall = createValueFunCall(); public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); return var(evaluator.push(), members, exp, false); } }; } }); define(new MultiResolver( "Variance", "Variance(<Set>[, <Numeric Expression>])", "Alias for Var.", new String[]{"fnx", "fnxn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { final Exp valueFunCall = createValueFunCall(); public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); return var(evaluator.push(), members, exp, false); } }; } }); define(new MultiResolver( "VarianceP", "VarianceP(<Set>[, <Numeric Expression>])", "Alias for VarP.", new String[]{"fnx", "fnxn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { final Exp valueFunCall = createValueFunCall(); public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); return var(evaluator.push(), members, exp, true); } }; } }); define(new MultiResolver( "VarP", "VarP(<Set>[, <Numeric Expression>])", "Returns the variance of a numeric expression evaluated over a set (biased).", new String[]{"fnx", "fnxn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { final Exp valueFunCall = createValueFunCall(); public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); return var(evaluator.push(), members, exp, true); } }; } }); // // SET FUNCTIONS if (false) define(new FunDefBase( "AddCalculatedMembers", "AddCalculatedMembers(<Set>)", "Adds calculated members to a set.", "fx*")); define(new FunDefBase( "Ascendants", "Ascendants(<Member>)", "Returns the set of the ascendants of a specified member.", "fxm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, false); if (member.isNull()) { return new ArrayList(); } Member[] members = member.getAncestorMembers(); final List result = new ArrayList(members.length + 1); result.add(member); addAll(result, members); return result; } }); define(new MultiResolver( "BottomCount", "BottomCount(<Set>, <Count>[, <Numeric Expression>])", "Returns a specified number of items from the bottom of a set, optionally ordering the set first.", new String[]{"fxxnn", "fxxn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { List list = (List) getArg(evaluator, args, 0); int n = getIntArg(evaluator, args, 1); ExpBase exp = (ExpBase) getArgNoEval(args, 2, null); if (exp != null) { boolean desc = false, brk = true; sort(evaluator, list, exp, desc, brk); } if (n < list.size()) { list = list.subList(0, n); } return list; } }; } }); define(new MultiResolver( "BottomPercent", "BottomPercent(<Set>, <Percentage>, <Numeric Expression>)", "Sorts a set and returns the bottom N elements whose cumulative total is at least a specified percentage.", new String[]{"fxxnn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 2); Double n = getDoubleArg(evaluator, args, 1); return topOrBottom(evaluator.push(), members, exp, false, true, n.doubleValue()); } }; } }); define(new MultiResolver( "BottomSum", "BottomSum(<Set>, <Value>, <Numeric Expression>)", "Sorts a set and returns the bottom N elements whose cumulative total is at least a specified value.", new String[]{"fxxnn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 2); Double n = getDoubleArg(evaluator, args, 1); return topOrBottom(evaluator.push(), members, exp, false, false, n.doubleValue()); } }; } }); define(new FunDefBase( "Children", "<Member>.Children", "Returns the children of a member.", "pxm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); Member[] children = evaluator.getSchemaReader().getMemberChildren(member); return Arrays.asList(children); } }); define(new MultiResolver( "Crossjoin", "Crossjoin(<Set1>, <Set2>)", "Returns the cross product of two sets.", new String[]{"fxxx"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new CrossJoinFunDef(dummyFunDef); } }); define(new MultiResolver( "NonEmptyCrossJoin", "NonEmptyCrossJoin(<Set1>, <Set2>)", "Returns the cross product of two sets, excluding empty tuples and tuples without associated fact table data.", new String[]{"fxxx"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new NonEmptyCrossJoinFunDef(dummyFunDef); } }); define(new MultiResolver( "*", "<Set1> * <Set2>", "Returns the cross product of two sets.", new String[]{"ixxx", "ixmx", "ixxm", "ixmm"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new CrossJoinFunDef(dummyFunDef); } }); define(new DescendantsFunDef.Resolver()); define(new FunDefBase( "Distinct", "Distinct(<Set>)", "Eliminates duplicate tuples from a set.", "fxx") { public Object evaluate(Evaluator evaluator, Exp[] args) { List list = (List) getArg(evaluator, args, 0); HashSet hashSet = new HashSet(list.size()); Iterator iter = list.iterator(); List result = new ArrayList(); while (iter.hasNext()) { Object element = iter.next(); MemberHelper lookupObj = new MemberHelper(element); if (hashSet.add(lookupObj)) { result.add(element); } } return result; } }); define(new MultiResolver( "DrilldownLevel", "DrilldownLevel(<Set>[, <Level>]) or DrilldownLevel(<Set>, , <Index>)", "Drills down the members of a set, at a specified level, to one level below. Alternatively, drills down on a specified dimension in the set.", new String[]{"fxx", "fxxl"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { //todo add fssl functionality List set0 = (List) getArg(evaluator, args, 0); if (set0.size() == 0) { return set0; } int searchDepth = -1; Level level = getLevelArg(evaluator, args, 1, false); if (level != null) { searchDepth = level.getDepth(); } if (searchDepth == -1) { searchDepth = ((Member)set0.get(0)).getLevel().getDepth(); for (int i = 1, m = set0.size(); i < m; i++) { Member member = (Member) set0.get(i); int memberDepth = member.getLevel().getDepth(); if (memberDepth > searchDepth) { searchDepth = memberDepth; } } } List drilledSet = new ArrayList(); for (int i = 0, m = set0.size(); i < m; i++) { Member member = (Member) set0.get(i); drilledSet.add(member); Member nextMember = i == m - 1 ? null : (Member) set0.get(i + 1); // // This member is drilled if it's at the correct depth // and if it isn't drilled yet. A member is considered // to be "drilled" if it is immediately followed by // at least one descendant // if (member.getLevel().getDepth() == searchDepth && !isAncestorOf(member, nextMember, true)) { Member[] childMembers = evaluator.getSchemaReader().getMemberChildren(member); for (int j = 0; j < childMembers.length; j++) { drilledSet.add(childMembers[j]); } } } return drilledSet; } }; } }); if (false) define(new FunDefBase( "DrilldownLevelBottom", "DrilldownLevelBottom(<Set>, <Count>[, [<Level>][, <Numeric Expression>]])", "Drills down the bottom N members of a set, at a specified level, to one level below.", "fx*")); if (false) define(new FunDefBase( "DrilldownLevelTop", "DrilldownLevelTop(<Set>, <Count>[, [<Level>][, <Numeric Expression>]])", "Drills down the top N members of a set, at a specified level, to one level below.", "fx*")); define(new DrilldownMemberFunDef.Resolver()); if (false) define(new FunDefBase( "DrilldownMemberBottom", "DrilldownMemberBottom(<Set1>, <Set2>, <Count>[, [<Numeric Expression>][, RECURSIVE]])", "Like DrilldownMember except that it includes only the bottom N children.", "fx*")); if (false) define(new FunDefBase( "DrilldownMemberTop", "DrilldownMemberTop(<Set1>, <Set2>, <Count>[, [<Numeric Expression>][, RECURSIVE]])", "Like DrilldownMember except that it includes only the top N children.", "fx*")); if (false) define(new FunDefBase( "DrillupLevel", "DrillupLevel(<Set>[, <Level>])", "Drills up the members of a set that are below a specified level.", "fx*")); if (false) define(new FunDefBase( "DrillupMember", "DrillupMember(<Set1>, <Set2>)", "Drills up the members in a set that are present in a second specified set.", "fx*")); define(new MultiResolver( "Except", "Except(<Set1>, <Set2>[, ALL])", "Finds the difference between two sets, optionally retaining duplicates.", new String[]{"fxxx", "fxxxy"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { // todo: implement ALL HashSet set = new HashSet(); set.addAll((List) getArg(evaluator, args, 1)); List set1 = (List) getArg(evaluator, args, 0); List result = new ArrayList(); for (int i = 0, count = set1.size(); i < count; i++) { Object o = set1.get(i); if (!set.contains(o)) { result.add(o); } } return result; } }; } }); if (false) define(new FunDefBase( "Extract", "Extract(<Set>, <Dimension>[, <Dimension>...])", "Returns a set of tuples from extracted dimension elements. The opposite of Crossjoin.", "fx*")); define(new FunDefBase( "Filter", "Filter(<Set>, <Search Condition>)", "Returns the set resulting from filtering a set based on a search condition.", "fxxb") { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); Exp exp = args[1]; List result = new ArrayList(); Evaluator evaluator2 = evaluator.push(); for (int i = 0, count = members.size(); i < count; i++) { Object o = members.get(i); if (o instanceof Member) { evaluator2.setContext((Member) o); } else if (o instanceof Member[]) { evaluator2.setContext((Member[]) o); } else { throw Util.newInternal( "unexpected type in set: " + o.getClass()); } Boolean b = (Boolean) exp.evaluateScalar(evaluator2); if (b != null && b.booleanValue()) { result.add(o); } } return result; } public boolean dependsOn(Exp[] args, Dimension dimension) { return dependsOnIntersection(args, dimension); } }); define(new MultiResolver( "Generate", "Generate(<Set1>, <Set2>[, ALL])", "Applies a set to each member of another set and joins the resulting sets by union.", new String[] {"fxxx", "fxxxy"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { final boolean all = getLiteralArg(args, 2, "", new String[] {"ALL"}, dummyFunDef).equalsIgnoreCase("ALL"); return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); List result = new ArrayList(); HashSet emitted = all ? null : new HashSet(); for (int i = 0; i < members.size(); i++) { Object o = members.get(i); if (o instanceof Member) { evaluator.setContext((Member) o); } else { evaluator.setContext((Member[]) o); } final List result2 = (List) args[1].evaluate(evaluator); if (all) { result.addAll(result2); } else { for (int j = 0; j < result2.size(); j++) { Object row = result2.get(j); if (emitted.add(row)) { result.add(row); } } } } return result; } }; } }); define(new MultiResolver( "Head", "Head(<Set>[, < Numeric Expression >])", "Returns the first specified number of elements in a set.", new String[] {"fxx", "fxxn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); final int count = args.length < 2 ? 1 : getIntArg(evaluator, args, 1); if (count >= members.size()) { return members; } if (count <= 0) { return new ArrayList(); } return members.subList(0, count); } }; } }); final String[] prePost = {"PRE","POST"}; define(new MultiResolver( "Hierarchize", "Hierarchize(<Set>[, POST])", "Orders the members of a set in a hierarchy.", new String[] {"fxx", "fxxy"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { String order = getLiteralArg(args, 1, "PRE", prePost, dummyFunDef); final boolean post = order.equals("POST"); return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); hierarchize(members, post); return members; } }; } public String[] getReservedWords() { return prePost; } }); define(new MultiResolver( "Intersect", "Intersect(<Set1>, <Set2>[, ALL])", "Returns the intersection of two input sets, optionally retaining duplicates.", new String[] {"fxxxy", "fxxx"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { final boolean all = getLiteralArg(args, 2, "", new String[] {"ALL"}, dummyFunDef).equalsIgnoreCase("ALL"); return new IntersectFunDef(dummyFunDef, all); } }); if (false) define(new FunDefBase( "LastPeriods", "LastPeriods(<Index>[, <Member>])", "Returns a set of members prior to and including a specified member.", "fx*")); define(new FunDefBase( "Members", "<Dimension>.Members", "Returns the set of all members in a dimension.", "pxd") { public Object evaluate(Evaluator evaluator, Exp[] args) { Dimension dimension = (Dimension) getArg(evaluator, args, 0); Hierarchy hierarchy = dimension.getHierarchy(); return addMembers(evaluator.getSchemaReader(), new ArrayList(), hierarchy); } }); /* * Clone of <Dimension>.Members for compatibility with MSAS */ define(new FunDefBase( "AllMembers", "<Dimension>.AllMembers", "Returns the set of all members in a dimension.", "pxd") { public Object evaluate(Evaluator evaluator, Exp[] args) { Dimension dimension = (Dimension) getArg(evaluator, args, 0); Hierarchy hierarchy = dimension.getHierarchy(); return addMembers(evaluator.getSchemaReader(), new ArrayList(), hierarchy); } }); define(new FunDefBase( "Members", "<Hierarchy>.Members", "Returns the set of all members in a hierarchy.", "pxh") { public Object evaluate(Evaluator evaluator, Exp[] args) { Hierarchy hierarchy = (Hierarchy) getArg(evaluator, args, 0); return addMembers(evaluator.getSchemaReader(), new ArrayList(), hierarchy); } }); /* * Clone of <Hierarchy>.Members for compatibility with MSAS */ define(new FunDefBase( "AllMembers", "<Hierarchy>.AllMembers", "Returns the set of all members in a hierarchy.", "pxh") { public Object evaluate(Evaluator evaluator, Exp[] args) { Hierarchy hierarchy = (Hierarchy) getArg(evaluator, args, 0); return addMembers(evaluator.getSchemaReader(), new ArrayList(), hierarchy); } }); define(new FunDefBase( "Members", "<Level>.Members", "Returns the set of all members in a level.", "pxl") { public Object evaluate(Evaluator evaluator, Exp[] args) { Level level = (Level) getArg(evaluator, args, 0); return Arrays.asList(evaluator.getSchemaReader().getLevelMembers(level)); } }); /* * Clone of <Level>.Members for compatibility with MSAS */ define(new FunDefBase( "AllMembers", "<Level>.AllMembers", "Returns the set of all members in a level.", "pxl") { public Object evaluate(Evaluator evaluator, Exp[] args) { Level level = (Level) getArg(evaluator, args, 0); return Arrays.asList(evaluator.getSchemaReader().getLevelMembers(level)); } }); define(new XtdFunDef.Resolver( "Mtd", "Mtd([<Member>])", "A shortcut function for the PeriodsToDate function that specifies the level to be Month.", new String[]{"fx", "fxm"}, LevelType.TimeMonths)); define(new OrderFunDef.OrderResolver()); define(new MultiResolver( "PeriodsToDate", "PeriodsToDate([<Level>[, <Member>]])", "Returns a set of periods (members) from a specified level starting with the first period and ending with a specified member.", new String[]{"fx", "fxl", "fxlm"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { public Type getResultType(Validator validator, Exp[] args) { if (args.length == 0) { // With no args, the default implementation cannot // guess the hierarchy. Hierarchy hierarchy = validator.getQuery() .getCube().getTimeDimension() .getHierarchy(); return new SetType( new MemberType(hierarchy, null, null)); } final Type type = args[0].getTypeX(); if (type.getHierarchy().getDimension() .getDimensionType() != DimensionType.TimeDimension) { throw MondrianResource.instance() .newTimeArgNeeded(getName()); } return super.getResultType(validator, args); } public Object evaluate(Evaluator evaluator, Exp[] args) { Level level; Member member; if (args.length == 0) { member = evaluator.getContext( evaluator.getCube().getTimeDimension()); level = member.getLevel().getParentLevel(); } else { level = getLevelArg(evaluator, args, 0, false); member = getMemberArg(evaluator, args, 1, false); } return periodsToDate(evaluator, level, member); } }; } }); define(new XtdFunDef.Resolver( "Qtd", "Qtd([<Member>])", "A shortcut function for the PeriodsToDate function that specifies the level to be Quarter.", new String[]{"fx", "fxm"}, LevelType.TimeQuarters)); if (false) define(new FunDefBase( "StripCalculatedMembers", "StripCalculatedMembers(<Set>)", "Removes calculated members from a set.", "fx*")); // "Siblings" is not a standard MDX function. define(new FunDefBase( "Siblings", "<Member>.Siblings", "Returns the set of siblings of the specified member.", "pxm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); Member parent = member.getParentMember(); final SchemaReader schemaReader = evaluator.getSchemaReader(); Member[] siblings = (parent == null) ? schemaReader.getHierarchyRootMembers(member.getHierarchy()) : schemaReader.getMemberChildren(parent); return Arrays.asList(siblings); } }); define(new FunDefBase( "StrToSet", "StrToSet(<String Expression>)", "Constructs a set from a string expression.", "fxS") { public Exp validateCall(Validator validator, FunCall call) { final Exp[] args = call.getArgs(); final int argCount = args.length; if (argCount <= 1) { throw Util.getRes().newMdxFuncArgumentsNum(getName()); } for (int i = 1; i < argCount; i++) { final Exp arg = args[i]; if (arg instanceof Dimension) { // if arg is a dimension, switch to dimension's default // hierarchy args[i] = ((Dimension) arg).getHierarchy(); } else if (arg instanceof Hierarchy) { // nothing } else { throw Util.getRes().newMdxFuncNotHier( new Integer(i + 1), getName()); } } return super.validateCall(validator, call); } public Type getResultType(Validator validator, Exp[] args) { if (args.length == 1) { // This is a call to the standard version of StrToSet, // which doesn't give us any hints about type. return new SetType(null); } else { // This is a call to Mondrian's extended version of // StrToSet, of the form // StrToSet(s, <Hier1>, ... , <HierN>) // // The result is a set of tuples // (<Hier1>, ... , <HierN>) final ArrayList list = new ArrayList(); for (int i = 1; i < args.length; i++) { Exp arg = args[i]; final Type type = arg.getTypeX(); list.add(type); } final Type[] types = (Type[]) list.toArray(new Type[list.size()]); return new SetType(new TupleType(types)); } } }); define(new MultiResolver( "Subset", "Subset(<Set>, <Start>[, <Count>])", "Returns a subset of elements from a set.", new String[] {"fxxn", "fxxnn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); final int start = getIntArg(evaluator, args, 1); final int end; if (args.length < 3) { end = members.size(); } else { final int count = getIntArg(evaluator, args, 2); end = start + count; } if (start >= end || start < 0) { return new ArrayList(); } if (start == 0 && end >= members.size()) { return members; } return members.subList(start, end); } }; } }); define(new MultiResolver( "Tail", "Tail(<Set>[, <Count>])", "Returns a subset from the end of a set.", new String[] {"fxx", "fxxn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); final int count = args.length < 2 ? 1 : getIntArg(evaluator, args, 1); if (count >= members.size()) { return members; } if (count <= 0) { return new ArrayList(); } return members.subList(members.size() - count, members.size()); } }; } }); define(new MultiResolver( "ToggleDrillState", "ToggleDrillState(<Set1>, <Set2>[, RECURSIVE])", "Toggles the drill state of members. This function is a combination of DrillupMember and DrilldownMember.", new String[]{"fxxx", "fxxxy"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { List v0 = (List) getArg(evaluator, args, 0), v1 = (List) getArg(evaluator, args, 1); if (args.length > 2) { throw MondrianResource.instance().newToggleDrillStateRecursiveNotSupported(); } if (v1.isEmpty()) { return v0; } if (v0.isEmpty()) { return v0; } HashSet set = new HashSet(); set.addAll(v1); HashSet set1 = set; List result = new ArrayList(); int i = 0, n = v0.size(); while (i < n) { Object o = v0.get(i++); result.add(o); Member m = null; int k = -1; if (o instanceof Member) { if (!set1.contains(o)) { continue; } m = (Member) o; k = -1; } else { Util.assertTrue(o instanceof Member[]); Member[] members = (Member[]) o; for (int j = 0; j < members.length; j++) { Member member = members[j]; if (set1.contains(member)) { k = j; m = member; break; } } if (k == -1) { continue; } } boolean isDrilledDown = false; if (i < n) { Object next = v0.get(i); Member nextMember = (k < 0) ? (Member) next : ((Member[]) next)[k]; boolean strict = true; if (isAncestorOf(m, nextMember, strict)) { isDrilledDown = true; } } if (isDrilledDown) { // skip descendants of this member do { Object next = v0.get(i); Member nextMember = (k < 0) ? (Member) next : ((Member[]) next)[k]; boolean strict = true; if (isAncestorOf(m, nextMember, strict)) { i++; } else { break; } } while (i < n); } else { Member[] children = evaluator.getSchemaReader().getMemberChildren(m); for (int j = 0; j < children.length; j++) { if (k < 0) { result.add(children[j]); } else { Member[] members = (Member[]) ((Member[]) o).clone(); members[k] = children[j]; result.add(members); } } } } return result; } }; } public String[] getReservedWords() { return new String[] {"RECURSIVE"}; } }); define(new MultiResolver( "TopCount", "TopCount(<Set>, <Count>[, <Numeric Expression>])", "Returns a specified number of items from the top of a set, optionally ordering the set first.", new String[]{"fxxnn", "fxxn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { List list = (List) getArg(evaluator, args, 0); int n = getIntArg(evaluator, args, 1); ExpBase exp = (ExpBase) getArgNoEval(args, 2, null); if (exp != null) { boolean desc = true, brk = true; sort(evaluator, list, exp, desc, brk); } if (n < list.size()) { list = list.subList(0, n); } return list; } }; } }); define(new MultiResolver( "TopPercent", "TopPercent(<Set>, <Percentage>, <Numeric Expression>)", "Sorts a set and returns the top N elements whose cumulative total is at least a specified percentage.", new String[]{"fxxnn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 2); Double n = getDoubleArg(evaluator, args, 1); return topOrBottom(evaluator.push(), members, exp, true, true, n.doubleValue()); } }; } }); define(new MultiResolver( "TopSum", "TopSum(<Set>, <Value>, <Numeric Expression>)", "Sorts a set and returns the top N elements whose cumulative total is at least a specified value.", new String[]{"fxxnn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 2); Double n = getDoubleArg(evaluator, args, 1); return topOrBottom(evaluator.push(), members, exp, true, false, n.doubleValue()); } }; } }); final String[] allDistinct = new String[] {"ALL", "DISTINCT"}; define(new MultiResolver( "Union", "Union(<Set1>, <Set2>[, ALL])", "Returns the union of two sets, optionally retaining duplicates.", new String[] {"fxxx", "fxxxy"}) { public String[] getReservedWords() { return allDistinct; } protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { String allString = getLiteralArg(args, 2, "DISTINCT", allDistinct, dummyFunDef); final boolean all = allString.equalsIgnoreCase("ALL"); checkCompatible(args[0], args[1], dummyFunDef); return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { List left = (List) getArg(evaluator, args, 0); List right = (List) getArg(evaluator, args, 1); if (all) { if ((left == null) || left.isEmpty()) { return right; } left.addAll(right); return left; } else { HashSet added = new HashSet(); List result = new ArrayList(); addUnique(result, left, added); addUnique(result, right, added); return result; } } }; } }); if (false) define(new FunDefBase( "VisualTotals", "VisualTotals(<Set>, <Pattern>)", "Dynamically totals child members specified in a set using a pattern for the total label in the result set.", "fx*")); define(new XtdFunDef.Resolver( "Wtd", "Wtd([<Member>])", "A shortcut function for the PeriodsToDate function that specifies the level to be Week.", new String[]{"fx", "fxm"}, LevelType.TimeWeeks)); define(new XtdFunDef.Resolver( "Ytd", "Ytd([<Member>])", "A shortcut function for the PeriodsToDate function that specifies the level to be Year.", new String[]{"fx", "fxm"}, LevelType.TimeYears)); define(new FunDefBase( ":", "<Member>:<Member>", "Infix colon operator returns the set of members between a given pair of members.", "ixmm") { // implement FunDef public Object evaluate(Evaluator evaluator, Exp[] args) { final Member member0 = getMemberArg(evaluator, args, 0, true); final Member member1 = getMemberArg(evaluator, args, 1, true); if (member0.isNull() || member1.isNull()) { return Collections.EMPTY_LIST; } if (member0.getLevel() != member1.getLevel()) { throw newEvalException(this, "Members must belong to the same level"); } return FunUtil.memberRange(evaluator, member0, member1); } }); // special resolver for the "{...}" operator define(new ResolverBase( "{}", "{<Member> [, <Member>]...}", "Brace operator constructs a set.", Syntax.Braces) { public FunDef resolve(Exp[] args, int[] conversionCount) { int[] parameterTypes = new int[args.length]; for (int i = 0; i < args.length; i++) { if (canConvert( args[i], Category.Member, conversionCount)) { parameterTypes[i] = Category.Member; continue; } if (canConvert( args[i], Category.Set, conversionCount)) { parameterTypes[i] = Category.Set; continue; } if (canConvert( args[i], Category.Tuple, conversionCount)) { parameterTypes[i] = Category.Tuple; continue; } return null; } return new SetFunDef(this, parameterTypes); } }); // // STRING FUNCTIONS define(new MultiResolver( "Format", "Format(<Numeric Expression>, <String Expression>)", "Formats a number to string.", new String[] { "fSmS", "fSnS" }) { protected FunDef createFunDef(final Exp[] args, final FunDef dummyFunDef) { final Locale locale = Locale.getDefault(); // todo: use connection's locale if (args[1] instanceof Literal) { // Constant string expression: optimize by compiling // format string. String formatString = (String) ((Literal) args[1]).getValue(); final Format format = new Format(formatString, locale); return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o = getDoubleArg(evaluator, args, 0); return format.format(o); } }; } else { // Variable string expression return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o = getDoubleArg(evaluator, args, 0); String formatString = getStringArg(evaluator, args, 1, null); final Format format = new Format(formatString, locale); return format.format(o); } }; } } }); define(new FunDefBase( "IIf", "IIf(<Logical Expression>, <String Expression1>, <String Expression2>)", "Returns one of two string values determined by a logical test.", "fSbSS") { public Object evaluate(Evaluator evaluator, Exp[] args) { Boolean b = getBooleanArg(evaluator, args, 0); if (b == null) { // The result of the logical expression is not known, // probably because some necessary value is not in the // cache yet. Evaluate both expressions so that the cache // gets populated as soon as possible. getStringArg(evaluator, args, 1, null); getStringArg(evaluator, args, 2, null); return null; } Object o = (b.booleanValue()) ? getStringArg(evaluator, args, 1, null) : getStringArg(evaluator, args, 2, null); return o; } }); define(new FunDefBase( "Caption", "<Dimension>.Caption", "Returns the caption of a dimension.", "pSd") { public Object evaluate(Evaluator evaluator, Exp[] args) { Dimension dimension = getDimensionArg(evaluator, args, 0, true); return dimension.getCaption(); } }); define(new FunDefBase( "Caption", "<Hierarchy>.Caption", "Returns the caption of a hierarchy.", "pSh") { public Object evaluate(Evaluator evaluator, Exp[] args) { Hierarchy hierarchy = getHierarchyArg(evaluator, args, 0, true); return hierarchy.getCaption(); } }); define(new FunDefBase( "Caption", "<Level>.Caption", "Returns the caption of a level.", "pSl") { public Object evaluate(Evaluator evaluator, Exp[] args) { Level level = getLevelArg(evaluator, args, 0, true); return level.getCaption(); } }); define(new FunDefBase( "Caption", "<Member>.Caption", "Returns the caption of a member.", "pSm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); return member.getCaption(); } }); define(new FunDefBase( "Name", "<Dimension>.Name", "Returns the name of a dimension.", "pSd") { public Object evaluate(Evaluator evaluator, Exp[] args) { Dimension dimension = getDimensionArg(evaluator, args, 0, true); return dimension.getName(); } }); define(new FunDefBase( "Name", "<Hierarchy>.Name", "Returns the name of a hierarchy.", "pSh") { public Object evaluate(Evaluator evaluator, Exp[] args) { Hierarchy hierarchy = getHierarchyArg(evaluator, args, 0, true); return hierarchy.getName(); } }); define(new FunDefBase( "Name", "<Level>.Name", "Returns the name of a level.", "pSl") { public Object evaluate(Evaluator evaluator, Exp[] args) { Level level = getLevelArg(evaluator, args, 0, true); return level.getName(); } }); define(new FunDefBase( "Name", "<Member>.Name", "Returns the name of a member.", "pSm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); return member.getName(); } }); define(new FunDefBase( "SetToStr", "SetToStr(<Set>)", "Constructs a string from a set.", "fSx") { public Object evaluate(Evaluator evaluator, Exp[] args) { List items = (List) getArg(evaluator, args, 0); StringBuffer buf = new StringBuffer(); buf.append("{"); for (int i = 0; i < items.size(); i++) { if (i > 0) { buf.append(", "); } final Object o = items.get(i); appendMemberOrTuple(buf, o); } buf.append("}"); return buf.toString(); } }); define(new FunDefBase( "TupleToStr", "TupleToStr(<Tuple>)", "Constructs a string from a tuple.", "fSt") { // implement FunDef public Object evaluate(Evaluator evaluator, Exp[] args) { Object o = getArg(evaluator, args, 0); StringBuffer buf = new StringBuffer(); appendMemberOrTuple(buf, o); return buf.toString(); } }); define(new FunDefBase( "UniqueName", "<Dimension>.UniqueName", "Returns the unique name of a dimension.", "pSd") { public Object evaluate(Evaluator evaluator, Exp[] args) { Dimension dimension = getDimensionArg(evaluator, args, 0, true); return dimension.getUniqueName(); } }); define(new FunDefBase( "UniqueName", "<Hierarchy>.UniqueName", "Returns the unique name of a hierarchy.", "pSh") { public Object evaluate(Evaluator evaluator, Exp[] args) { Hierarchy hierarchy = getHierarchyArg(evaluator, args, 0, true); return hierarchy.getUniqueName(); } }); define(new FunDefBase( "UniqueName", "<Level>.UniqueName", "Returns the unique name of a level.", "pSl") { public Object evaluate(Evaluator evaluator, Exp[] args) { Level level = getLevelArg(evaluator, args, 0, true); return level.getUniqueName(); } }); define(new FunDefBase( "UniqueName", "<Member>.UniqueName", "Returns the unique name of a member.", "pSm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); return member.getUniqueName(); } }); // // TUPLE FUNCTIONS define(new FunDefBase( "Current", "<Set>.Current", "Returns the current tuple from a set during an iteration.", "ptx")); // we do not support the <String expression> arguments if (false) define(new FunDefBase( "Item", "<Set>.Item(<String Expression>[, <String Expression>...] | <Index>)", "Returns a tuple from a set.", "mx*")); define(new FunDefBase( "Item", "<Set>.Item(<Index>)", "Returns a tuple from the set specified in Set. The tuple to be returned is specified by the zero-based position of the tuple in the set in Index.", "mtxn") { public Type getResultType(Validator validator, Exp[] args) { SetType setType = (SetType) args[0].getTypeX(); return setType.getElementType(); } public Object evaluate(Evaluator evaluator, Exp[] args) { Object arg0 = getArg(evaluator, args, 0); int index = getIntArg(evaluator, args, 1); if (arg0 == null) { // List is empty, therefore every index it out of // bounds. return null; } else if (arg0 instanceof List) { List theSet = (List)arg0; int setSize = theSet.size(); if (index >= setSize || index < 0) { return null; } else { return theSet.get(index); } } else { // // You'll get a member in the following case: // {[member]}.item(0).item(0), even though the first invocation of // item returned a tuple. // assert ((arg0 instanceof Member[]) || (arg0 instanceof Member)); if (arg0 instanceof Member) { if (index == 0) { return arg0; } return null; } else { Member[] tuple = (Member[]) arg0; if (index < tuple.length && index >= 0) { return tuple[index]; } return null; } } } }); define(new FunDefBase( "Item", "<Tuple>.Item(<Index>)", "Returns a member from the tuple specified in Tuple. The member to be returned is specified by the zero-based position of the member in the set in Index.", "mmtn") { public Type getResultType(Validator validator, Exp[] args) { // Suppose we are called as follows: // ([Gender].CurrentMember, [Store].CurrentMember).Item(n) // // We know that our result is a member type, but we don't // know which dimension. return new MemberType(null, null, null); } public Object evaluate(Evaluator evaluator, Exp[] args) { Object arg0 = getArg(evaluator, args, 0); int index = getIntArg(evaluator, args, 1); if (arg0 == null) { // List is empty, therefore every index it out of // bounds. return null; } else { // {[member]}.item(0).item(0), even though the first invocation of // item returned a tuple. // assert ((arg0 instanceof Member[]) || (arg0 instanceof Member)); if (arg0 instanceof Member) { if (index == 0) { return arg0; } return null; } else { Member[] tuple = (Member[]) arg0; if (index >= tuple.length || index < 0) { return null; } return tuple[index]; } } } }); define(new FunDefBase( "StrToTuple", "StrToTuple(<String Expression>)", "Constructs a tuple from a string.", "ftS") { public Exp validateCall(Validator validator, FunCall call) { final Exp[] args = call.getArgs(); final int argCount = args.length; if (argCount <= 1) { throw Util.getRes().newMdxFuncArgumentsNum(getName()); } for (int i = 1; i < argCount; i++) { final Exp arg = args[i]; if (arg instanceof Dimension) { // if arg is a dimension, switch to dimension's default // hierarchy args[i] = ((Dimension) arg).getHierarchy(); } else if (arg instanceof Hierarchy) { // nothing } else { throw Util.getRes().newMdxFuncNotHier( new Integer(i + 1), getName()); } } return super.validateCall(validator, call); } public Type getResultType(Validator validator, Exp[] args) { if (args.length == 1) { // This is a call to the standard version of StrToTuple, // which doesn't give us any hints about type. return new TupleType(null); } else { // This is a call to Mondrian's extended version of // StrToTuple, of the form // StrToTuple(s, <Hier1>, ... , <HierN>) // // The result is a tuple // (<Hier1>, ... , <HierN>) final ArrayList list = new ArrayList(); for (int i = 1; i < args.length; i++) { Exp arg = args[i]; final Type type = arg.getTypeX(); list.add(type); } final Type[] types = (Type[]) list.toArray(new Type[list.size()]); return new TupleType(types); } } }); // special resolver for "()" define(new ResolverBase( "()", null, null, Syntax.Parentheses) { public FunDef resolve(Exp[] args, int[] conversionCount) { // Compare with TupleFunDef.getReturnCategory(). For example, // ([Gender].members) is a set, // ([Gender].[M]) is a member, // (1 + 2) is a numeric, // but // ([Gender].[M], [Marital Status].[S]) is a tuple. return (args.length == 1) ? new ParenthesesFunDef(args[0].getCategory()) : (FunDef) new TupleFunDef(ExpBase.getTypes(args)); } }); // // GENERIC VALUE FUNCTIONS define(new ResolverBase( "CoalesceEmpty", "CoalesceEmpty(<Value Expression>[, <Value Expression>]...)", "Coalesces an empty cell value to a different value. All of the expressions must be of the same type (number or string).", Syntax.Function) { public FunDef resolve(Exp[] args, int[] conversionCount) { if (args.length < 1) { return null; } final int[] types = {Category.Numeric, Category.String}; for (int j = 0; j < types.length; j++) { int type = types[j]; int matchingArgs = 0; conversionCount[0] = 0; for (int i = 0; i < args.length; i++) { if (canConvert(args[i], type, conversionCount)) { matchingArgs++; } } if (matchingArgs == args.length) { return new CoalesceEmptyFunDef(this, type, ExpBase.getTypes(args)); } } return null; } public boolean requiresExpression(int k) { return true; } }); define(new ResolverBase( "_CaseTest", "Case When <Logical Expression> Then <Expression> [...] [Else <Expression>] End", "Evaluates various conditions, and returns the corresponding expression for the first which evaluates to true.", Syntax.Case) { public FunDef resolve(Exp[] args, int[] conversionCount) { if (args.length < 1) { return null; } int j = 0; int clauseCount = args.length / 2; int mismatchingArgs = 0; int returnType = args[1].getCategory(); for (int i = 0; i < clauseCount; i++) { if (!canConvert(args[j++], Category.Logical, conversionCount)) { mismatchingArgs++; } if (!canConvert(args[j++], returnType, conversionCount)) { mismatchingArgs++; } } if (j < args.length) { if (!canConvert(args[j++], returnType, conversionCount)) { mismatchingArgs++; } } Util.assertTrue(j == args.length); if (mismatchingArgs == 0) { return new FunDefBase(this, returnType, ExpBase.getTypes(args)) { // implement FunDef public Object evaluate(Evaluator evaluator, Exp[] args) { return evaluateCaseTest(evaluator, args); } }; } else { return null; } } public boolean requiresExpression(int k) { return true; } Object evaluateCaseTest(Evaluator evaluator, Exp[] args) { int clauseCount = args.length / 2; int j = 0; for (int i = 0; i < clauseCount; i++) { boolean logical = getBooleanArg(evaluator, args, j++, false); if (logical) { return getArg(evaluator, args, j); } else { j++; } } return (j < args.length) ? getArg(evaluator, args, j) : null; } }); define(new ResolverBase( "_CaseMatch", "Case <Expression> When <Expression> Then <Expression> [...] [Else <Expression>] End", "Evaluates various expressions, and returns the corresponding expression for the first which matches a particular value.", Syntax.Case) { public FunDef resolve(Exp[] args, int[] conversionCount) { if (args.length < 3) { return null; } int valueType = args[0].getCategory(); int returnType = args[2].getCategory(); int j = 0; int clauseCount = (args.length - 1) / 2; int mismatchingArgs = 0; if (!canConvert(args[j++], valueType, conversionCount)) { mismatchingArgs++; } for (int i = 0; i < clauseCount; i++) { if (!canConvert(args[j++], valueType, conversionCount)) { mismatchingArgs++; } if (!canConvert(args[j++], returnType, conversionCount)) { mismatchingArgs++; } } if (j < args.length) { if (!canConvert(args[j++], returnType, conversionCount)) { mismatchingArgs++; } } Util.assertTrue(j == args.length); if (mismatchingArgs == 0) { return new FunDefBase(this, returnType, ExpBase.getTypes(args)) { // implement FunDef public Object evaluate(Evaluator evaluator, Exp[] args) { return evaluateCaseMatch(evaluator, args); } }; } else { return null; } } public boolean requiresExpression(int k) { return true; } Object evaluateCaseMatch(Evaluator evaluator, Exp[] args) { int clauseCount = (args.length - 1)/ 2; int j = 0; Object value = getArg(evaluator, args, j++); for (int i = 0; i < clauseCount; i++) { Object match = getArg(evaluator, args, j++); if (match.equals(value)) { return getArg(evaluator, args, j); } else { j++; } } return (j < args.length) ? getArg(evaluator, args, j) : null; } }); define(new PropertiesFunDef.Resolver()); // // PARAMETER FUNCTIONS define(new ParameterFunDef.ParameterResolver()); define(new ParameterFunDef.ParamRefResolver()); // // OPERATORS define(new FunDefBase( "+", "<Numeric Expression> + <Numeric Expression>", "Adds two numbers.", "innn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o0 = getDoubleArg(evaluator, args, 0, null); Double o1 = getDoubleArg(evaluator, args, 1, null); if (o0 == null || o1 == null) { return null; } return new Double(o0.doubleValue() + o1.doubleValue()); } }); define(new FunDefBase( "-", "<Numeric Expression> - <Numeric Expression>", "Subtracts two numbers.", "innn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o0 = getDoubleArg(evaluator, args, 0, null); Double o1 = getDoubleArg(evaluator, args, 1, null); if (o0 == null || o1 == null) { return null; } return new Double(o0.doubleValue() - o1.doubleValue()); } }); define(new FunDefBase( "*", "<Numeric Expression> * <Numeric Expression>", "Multiplies two numbers.", "innn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o0 = getDoubleArg(evaluator, args, 0, null); Double o1 = getDoubleArg(evaluator, args, 1, null); if (o0 == null || o1 == null) { return null; } return new Double(o0.doubleValue() * o1.doubleValue()); } }); define(new FunDefBase( "/", "<Numeric Expression> / <Numeric Expression>", "Divides two numbers.", "innn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o0 = getDoubleArg(evaluator, args, 0, null); Double o1 = getDoubleArg(evaluator, args, 1, null); if (o0 == null || o1 == null) { return null; } return new Double(o0.doubleValue() / o1.doubleValue()); } // todo: use this, via reflection public double evaluate(double d1, double d2) { return d1 / d2; } }); define(new FunDefBase( "-", "- <Numeric Expression>", "Returns the negative of a number.", "Pnn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o0 = getDoubleArg(evaluator, args, 0, null); if (o0 == null) { return null; } return new Double(- o0.doubleValue()); } }); define(new FunDefBase( "||", "<String Expression> || <String Expression>", "Concatenates two strings.", "iSSS") { public Object evaluate(Evaluator evaluator, Exp[] args) { String o0 = getStringArg(evaluator, args, 0, null); String o1 = getStringArg(evaluator, args, 1, null); return o0 + o1; } }); define(new FunDefBase( "AND", "<Logical Expression> AND <Logical Expression>", "Returns the conjunction of two conditions.", "ibbb") { public Object evaluate(Evaluator evaluator, Exp[] args) { // if the first arg is known and false, we dont evaluate the second Boolean b1 = getBooleanArg(evaluator, args, 0); if ((b1 != null) && !b1.booleanValue()) { return Boolean.FALSE; } Boolean b2 = getBooleanArg(evaluator, args, 1); if ((b2 != null) && !b2.booleanValue()) { return Boolean.FALSE; } if (b1 == null || b2 == null) { return null; } return Boolean.valueOf(b1.booleanValue() && b2.booleanValue()); } }); define(new FunDefBase( "OR", "<Logical Expression> OR <Logical Expression>", "Returns the disjunction of two conditions.", "ibbb") { public Object evaluate(Evaluator evaluator, Exp[] args) { // if the first arg is known and true, we dont evaluate the second Boolean b1 = getBooleanArg(evaluator, args, 0); if ((b1 != null) && b1.booleanValue()) { return Boolean.TRUE; } Boolean b2 = getBooleanArg(evaluator, args, 1); if ((b2 != null) && b2.booleanValue()) { return Boolean.TRUE; } if (b1 == null || b2 == null) { return null; } return Boolean.valueOf(b1.booleanValue() || b2.booleanValue()); } }); define(new FunDefBase( "XOR", "<Logical Expression> XOR <Logical Expression>", "Returns whether two conditions are mutually exclusive.", "ibbb") { public Object evaluate(Evaluator evaluator, Exp[] args) { Boolean b1 = getBooleanArg(evaluator, args, 0); Boolean b2 = getBooleanArg(evaluator, args, 1); if (b1 == null || b2 == null) { return null; } return Boolean.valueOf(b1.booleanValue() != b2.booleanValue()); } }); define(new FunDefBase( "NOT", "NOT <Logical Expression>", "Returns the negation of a condition.", "Pbb") { public Object evaluate(Evaluator evaluator, Exp[] args) { Boolean b = getBooleanArg(evaluator, args, 0); return (b == null) ? null : b.booleanValue() ? Boolean.FALSE : Boolean.TRUE; } }); define(new FunDefBase( "=", "<String Expression> = <String Expression>", "Returns whether two expressions are equal.", "ibSS") { public Object evaluate(Evaluator evaluator, Exp[] args) { String o0 = getStringArg(evaluator, args, 0, null); String o1 = getStringArg(evaluator, args, 1, null); if (o0 == null || o1 == null) { return null; } return Boolean.valueOf(o0.equals(o1)); } }); define(new FunDefBase( "=", "<Numeric Expression> = <Numeric Expression>", "Returns whether two expressions are equal.", "ibnn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o0 = getDoubleArg(evaluator, args, 0); Double o1 = getDoubleArg(evaluator, args, 1); if (o0.isNaN() || o1.isNaN()) { return null; } return Boolean.valueOf(o0.equals(o1)); } }); define(new FunDefBase( "<>", "<String Expression> <> <String Expression>", "Returns whether two expressions are not equal.", "ibSS") { public Object evaluate(Evaluator evaluator, Exp[] args) { String o0 = getStringArg(evaluator, args, 0, null); String o1 = getStringArg(evaluator, args, 1, null); if (o0 == null || o1 == null) { return null; } return o0.equals(o1) ? Boolean.FALSE : Boolean.TRUE; } }); define(new FunDefBase( "<>", "<Numeric Expression> <> <Numeric Expression>", "Returns whether two expressions are not equal.", "ibnn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o0 = getDoubleArg(evaluator, args, 0); Double o1 = getDoubleArg(evaluator, args, 1); if (o0.isNaN() || o1.isNaN()) { return null; } return o0.equals(o1) ? Boolean.FALSE : Boolean.TRUE; } }); define(new FunDefBase( "<", "<Numeric Expression> < <Numeric Expression>", "Returns whether an expression is less than another.", "ibnn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o0 = getDoubleArg(evaluator, args, 0); Double o1 = getDoubleArg(evaluator, args, 1); if (o0.isNaN() || o1.isNaN()) { return null; } return Boolean.valueOf(o0.compareTo(o1) < 0); } }); define(new FunDefBase( "<", "<String Expression> < <String Expression>", "Returns whether an expression is less than another.", "ibSS") { public Object evaluate(Evaluator evaluator, Exp[] args) { String o0 = getStringArg(evaluator, args, 0, null); String o1 = getStringArg(evaluator, args, 1, null); if (o0 == null || o1 == null) { return null; } return Boolean.valueOf(o0.compareTo(o1) < 0); } }); define(new FunDefBase( "<=", "<Numeric Expression> <= <Numeric Expression>", "Returns whether an expression is less than or equal to another.", "ibnn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o0 = getDoubleArg(evaluator, args, 0); Double o1 = getDoubleArg(evaluator, args, 1); if (o0.isNaN() || o1.isNaN()) { return null; } return Boolean.valueOf(o0.compareTo(o1) <= 0); } }); define(new FunDefBase( "<=", "<String Expression> <= <String Expression>", "Returns whether an expression is less than or equal to another.", "ibSS") { public Object evaluate(Evaluator evaluator, Exp[] args) { String o0 = getStringArg(evaluator, args, 0, null); String o1 = getStringArg(evaluator, args, 1, null); if (o0 == null || o1 == null) { return null; } return Boolean.valueOf(o0.compareTo(o1) <= 0); } }); define(new FunDefBase( ">", "<Numeric Expression> > <Numeric Expression>", "Returns whether an expression is greater than another.", "ibnn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o0 = getDoubleArg(evaluator, args, 0); Double o1 = getDoubleArg(evaluator, args, 1); if (o0.isNaN() || o1.isNaN()) { return null; } return Boolean.valueOf(o0.compareTo(o1) > 0); } }); define(new FunDefBase( ">", "<String Expression> > <String Expression>", "Returns whether an expression is greater than another.", "ibSS") { public Object evaluate(Evaluator evaluator, Exp[] args) { String o0 = getStringArg(evaluator, args, 0, null); String o1 = getStringArg(evaluator, args, 1, null); if (o0 == null || o1 == null) { return null; } return Boolean.valueOf(o0.compareTo(o1) > 0); } }); define(new FunDefBase( ">=", "<Numeric Expression> >= <Numeric Expression>", "Returns whether an expression is greater than or equal to another.", "ibnn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o0 = getDoubleArg(evaluator, args, 0); Double o1 = getDoubleArg(evaluator, args, 1); if (o0.isNaN() || o1.isNaN()) { return null; } return Boolean.valueOf(o0.compareTo(o1) >= 0); } }); define(new FunDefBase( ">=", "<String Expression> >= <String Expression>", "Returns whether an expression is greater than or equal to another.", "ibSS") { public Object evaluate(Evaluator evaluator, Exp[] args) { String o0 = getStringArg(evaluator, args, 0, null); String o1 = getStringArg(evaluator, args, 1, null); if (o0 == null || o1 == null) { return null; } return Boolean.valueOf(o0.compareTo(o1) >= 0); } }); // NON-STANDARD FUNCTIONS define(new MultiResolver( "FirstQ", "FirstQ(<Set>[, <Numeric Expression>])", "Returns the 1st quartile value of a numeric expression evaluated over a set.", new String[]{"fnx", "fnxn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { final Exp valueFunCall = createValueFunCall(); public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArg(evaluator, args, 1, valueFunCall); //todo: ignore nulls, do we need to ignore the List? return quartile(evaluator.push(), members, exp, 1); } }; } }); define(new MultiResolver( "ThirdQ", "ThirdQ(<Set>[, <Numeric Expression>])", "Returns the 3rd quartile value of a numeric expression evaluated over a set.", new String[]{"fnx", "fnxn"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new FunDefBase(dummyFunDef) { final Exp valueFunCall = createValueFunCall(); public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArg(evaluator, args, 1, valueFunCall); //todo: ignore nulls, do we need to ignore the List? return quartile(evaluator.push(), members, exp, 3); } }; } }); }
4891 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4891/3041f930b5fc4bf6aa3339845b828801c1d8b366/BuiltinFunTable.java/buggy/src/main/mondrian/olap/fun/BuiltinFunTable.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 4750, 918, 4426, 7503, 1435, 288, 3639, 4426, 10435, 2932, 8560, 8863, 3639, 368, 1122, 1149, 30, 293, 33, 1396, 16, 312, 33, 1305, 16, 277, 33, 382, 904, 16, 453, 33, 2244, 3639, 368, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 4750, 918, 4426, 7503, 1435, 288, 3639, 4426, 10435, 2932, 8560, 8863, 3639, 368, 1122, 1149, 30, 293, 33, 1396, 16, 312, 33, 1305, 16, 277, 33, 382, 904, 16, 453, 33, 2244, 3639, 368, ...
lineInfo[line] = ((lineInfo[line] & ~(END_MASK | FOLD_LEVEL_VALID_MASK)) | end);
lineInfo[line] = ((lineInfo[line] & ~END_MASK) | end);
private final void setLineEndOffset(int line, int end) { lineInfo[line] = ((lineInfo[line] & ~(END_MASK | FOLD_LEVEL_VALID_MASK)) | end); // what is the point of this -- DO NOT UNCOMMENT THIS IT // CAUSES A PERFORMANCE LOSS; nextLineRequested becomes true //lineContext[line] = null; } //}}}
8690 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8690/a7e074f5ba1dfe7886971aebfaa4404a915275ef/OffsetManager.java/buggy/org/gjt/sp/jedit/buffer/OffsetManager.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1152, 727, 918, 26482, 1638, 2335, 12, 474, 980, 16, 509, 679, 13, 202, 95, 202, 202, 1369, 966, 63, 1369, 65, 273, 14015, 1369, 966, 63, 1369, 65, 473, 4871, 12, 4415, 67, 11704...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1152, 727, 918, 26482, 1638, 2335, 12, 474, 980, 16, 509, 679, 13, 202, 95, 202, 202, 1369, 966, 63, 1369, 65, 273, 14015, 1369, 966, 63, 1369, 65, 473, 4871, 12, 4415, 67, 11704...
iterator = getMailItems(context, mailItem, context.getStartTime(), context.getEndTime());
iterator = getMailItems(context, mailItem, context.getStartTime(), context.getEndTime(), Integer.MAX_VALUE);
public void formatCallback(Context context, MailItem mailItem) throws IOException, ServiceException { Iterator<? extends MailItem> iterator = null; List<CalendarItem> calItems = new ArrayList<CalendarItem>(); //ZimbraLog.mailbox.info("start = "+new Date(context.getStartTime())); //ZimbraLog.mailbox.info("end = "+new Date(context.getEndTime())); try { iterator = getMailItems(context, mailItem, context.getStartTime(), context.getEndTime()); // this is lame while (iterator.hasNext()) { MailItem item = iterator.next(); if (item instanceof CalendarItem) calItems.add((CalendarItem) item); } } finally { if (iterator instanceof QueryResultIterator) ((QueryResultIterator) iterator).finished(); } context.resp.setCharacterEncoding(Mime.P_CHARSET_UTF8); context.resp.setContentType(Mime.CT_TEXT_CALENDAR ); Browser browser = HttpUtil.guessBrowser(context.req); boolean useOutlookCompatMode = Browser.IE.equals(browser);// try { ZVCalendar cal = context.targetMailbox.getZCalendarForCalendarItems(calItems, useOutlookCompatMode); ByteArrayOutputStream buf = new ByteArrayOutputStream(); OutputStreamWriter wout = new OutputStreamWriter(buf, Mime.P_CHARSET_UTF8); cal.toICalendar(wout); wout.flush(); context.resp.getOutputStream().write(buf.toByteArray());// } catch (ValidationException e) {// throw ServiceException.FAILURE(" mbox:"+context.targetMailbox.getId()+" unable to get calendar "+e, e);// } }
6965 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6965/4009a430eb181a0f36227b798f8dff5c304e0078/IcsFormatter.java/buggy/ZimbraServer/src/java/com/zimbra/cs/service/formatter/IcsFormatter.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 740, 2428, 12, 1042, 819, 16, 11542, 1180, 4791, 1180, 13, 1216, 1860, 16, 16489, 288, 3639, 4498, 12880, 3231, 11542, 1180, 34, 2775, 273, 446, 31, 3639, 987, 32, 7335, 1180, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 740, 2428, 12, 1042, 819, 16, 11542, 1180, 4791, 1180, 13, 1216, 1860, 16, 16489, 288, 3639, 4498, 12880, 3231, 11542, 1180, 34, 2775, 273, 446, 31, 3639, 987, 32, 7335, 1180, ...
public Element createElement(String tagName) throws DOMException
public Element createElement(String tagName) throws DOMException
public Element createElement(String tagName) throws DOMException { if (indexedLookup) return new IndexedElemImpl(this, tagName); else return new ElementImpl(this, tagName); }
46591 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46591/0e2298c0c460e281c6e54e92ac95421ec5eca2e4/DocumentImpl.java/clean/src/org/apache/xalan/stree/DocumentImpl.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 3010, 5411, 6310, 12, 780, 7196, 13, 565, 1216, 4703, 503, 225, 288, 565, 309, 261, 19626, 6609, 13, 1377, 327, 394, 22524, 7498, 2828, 12, 2211, 16, 7196, 1769, 565, 469, 1377, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 3010, 5411, 6310, 12, 780, 7196, 13, 565, 1216, 4703, 503, 225, 288, 565, 309, 261, 19626, 6609, 13, 1377, 327, 394, 22524, 7498, 2828, 12, 2211, 16, 7196, 1769, 565, 469, 1377, 3...
public Map getRequestParameter() {
public Map getRequestParameter() {
public Map getRequestParameter() { return requestParameter; }
51810 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51810/cba5674453f8a9143c9f5bd050cc9e5572dd940b/PortalControlParameter.java/buggy/portal/src/java/org/apache/pluto/portalImpl/core/PortalControlParameter.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 1635, 17025, 1435, 565, 288, 3639, 327, 590, 1662, 31, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 1635, 17025, 1435, 565, 288, 3639, 327, 590, 1662, 31, 565, 289, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
GrouperLog.debug(LOG, s, msg + "system maintained");
protected void canPrivDispatch( GrouperSession s, Group g, Subject subj, Privilege priv ) throws InsufficientPrivilegeException, SchemaException { String msg = "canPrivDispatch '" + priv.getName().toUpperCase() + "': "; if (priv.equals(AccessPrivilege.ADMIN)) { GrouperLog.debug(LOG, s, msg + "canADMIN"); this.canADMIN(s, g, subj); } else if (priv.equals(AccessPrivilege.OPTIN)) { GrouperLog.debug(LOG, s, msg + "canOPTIN"); this.canOPTIN(s, g, subj); } else if (priv.equals(AccessPrivilege.OPTOUT)) { GrouperLog.debug(LOG, s, msg + "canOPTOUT"); this.canOPTOUT(s, g, subj); } else if (priv.equals(AccessPrivilege.READ)) { GrouperLog.debug(LOG, s, msg + "canREAD"); this.canREAD(s, g, subj); } else if (priv.equals(AccessPrivilege.UPDATE)) { GrouperLog.debug(LOG, s, msg + "canUPDATE"); this.canUPDATE(s, g, subj); } else if (priv.equals(AccessPrivilege.VIEW)) { GrouperLog.debug(LOG, s, msg + "canVIEW"); this.canVIEW(s, g, subj); } else if (priv.equals(AccessPrivilege.SYSTEM)) { GrouperLog.debug(LOG, s, msg + "system maintained"); throw new InsufficientPrivilegeException("system maintained"); } else { throw new SchemaException("unknown access privilege: " + priv); } } // protected void canPrivDispatch(s, g, subj, priv)
5235 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5235/11170f2a782492e4c1e43aa1adabfc484a62c9f3/PrivilegeResolver.java/clean/grouper/src/grouper/edu/internet2/middleware/grouper/PrivilegeResolver.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 4750, 918, 848, 15475, 5325, 12, 565, 3756, 264, 2157, 272, 16, 3756, 314, 16, 9912, 15333, 16, 2301, 8203, 908, 6015, 225, 262, 565, 1216, 225, 22085, 11339, 24308, 503, 16, 5411, 4611, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 4750, 918, 848, 15475, 5325, 12, 565, 3756, 264, 2157, 272, 16, 3756, 314, 16, 9912, 15333, 16, 2301, 8203, 908, 6015, 225, 262, 565, 1216, 225, 22085, 11339, 24308, 503, 16, 5411, 4611, ...
throws IOException {
throws IOException, InterruptedException {
public static URN createSHA1Urn(File file) throws IOException { return new URN(createSHA1String(file), UrnType.SHA1); }
5134 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5134/a9c96e939bbbccc4de9cae20c217c4e0b8e29aa0/URN.java/buggy/components/gnutella-core/src/main/java/com/limegroup/gnutella/URN.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 760, 1618, 50, 752, 8325, 21, 57, 27639, 12, 812, 585, 13, 3196, 202, 15069, 1860, 288, 202, 202, 2463, 394, 1618, 50, 12, 2640, 8325, 21, 780, 12, 768, 3631, 587, 27639, 55...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 760, 1618, 50, 752, 8325, 21, 57, 27639, 12, 812, 585, 13, 3196, 202, 15069, 1860, 288, 202, 202, 2463, 394, 1618, 50, 12, 2640, 8325, 21, 780, 12, 768, 3631, 587, 27639, 55...
try { return (Help) InitialNaming.lookup(NAME); } catch (NamingException ex) { throw new HelpException("Help application not found"); } }
try { return (Help) InitialNaming.lookup(NAME); } catch (NamingException ex) { throw new HelpException("Help application not found"); } }
public static Help getHelp() throws HelpException { try { return (Help) InitialNaming.lookup(NAME); } catch (NamingException ex) { throw new HelpException("Help application not found"); } }
50763 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50763/8475fed231619f209c4398ccad2ba966899e292d/Help.java/buggy/shell/src/shell/org/jnode/shell/help/Help.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 760, 11288, 336, 6696, 1435, 1216, 11288, 503, 288, 202, 202, 698, 288, 1082, 202, 2463, 261, 6696, 13, 10188, 24102, 18, 8664, 12, 1985, 1769, 202, 202, 97, 1044, 261, 24102, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 760, 11288, 336, 6696, 1435, 1216, 11288, 503, 288, 202, 202, 698, 288, 1082, 202, 2463, 261, 6696, 13, 10188, 24102, 18, 8664, 12, 1985, 1769, 202, 202, 97, 1044, 261, 24102, ...
public Enumeration getKeyStrokeData() { return _actionToDataMap.elements(); }
public Enumeration getKeyStrokeData() { return _actionToDataMap.elements(); }
public Enumeration getKeyStrokeData() { return _actionToDataMap.elements(); }
11192 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/11192/4ec6eda5e5d4bd8e2b6e61afae08eb8548f8c4b5/KeyBindingManager.java/clean/drjava/src/edu/rice/cs/drjava/ui/KeyBindingManager.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 13864, 3579, 14602, 751, 1435, 288, 327, 389, 1128, 774, 31982, 18, 6274, 5621, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 13864, 3579, 14602, 751, 1435, 288, 327, 389, 1128, 774, 31982, 18, 6274, 5621, 289, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
public TA_RetCode STOCH( int startIdx, int endIdx, double inHigh[], double inLow[], double inClose[], int optInFastK_Period, int optInSlowK_Period, TA_MAType optInSlowK_MAType, int optInSlowD_Period, TA_MAType optInSlowD_MAType, MInteger outBegIdx, MInteger outNbElement, double outSlowK[], double outSlowD[] ){ TA_RetCode retCode; double lowest, highest, tmp, diff; double []tempBuffer ; int outIdx, lowestIdx, highestIdx; int lookbackTotal, lookbackK, lookbackKSlow, lookbackDSlow; int trailingIdx, today, i; if( startIdx < 0 ) return TA_RetCode. TA_OUT_OF_RANGE_START_INDEX; if( (endIdx < 0) || (endIdx < startIdx)) return TA_RetCode. TA_OUT_OF_RANGE_END_INDEX; if( (int)optInFastK_Period == ( Integer.MIN_VALUE ) ) optInFastK_Period = 5; else if( ((int)optInFastK_Period < 1) || ((int)optInFastK_Period > 100000) ) return TA_RetCode. TA_BAD_PARAM; if( (int)optInSlowK_Period == ( Integer.MIN_VALUE ) ) optInSlowK_Period = 3; else if( ((int)optInSlowK_Period < 1) || ((int)optInSlowK_Period > 100000) ) return TA_RetCode. TA_BAD_PARAM; if( (int)optInSlowD_Period == ( Integer.MIN_VALUE ) ) optInSlowD_Period = 3; else if( ((int)optInSlowD_Period < 1) || ((int)optInSlowD_Period > 100000) ) return TA_RetCode. TA_BAD_PARAM; lookbackK = optInFastK_Period-1; lookbackKSlow = MA_Lookback ( optInSlowK_Period, optInSlowK_MAType ); lookbackDSlow = MA_Lookback ( optInSlowD_Period, optInSlowD_MAType ); lookbackTotal = lookbackK + lookbackDSlow + lookbackKSlow; if( startIdx < lookbackTotal ) startIdx = lookbackTotal; if( startIdx > endIdx ) { outBegIdx.value = 0 ; outNbElement.value = 0 ; return TA_RetCode. TA_SUCCESS; } outIdx = 0; trailingIdx = startIdx-lookbackTotal; today = trailingIdx+lookbackK; lowestIdx = highestIdx = -1; diff = highest = lowest = 0.0; if( (outSlowK == inHigh) || (outSlowK == inLow) || (outSlowK == inClose) ) { tempBuffer = outSlowK; } else if( (outSlowD == inHigh) || (outSlowD == inLow) || (outSlowD == inClose) ) { tempBuffer = outSlowD; } else { tempBuffer = new double[endIdx-today+1] ; } while( today <= endIdx ) { tmp = inLow[today]; if( lowestIdx < trailingIdx ) { lowestIdx = trailingIdx; lowest = inLow[lowestIdx]; i = lowestIdx; while( ++i<=today ) { tmp = inLow[i]; if( tmp < lowest ) { lowestIdx = i; lowest = tmp; } } diff = (highest - lowest)/100.0; } else if( tmp <= lowest ) { lowestIdx = today; lowest = tmp; diff = (highest - lowest)/100.0; } tmp = inHigh[today]; if( highestIdx < trailingIdx ) { highestIdx = trailingIdx; highest = inHigh[highestIdx]; i = highestIdx; while( ++i<=today ) { tmp = inHigh[i]; if( tmp > highest ) { highestIdx = i; highest = tmp; } } diff = (highest - lowest)/100.0; } else if( tmp >= highest ) { highestIdx = today; highest = tmp; diff = (highest - lowest)/100.0; } if( diff != 0.0 ) tempBuffer[outIdx++] = (inClose[today]-lowest)/diff; else tempBuffer[outIdx++] = 0.0; trailingIdx++; today++; } retCode = MA ( 0, outIdx-1, tempBuffer, optInSlowK_Period, optInSlowK_MAType, outBegIdx, outNbElement, tempBuffer ); if( (retCode != TA_RetCode. TA_SUCCESS ) || ((int) outNbElement.value == 0) ) { ; outBegIdx.value = 0 ; outNbElement.value = 0 ; return retCode; } retCode = MA ( 0, (int) outNbElement.value -1, tempBuffer, optInSlowD_Period, optInSlowD_MAType, outBegIdx, outNbElement, outSlowD ); System.arraycopy(tempBuffer,0,outSlowK,0,(int) outNbElement.value ) ; ; if( retCode != TA_RetCode. TA_SUCCESS ) { outBegIdx.value = 0 ; outNbElement.value = 0 ; return retCode; } outBegIdx.value = startIdx; return TA_RetCode. TA_SUCCESS;}
7231 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7231/1bccb7a13486c61b10e8ebdf0c938797539a3f3d/Core.java/clean/ta-lib/java/src/TA/Lib/Core.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1071, 9833, 67, 7055, 1085, 31487, 1792, 12, 474, 1937, 4223, 16, 474, 409, 4223, 16, 9056, 267, 8573, 63, 6487, 9056, 267, 10520, 63, 6487, 9056, 267, 4605, 63, 6487, 474, 3838, 382, 12305, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1071, 9833, 67, 7055, 1085, 31487, 1792, 12, 474, 1937, 4223, 16, 474, 409, 4223, 16, 9056, 267, 8573, 63, 6487, 9056, 267, 10520, 63, 6487, 9056, 267, 4605, 63, 6487, 474, 3838, 382, 12305, ...
if (unitcellparams[5] != -1.0) {
if (crystalScalar > 0) {
public void endElement(Stack xpath, String uri, String name, String raw) { logger.debug("EndElement: " + name); setCurrentElement(name); switch (CurrentElement) { case BOND: if (!stereoGiven) bondStereo.addElement(""); if (bondStereo.size() > bondDictRefs.size()) bondDictRefs.addElement(null); break; case ATOM: if (atomCounter > formalCharges.size()) { /* while strictly undefined, assume zero charge when no number is given */ formalCharges.addElement("0"); } if (atomCounter > hCounts.size()) { /* while strictly undefined, assume zero implicit hydrogens when no number is given */ hCounts.addElement("0"); } if (atomCounter > atomDictRefs.size()) { atomDictRefs.addElement(null); } if (atomCounter > isotope.size()) { isotope.addElement(null); } /* It may happen that not all atoms have associated 2D or 3D coordinates. accept that */ if (atomCounter > x2.size() && x2.size() != 0) { /* apparently, the previous atoms had atomic coordinates, add 'null' for this atom */ x2.addElement(null); y2.addElement(null); } if (atomCounter > x3.size() && x3.size() != 0) { /* apparently, the previous atoms had atomic coordinates, add 'null' for this atom */ x3.addElement(null); y3.addElement(null); z3.addElement(null); } if (atomCounter > xfract.size() && xfract.size() != 0) { /* apparently, the previous atoms had atomic coordinates, add 'null' for this atom */ xfract.addElement(null); yfract.addElement(null); zfract.addElement(null); } break; case MOLECULE: storeData(); cdo.endObject("Molecule"); break; case CRYSTAL: if (unitcellparams[5] != -1.0) { // convert unit cell parameters to cartesians double[][] axes = CrystalGeometryTools.notionalToCartesian( unitcellparams[0], unitcellparams[1], unitcellparams[2], unitcellparams[3], unitcellparams[4], unitcellparams[5] ); a[0] = axes[0][0]; a[1] = axes[0][1]; a[2] = axes[0][2]; b[0] = axes[1][0]; b[1] = axes[1][1]; b[2] = axes[1][2]; c[0] = axes[2][0]; c[1] = axes[2][1]; c[2] = axes[2][2]; cartesianAxesSet = true; cdo.startObject("a-axis"); cdo.setObjectProperty("a-axis", "x", new Double(a[0]).toString()); cdo.setObjectProperty("a-axis", "y", new Double(a[1]).toString()); cdo.setObjectProperty("a-axis", "z", new Double(a[2]).toString()); cdo.endObject("a-axis"); cdo.startObject("b-axis"); cdo.setObjectProperty("b-axis", "x", new Double(b[0]).toString()); cdo.setObjectProperty("b-axis", "y", new Double(b[1]).toString()); cdo.setObjectProperty("b-axis", "z", new Double(b[2]).toString()); cdo.endObject("b-axis"); cdo.startObject("c-axis"); cdo.setObjectProperty("c-axis", "x", new Double(c[0]).toString()); cdo.setObjectProperty("c-axis", "y", new Double(c[1]).toString()); cdo.setObjectProperty("c-axis", "z", new Double(c[2]).toString()); cdo.endObject("c-axis"); } else { logger.error("Could not find crystal unit cell parameters"); } cdo.endObject("Crystal"); break; case LIST: cdo.endObject("SetOfMolecules"); break; case COORDINATE3: if (BUILTIN.equals("xyz3")) { logger.debug("New coord3 xyz3 found: " + currentChars); try { StringTokenizer st = new StringTokenizer(currentChars); x3.addElement(st.nextToken()); y3.addElement(st.nextToken()); z3.addElement(st.nextToken()); logger.debug("coord3 x3.length: " + x3.size()); logger.debug("coord3 y3.length: " + y3.size()); logger.debug("coord3 z3.length: " + z3.size()); } catch (Exception exception) { logger.error( "CMLParsing error while setting coordinate3!"); logger.debug(exception); } } else { logger.warn("Unknown coordinate3 BUILTIN: " + BUILTIN); } break; } currentChars = ""; BUILTIN = ""; elementTitle = ""; }
45167 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45167/720ab06bbd3e61e18d5307124a6905d68682a8ba/CMLCoreModule.java/buggy/src/org/openscience/cdk/io/cml/CMLCoreModule.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 14840, 12, 2624, 6748, 16, 514, 2003, 16, 514, 508, 16, 514, 1831, 13, 288, 3639, 1194, 18, 4148, 2932, 1638, 1046, 30, 315, 397, 508, 1769, 3639, 12589, 1046, 12, 529, 1769,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 14840, 12, 2624, 6748, 16, 514, 2003, 16, 514, 508, 16, 514, 1831, 13, 288, 3639, 1194, 18, 4148, 2932, 1638, 1046, 30, 315, 397, 508, 1769, 3639, 12589, 1046, 12, 529, 1769,...
switch(type) { case TYPE_GUI: return loadGUI(); case TYPE_GRAMMAR: return loadGrammar(); case TYPE_RUNTIME: return loadRuntime(); } return false;
if(type.equals(StatisticsReporter.TYPE_GRAMMAR)) return loadGrammar(); else if(type.equals(StatisticsReporter.TYPE_RUNTIME)) return loadRuntime(); else if(type.equals(StatisticsReporter.TYPE_GUI)) return loadGUI(); else return false;
public boolean load() { rawLines.clear(); switch(type) { case TYPE_GUI: return loadGUI(); case TYPE_GRAMMAR: return loadGrammar(); case TYPE_RUNTIME: return loadRuntime(); } return false; }
4430 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4430/4373ac48d4e6ad61aa9aca8f5147a3faf0373572/StatisticsManager.java/buggy/src/org/antlr/works/stats/StatisticsManager.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 1250, 1262, 1435, 288, 3639, 1831, 5763, 18, 8507, 5621, 3639, 1620, 12, 723, 13, 288, 5411, 648, 3463, 67, 43, 5370, 30, 225, 327, 1262, 43, 5370, 5621, 5411, 648, 3463, 67, 1537...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 1250, 1262, 1435, 288, 3639, 1831, 5763, 18, 8507, 5621, 3639, 1620, 12, 723, 13, 288, 5411, 648, 3463, 67, 43, 5370, 30, 225, 327, 1262, 43, 5370, 5621, 5411, 648, 3463, 67, 1537...
for (int oldIndex = 0, index = line.indexOf(CCM_ATTR_DELIMITER, 0); true; oldIndex = index + CCM_ATTR_DELIMITER.length(), index = line.indexOf(CCM_ATTR_DELIMITER, oldIndex), tokenIndex++) {
for (int oldIndex = 0, index = line.indexOf(CCM_ATTR_DELIMITER, 0); true; oldIndex = index + CCM_ATTR_DELIMITER.length(), index = line.indexOf( CCM_ATTR_DELIMITER, oldIndex), tokenIndex++) {
private String[] tokeniseEntry(String line, int maxTokens) { int minTokens = maxTokens - 1; // comment may be absent. String[] tokens = new String[maxTokens]; Arrays.fill(tokens, ""); int tokenIndex = 0; for (int oldIndex = 0, index = line.indexOf(CCM_ATTR_DELIMITER, 0); true; oldIndex = index + CCM_ATTR_DELIMITER.length(), index = line.indexOf(CCM_ATTR_DELIMITER, oldIndex), tokenIndex++) { if (tokenIndex > maxTokens) { LOG.debug("Too many tokens; skipping entry"); return null; } if (index == -1) { tokens[tokenIndex] = line.substring(oldIndex); break; } else { tokens[tokenIndex] = line.substring(oldIndex, index); } } if (tokenIndex < minTokens) { LOG.debug("Not enough tokens; skipping entry"); return null; } return tokens; }
55334 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55334/a4e72eac539061d415ca98e384ba3bec43a3c298/CMSynergy.java/buggy/main/src/net/sourceforge/cruisecontrol/sourcecontrols/CMSynergy.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 514, 8526, 1147, 784, 1622, 12, 780, 980, 16, 509, 943, 5157, 13, 288, 3639, 509, 1131, 5157, 273, 943, 5157, 300, 404, 31, 368, 2879, 2026, 506, 17245, 18, 3639, 514, 8526, 2430,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 514, 8526, 1147, 784, 1622, 12, 780, 980, 16, 509, 943, 5157, 13, 288, 3639, 509, 1131, 5157, 273, 943, 5157, 300, 404, 31, 368, 2879, 2026, 506, 17245, 18, 3639, 514, 8526, 2430,...
this.dataCapacity = dataCapacity; this.errorCodewords = errorCodewords; this.matrixWidth = matrixWidth; this.matrixHeight = matrixHeight; this.dataRegions = dataRegions;
this(rectangular, dataCapacity, errorCodewords, matrixWidth, matrixHeight, dataRegions, dataCapacity, errorCodewords);
public DataMatrixSymbolInfo(int dataCapacity, int errorCodewords, int matrixWidth, int matrixHeight, int dataRegions) { this.dataCapacity = dataCapacity; this.errorCodewords = errorCodewords; this.matrixWidth = matrixWidth; this.matrixHeight = matrixHeight; this.dataRegions = dataRegions; }
47348 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47348/ac262af72415c9e519cceced811a21b3c89b70a2/DataMatrixSymbolInfo.java/buggy/barcode4j/src/java/org/krysalis/barcode4j/impl/datamatrix/DataMatrixSymbolInfo.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 1910, 4635, 5335, 966, 12, 474, 501, 7437, 16, 509, 12079, 3753, 16, 2398, 509, 3148, 2384, 16, 509, 3148, 2686, 16, 509, 501, 17344, 13, 288, 3639, 333, 18, 892, 7437, 273, 501, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 1910, 4635, 5335, 966, 12, 474, 501, 7437, 16, 509, 12079, 3753, 16, 2398, 509, 3148, 2384, 16, 509, 3148, 2686, 16, 509, 501, 17344, 13, 288, 3639, 333, 18, 892, 7437, 273, 501, ...
Phase.MAP, hostname, trackerName, myMetrics);
TaskStatus.Phase.MAP, hostname, trackerName, myMetrics);
void lostTaskTracker(String trackerName, String hostname) { LOG.info("Lost tracker '" + trackerName + "'"); TreeSet lostTasks = (TreeSet) trackerToTaskMap.get(trackerName); trackerToTaskMap.remove(trackerName); if (lostTasks != null) { for (Iterator it = lostTasks.iterator(); it.hasNext(); ) { String taskId = (String) it.next(); TaskInProgress tip = (TaskInProgress) taskidToTIPMap.get(taskId); // Completed reduce tasks never need to be failed, because // their outputs go to dfs if (tip.isMapTask() || !tip.isComplete()) { JobInProgress job = tip.getJob(); // if the job is done, we don't want to change anything if (job.getStatus().getRunState() == JobStatus.RUNNING) { job.failedTask(tip, taskId, "Lost task tracker", Phase.MAP, hostname, trackerName, myMetrics); } } } } }
50370 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50370/1e24384b1f84e52afdfd79649a51a55574be4905/JobTracker.java/buggy/src/java/org/apache/hadoop/mapred/JobTracker.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 918, 13557, 2174, 8135, 12, 780, 9745, 461, 16, 514, 5199, 13, 288, 3639, 2018, 18, 1376, 2932, 19024, 9745, 2119, 397, 9745, 461, 397, 5862, 1769, 3639, 19461, 13557, 6685, 273, 261, 247...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 918, 13557, 2174, 8135, 12, 780, 9745, 461, 16, 514, 5199, 13, 288, 3639, 2018, 18, 1376, 2932, 19024, 9745, 2119, 397, 9745, 461, 397, 5862, 1769, 3639, 19461, 13557, 6685, 273, 261, 247...
v[0] = M.getRow(0); v[1] = M.getRow(1); v[2] = M.getRow(2);
v[0] = B.getRow(0); v[1] = B.getRow(1); v[2] = B.getRow(2);
public static Matrix sellingReducedRows(final Matrix B, final Matrix M) { if (B.numberOfRows() != 3 || B.numberOfColumns() != 3) { final String msg = "first argument must be a 3x3 matrix"; throw new IllegalArgumentException(msg); } if (M.numberOfRows() != 3 || !M.equals(M.transposed())) { final String msg = "second argument must be a symmetric 3x3 matrix"; throw new IllegalArgumentException(msg); } final Matrix v[] = new Matrix[4]; v[0] = M.getRow(0); v[1] = M.getRow(1); v[2] = M.getRow(2); v[3] = (Matrix) v[0].plus(v[1]).plus(v[2]).negative(); while (sellingStep(v, M)) { } final Matrix res = new Matrix(3, 3); res.setRow(0, v[0]); res.setRow(1, v[1]); res.setRow(2, v[2]); return res; }
9751 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/9751/8a875fd2ef9208d3edc46b67274e956f8353a330/LinearAlgebra.java/clean/src/org/gavrog/jane/numbers/LinearAlgebra.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 760, 7298, 357, 2456, 16911, 3263, 4300, 12, 6385, 7298, 605, 16, 727, 7298, 490, 13, 288, 3639, 309, 261, 38, 18, 2696, 951, 4300, 1435, 480, 890, 747, 605, 18, 2696, 951, 3380, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 760, 7298, 357, 2456, 16911, 3263, 4300, 12, 6385, 7298, 605, 16, 727, 7298, 490, 13, 288, 3639, 309, 261, 38, 18, 2696, 951, 4300, 1435, 480, 890, 747, 605, 18, 2696, 951, 3380, ...
File file_path = image_path ; String canon_path = file_path.getCanonicalPath(); String root_dir_parent = file_path.getParent(); String root_dir_name = canon_path.substring(root_dir_parent.length()); if (root_dir_name.startsWith(File.separator)) { root_dir_name = root_dir_name.substring(File.separator.length()); }
String root_dir_name = image_path.getName();
public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { String host = req.getHeader("Host") ; String imcserver = Utility.getDomainPref("adminserver",host) ; String start_url = Utility.getDomainPref( "start_url",host ) ; String image_url = Utility.getDomainPref( "image_url",host ) ; File image_path = Utility.getDomainPrefPath( "image_path",host ) ; imcode.server.User user ; String htmlStr = "" ; int meta_id ; int img_no ; res.setContentType("text/html"); PrintWriter out = res.getWriter(); String tmp = (req.getParameter("img_no") != null)?req.getParameter("img_no"):req.getParameter("img") ; //log (tmp); img_no = Integer.parseInt(tmp) ; tmp = req.getParameter("meta_id") ; //log (tmp); meta_id = Integer.parseInt(tmp) ; // Check if ChangeImage is invoked by ImageBrowse, hence containing // an image filename as option value (M. Wallin) String img_preset = (req.getParameter("imglist") == null)?"":java.net.URLDecoder.decode(req.getParameter("imglist")); /* Enumeration logga = req.getParameterNames(); while(logga.hasMoreElements()) log("PARAMETER: " + logga.nextElement()); */ // Get the session HttpSession session = req.getSession(true); // Does the session indicate this user already logged in? Object done = session.getValue("logon.isDone"); // marker object user = (imcode.server.User)done ; //log ("a") ; if (done == null) { // No logon.isDone means he hasn't logged in. // Save the request URL as the true target and redirect to the login page. String scheme = req.getScheme(); String serverName = req.getServerName(); int p = req.getServerPort(); String port = (p == 80) ? "" : ":" + p; res.sendRedirect(scheme + "://" + serverName + port + start_url) ; return ; } //log ("b") ; // Check if user has write rights if ( !IMCServiceRMI.checkDocAdminRights(imcserver, meta_id, user) ) { log("User "+user.getInt("user_id")+" was denied access to meta_id "+meta_id+" and was sent to "+start_url) ; String scheme = req.getScheme() ; String serverName = req.getServerName() ; int p = req.getServerPort() ; String port = ( p == 80 ) ? "" : ":" + p ; res.sendRedirect( scheme + "://" + serverName + port + start_url ) ; return ; } //log ("c") ; //*lets get some path we need later on File file_path = image_path ; String canon_path = file_path.getCanonicalPath();//ex: C:\Tomcat3\webapps\imcms\images String root_dir_parent = file_path.getParent();//ex: c:\Tomcat3\webapps\imcms String root_dir_name = canon_path.substring(root_dir_parent.length()); if (root_dir_name.startsWith(File.separator)) { root_dir_name = root_dir_name.substring(File.separator.length()); //ex: root_dir_name = images } //*lets get the dirlist, and add the rootdir to it List imageFolders = GetImages.getImageFolders(file_path, true) ; imageFolders.add(0,file_path); //ok we have the list, now lets setup the option list StringBuffer folderOptions = new StringBuffer(); for(int i=0;i<imageFolders.size();i++) { File fileObj = (File) imageFolders.get(i); //ok lets set up the folder name to show and the one to put as value String optionName = fileObj.getCanonicalPath(); //lets remove the start of the path so we end up at the rootdir. if (optionName.startsWith(canon_path)) { optionName = optionName.substring(root_dir_parent.length()) ; if (optionName.startsWith(File.separator)) { optionName = optionName.substring(File.separator.length()) ; } }else if(optionName.startsWith(File.separator)) { optionName = optionName.substring(File.separator.length()) ; } //the path to put in the option value String optionPath = optionName; if (optionPath.startsWith(root_dir_name)) { optionPath = optionPath.substring(root_dir_name.length()); } System.out.println("optionPath: "+optionPath); //ok now we have to replace all parent folders with a '-' char StringTokenizer token = new StringTokenizer(optionName,"\\",false); StringBuffer buff = new StringBuffer(""); if (token.countTokens() > 2) { //lets only allowe one dir down from imageroot break; } while ( token.countTokens() > 1 ) { String temp = token.nextToken(); buff.append("&nbsp;&nbsp;-"); } if (token.countTokens() > 0) { optionName = buff.toString()+token.nextToken(); } File urlFile = new File(optionName) ; String fileName = urlFile.getName() ; File parentDir = urlFile.getParentFile() ; if (parentDir != null) { optionName = parentDir.getPath()+"/" ; } else { optionName = "" ; } //filepathfix ex: images\nisse\kalle.gif to images/nisse/kalle.gif optionName = optionName.replace(File.separatorChar,'/')+fileName ; StringTokenizer tokenizer = new StringTokenizer(optionName, "/", true); StringBuffer filePathSb = new StringBuffer(); StringBuffer displayFolderName = new StringBuffer(); //the URLEncoder.encode() method replaces '/' whith "%2F" and the can't be red by the browser //that's the reason for the while-loop. while ( tokenizer.countTokens() > 0 ) { String temp = tokenizer.nextToken(); if (temp.length() > 1) { filePathSb.append(java.net.URLEncoder.encode(temp)); }else { filePathSb.append(temp); } } optionName = optionName.replace('-','\\');//Gud strul String parsedFilePath = filePathSb.toString() ; folderOptions.append("<option value=\"" + optionPath + "\">" + optionName + "</option>\r\n"); session.setAttribute("imageFolderOptionList",folderOptions.toString()); }//end for loop String sqlStr = "select image_name,imgurl,width,height,border,v_space,h_space,target,target_name,align,alt_text,low_scr,linkurl from images where meta_id = "+meta_id+" and name = "+img_no ; String[] sql = IMCServiceRMI.sqlQuery(imcserver,sqlStr) ; //log ("d") ; Vector vec = new Vector () ; String imageName = ("".equals(img_preset)&&sql.length>0?sql[1]:img_preset); // selected OPTION or "" //**************************************************************** ImageFileMetaData image = new ImageFileMetaData(new File(image_path,imageName)) ; int width = image.getWidth() ; int height = image.getHeight() ; //**************************************************************** imageName = imageName ; if ( sql.length > 0 ) { int current_width = 0 ; try { current_width = Integer.parseInt(img_preset.equals("")?sql[2]:"" + width) ; } catch ( NumberFormatException ex ) { } int current_height = 0 ; try { current_height = Integer.parseInt(img_preset.equals("")?sql[3]:"" + height) ; } catch ( NumberFormatException ex ) { } int aspect = 0 ; if (current_width * current_height != 0) { aspect = 100 * current_width / current_height ; } String keepAspect = "checked" ; if (width * height != 0 && aspect != (100 * width / height)) { keepAspect = "" ; } //log("sql.lenght > 0"); vec.add("#imgName#") ; vec.add(sql[0]) ; vec.add("#imgRef#") ; vec.add(imageName); vec.add("#imgWidth#") ; vec.add(current_width!=0?""+current_width:""+width); vec.add("#origW#"); // original imageWidth vec.add("" + width); vec.add("#imgHeight#") ; vec.add(current_height!=0?""+current_height:""+height); vec.add("#origH#"); vec.add("" + height); // original imageHeight vec.add("#keep_aspect#") ; vec.add(keepAspect) ; vec.add("#imgBorder#") ; vec.add(sql[4]) ; vec.add("#imgVerticalSpace#") ; vec.add(sql[5]) ; vec.add("#imgHorizontalSpace#") ; vec.add(sql[6]) ; if ( "_top".equals(sql[7]) ) { vec.add("#target_name#") ; vec.add("") ; vec.add("#top_checked#") ; } else if ( "_self".equals(sql[7]) ) { vec.add("#target_name#") ; vec.add("") ; vec.add("#self_checked#") ; } else if ( "_blank".equals(sql[7]) ) { vec.add("#target_name#") ; vec.add("") ; vec.add("#blank_checked#") ; } else if ( "_parent".equals(sql[7]) ) { vec.add("#target_name#") ; vec.add("") ; vec.add("#blank_checked#") ; } else { vec.add("#target_name#") ; vec.add(sql[8]) ; vec.add("#other_checked#") ; } vec.add("selected") ; if ( "baseline".equals(sql[9]) ) { vec.add("#baseline_selected#") ; } else if ( "top".equals(sql[9]) ) { vec.add("#top_selected#") ; } else if ( "middle".equals(sql[9]) ) { vec.add("#middle_selected#") ; } else if ( "bottom".equals(sql[9]) ) { vec.add("#bottom_selected#") ; } else if ( "texttop".equals(sql[9]) ) { vec.add("#texttop_selected#") ; } else if ( "absmiddle".equals(sql[9]) ) { vec.add("#absmiddle_selected#") ; } else if ( "absbottom".equals(sql[9]) ) { vec.add("#absbottom_selected#") ; } else if ( "left".equals(sql[9]) ) { vec.add("#left_selected#") ; } else if ( "right".equals(sql[9]) ) { vec.add("#right_selected#") ; } else { vec.add("#none_selected#") ; } vec.add("selected") ; vec.add("#imgAltText#") ; vec.add(sql[10]) ; vec.add("#imgLowScr#") ; vec.add(sql[11]) ; vec.add("#imgRefLink#") ; vec.add(sql[12]) ; } else { vec.add("#imgName#") ; vec.add("") ; vec.add("#imgRef#") ; vec.add(imageName); vec.add("#imgWidth#") ; vec.add("" + width) ; vec.add("#imgHeight#") ; vec.add("" + height) ; vec.add("#origW#"); vec.add("" + width); vec.add("#origH#"); vec.add("" + height); vec.add("#imgBorder#") ; vec.add("0") ; vec.add("#imgVerticalSpace#") ; vec.add("0") ; vec.add("#imgHorizontalSpace#") ; vec.add("0") ; vec.add("#target_name#") ; vec.add("") ; vec.add("#self_checked#") ; vec.add("selected") ; vec.add("#top_selected#") ; vec.add("selected") ; vec.add("#imgAltText#") ; vec.add("") ; vec.add("#imgLowScr#") ; vec.add("") ; vec.add("#imgRefLink#") ; vec.add("") ; } vec.add("#imgUrl#") ; vec.add(image_url) ; vec.add("#getMetaId#") ; vec.add(String.valueOf(meta_id)) ; vec.add("#img_no#") ; vec.add(String.valueOf(img_no)) ; vec.add("#folders#"); vec.add(folderOptions.toString()); //log ("e") ; String lang_prefix = IMCServiceRMI.sqlQueryStr(imcserver, "select lang_prefix from lang_prefixes where lang_id = "+user.getInt("lang_id")) ; //log ("f") ; htmlStr = IMCServiceRMI.parseDoc(imcserver,vec,"change_img.html", lang_prefix) ; //log ("g") ; //htmlStr = IMCServiceRMI.interpretAdminTemplate(imcserver,meta_id,user,"change_img.html",img_no,0,0,0) ; out.print(htmlStr) ; }
8781 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8781/55326d0777ef49274a7625825e9cc73bc2ac1854/ChangeImage.java/buggy/servlets/ChangeImage.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 23611, 12, 2940, 18572, 1111, 16, 12446, 400, 13, 1216, 16517, 16, 1860, 288, 202, 202, 780, 1479, 1875, 202, 33, 1111, 18, 588, 1864, 2932, 2594, 7923, 274, 202, 202, 78...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 23611, 12, 2940, 18572, 1111, 16, 12446, 400, 13, 1216, 16517, 16, 1860, 288, 202, 202, 780, 1479, 1875, 202, 33, 1111, 18, 588, 1864, 2932, 2594, 7923, 274, 202, 202, 78...
if(nodeList.contains(m.getOriginator().toString())||
/* if(nodeList.contains(m.getOriginator().toString())||
public void receiveMessage(Message m) { if(mtc == null) { log.warn("Message Transport Client is null"); return; } if(log.isDebugEnabled()) { log.debug("Received message of Access agent proxy in :" + getMessageAddress().toString() +" : "+ m.toString()); } if (m instanceof MessageWithTrust ) { if(log.isDebugEnabled()) { log.debug(" Got instance of MWT"); } MessageWithTrust mwt = (MessageWithTrust)m; if (mwt == null) { if(log.isWarnEnabled()) { log.warn("Message to " + mtc.getMessageAddress().toString() + " not delivered (null msg)"); } } Message contents =mwt.getMessage(); TrustSet tset[] = mwt.getTrusts(); if(contents==null) { publishMessageFailure(m.getOriginator().toString(), m.getTarget().toString(), MessageFailureEvent.INVALID_MESSAGE_CONTENTS, m.toString()); if(log.isWarnEnabled()) { log.warn("Rejecting incoming messagewithtrust. Null message content" + m.toString()); } return; } // Check verb of incoming message checkInVerbs(contents); // Update TrustSet of incoming message // The sender is allowed to provide a TrustSet, but the receiver // does not necessarily trust the sender. The receiver needs to // update the TrustSet to reflet its view of the TrustSet. if(!incomingTrust(contents, tset)){ publishMessageFailure(m.getOriginator().toString(), m.getTarget().toString(), MessageFailureEvent.INVALID_MESSAGE_CONTENTS, m.toString()); if(log.isWarnEnabled()) { log.warn("Rejecting incoming messagewithtrust. trust invalid." + m.toString()); } } String failureIfOccurred = null; if(!incomingMessageAction(contents, tset[0])) { failureIfOccurred = MessageFailureEvent.SETASIDE_INCOMING_MESSAGE_ACTION; if (log.isWarnEnabled()) { log.warn("Rejecting incoming messagewithtrust : " + m.toString()); } } else if(!incomingAgentAction(contents)) { failureIfOccurred = MessageFailureEvent.SETASIDE_INCOMING_AGENT_ACTION; if (log.isWarnEnabled()) log.warn("Rejecting incoming messagewithtrust : " + m.toString()); } if(failureIfOccurred != null) { // a failure has occurred. publish idmef message and return publishMessageFailure(m.getOriginator().toString(), m.getTarget().toString(), failureIfOccurred, m.toString()); return; } if(log.isDebugEnabled()) { log.debug("DONE receiving Message from Access Agent proxy" + contents.toString()); } mtc.receiveMessage(contents); return; } else { //check to see if any node agent is involved. if(nodeList.contains(m.getOriginator().toString())|| nodeList.contains(m.getTarget().toString())){ //no wrapping with trust mtc.receiveMessage(m); if(log.isDebugEnabled()){ log.debug("handling no wrapping with trust for node agent." + m); } return; } else { if (log.isDebugEnabled()) { log.debug("Wrapping trust, it is not wrapped in a MessageWithTrust: " + m.toString()); } int len; if(m instanceof DirectiveMessage){ Directive directive[] = ((DirectiveMessage)m).getDirectives(); len = directive.length; } else{ len = 1; } TrustSet[] ts = new TrustSet[len]; for(int i = 0; i < len; i++) { ts[i] = makeLowestTrust(); } MessageWithTrust newMessage = new MessageWithTrust(m, ts); receiveMessage(newMessage); if (log.isDebugEnabled()) { log.debug("Wrapping message:" + m + "with lowest Trust."); } return; } } }
12869 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12869/5cca6021b29f6895a8dce25becfc127f12241945/AccessAgentProxy.java/clean/securityservices/src/org/cougaar/core/security/access/AccessAgentProxy.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 918, 6798, 1079, 12, 1079, 312, 13, 225, 288, 565, 309, 12, 1010, 71, 422, 446, 13, 288, 1377, 613, 18, 8935, 2932, 1079, 9514, 2445, 353, 446, 8863, 1377, 327, 31, 565, 289, 56...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 918, 6798, 1079, 12, 1079, 312, 13, 225, 288, 565, 309, 12, 1010, 71, 422, 446, 13, 288, 1377, 613, 18, 8935, 2932, 1079, 9514, 2445, 353, 446, 8863, 1377, 327, 31, 565, 289, 56...
public String getXML() { StringBuffer retval = new StringBuffer(); retval.append(" "+XMLHandler.addTagValue("table", tablename)); //$NON-NLS-1$ //$NON-NLS-2$ retval.append(" "+XMLHandler.addTagValue("connection", database==null?"":database.getName())); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ retval.append(" "+XMLHandler.addTagValue("commit", commitSize)); //$NON-NLS-1$ //$NON-NLS-2$ retval.append(" "+XMLHandler.addTagValue("replace", replaceFields)); //$NON-NLS-1$ //$NON-NLS-2$ retval.append(" "+XMLHandler.addTagValue("crc", useHash)); //$NON-NLS-1$ //$NON-NLS-2$ retval.append(" "+XMLHandler.addTagValue("crcfield", hashField)); //$NON-NLS-1$ //$NON-NLS-2$ retval.append(" <fields>"+Const.CR); //$NON-NLS-1$ for (int i=0;i<keyField.length;i++) { retval.append(" <key>"+Const.CR); //$NON-NLS-1$ retval.append(" "+XMLHandler.addTagValue("name", keyField[i])); //$NON-NLS-1$ //$NON-NLS-2$ retval.append(" "+XMLHandler.addTagValue("lookup", keyLookup[i])); //$NON-NLS-1$ //$NON-NLS-2$ retval.append(" </key>"+Const.CR); //$NON-NLS-1$ } retval.append(" <return>"+Const.CR); //$NON-NLS-1$ retval.append(" "+XMLHandler.addTagValue("name", technicalKeyField)); //$NON-NLS-1$ //$NON-NLS-2$ retval.append(" "+XMLHandler.addTagValue("use_autoinc", useAutoinc)); //$NON-NLS-1$ //$NON-NLS-2$ retval.append(" </return>"+Const.CR); //$NON-NLS-1$ retval.append(" </fields>"+Const.CR); //$NON-NLS-1$ // If sequence is empty: use auto-increment field! retval.append(" "+XMLHandler.addTagValue("sequence", sequenceFrom)); //$NON-NLS-1$ //$NON-NLS-2$ return retval.toString(); }
58146 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/58146/e76efd6e9392ea1c11d8c3e17389017033b36e46/CombinationLookupMeta.java/buggy/kettle/src/be/ibridge/kettle/trans/step/combinationlookup/CombinationLookupMeta.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 514, 336, 4201, 1435, 202, 95, 3639, 6674, 5221, 273, 394, 6674, 5621, 9506, 202, 18341, 18, 6923, 2932, 1377, 13773, 4201, 1503, 18, 1289, 1805, 620, 2932, 2121, 3113, 19096, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 514, 336, 4201, 1435, 202, 95, 3639, 6674, 5221, 273, 394, 6674, 5621, 9506, 202, 18341, 18, 6923, 2932, 1377, 13773, 4201, 1503, 18, 1289, 1805, 620, 2932, 2121, 3113, 19096, 1...
return new DERTaggedObject(this.isConstructed(), _tagNumber, new DERSequence(v));
return new DERTaggedObject(false, _tagNumber, new DERSequence(v));
public DERObject getDERObject() { if (_indefiniteLength) { ASN1EncodableVector v = rLoadVector(_contentStream); if (v.size() > 1) { return new BERTaggedObject(this.isConstructed(), _tagNumber, new BERSequence(v)); } else if (v.size() == 1) { return new BERTaggedObject(this.isConstructed(), _tagNumber, v.get(0)); } else { return new BERTaggedObject(this.isConstructed(), _tagNumber, null); } } else { if (this.isConstructed()) { ASN1EncodableVector v = rLoadVector(_contentStream); if (v.size() > 1) { return new DERTaggedObject(this.isConstructed(), _tagNumber, new DERSequence(v)); } else if (v.size() == 1) { return new DERTaggedObject(this.isConstructed(), _tagNumber, v.get(0)); } else { return new DERTaggedObject(this.isConstructed(), _tagNumber, null); } } try { return new DERTaggedObject(false, _tagNumber, new DEROctetString(((DefiniteLengthInputStream)_contentStream).toByteArray())); } catch (IOException e) { throw new IllegalStateException(e.getMessage()); } } }
53000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53000/ec0e8b3db1a5dfd68dd8a015fa98af2c8dfa1d35/BERTaggedObjectParser.java/buggy/crypto/src/org/bouncycastle/asn1/BERTaggedObjectParser.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 21801, 921, 2343, 654, 921, 1435, 565, 288, 3639, 309, 261, 67, 267, 5649, 1137, 1782, 13, 3639, 288, 5411, 18598, 21, 25100, 429, 5018, 331, 273, 436, 2563, 5018, 24899, 1745, 1228...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 21801, 921, 2343, 654, 921, 1435, 565, 288, 3639, 309, 261, 67, 267, 5649, 1137, 1782, 13, 3639, 288, 5411, 18598, 21, 25100, 429, 5018, 331, 273, 436, 2563, 5018, 24899, 1745, 1228...
catch (Exception e) {
if (s.charAt(0) != '@')
public PopURL(String s) throws MalformedURLException { if (!s.startsWith("pop://")) throw new MalformedURLException(); s = s.substring(6); port = DEFAULT_PORT; int index = s.indexOf(':'); if (index >= 0) { try { port = Integer.parseInt(s.substring(index + 1)); } catch (Exception e) { throw new MalformedURLException(); } s = s.substring(0, index); } index = s.indexOf('@'); if (index >= 0) { user = s.substring(0, index); host = s.substring(index + 1); } else { user = s; host = "127.0.0.1"; } }
8279 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8279/91712c1c66f240069f17f9631334944c2d0290df/PopURL.java/clean/j/src/org/armedbear/j/mail/PopURL.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 10264, 1785, 12, 780, 272, 13, 1216, 20710, 565, 288, 3639, 309, 16051, 87, 18, 17514, 1190, 2932, 5120, 14334, 3719, 5411, 604, 394, 20710, 5621, 3639, 272, 273, 272, 18, 28023, 12...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 10264, 1785, 12, 780, 272, 13, 1216, 20710, 565, 288, 3639, 309, 16051, 87, 18, 17514, 1190, 2932, 5120, 14334, 3719, 5411, 604, 394, 20710, 5621, 3639, 272, 273, 272, 18, 28023, 12...
if (defaultEditors == null || defaultEditors.length() == 0) return;
if (defaultEditors == null || defaultEditors.length() == 0) { return; }
private void setProductDefaults(String defaultEditors) { if (defaultEditors == null || defaultEditors.length() == 0) return; StringTokenizer extEditors = new StringTokenizer(defaultEditors, new Character(IPreferenceConstants.SEPARATOR).toString()); while (extEditors.hasMoreTokens()) { String extEditor = extEditors.nextToken().trim(); int index = extEditor.indexOf(':'); if (extEditor.length() < 3 || index <= 0 || index >= (extEditor.length() - 1)) { //Extension and id must have at least one char. WorkbenchPlugin .log("Error setting default editor. Could not parse '" + extEditor + "'. Default editors should be specified as '*.ext1:editorId1;*.ext2:editorId2'"); //$NON-NLS-1$ //$NON-NLS-2$ return; } String ext = extEditor.substring(0, index).trim(); String editorId = extEditor.substring(index + 1).trim(); FileEditorMapping mapping = getMappingFor(ext); if (mapping == null) { WorkbenchPlugin .log("Error setting default editor. Could not find mapping for '" + ext + "'."); //$NON-NLS-1$ //$NON-NLS-2$ continue; } EditorDescriptor editor = (EditorDescriptor) findEditor(editorId); if (editor == null) { WorkbenchPlugin .log("Error setting default editor. Could not find editor: '" + editorId + "'."); //$NON-NLS-1$ //$NON-NLS-2$ continue; } mapping.setDefaultEditor(editor); } }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/fa4a8cff0e027f8d3c6b1fcb92b30f46767dd191/EditorRegistry.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 918, 444, 4133, 7019, 12, 780, 805, 4666, 1383, 13, 288, 3639, 309, 261, 1886, 4666, 1383, 422, 446, 747, 805, 4666, 1383, 18, 2469, 1435, 422, 374, 13, 5411, 327, 31, 3639, 16370...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 918, 444, 4133, 7019, 12, 780, 805, 4666, 1383, 13, 288, 3639, 309, 261, 1886, 4666, 1383, 422, 446, 747, 805, 4666, 1383, 18, 2469, 1435, 422, 374, 13, 5411, 327, 31, 3639, 16370...
/*this.getContentPane().setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); this.getContentPane().add(_topPanel); this.getContentPane().add(Box.createGlue()); this.getContentPane().add(_stackTraceScroll);*/
public UncaughtExceptionWindow(Throwable exception) { _exception = exception; this.setSize(600,400); this.setLocation(200,200); Insets ins = new Insets(20,20,20,20); // If we set this pane to be of type text/rtf, it wraps based on words // as opposed to based on characters. _stackTrace = new JTextArea(_getStackTraceString()); //_stackTrace.setPreferredSize(new Dimension(400, 250)); _stackTrace.setBackground(Color.gray.brighter()); _stackTrace.setMargin(ins); _exceptionInfo = new JTextArea(_getExceptionString()); _exceptionInfo.setBackground(Color.gray.brighter()); _exceptionInfo.setMargin(ins); //_exceptionInfo.setPreferredSize(new Dimension(300, 100)); // set text in _exceptionInfo JEditorPane //String exceptionString = _getExceptionString(); //_exceptionInfo.setText(exceptionString); _exceptionInfo.setEditable(false); // set text in _stackTrace JEditorPane //String stackTraceString = _getStackTraceString(); //_stackTrace.setText(stackTraceString); _stackTrace.setEditable(false); _okButton = new JButton(_okAction); _okPanel = new JPanel(new BorderLayout()); _okPanel.add(_okButton, BorderLayout.SOUTH); _okPanel.setBackground(Color.gray.brighter()); _topPanel = new JPanel(new BorderLayout()); _topPanel.add(_exceptionInfo, BorderLayout.CENTER); _topPanel.add(_okPanel, BorderLayout.EAST); _stackTraceScroll = new JScrollPane(_stackTrace, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); /*this.getContentPane().setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); this.getContentPane().add(_topPanel); this.getContentPane().add(Box.createGlue()); this.getContentPane().add(_stackTraceScroll);*/ this.getContentPane().setLayout(new BorderLayout()); this.getContentPane().add(_topPanel, BorderLayout.NORTH); this.getContentPane().add(_stackTraceScroll, BorderLayout.CENTER); this.setTitle("Uncaught Exception"); this.setVisible(true); //this.pack(); }
11192 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/11192/796b0e638d56097e8f7b988621a4d11f743acc52/UncaughtExceptionWindow.java/buggy/drjava/src/edu/rice/cs/drjava/ui/UncaughtExceptionWindow.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 1351, 27611, 503, 3829, 12, 15155, 1520, 13, 288, 565, 389, 4064, 273, 1520, 31, 3639, 333, 18, 542, 1225, 12, 28133, 16, 16010, 1769, 565, 333, 18, 542, 2735, 12, 6976, 16, 6976,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 1351, 27611, 503, 3829, 12, 15155, 1520, 13, 288, 565, 389, 4064, 273, 1520, 31, 3639, 333, 18, 542, 1225, 12, 28133, 16, 16010, 1769, 565, 333, 18, 542, 2735, 12, 6976, 16, 6976,...
if (this.showTotalsOnly() && this.showAsTable().equals("true")) {
if (this.showTotalsOnly() && this.showAsTable()) {
public boolean showTotalsOnlyAsTable() { if (this.showTotalsOnly() && this.showAsTable().equals("true")) { return true; } return false; }
17168 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/17168/098f97d7c256e52a9f6c9385bd12a5f645b22d6d/WRRecordGroup.java/buggy/DynaReporting/Frameworks/WRReporting/Sources/er/reporting/WRRecordGroup.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 1250, 2405, 31025, 3386, 1463, 1388, 1435, 288, 3639, 309, 261, 2211, 18, 4500, 31025, 3386, 1435, 597, 333, 18, 4500, 1463, 1388, 10756, 288, 5411, 327, 638, 31, 3639, 289, 3639, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 1250, 2405, 31025, 3386, 1463, 1388, 1435, 288, 3639, 309, 261, 2211, 18, 4500, 31025, 3386, 1435, 597, 333, 18, 4500, 1463, 1388, 10756, 288, 5411, 327, 638, 31, 3639, 289, 3639, 3...
routingTable.getRoute(packet.getFrom()).process(packet);
routingTable.getRoute(packet.getFrom()).process(reply);
private void handle(IQ packet) { JID recipientJID = packet.getTo(); try { // Check for registered components, services or remote servers if (recipientJID != null) { try { RoutableChannelHandler serviceRoute = routingTable.getRoute(recipientJID); if (!(serviceRoute instanceof ClientSession)) { // A component/service/remote server was found that can handle the Packet serviceRoute.process(packet); return; } } catch (NoSuchRouteException e) { // Do nothing. Continue looking for a handler } } if (isLocalServer(recipientJID)) { // Let the server handle the Packet Element childElement = packet.getChildElement(); String namespace = null; if (childElement != null) { namespace = childElement.getNamespaceURI(); } if (namespace == null) { if (packet.getType() != IQ.Type.result) { // Do nothing. We can't handle queries outside of a valid namespace Log.warn("Unknown packet " + packet); } } else { IQHandler handler = getHandler(namespace); if (handler == null) { IQ reply = IQ.createResultIQ(packet); if (recipientJID == null) { // Answer an error since the server can't handle the requested namespace reply.setChildElement(packet.getChildElement().createCopy()); reply.setError(PacketError.Condition.service_unavailable); } else if (recipientJID.getNode() == null || "".equals(recipientJID.getNode())) { // Answer an error if JID is of the form <domain> reply.setChildElement(packet.getChildElement().createCopy()); reply.setError(PacketError.Condition.feature_not_implemented); } else { // JID is of the form <node@domain> // Answer an error since the server can't handle packets sent to a node reply.setChildElement(packet.getChildElement().createCopy()); reply.setError(PacketError.Condition.service_unavailable); } try { // Locate a route to the sender of the IQ and ask it to process // the packet. Use the routingTable so that routes to remote servers // may be found routingTable.getRoute(packet.getFrom()).process(packet); } catch (NoSuchRouteException e) { // No root was found so try looking for local sessions that have never // sent an available presence or haven't authenticated yet Session session = sessionManager.getSession(packet.getFrom()); if (session != null) { session.process(reply); } else { Log.warn("Packet could not be delivered " + packet); } } } else { handler.process(packet); } } } else { // JID is of the form <node@domain/resource> boolean handlerFound = false; // IQ packets should be sent to users even before they send an available presence. // So if the target address belongs to this server then use the sessionManager // instead of the routingTable since unavailable clients won't have a route to them if (XMPPServer.getInstance().isLocal(recipientJID)) { Session session = sessionManager.getBestRoute(recipientJID); if (session != null) { session.process(packet); handlerFound = true; } else { Log.info("Packet sent to unreachable address " + packet); } } else { try { ChannelHandler route = routingTable.getRoute(recipientJID); route.process(packet); handlerFound = true; } catch (NoSuchRouteException e) { Log.info("Packet sent to unreachable address " + packet); } } // If a route to the target address was not found then try to answer a // service_unavailable error code to the sender of the IQ packet if (!handlerFound && IQ.Type.result != packet.getType()) { IQ reply = IQ.createResultIQ(packet); reply.setChildElement(packet.getChildElement().createCopy()); reply.setError(PacketError.Condition.service_unavailable); try { // Locate a route to the sender of the IQ and ask it to process // the packet. Use the routingTable so that routes to remote servers // may be found routingTable.getRoute(packet.getFrom()).process(reply); } catch (NoSuchRouteException e) { // No root was found so try looking for local sessions that have never // sent an available presence or haven't authenticated yet Session session = sessionManager.getSession(packet.getFrom()); if (session != null) { session.process(reply); } else { Log.warn("Packet could not be delivered " + reply); } } } } } catch (Exception e) { Log.error(LocaleUtils.getLocalizedString("admin.error.routing"), e); Session session = sessionManager.getSession(packet.getFrom()); if (session != null) { Connection conn = session.getConnection(); if (conn != null) { conn.close(); } } } }
6312 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6312/0cdab8d704af9fb9618d7b0c5e2fb29f4e812116/IQRouter.java/clean/src/java/org/jivesoftware/messenger/IQRouter.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 918, 1640, 12, 45, 53, 4414, 13, 288, 3639, 804, 734, 8027, 46, 734, 273, 4414, 18, 588, 774, 5621, 3639, 775, 288, 5411, 368, 2073, 364, 4104, 4085, 16, 4028, 578, 2632, 7084, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 918, 1640, 12, 45, 53, 4414, 13, 288, 3639, 804, 734, 8027, 46, 734, 273, 4414, 18, 588, 774, 5621, 3639, 775, 288, 5411, 368, 2073, 364, 4104, 4085, 16, 4028, 578, 2632, 7084, ...
}, getLocale( ) ) );
}, getLocale( ) ) );
public void setProperty( String sProperty, Object oValue ) { if ( sProperty.equals( IDeviceRenderer.UPDATE_NOTIFIER ) ) { _iun = (IUpdateNotifier) oValue; _lhmAllTriggers.clear( ); Object obj = _iun.peerInstance( ); if ( obj instanceof JComponent ) { JComponent jc = (JComponent) obj; MouseListener[] mla = jc.getMouseListeners( ); for ( int i = 0; i < mla.length; i++ ) { if ( mla[i] instanceof SwingEventHandler ) { jc.removeMouseListener( mla[i] ); } } MouseMotionListener[] mmla = jc.getMouseMotionListeners( ); for ( int i = 0; i < mmla.length; i++ ) { if ( mmla[i] instanceof SwingEventHandler ) { jc.removeMouseMotionListener( mmla[i] ); } } KeyListener[] kla = jc.getKeyListeners( ); for ( int i = 0; i < kla.length; i++ ) { if ( kla[i] instanceof SwingEventHandler ) { jc.removeKeyListener( kla[i] ); } } _eh = new SwingEventHandler( _lhmAllTriggers, _iun, getLocale( ) ); jc.addMouseListener( _eh ); jc.addMouseMotionListener( _eh ); jc.addKeyListener( _eh ); } } else if ( sProperty.equals( IDeviceRenderer.GRAPHICS_CONTEXT ) ) { _g2d = (Graphics2D) oValue; _g2d.setRenderingHint( RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON ); _g2d.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON ); _g2d.setRenderingHint( RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON ); _g2d.setRenderingHint( RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY ); // _frc = new FontRenderContext(new AffineTransform(), true, false); logger.log( ILogger.INFORMATION, Messages.getString( "info.using.graphics.context", //$NON-NLS-1$ new Object[]{ _g2d }, getLocale( ) ) ); } else if ( sProperty.equals( IDeviceRenderer.DPI_RESOLUTION ) ) { getDisplayServer( ).setDpiResolution( ( (Integer) oValue ).intValue( ) ); } }
46013 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46013/153018b387fe5753058486f0593a2e2b0b1098ac/SwingRendererImpl.java/buggy/chart/org.eclipse.birt.chart.device.extension/src/org/eclipse/birt/chart/device/swing/SwingRendererImpl.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 7486, 12, 514, 272, 1396, 16, 1033, 320, 620, 262, 202, 95, 202, 202, 430, 261, 272, 1396, 18, 14963, 12, 467, 3654, 6747, 18, 8217, 67, 4400, 10591, 262, 262, 202, 202...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 7486, 12, 514, 272, 1396, 16, 1033, 320, 620, 262, 202, 95, 202, 202, 430, 261, 272, 1396, 18, 14963, 12, 467, 3654, 6747, 18, 8217, 67, 4400, 10591, 262, 262, 202, 202...
this.fill = fill; this.outline = outline;
this.fill = fill == null ? null : new RGB(fill.red, fill.green, fill.blue); this.outline = outline == null ? null : new RGB(outline.red, outline.green, outline.blue);
public void setValues( int width, int height, Color fill, Color outline, boolean maintainAspectRatio, boolean antialias) { this.width = width; this.height = height; this.fill = fill; this.outline = outline; this.maintainAspectRatio = maintainAspectRatio; this.antialias = antialias; }
1758 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1758/9991cff9f519ab194c501d79cde113d1f0946c5e/RenderInfoImpl.java/buggy/org.eclipse.gmf.runtime/plugins/org.eclipse.gmf.runtime.draw2d.ui.render/src/org/eclipse/gmf/runtime/draw2d/ui/render/internal/factory/RenderInfoImpl.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 27466, 12, 202, 202, 474, 1835, 16, 202, 202, 474, 2072, 16, 202, 202, 2957, 3636, 16, 5563, 16363, 16, 202, 202, 6494, 17505, 17468, 8541, 16, 202, 202, 6494, 17841, 649...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 27466, 12, 202, 202, 474, 1835, 16, 202, 202, 474, 2072, 16, 202, 202, 2957, 3636, 16, 5563, 16363, 16, 202, 202, 6494, 17505, 17468, 8541, 16, 202, 202, 6494, 17841, 649...
return new org.quickfix.fix40.ListExecute();
return new quickfix.fix40.ListExecute();
public Message create( String beginString, String msgType ) { if("0".equals(msgType)) { return new org.quickfix.fix40.Heartbeat(); } if("A".equals(msgType)) { return new org.quickfix.fix40.Logon(); } if("1".equals(msgType)) { return new org.quickfix.fix40.TestRequest(); } if("2".equals(msgType)) { return new org.quickfix.fix40.ResendRequest(); } if("3".equals(msgType)) { return new org.quickfix.fix40.Reject(); } if("4".equals(msgType)) { return new org.quickfix.fix40.SequenceReset(); } if("5".equals(msgType)) { return new org.quickfix.fix40.Logout(); } if("7".equals(msgType)) { return new org.quickfix.fix40.Advertisement(); } if("6".equals(msgType)) { return new org.quickfix.fix40.IndicationofInterest(); } if("B".equals(msgType)) { return new org.quickfix.fix40.News(); } if("C".equals(msgType)) { return new org.quickfix.fix40.Email(); } if("R".equals(msgType)) { return new org.quickfix.fix40.QuoteRequest(); } if("S".equals(msgType)) { return new org.quickfix.fix40.Quote(); } if("D".equals(msgType)) { return new org.quickfix.fix40.NewOrderSingle(); } if("8".equals(msgType)) { return new org.quickfix.fix40.ExecutionReport(); } if("Q".equals(msgType)) { return new org.quickfix.fix40.DontKnowTrade(); } if("G".equals(msgType)) { return new org.quickfix.fix40.OrderCancelReplaceRequest(); } if("F".equals(msgType)) { return new org.quickfix.fix40.OrderCancelRequest(); } if("9".equals(msgType)) { return new org.quickfix.fix40.OrderCancelReject(); } if("H".equals(msgType)) { return new org.quickfix.fix40.OrderStatusRequest(); } if("J".equals(msgType)) { return new org.quickfix.fix40.Allocation(); } if("P".equals(msgType)) { return new org.quickfix.fix40.AllocationACK(); } if("E".equals(msgType)) { return new org.quickfix.fix40.NewOrderList(); } if("N".equals(msgType)) { return new org.quickfix.fix40.ListStatus(); } if("L".equals(msgType)) { return new org.quickfix.fix40.ListExecute(); } if("K".equals(msgType)) { return new org.quickfix.fix40.ListCancelRequest(); } if("M".equals(msgType)) { return new org.quickfix.fix40.ListStatusRequest(); } return new org.quickfix.fix40.Message(); }
8803 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8803/fecc27f98261270772ff182a1d4dfd94b5daa73d/MessageFactory.java/buggy/src/java/src/quickfix/fix40/MessageFactory.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 2350, 752, 12, 514, 2376, 780, 16, 514, 1234, 559, 262, 288, 377, 309, 2932, 20, 9654, 14963, 12, 3576, 559, 3719, 288, 377, 327, 394, 2358, 18, 19525, 904, 18, 904, 7132, 18, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 2350, 752, 12, 514, 2376, 780, 16, 514, 1234, 559, 262, 288, 377, 309, 2932, 20, 9654, 14963, 12, 3576, 559, 3719, 288, 377, 327, 394, 2358, 18, 19525, 904, 18, 904, 7132, 18, 1...
pushScope( declaration );
public void enterTemplateDeclaration(IASTTemplateDeclaration declaration) { // TODO Auto-generated method stub }
54911 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54911/5a0369683c183e148f3c496273fb138a89fe9911/CompleteParseBaseTest.java/clean/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseBaseTest.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1817, 3876, 12, 8266, 11272, 1817, 3876, 12, 8266, 11272, 1817, 3876, 12, 8266, 11272, 1817, 3876, 12, 8266, 11272, 1817, 3876, 12, 8266, 11272, 1817, 3876, 12, 8266, 11272, 1817, 3876, 12, 8266...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1817, 3876, 12, 8266, 11272, 1817, 3876, 12, 8266, 11272, 1817, 3876, 12, 8266, 11272, 1817, 3876, 12, 8266, 11272, 1817, 3876, 12, 8266, 11272, 1817, 3876, 12, 8266, 11272, 1817, 3876, 12, 8266...
} catch (MessagingException me) { System.out.println("aigh! messaging exception while loading! implement Pooka.showError()!");
FolderTableModel ftm = new FolderTableModel(messageProxies, getColumnNames(), getColumnSizes()); setFolderTableModel(ftm); loaderThread.loadMessages(messageProxies); if (!loaderThread.isAlive()) loaderThread.start(); if (preferredStatus == CONNECTED) getFolderThread().addToQueue(new net.suberic.util.thread.ActionWrapper(new javax.swing.AbstractAction() { public void actionPerformed(java.awt.event.ActionEvent actionEvent) { try { synchronizeCache(); } catch (Exception e) { if (getFolderDisplayUI() != null) getFolderDisplayUI().showError(Pooka.getProperty("error.CachingFolder.synchronzing", "Error synchronizing with folder"), Pooka.getProperty("error.CachingFolder.synchronzing.title", "Error synchronizing with folder"), e); } } }, getFolderThread()), new java.awt.event.ActionEvent(this, 1, "message-count-changed")); } finally { if (getFolderDisplayUI() != null) { getFolderDisplayUI().setBusy(false); getFolderDisplayUI().showStatusMessage(Pooka.getProperty("messages.CachingFolder.loading.finished", "Done loading messages.")); }
public synchronized void loadAllMessages() { if (folderTableModel == null) { Vector messageProxies = new Vector(); FetchProfile fp = createColumnInformation(); if (loaderThread == null) loaderThread = createLoaderThread(); try { if (!(getFolder().isOpen())) { openFolder(Folder.READ_WRITE); } long[] uids = cache.getMessageUids(); MessageInfo mi; for (int i = 0; i < uids.length; i++) { Message m = new CachingMimeMessage(this, uids[i]); mi = new MessageInfo(m, this); messageProxies.add(new MessageProxy(getColumnValues() , mi)); messageToInfoTable.put(m, mi); uidToInfoTable.put(new Long(uids[i]), mi); } } catch (MessagingException me) { System.out.println("aigh! messaging exception while loading! implement Pooka.showError()!"); } FolderTableModel ftm = new FolderTableModel(messageProxies, getColumnNames(), getColumnSizes()); setFolderTableModel(ftm); loaderThread.loadMessages(messageProxies); if (!loaderThread.isAlive()) loaderThread.start(); if (preferredStatus == CONNECTED) getFolderThread().addToQueue(new net.suberic.util.thread.ActionWrapper(new javax.swing.AbstractAction() { public void actionPerformed(java.awt.event.ActionEvent actionEvent) { try { synchronizeCache(); } catch (Exception e) { if (getFolderDisplayUI() != null) getFolderDisplayUI().showError(Pooka.getProperty("error.CachingFolder.synchronzing", "Error synchronizing with folder"), Pooka.getProperty("error.CachingFolder.synchronzing.title", "Error synchronizing with folder"), e); } } }, getFolderThread()), new java.awt.event.ActionEvent(this, 1, "message-count-changed")); } }
967 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/967/42ac8102e7ae8f3e47484c22f4467d39cb29f9ea/CachingFolderInfo.java/buggy/net/suberic/pooka/cache/CachingFolderInfo.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 3852, 918, 1262, 1595, 5058, 1435, 288, 202, 430, 261, 5609, 1388, 1488, 422, 446, 13, 288, 202, 565, 5589, 883, 21488, 273, 394, 5589, 5621, 202, 377, 202, 565, 8065, 4029, 4253, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 3852, 918, 1262, 1595, 5058, 1435, 288, 202, 430, 261, 5609, 1388, 1488, 422, 446, 13, 288, 202, 565, 5589, 883, 21488, 273, 394, 5589, 5621, 202, 377, 202, 565, 8065, 4029, 4253, ...
}
public char[] textToCharArray() { synchronized (PsiLock.LOCK) { char[] buffer = new char[getTextLength()]; SourceUtil.toBuffer(this, buffer, 0); return buffer; } }
56598 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56598/618abf69beebe8ca5f0db1e24631b6f764e428b4/CompositeElement.java/buggy/source/com/intellij/psi/impl/source/tree/CompositeElement.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 1149, 8526, 977, 774, 15936, 1435, 288, 225, 3852, 261, 52, 7722, 2531, 18, 6589, 13, 288, 565, 1149, 8526, 1613, 273, 394, 1149, 63, 588, 1528, 1782, 1435, 15533, 565, 4998, 1304, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 1149, 8526, 977, 774, 15936, 1435, 288, 225, 3852, 261, 52, 7722, 2531, 18, 6589, 13, 288, 565, 1149, 8526, 1613, 273, 394, 1149, 63, 588, 1528, 1782, 1435, 15533, 565, 4998, 1304, ...
public List getTokens();
public List<Token> getTokens();
public List getTokens();
47105 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47105/28ca973856343fe3aa9a9d262ec9569d9eeefe81/ActiveList.java/buggy/sphinx4/src/sphinx4/edu/cmu/sphinx/decoder/search/ActiveList.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 987, 18349, 5621, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 987, 18349, 5621, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if(code != TIMED_OUT && code != GENERATED_REJECTED_OVERLOAD && code != INTERNAL_ERROR && code != ROUTE_REALLY_NOT_FOUND) {
if((code != TIMED_OUT) && (code != GENERATED_REJECTED_OVERLOAD) && (code != INTERNAL_ERROR) && (code != ROUTE_REALLY_NOT_FOUND)) {
private void finish(int code, PeerNode next) { Logger.minor(this, "Finished: "+code+" on "+this, new Exception("debug")); synchronized(this) { if(status != NOT_FINISHED) throw new IllegalStateException("finish() called with "+code+" when was already "+status); setStatusTime = System.currentTimeMillis(); if(code == ROUTE_NOT_FOUND && !sentRequest) code = ROUTE_REALLY_NOT_FOUND; status = code; notifyAll(); Logger.minor(this, "Set status code: "+getStatusString()+" on "+uid); // Now wait for transfers, or for downstream transfer notifications. if(cw != null) { while(!allTransfersCompleted) { try { wait(10*1000); } catch (InterruptedException e) { // Try again } } } else { Logger.minor(this, "No completion waiter"); // There weren't any transfers allTransfersCompleted = true; } notifyAll(); } if(code != TIMED_OUT && code != GENERATED_REJECTED_OVERLOAD && code != INTERNAL_ERROR && code != ROUTE_REALLY_NOT_FOUND) { Logger.minor(this, "CHK insert cost "+getTotalSentBytes()+"/"+getTotalReceivedBytes()+" bytes ("+code+")"); (source == null ? node.localChkInsertBytesSentAverage : node.remoteChkInsertBytesSentAverage) .report(getTotalSentBytes()); (source == null ? node.localChkInsertBytesReceivedAverage : node.remoteChkInsertBytesReceivedAverage) .report(getTotalReceivedBytes()); } Logger.minor(this, "Returning from finish()"); }
50915 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50915/ca136843ae9ecb30cadada58a33a5dc2cf8ad064/CHKInsertSender.java/clean/src/freenet/node/CHKInsertSender.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 918, 4076, 12, 474, 981, 16, 10669, 907, 1024, 13, 288, 3639, 4242, 18, 17364, 12, 2211, 16, 315, 10577, 30, 13773, 710, 9078, 603, 13773, 2211, 16, 394, 1185, 2932, 4148, 7923, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 918, 4076, 12, 474, 981, 16, 10669, 907, 1024, 13, 288, 3639, 4242, 18, 17364, 12, 2211, 16, 315, 10577, 30, 13773, 710, 9078, 603, 13773, 2211, 16, 394, 1185, 2932, 4148, 7923, 1...
else { updateLock.clearParameters(); updateLock.setString(1, nodeID); updateLock.setTimestamp(2, expiryDate); updateLock.setString(3, swl.getId()); updateLock.setString(4, swl.getNodename()); updateLock.setString(5, swl.getLockkey()); if (updateLock.executeUpdate() == 1) { log.debug("UPDATED Lock Record " + swl.getId() + "::" + nodeID + "::" + expiryDate); locked = true; } }
private boolean getLockTransaction() { String nodeID = getNodeID(); Connection connection = null; boolean locked = false; boolean autoCommit = false; PreparedStatement selectLock = null; PreparedStatement updateLock = null; PreparedStatement insertLock = null; PreparedStatement countWork = null; ResultSet resultSet = null; Timestamp now = new Timestamp(System.currentTimeMillis()); Timestamp expiryDate = new Timestamp(now.getTime() + (10L * 60L * 1000L)); try { // I need to go direct to JDBC since its just too awful to // try and do this in Hibernate. updateNodeLock(); connection = dataSource.getConnection(); autoCommit = connection.getAutoCommit(); if (autoCommit) { connection.setAutoCommit(false); } selectLock = connection.prepareStatement(SELECT_LOCK_SQL); updateLock = connection.prepareStatement(UPDATE_LOCK_SQL); insertLock = connection.prepareStatement(INSERT_LOCK_SQL); countWork = connection.prepareStatement(COUNT_WORK_SQL); SearchWriterLock swl = null; selectLock.clearParameters(); selectLock.setString(1, LOCKKEY); resultSet = selectLock.executeQuery(); if (resultSet.next()) { swl = new SearchWriterLockImpl(); swl.setId(resultSet.getString(1)); swl.setNodename(resultSet.getString(2)); swl.setLockkey(resultSet.getString(3)); swl.setExpires(resultSet.getTimestamp(4)); log.debug("GOT Lock Record " + swl.getId() + "::" + swl.getNodename() + "::" + swl.getExpires()); } resultSet.close(); resultSet = null; boolean takelock = false; if (swl == null) { log.debug("_-------------NO Lock Record"); takelock = true; } else if ("none".equals(swl.getNodename())) { takelock = true; log.debug(nodeID + "_-------------no lock"); } else if (nodeID.equals(swl.getNodename())) { takelock = true; log.debug(nodeID + "_------------matched threadid "); } else if (swl.getExpires() == null || swl.getExpires().before(now)) { takelock = true; log.debug(nodeID + "_------------thread dead "); } if (takelock) { // any work ? countWork.clearParameters(); countWork.setInt(1, SearchBuilderItem.STATE_PENDING.intValue()); countWork .setInt(2, SearchBuilderItem.ACTION_UNKNOWN.intValue()); resultSet = countWork.executeQuery(); int nitems = 0; if (resultSet.next()) { nitems = resultSet.getInt(1); } resultSet.close(); resultSet = null; if (nitems > 0) { if (swl == null) { insertLock.clearParameters(); insertLock.setString(1, nodeID); insertLock.setString(2, nodeID); insertLock.setString(3, LOCKKEY); insertLock.setTimestamp(4, expiryDate); if (insertLock.executeUpdate() == 1) { log.debug("INSERT Lock Record " + nodeID + "::" + nodeID + "::" + expiryDate); locked = true; } } else { updateLock.clearParameters(); updateLock.setString(1, nodeID); updateLock.setTimestamp(2, expiryDate); updateLock.setString(3, swl.getId()); updateLock.setString(4, swl.getNodename()); updateLock.setString(5, swl.getLockkey()); if (updateLock.executeUpdate() == 1) { log.debug("UPDATED Lock Record " + swl.getId() + "::" + nodeID + "::" + expiryDate); locked = true; } } } } connection.commit(); } catch (Exception ex) { if (connection != null) { try { connection.rollback(); } catch (SQLException e) { } } log.error("Failed to get lock " + ex.getMessage()); locked = false; } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } } if (selectLock != null) { try { selectLock.close(); } catch (SQLException e) { } } if (updateLock != null) { try { updateLock.close(); } catch (SQLException e) { } } if (insertLock != null) { try { insertLock.close(); } catch (SQLException e) { } } if (countWork != null) { try { countWork.close(); } catch (SQLException e) { } } if (connection != null) { try { connection.setAutoCommit(autoCommit); } catch (SQLException e) { } try { connection.close(); log.debug("Connection Closed "); } catch (SQLException e) { log.error("Error Closing Connection ", e); } connection = null; } } return locked; }
2021 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2021/ef5f74093f60c8ebb80f93c6aa20b19004710b46/SearchIndexBuilderWorkerImpl.java/clean/search/search-impl/impl/src/java/org/sakaiproject/search/component/service/impl/SearchIndexBuilderWorkerImpl.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1152, 12107, 288, 1089, 2531, 18, 8507, 2402, 5621, 1089, 2531, 18, 542, 780, 12, 21, 16, 14871, 1769, 1089, 2531, 18, 542, 4921, 12, 22, 16, 10839, 1626, 1769, 1089, 2531, 18, 542...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1152, 12107, 288, 1089, 2531, 18, 8507, 2402, 5621, 1089, 2531, 18, 542, 780, 12, 21, 16, 14871, 1769, 1089, 2531, 18, 542, 4921, 12, 22, 16, 10839, 1626, 1769, 1089, 2531, 18, 542...
public void bind(Object instance, Bundle bundle) { if (bundle == null) { return; } String filterString = "(&(" + org.osgi.framework.Constants.OBJECTCLASS + "=" + interfaceName + ")" + "(" + Constants.BUNDLE_ID + "=" + bundle.getBundleId() + "))"; try { Filter filter = this.context.createFilter(filterString); ServiceReference[] refs = this.context.getServiceReferences(null, filter.toString()); bound = refs[0]; invokeEventMethod(instance, bindMethodName, bound); } catch (InvalidSyntaxException e) { Activator.log.error("Couldn't create filter for reference " + filterString + "\" used by component \"" + config.getName() + "\". Got exception.", e);
public void bind(Object instance, Object bindObject) { if (bindObject != null) { invokeEventMethod(instance, bindMethodName, bindObject);
public void bind(Object instance, Bundle bundle) { if (bundle == null) { return; } String filterString = "(&(" + org.osgi.framework.Constants.OBJECTCLASS + "=" + interfaceName + ")" + "(" + Constants.BUNDLE_ID + "=" + bundle.getBundleId() + "))"; try { Filter filter = this.context.createFilter(filterString); ServiceReference[] refs = this.context.getServiceReferences(null, filter.toString()); bound = refs[0]; invokeEventMethod(instance, bindMethodName, bound); } catch (InvalidSyntaxException e) { Activator.log.error("Couldn't create filter for reference " + filterString + "\" used by component \"" + config.getName() + "\". Got exception.", e); } }
55496 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55496/8922bc9e11e143d8b139ae27461eeda530fc16c3/DuplexReference.java/clean/trunk/bamja_core/src/org/bamja/core/impl/DuplexReference.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1993, 12, 921, 791, 16, 8539, 3440, 13, 288, 3639, 309, 261, 9991, 422, 446, 13, 288, 5411, 327, 31, 3639, 289, 3639, 514, 1034, 780, 273, 7751, 10, 2932, 397, 2358, 18, 53...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1993, 12, 921, 791, 16, 8539, 3440, 13, 288, 3639, 309, 261, 9991, 422, 446, 13, 288, 5411, 327, 31, 3639, 289, 3639, 514, 1034, 780, 273, 7751, 10, 2932, 397, 2358, 18, 53...
if ( !(requests[0] instanceof ChatRequest && (requests[0] instanceof KoLAdventure || requests[0] instanceof KoLRequest)) ) KoLmafia.forceContinue();
KoLmafia.forceContinue();
public void run() { if ( requests.length == 0 ) return; if ( !(requests[0] instanceof ChatRequest && (requests[0] instanceof KoLAdventure || requests[0] instanceof KoLRequest)) ) KoLmafia.forceContinue(); for ( int i = 0; i < requests.length; ++i ) { // Chat requests are only run once, no matter what // the repeat count is. This is also to avoid the // message prompts you get otherwise. if ( requests[i] instanceof ChatRequest ) requests[i].run(); // Setting it up so that derived classes can // override the behavior of execution. else if ( requests[i] instanceof KoLRequest ) { run( (KoLRequest) requests[i], repeatCount ); } // Standard KoL adventures are handled through the // client.makeRequest() method. else if ( requests[i] instanceof KoLAdventure ) StaticEntity.getClient().makeRequest( requests[i], repeatCount ); // All other runnables are run, as expected, with // no updates to the client. else for ( int j = 0; j < repeatCount; ++j ) requests[i].run(); } if ( !(requests[0] instanceof ChatRequest && (requests[0] instanceof KoLAdventure || requests[0] instanceof KoLRequest)) ) KoLmafia.enableDisplay(); }
50364 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50364/88667b688fedc25178231d836bcef1605b24936a/RequestThread.java/buggy/src/net/sourceforge/kolmafia/RequestThread.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 1086, 1435, 202, 95, 202, 202, 430, 261, 3285, 18, 2469, 422, 374, 262, 1082, 202, 2463, 31, 202, 202, 430, 261, 401, 12, 11420, 63, 20, 65, 1276, 16903, 691, 597, 261,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 1086, 1435, 202, 95, 202, 202, 430, 261, 3285, 18, 2469, 422, 374, 262, 1082, 202, 2463, 31, 202, 202, 430, 261, 401, 12, 11420, 63, 20, 65, 1276, 16903, 691, 597, 261,...
if(undos.size() > limit)
for(int i = undoCount - 1; i >= undoPos; i--)
private void addEdit(Edit edit) { undos.add(undoPos++,edit); if(undos.size() > limit) { undos.remove(0); undoPos--; } undoCount = undoPos; } //}}}
8690 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8690/dfc46fa26176bd57ba2eb4f12cc45e6647e1f439/UndoManager.java/buggy/org/gjt/sp/jedit/buffer/UndoManager.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1152, 918, 527, 4666, 12, 4666, 3874, 13, 202, 95, 202, 202, 1074, 538, 18, 1289, 12, 31226, 1616, 9904, 16, 4619, 1769, 202, 202, 430, 12, 1074, 538, 18, 1467, 1435, 405, 1800, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1152, 918, 527, 4666, 12, 4666, 3874, 13, 202, 95, 202, 202, 1074, 538, 18, 1289, 12, 31226, 1616, 9904, 16, 4619, 1769, 202, 202, 430, 12, 1074, 538, 18, 1467, 1435, 405, 1800, ...
myHTMLViewer.addHyperlinkListener(new HyperlinkListener() {
myHyperLinkListener = new HyperlinkListener() {
public Browser(InspectionResultsView view) { super(new BorderLayout()); myView = view; myClickListeners = new ArrayList<ClickListener>(); myCurrentEntity = null; myHTMLViewer = new JEditorPane("text/html", "<HTML><BODY>Select tree node for detailed information</BODY></HTML>"); myHTMLViewer.setEditable(false); myHTMLViewer.addHyperlinkListener(new HyperlinkListener() { public void hyperlinkUpdate(HyperlinkEvent e) { if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { JEditorPane pane = (JEditorPane)e.getSource(); if (e instanceof HTMLFrameHyperlinkEvent) { HTMLFrameHyperlinkEvent evt = (HTMLFrameHyperlinkEvent)e; HTMLDocument doc = (HTMLDocument)pane.getDocument(); doc.processHTMLFrameHyperlinkEvent(evt); } else { try { URL url = e.getURL(); String ref = url.getRef(); if (ref.startsWith("pos:")) { int delimeterPos = ref.indexOf(':', "pos:".length() + 1); String startPosition = ref.substring("pos:".length(), delimeterPos); String endPosition = ref.substring(delimeterPos + 1); Integer textStartOffset = new Integer(startPosition); Integer textEndOffset = new Integer(endPosition); String fileURL = url.toExternalForm(); fileURL = fileURL.substring(0, fileURL.indexOf('#')); VirtualFile vFile = VirtualFileManager.getInstance().findFileByUrl(fileURL); if (vFile != null) { fireClickEvent(vFile, textStartOffset.intValue(), textEndOffset.intValue()); } } else if (ref.startsWith("descr:")) { int descriptionIndex = Integer.parseInt(ref.substring("descr:".length())); ProblemDescriptor descriptor = ((DescriptorProviderInspection)getTool()).getDescriptions( (RefElement)myCurrentEntity)[descriptionIndex]; PsiElement psiElement = descriptor.getPsiElement(); if (psiElement == null) return; VirtualFile vFile = psiElement.getContainingFile().getVirtualFile(); if (vFile != null) { TextRange range = psiElement.getTextRange(); fireClickEvent(vFile, range.getStartOffset(), range.getEndOffset()); } } else if (ref.startsWith("invoke:")) { int actionNumber = Integer.parseInt(ref.substring("invoke:".length())); getTool().getQuickFixes(new RefElement[] {(RefElement)myCurrentEntity})[actionNumber].doApplyFix(new RefElement[]{(RefElement)myCurrentEntity}); } else if (ref.startsWith("invokelocal:")) { int actionNumber = Integer.parseInt(ref.substring("invokelocal:".length())); if (actionNumber > -1){ myView.invokeLocalFix(actionNumber); } } else { int offset = Integer.parseInt(ref); String fileURL = url.toExternalForm(); fileURL = fileURL.substring(0, fileURL.indexOf('#')); VirtualFile vFile = VirtualFileManager.getInstance().findFileByUrl(fileURL); if (vFile != null) { fireClickEvent(vFile, offset, offset); } } } catch (Throwable t) { t.printStackTrace(); } } } } }); add(new JScrollPane(myHTMLViewer), BorderLayout.CENTER); }
56598 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56598/a8c458ccadb63729cc057f72199e325c8e861025/Browser.java/buggy/source/com/intellij/codeInspection/ui/Browser.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 15408, 12, 14985, 3447, 1767, 1476, 13, 288, 565, 2240, 12, 2704, 30814, 10663, 565, 3399, 1767, 273, 1476, 31, 565, 3399, 6563, 5583, 273, 394, 2407, 32, 22092, 34, 5621, 565, 3399...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 15408, 12, 14985, 3447, 1767, 1476, 13, 288, 565, 2240, 12, 2704, 30814, 10663, 565, 3399, 1767, 273, 1476, 31, 565, 3399, 6563, 5583, 273, 394, 2407, 32, 22092, 34, 5621, 565, 3399...
String normalizationName = optionHandler .getOptionValue(NORMALIZATION_P);
String normalizationName = optionHandler.getOptionValue(NORMALIZATION_P);
public String[] setParameters(String[] args) throws ParameterException { String[] remainingParameters = optionHandler.grabOptions(args); if (args.length == 0) { throw new AbortException( "No options specified. Try flag -h to gain more information."); } if (optionHandler.isSet(HELP_F) || optionHandler.isSet(HELPLONG_F)) { throw new AbortException(description()); } // algorithm String algorithmName = optionHandler.getOptionValue(ALGORITHM_P); try { algorithm = Util.instantiate(Algorithm.class, algorithmName); } catch (UnableToComplyException e) { throw new WrongParameterValueException(ALGORITHM_P, algorithmName, ALGORITHM_D, e); } if (optionHandler.isSet(DESCRIPTION_F)) { throw new AbortException(algorithm.getDescription().toString() + '\n' + algorithm.description()); } // database connection String databaseConnectionName = optionHandler .isSet(DATABASE_CONNECTION_P) ? optionHandler .getOptionValue(DATABASE_CONNECTION_P) : DEFAULT_DATABASE_CONNECTION; try { databaseConnection = Util.instantiate(DatabaseConnection.class, databaseConnectionName); } catch (UnableToComplyException e) { throw new WrongParameterValueException(DATABASE_CONNECTION_P, databaseConnectionName, DATABASE_CONNECTION_D, e); } // output if (optionHandler.isSet(OUTPUT_P)) { out = new File(optionHandler.getOptionValue(OUTPUT_P)); } else { out = null; } // normalization if (optionHandler.isSet(NORMALIZATION_P)) { String normalizationName = optionHandler .getOptionValue(NORMALIZATION_P); try { normalization = Util.instantiate(Normalization.class, normalizationName); } catch (UnableToComplyException e) { throw new WrongParameterValueException(NORMALIZATION_P, normalizationName, NORMALIZATION_D, e); } normalizationUndo = optionHandler.isSet(NORMALIZATION_UNDO_F); remainingParameters = normalization .setParameters(remainingParameters); } else if (optionHandler.isSet(NORMALIZATION_UNDO_F)) { throw new WrongParameterValueException( "Illegal parameter setting: Flag " + NORMALIZATION_UNDO_F + " is set, but no normalization is specified."); } remainingParameters = algorithm.setParameters(remainingParameters); remainingParameters = databaseConnection .setParameters(remainingParameters); initialized = true; setParameters(args, remainingParameters); return remainingParameters; }
5508 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5508/6c3be79c76e43283efc0fa00b4688253706c8314/KDDTask.java/buggy/src/de/lmu/ifi/dbs/algorithm/KDDTask.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 514, 8526, 22556, 12, 780, 8526, 833, 13, 1216, 5498, 503, 565, 288, 3639, 514, 8526, 4463, 2402, 273, 1456, 1503, 18, 2752, 70, 1320, 12, 1968, 1769, 3639, 309, 261, 1968, 18, 24...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 514, 8526, 22556, 12, 780, 8526, 833, 13, 1216, 5498, 503, 565, 288, 3639, 514, 8526, 4463, 2402, 273, 1456, 1503, 18, 2752, 70, 1320, 12, 1968, 1769, 3639, 309, 261, 1968, 18, 24...
Collection connectors = componentRegistry.getLocalComponentConnectors();
Collection connectors = registry.getLocalComponentConnectors();
public ServiceEndpoint resolveEndpointReference(DocumentFragment epr) { Collection connectors = componentRegistry.getLocalComponentConnectors(); for (Iterator iter = connectors.iterator(); iter.hasNext();) { LocalComponentConnector connector = (LocalComponentConnector) iter.next(); ServiceEndpoint se = connector.getComponent().resolveEndpointReference(epr); if (se != null) { return new DynamicEndpoint(connector.getComponentNameSpace(), se, epr); } } return null; }
6264 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6264/147052fceba4d3bb85729a9aef33f5d0245d2219/EndpointRegistry.java/buggy/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/EndpointRegistry.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 1956, 3293, 2245, 3293, 2404, 12, 2519, 7456, 425, 683, 13, 288, 3639, 2200, 28473, 273, 4023, 18, 588, 2042, 1841, 7487, 87, 5621, 3639, 364, 261, 3198, 1400, 273, 28473, 18, 9838,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 1956, 3293, 2245, 3293, 2404, 12, 2519, 7456, 425, 683, 13, 288, 3639, 2200, 28473, 273, 4023, 18, 588, 2042, 1841, 7487, 87, 5621, 3639, 364, 261, 3198, 1400, 273, 28473, 18, 9838,...
int oHeight = 0 ; try { oHeight = Integer.parseInt(origHeight); } catch ( NumberFormatException ex ) { log("Failed to parse origHeight") ; } int oWidth = 0 ; try { oWidth = Integer.parseInt(origWidth); } catch ( NumberFormatException ex ) { log("Failed to parse origHeight") ; }
public void doPost( HttpServletRequest req, HttpServletResponse res ) throws ServletException, IOException { String host = req.getHeader("Host") ; String imcserver = Utility.getDomainPref("adminserver",host) ; String start_url = Utility.getDomainPref( "start_url",host ) ; String servlet_url = Utility.getDomainPref( "servlet_url",host ) ; String image_url = Utility.getDomainPref( "image_url",host ) ; File image_path = Utility.getDomainPrefPath( "image_path",host ) ; imcode.server.User user ; String htmlStr = "" ; String submit_name = "" ; String values[] ; int img_no = 0 ; imcode.server.Image image = new imcode.server.Image( ) ; res.setContentType( "text/html" ); ServletOutputStream out = res.getOutputStream( ); // get meta_id String m_id = req.getParameter( "meta_id" ) ; int meta_id = Integer.parseInt( m_id ) ;// int parent_meta_id = Integer.parseInt( req.getParameter( "parent_meta_id" ) ) ; // get img_no String i_no = req.getParameter( "img_no" ) ; img_no = Integer.parseInt( i_no ) ; // get image_height String image_height = req.getParameter( "image_height" ) ; // get image_width String image_width = req.getParameter( "image_width" ) ; // get image_border String image_border = req.getParameter( "image_border" ) ; // get vertical_space String v_space = req.getParameter( "v_space" ) ; // get horizonal_space String h_space = req.getParameter( "h_space" ) ;//****************************** boolean keepAspectRatio = (req.getParameter("keepAspectRatio") != null); log("SaveImage: KEEP_ASPECT_RATIO =" + req.getParameter("keepAspectRatio")); String sqlStr = "select image_name,imgurl,width,height,border,v_space,h_space,target,target_name,align,alt_text,low_scr,linkurl from images where meta_id = "+meta_id+" and name = "+img_no; String[] sql = IMCServiceRMI.sqlQuery(imcserver,sqlStr); String origWidth = req.getParameter("origW"); // width String origHeight = req.getParameter("origH"); // height //***************************** try { image.setImageHeight( Integer.parseInt( image_height ) ) ; } catch ( NumberFormatException ex ) { image_height = "0" ; image.setImageHeight( 0 ) ; } try { image.setImageBorder( Integer.parseInt( image_border ) ) ; } catch ( NumberFormatException ex ) { image_border = "0" ; image.setImageBorder( 0 ) ; } try { image.setImageWidth( Integer.parseInt( image_width ) ) ; } catch ( NumberFormatException ex ) { image_width = "0" ; image.setImageWidth( 0 ) ; } // ****************************** Hr brjar Mrtens lilla lekstuga if(keepAspectRatio && (req.getParameter("ok") != null || req.getParameter("show_img") != null)) { int iHeight = 0 ; try { iHeight = Integer.parseInt(image_height); // form width } catch ( NumberFormatException ex ) { log("Failed to parse image_height") ; } int iWidth = 0 ; try { iWidth = Integer.parseInt(image_width); // form height } catch ( NumberFormatException ex ) { log("Failed to parse image_width") ; } int oldHeight = 0 ; try { oldHeight = (sql.length>0)?Integer.parseInt(sql[3]):0; // database height } catch ( NumberFormatException ex ) { log("Failed to parse oldHeight") ; } int oldWidth = 0 ; try { oldWidth = (sql.length>0)?Integer.parseInt(sql[2]):0; // database width } catch ( NumberFormatException ex ) { log("Failed to parse oldWidth") ; } //log("REQUESTED SIZE " + iWidth + "/" + iHeight); int oHeight = 0 ; try { oHeight = Integer.parseInt(origHeight); // image height } catch ( NumberFormatException ex ) { log("Failed to parse origHeight") ; } int oWidth = 0 ; try { oWidth = Integer.parseInt(origWidth); // image width } catch ( NumberFormatException ex ) { log("Failed to parse origHeight") ; } double asp_rat = ((double)oWidth/(double)oHeight); int heightDiff = Math.abs(iHeight - oldHeight); int widthDiff = Math.abs(iWidth - oldWidth); // Dominant value: // 1. greatest diff, 2. greatest int, 3. width if(widthDiff > heightDiff) { iHeight = (int)(iWidth/asp_rat); } else if (heightDiff > widthDiff) { iWidth = (int)(iHeight*asp_rat); } else if(heightDiff == widthDiff) { if(iHeight>iWidth) { iWidth = (int)(iHeight*asp_rat); } else { iHeight = (int)(iWidth/asp_rat); } } else { iHeight = (int)(iWidth*asp_rat); } image.setImageHeight( iHeight ) ; image.setImageWidth( iWidth ) ; image_width = "" + iWidth; image_height = "" + iHeight; //log("CALCULATED SIZE " + image_width + "/" + image_height); } //******************************* try { image.setVerticalSpace( Integer.parseInt( v_space ) ) ; } catch ( NumberFormatException ex ) { v_space = "0" ; image.setVerticalSpace( 0 ) ; } try { image.setHorizonalSpace( Integer.parseInt( h_space ) ) ; } catch ( NumberFormatException ex ) { h_space = "0" ; image.setHorizonalSpace( 0 ) ; } // get imageref String image_ref = req.getParameter( "imageref" ) ; image.setImageRef( image_ref ) ; // get image_name String image_name = req.getParameter( "image_name" ) ; image.setImageName( image_name ) ; // get image_align String image_align = req.getParameter( "image_align" ) ; image.setImageAlign( image_align ) ; // get alt_text String alt_text = imcode.server.HTMLConv.toHTML(req.getParameter( "alt_text" )) ; image.setAltText( alt_text ) ; // get low_scr String low_scr = req.getParameter( "low_scr" ) ; image.setLowScr( low_scr ) ; // get target String target = req.getParameter( "target" ) ; image.setTarget( target ) ; // get target_name String target_name = req.getParameter( "target_name" ) ; image.setTargetName( target_name ) ; // get image_ref_link String imageref_link = req.getParameter( "imageref_link" ) ; image.setImageRefLink( imageref_link ) ; // redirect data String scheme = req.getScheme( ); String serverName = req.getServerName( ); int p = req.getServerPort( ); String port = (p == 80) ? "" : ":" + p; // Get the session HttpSession session = req.getSession( true ); // Does the session indicate this user already logged in? Object done = session.getValue( "logon.isDone" ); // marker object user = (imcode.server.User)done ; if( done == null ) { // No logon.isDone means he hasn't logged in. // Save the request URL as the true target and redirect to the login page. res.sendRedirect( scheme + "://" + serverName + port + start_url ) ; return ; } // Check if user has write rights if ( !IMCServiceRMI.checkDocAdminRights(imcserver,meta_id,user,131072 ) ) { // Checking to see if user may edit this byte[] tempbytes ; tempbytes = AdminDoc.adminDoc(meta_id,meta_id,host,user,req,res) ; if ( tempbytes != null ) { out.write(tempbytes) ; } return ; } user.put("flags",new Integer(131072)) ; //the folderlist String dirList = (String) session.getAttribute("imageFolderOptionList"); if(dirList == null)dirList=""; if( req.getParameter( "cancel" )!=null ) {// htmlStr = IMCServiceRMI.interpretTemplate( imcserver,meta_id,user ) ; byte[] tempbytes = AdminDoc.adminDoc(meta_id,meta_id,host,user,req,res) ; if ( tempbytes != null ) { out.write(tempbytes) ; } return ; } else if( req.getParameter( "show_img" )!=null ) { //**************************************************************** ImageFileMetaData imagefile = new ImageFileMetaData(new File(image_path,image_ref)) ; int width = imagefile.getWidth() ; int height = imagefile.getHeight() ; //**************************************************************** Vector vec = new Vector () ; vec.add("#imgUrl#") ; vec.add(image_url) ; vec.add("#imgName#") ; vec.add(image_name) ; vec.add("#imgRef#") ; vec.add(image_ref) ; vec.add("#imgWidth#") ; vec.add("0".equals(image_width)?""+width:image_width) ; vec.add("#imgHeight#") ; vec.add("0".equals(image_height)?""+height:image_height) ; vec.add("#origW#"); vec.add("" + width); vec.add("#origH#"); vec.add("" + height); vec.add("#imgBorder#") ; vec.add(image_border) ; vec.add("#imgVerticalSpace#") ; vec.add(v_space) ; vec.add("#imgHorizontalSpace#") ; vec.add(h_space) ; if ( "_top".equals(target) ) { vec.add("#target_name#") ; vec.add("") ; vec.add("#top_checked#") ; } else if ( "_self".equals(target) ) { vec.add("#target_name#") ; vec.add("") ; vec.add("#self_checked#") ; } else if ( "_blank".equals(target) ) { vec.add("#target_name#") ; vec.add("") ; vec.add("#blank_checked#") ; } else if ( "_parent".equals(target) ) { vec.add("#target_name#") ; vec.add("") ; vec.add("#blank_checked#") ; } else { vec.add("#target_name#") ; vec.add(target_name) ; vec.add("#other_checked#") ; } vec.add("selected") ; if ( "baseline".equals(image_align) ) { vec.add("#baseline_selected#") ; } else if ( "top".equals(image_align) ) { vec.add("#top_selected#") ; } else if ( "middle".equals(image_align) ) { vec.add("#middle_selected#") ; } else if ( "bottom".equals(image_align) ) { vec.add("#bottom_selected#") ; } else if ( "texttop".equals(image_align) ) { vec.add("#texttop_selected#") ; } else if ( "absmiddle".equals(image_align) ) { vec.add("#absmiddle_selected#") ; } else if ( "absbottom".equals(image_align) ) { vec.add("#absbottom_selected#") ; } else if ( "left".equals(image_align) ) { vec.add("#left_selected#") ; } else if ( "right".equals(image_align) ) { vec.add("#right_selected#") ; } else { vec.add("#none_selected#") ; } vec.add("selected") ; vec.add("#imgAltText#") ; vec.add(alt_text) ; vec.add("#imgLowScr#") ; vec.add(low_scr) ; vec.add("#imgRefLink#") ; vec.add(imageref_link) ; vec.add("#getMetaId#") ; vec.add(m_id) ; vec.add("#img_no#") ; vec.add(i_no) ; vec.add("#folders#"); vec.add(dirList); //IMCServiceRMI.saveImage( imcserver,meta_id,user,img_no,image ) ; //res.sendRedirect( scheme + "://" + serverName + port + servlet_url + "ChangeImage?meta_id=" + meta_id + "&img=" + img_no ); String lang_prefix = IMCServiceRMI.sqlQueryStr(imcserver, "select lang_prefix from lang_prefixes where lang_id = "+user.getInt("lang_id")) ; htmlStr = IMCServiceRMI.parseDoc(imcserver,vec,"change_img.html", lang_prefix) ; out.print(htmlStr) ; return ; } else if ( req.getParameter("delete") != null ) { Vector vec = new Vector () ; vec.add("#imgUrl#") ; vec.add("") ; vec.add("#imgName#") ; vec.add("") ; vec.add("#imgRef#") ; vec.add("") ; vec.add("#imgWidth#") ; vec.add("0") ; vec.add("#imgHeight#") ; vec.add("0") ; vec.add("#imgBorder#") ; vec.add("0") ; vec.add("#imgVerticalSpace#") ; vec.add("0") ; vec.add("#imgHorizontalSpace#") ; vec.add("0") ; vec.add("#target_name#") ; vec.add("") ; vec.add("#self_checked#") ; vec.add("selected") ; vec.add("#top_selected#") ; vec.add("selected") ; vec.add("#imgAltText#") ; vec.add("") ; vec.add("#imgLowScr#") ; vec.add("") ; vec.add("#imgRefLink#") ; vec.add("") ; vec.add("#getMetaId#") ; vec.add(String.valueOf(meta_id)) ; vec.add("#img_no#") ; vec.add(String.valueOf(img_no)) ; vec.add("#folders#"); vec.add(dirList); String lang_prefix = IMCServiceRMI.sqlQueryStr(imcserver, "select lang_prefix from lang_prefixes where lang_id = "+user.getInt("lang_id")) ; htmlStr = IMCServiceRMI.parseDoc(imcserver,vec,"change_img.html", lang_prefix) ; out.print(htmlStr) ; return ; } else { IMCServiceRMI.saveImage( imcserver,meta_id,user,img_no,image ) ; SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd") ; Date dt = IMCServiceRMI.getCurrentDate(imcserver) ; sqlStr = "update meta set date_modified = '"+dateformat.format(dt)+"' where meta_id = "+meta_id ; IMCServiceRMI.sqlUpdateQuery(imcserver,sqlStr); // htmlStr = IMCServiceRMI.interpretTemplate( imcserver,meta_id,user ) ; byte[] tempbytes = AdminDoc.adminDoc(meta_id,meta_id,host,user,req,res) ; if ( tempbytes != null ) { out.write(tempbytes) ; } return ; } }
8781 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8781/688df705fc0ba72946fac52fb635e1a7bf61181d/SaveImage.java/clean/servlets/SaveImage.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 741, 3349, 12, 9984, 1111, 16, 12446, 400, 262, 1216, 16517, 16, 1860, 288, 202, 202, 780, 1479, 4697, 202, 33, 1111, 18, 588, 1864, 2932, 2594, 7923, 274, 202, 202, 780,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 741, 3349, 12, 9984, 1111, 16, 12446, 400, 262, 1216, 16517, 16, 1860, 288, 202, 202, 780, 1479, 4697, 202, 33, 1111, 18, 588, 1864, 2932, 2594, 7923, 274, 202, 202, 780,...
public TabbedStackPresentation(IStackPresentationSite site, AbstractTabFolder folder, TabOrder tabs, TabDragHandler dragBehavior) { super(site); tabFolder = folder; this.tabs = tabs; this.dragBehavior = dragBehavior; folder.getControl().addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { presentationDisposed(); } }); folder.allowMaximizeButton(getSite().supportsState( IStackPresentationSite.STATE_MAXIMIZED)); folder.allowMinimizeButton(getSite().supportsState( IStackPresentationSite.STATE_MINIMIZED)); folder.addListener(tabFolderListener); tabFolder.getControl().getShell().addShellListener(shellListener); tabFolder.shellActive(tabFolder.getControl().getDisplay() .getActiveShell() == tabFolder.getControl().getShell());
public TabbedStackPresentation(IStackPresentationSite site, AbstractTabFolder widget, ISystemMenu systemMenu) { this(site, new PresentablePartFolder(widget), systemMenu);
public TabbedStackPresentation(IStackPresentationSite site, AbstractTabFolder folder, TabOrder tabs, TabDragHandler dragBehavior) { super(site); tabFolder = folder; this.tabs = tabs; this.dragBehavior = dragBehavior; // Add a dispose listener. This will call the presentationDisposed() // method when the widget is destroyed. folder.getControl().addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { presentationDisposed(); } }); folder.allowMaximizeButton(getSite().supportsState( IStackPresentationSite.STATE_MAXIMIZED)); folder.allowMinimizeButton(getSite().supportsState( IStackPresentationSite.STATE_MINIMIZED)); folder.addListener(tabFolderListener); tabFolder.getControl().getShell().addShellListener(shellListener); tabFolder.shellActive(tabFolder.getControl().getDisplay() .getActiveShell() == tabFolder.getControl().getShell()); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/a44e3679b294ff539fce71b7e835499b2c444fa7/TabbedStackPresentation.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/newapi/TabbedStackPresentation.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 9483, 2992, 2624, 6351, 367, 12, 45, 2624, 6351, 367, 4956, 2834, 16, 5411, 4115, 5661, 3899, 3009, 16, 9483, 2448, 10920, 16, 9483, 11728, 1503, 8823, 9212, 13, 288, 3639, 2240, 12...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 9483, 2992, 2624, 6351, 367, 12, 45, 2624, 6351, 367, 4956, 2834, 16, 5411, 4115, 5661, 3899, 3009, 16, 9483, 2448, 10920, 16, 9483, 11728, 1503, 8823, 9212, 13, 288, 3639, 2240, 12...
for ( String desc : aSpell.getDescriptorList() )
for (String desc : aSpell.getDescriptorList())
int getTotalCasterLevelWithSpellBonus(final Spell aSpell, final String spellType, final String classOrRace, final int casterLev) { if(aSpell != null && aSpell.getFixedCasterLevel() != null) { return getVariableValue(aSpell.getFixedCasterLevel(), Constants.EMPTY_STRING).intValue(); } int tBonus = casterLev; boolean replaceCasterLevel = false; String tType; String tStr;// final List<TypedBonus> bonuses = new ArrayList<TypedBonus>(); final List<CasterLevelSpellBonus> bonuses = new ArrayList<CasterLevelSpellBonus>(); if (classOrRace != null) {// bonuses.addAll(getBonusesTo("CASTERLEVEL", classOrRace)); tBonus = (int)getTotalBonusTo("CASTERLEVEL", classOrRace); if (tBonus > 0) { tType = getSpellBonusType("CASTERLEVEL", classOrRace); bonuses.add(new CasterLevelSpellBonus(tBonus, tType)); } //Support both types of syntax for CLASS: //BONUS:CASTERLEVEL|Sorcerer|1 and BONUS:CASTERLEVEL|CLASS.Sorcerer|1 if (!classOrRace.startsWith("RACE.")) { tStr = "CLASS." + classOrRace;// bonuses.addAll( getBonusesTo("CASTERLEVEL", tStr) ); tBonus = (int)getTotalBonusTo("CASTERLEVEL", tStr); if (tBonus > 0) { tType = getSpellBonusType("CASTERLEVEL", tStr); bonuses.add(new CasterLevelSpellBonus(tBonus, tType)); } } } if (aSpell == null) { return(tBonus); } if (!spellType.equals(Constants.s_NONE)) { tStr = "TYPE." + spellType;// bonuses.addAll( getBonusesTo("CASTERLEVEL", tStr) ); tBonus = (int)getTotalBonusTo("CASTERLEVEL", tStr); if (tBonus > 0) { tType = getSpellBonusType("CASTERLEVEL", tStr); bonuses.add(new CasterLevelSpellBonus(tBonus, tType)); } tStr += ".RESET";// final List<TypedBonus> reset = getBonusesTo("CASTERLEVEL", tStr);// if ( reset.size() > 0 )// {// bonuses.addAll(reset);// replaceCasterLevel = true;// } tBonus = (int)getTotalBonusTo("CASTERLEVEL", tStr); if (tBonus > 0) { replaceCasterLevel = true; tType = getSpellBonusType("CASTERLEVEL", tStr); bonuses.add(new CasterLevelSpellBonus(tBonus, tType)); } } tStr = "SPELL." + aSpell.getKeyName();// bonuses.addAll( getBonusesTo("CASTERLEVEL", tStr) ); tBonus = (int)getTotalBonusTo("CASTERLEVEL", tStr); if (tBonus > 0) { tType = getSpellBonusType("CASTERLEVEL", tStr); bonuses.add(new CasterLevelSpellBonus(tBonus, tType)); } tStr += ".RESET";// final List<TypedBonus> reset = getBonusesTo("CASTERLEVEL", tStr);// if ( reset.size() > 0 )// {// bonuses.addAll(reset);// replaceCasterLevel = true;// } tBonus = (int)getTotalBonusTo("CASTERLEVEL", tStr); if (tBonus > 0) { replaceCasterLevel = true; tType = getSpellBonusType("CASTERLEVEL", tStr); bonuses.add(new CasterLevelSpellBonus(tBonus, tType)); } for ( String school : aSpell.getSchools() ) { tStr = "SCHOOL." + school;// bonuses.addAll( getBonusesTo("CASTERLEVEL", tStr) ); tBonus = (int)getTotalBonusTo("CASTERLEVEL", tStr); if (tBonus > 0) { tType = getSpellBonusType("CASTERLEVEL", tStr); bonuses.add(new CasterLevelSpellBonus(tBonus, tType)); } tStr += ".RESET";// final List<TypedBonus> reset1 = getBonusesTo("CASTERLEVEL", tStr);// if ( reset.size() > 0 )// {// bonuses.addAll(reset1);// replaceCasterLevel = true;// } tBonus = (int)getTotalBonusTo("CASTERLEVEL", tStr); if (tBonus > 0) { replaceCasterLevel = true; tType = getSpellBonusType("CASTERLEVEL", tStr); bonuses.add(new CasterLevelSpellBonus(tBonus, tType)); } } for ( String subschool : aSpell.getSubschools() ) { tStr = "SUBSCHOOL." + subschool;// bonuses.addAll( getBonusesTo("CASTERLEVEL", tStr) ); tBonus = (int)getTotalBonusTo("CASTERLEVEL", tStr); if (tBonus > 0) { tType = getSpellBonusType("CASTERLEVEL", tStr); bonuses.add(new CasterLevelSpellBonus(tBonus, tType)); } tStr += ".RESET";// final List<TypedBonus> reset1 = getBonusesTo("CASTERLEVEL", tStr);// if ( reset.size() > 0 )// {// bonuses.addAll(reset1);// replaceCasterLevel = true;// } tBonus = (int)getTotalBonusTo("CASTERLEVEL", tStr); if (tBonus > 0) { replaceCasterLevel = true; tType = getSpellBonusType("CASTERLEVEL", tStr); bonuses.add(new CasterLevelSpellBonus(tBonus, tType)); } } for ( String desc : aSpell.getDescriptorList() ) { tStr = "DESCRIPTOR." + desc;// bonuses.addAll( getBonusesTo("CASTERLEVEL", tStr) ); tBonus = (int)getTotalBonusTo("CASTERLEVEL", tStr); if (tBonus > 0) { tType = getSpellBonusType("CASTERLEVEL", tStr); bonuses.add(new CasterLevelSpellBonus(tBonus, tType)); } tStr += ".RESET";// final List<TypedBonus> reset1 = getBonusesTo("CASTERLEVEL", tStr);// if ( reset.size() > 0 )// {// bonuses.addAll(reset1);// replaceCasterLevel = true;// } tBonus = (int)getTotalBonusTo("CASTERLEVEL", tStr); if (tBonus > 0) { replaceCasterLevel = true; tType = getSpellBonusType("CASTERLEVEL", tStr); bonuses.add(new CasterLevelSpellBonus(tBonus, tType)); } } final Map<String, Integer> domainMap = aSpell.getLevelInfo(this); if (domainMap != null) { for ( String mKey : domainMap.keySet() ) { if (mKey.startsWith("DOMAIN|")) { tStr = "DOMAIN." + mKey.substring(7);// bonuses.addAll( getBonusesTo("CASTERLEVEL", tStr) ); tBonus = (int)getTotalBonusTo("CASTERLEVEL", tStr); if (tBonus > 0) { tType = getSpellBonusType("CASTERLEVEL", tStr); bonuses.add(new CasterLevelSpellBonus(tBonus, tType)); } tStr += ".RESET";// final List<TypedBonus> reset1 = getBonusesTo("CASTERLEVEL", tStr);// if ( reset.size() > 0 )// {// bonuses.addAll(reset1);// replaceCasterLevel = true;// } tBonus = (int)getTotalBonusTo("CASTERLEVEL", tStr); if (tBonus > 0) { replaceCasterLevel = true; tType = getSpellBonusType("CASTERLEVEL", tStr); bonuses.add(new CasterLevelSpellBonus(tBonus, tType)); } } } } //now go through all bonuses, checking types to see what should add together for (int z = 0; z < bonuses.size()-1; z++) { final CasterLevelSpellBonus zBonus = bonuses.get(z); String zType = zBonus.getType(); if ((zBonus.getBonus() == 0) || zType.equals("")) { continue; } boolean zReplace = false; boolean zStack = false; if (zType.endsWith(".REPLACE")) { zType = zType.substring(0, zType.length() - 8); zReplace = true; } else { if (zType.endsWith(".STACK")) { zType = zType.substring(0, zType.length() - 6); zStack = true; } } for (int k = z+1; k < bonuses.size(); k++) { final CasterLevelSpellBonus kBonus = bonuses.get(k); String kType = kBonus.getType(); if ((kBonus.getBonus() == 0) || kType.equals("")) { continue; } boolean kReplace = false; boolean kStack = false; if (kType.endsWith(".REPLACE")) { kType = kType.substring(0, kType.length() - 8); kReplace = true; } else { if (kType.endsWith(".STACK")) { kType = kType.substring(0, kType.length() - 6); kStack = true; } } if (!zType.equals(kType)) { continue; } //if both end in ".REPLACE", add together and save for later comparison if (zReplace && kReplace) { kBonus.setBonus(zBonus.getBonus() + kBonus.getBonus()); zBonus.setBonus(0); continue; } //if either ends in ".STACK", then they will add if (zStack || kStack) { continue; } //otherwise, only keep max if (zBonus.getBonus() > kBonus.getBonus()) { kBonus.setBonus(0); } else { zBonus.setBonus(0); } } } int result = 0; if (!replaceCasterLevel) { result += casterLev; }// result += TypedBonus.totalBonuses(bonuses); //Now go through bonuses and add it up for ( CasterLevelSpellBonus resultBonus : bonuses ) { result += resultBonus.getBonus(); } if(result == 0) { result = 1; } return(result); }
48301 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/48301/376816acf8bf134fa77bd6ea5c602dbe9af9bfbd/PlayerCharacter.java/clean/code/src/java/pcgen/core/PlayerCharacter.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 474, 12831, 39, 2440, 2355, 1190, 3389, 1165, 38, 22889, 12, 6385, 5878, 1165, 279, 3389, 1165, 16, 727, 514, 22377, 559, 16, 727, 514, 667, 1162, 54, 623, 16, 727, 509, 276, 2440,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 474, 12831, 39, 2440, 2355, 1190, 3389, 1165, 38, 22889, 12, 6385, 5878, 1165, 279, 3389, 1165, 16, 727, 514, 22377, 559, 16, 727, 514, 667, 1162, 54, 623, 16, 727, 509, 276, 2440,...
if (version != null) { if (!isMsgType(msgType)) { throw new InvalidMessageType(); } Message messageInfo = getMessage(message.getHeader().getString(MsgType.FIELD)); checkRequiredFields(message.getHeader(), headerFieldsByTag.getRequiredElements()); checkRequiredFields(message, messageInfo.getRequiredElements()); checkRequiredFields(message.getTrailer(), trailerFieldsByTag.getRequiredElements());
String msgType = message.getHeader().getString(MsgType.FIELD); if (hasVersion) { checkMsgType(msgType); checkHasRequired(message.getHeader(), message, message.getTrailer(), msgType);
void validate(quickfix.Message message) throws quickfix.FieldNotFound, InvalidMessage { String beginString = message.getHeader().getString(BeginString.FIELD); String msgType = message.getHeader().getString(MsgType.FIELD); if (version != null && !version.equals(beginString)) { throw new UnsupportedVersion(); } // This is a little different than the C++ code if (doCheckFieldsOutofOrder && !message.hasValidStructure()) { throw new FieldException(SessionRejectReason.TAG_SPECIFIED_OUT_OF_REQUIRED_ORDER, message.getInvalidStructureTag()); } if (version != null) { if (!isMsgType(msgType)) { throw new InvalidMessageType(); } Message messageInfo = getMessage(message.getHeader().getString(MsgType.FIELD)); checkRequiredFields(message.getHeader(), headerFieldsByTag.getRequiredElements()); checkRequiredFields(message, messageInfo.getRequiredElements()); checkRequiredFields(message.getTrailer(), trailerFieldsByTag.getRequiredElements()); } checkFields(message.getHeader(), msgType); checkFields(message.getTrailer(), msgType); checkFields(message, msgType); }
52526 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52526/4af152a6fc05e5cb33fd9e1685b685d4dea7c867/DataDictionary.java/clean/src/quickfix/DataDictionary.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 918, 1954, 12, 19525, 904, 18, 1079, 883, 13, 1216, 9549, 904, 18, 974, 2768, 16, 1962, 1079, 288, 3639, 514, 2376, 780, 273, 883, 18, 588, 1864, 7675, 588, 780, 12, 8149, 780, 18, 67...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 918, 1954, 12, 19525, 904, 18, 1079, 883, 13, 1216, 9549, 904, 18, 974, 2768, 16, 1962, 1079, 288, 3639, 514, 2376, 780, 273, 883, 18, 588, 1864, 7675, 588, 780, 12, 8149, 780, 18, 67...
setValueType(ENUMERATED);
setValueType(ENUMERATED_PROP);
QuickDProp (int i) { // setValueType((i == NFC || i == NFKC) ? ENUMERATED : BINARY); setValueType(ENUMERATED); type = DERIVED_NORMALIZATION; nfx = nf[i]; NO = nfx.getName() + "_NO"; MAYBE = nfx.getName() + "_MAYBE"; name = nfx.getName() + "_QuickCheck"; shortName = nfx.getName() + "_QC"; header = "# Derived Property: " + name + "\r\n# Generated from computing decomposibles" + ((i == NFC || i == NFKC) ? " (and characters that may compose with previous ones)" : ""); }
5620 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5620/48a93f33defcd4834224664c273ac45d72bca59e/DerivedProperty.java/buggy/tools/unicodetools/com/ibm/text/UCD/DerivedProperty.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 540, 19884, 40, 4658, 261, 474, 277, 13, 288, 5411, 368, 5524, 559, 12443, 77, 422, 423, 4488, 747, 277, 422, 423, 13121, 39, 13, 692, 24776, 654, 6344, 294, 22468, 1769, 5411, 5524, 559, 12...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 540, 19884, 40, 4658, 261, 474, 277, 13, 288, 5411, 368, 5524, 559, 12443, 77, 422, 423, 4488, 747, 277, 422, 423, 13121, 39, 13, 692, 24776, 654, 6344, 294, 22468, 1769, 5411, 5524, 559, 12...
File repoPath = new File( localRepo );
public static void main( String[] args ) throws Exception { if ( args.length != 5 ) { System.err.println( "Usage: pluggy <mode> <source directory> <output directory> <pom> <local-repo>" ); System.exit( 1 ); } // Make sense of the args. String mode = args[0]; String sourceDirectory = args[1]; String outputDirectory = args[2]; String pom = args[3]; String localRepo = args[4]; // Massage the local-repo path into an ArtifactRepository. File repoPath = new File( localRepo ); URL repoUrl = repoPath.toURL(); MavenXpp3Reader modelReader = new MavenXpp3Reader(); FileReader reader = new FileReader( pom ); Model model = modelReader.read( reader ); // Not doing inheritence, except for groupId and version if ( model.getGroupId() == null ) { model.setGroupId( model.getParent().getGroupId() ); } if ( model.getVersion() == null ) { model.setVersion( model.getParent().getVersion() ); } MavenProject project = new MavenProject( model ); project.setFile( new File( pom ) ); project.addCompileSourceRoot( sourceDirectory ); // Lookup the mojo scanner instance, and use it to scan for mojo's, and // extract their descriptors. MojoScanner scanner = new DefaultMojoScanner( Collections.singletonMap( "java", new JavaMojoDescriptorExtractor() ) ); Set descriptors = scanner.execute( project ); // Create the generator. Generator generator = null; if ( mode.equals( "descriptor" ) ) { generator = new PluginDescriptorGenerator(); } else if ( mode.equals( "xdoc" ) ) { generator = new PluginXdocGenerator(); } else if ( mode.equals( "jelly" ) ) { generator = new JellyHarnessGenerator(); } else if ( mode.equals( "bean" ) ) { generator = new BeanGenerator(); } // Use the generator to process the discovered descriptors and produce // something with them. generator.execute( outputDirectory, descriptors, project ); }
50542 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50542/24c6328ad361f8e709e2b3fddefd9cde220a0628/Main.java/clean/maven-plugin-tools/maven-plugin-tools-pluggy/src/main/java/org/apache/maven/tools/plugin/pluggy/Main.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 760, 918, 2774, 12, 514, 8526, 833, 262, 3639, 1216, 1185, 565, 288, 3639, 309, 261, 833, 18, 2469, 480, 1381, 262, 3639, 288, 5411, 2332, 18, 370, 18, 8222, 12, 315, 5357, 30, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 760, 918, 2774, 12, 514, 8526, 833, 262, 3639, 1216, 1185, 565, 288, 3639, 309, 261, 833, 18, 2469, 480, 1381, 262, 3639, 288, 5411, 2332, 18, 370, 18, 8222, 12, 315, 5357, 30, ...
else if (attGroupRefsCount == 1) {
} else if (attGroupRefsCount == 1) {
private void renameRedefinedComponents(Element redefineDecl, Element schemaToRedefine) throws Exception { for (Element child = XUtil.getFirstChildElement(redefineDecl); child != null; child = XUtil.getNextSiblingElement(child)) { String name = child.getLocalName(); if (name.equals(SchemaSymbols.ELT_ANNOTATION) ) continue; else if (name.equals(SchemaSymbols.ELT_SIMPLETYPE)) { String typeName = child.getAttribute( SchemaSymbols.ATT_NAME ); QName processedTypeName = new QName(-1, fStringPool.addSymbol(typeName), fStringPool.addSymbol(typeName), fTargetNSURI); Element grandKid = XUtil.getFirstChildElement(child); if (grandKid == null) // REVISIT: Localize reportGenericSchemaError("a simpleType child of a <redefine> must have a restriction element as a child"); else { String grandKidName = grandKid.getLocalName(); if(!grandKidName.equals(SchemaSymbols.ELT_RESTRICTION)) // REVISIT: Localize reportGenericSchemaError("a simpleType child of a <redefine> must have a restriction element as a child"); else { String derivedBase = grandKid.getAttribute( SchemaSymbols.ATT_BASE ); QName processedDerivedBase = parseBase(derivedBase); if(!processedTypeName.equals(processedDerivedBase)) // REVISIT: Localize reportGenericSchemaError("the base attribute of the restriction child of a simpleType child of a redefine must have the same value as the simpleType's type attribute"); else { // now we have to do the renaming... String newBase = derivedBase + "#redefined"; grandKid.setAttribute( SchemaSymbols.ATT_BASE, newBase ); fixRedefinedSchema(SchemaSymbols.ELT_SIMPLETYPE, typeName, typeName+"#redefined", schemaToRedefine); } } } } else if (name.equals(SchemaSymbols.ELT_COMPLEXTYPE)) { String typeName = child.getAttribute( SchemaSymbols.ATT_NAME ); QName processedTypeName = new QName(-1, fStringPool.addSymbol(typeName), fStringPool.addSymbol(typeName), fTargetNSURI); Element grandKid = XUtil.getFirstChildElement(child); if (grandKid == null) // REVISIT: Localize reportGenericSchemaError("a complexType child of a <redefine> must have a restriction or extension element as a grandchild"); else { // have to go one more level down; let another pass worry whether complexType is valid. Element greatGrandKid = XUtil.getFirstChildElement(grandKid); if (greatGrandKid == null) // REVISIT: Localize reportGenericSchemaError("a complexType child of a <redefine> must have a restriction or extension element as a grandchild"); else { String greatGrandKidName = greatGrandKid.getLocalName(); if(!greatGrandKidName.equals(SchemaSymbols.ELT_RESTRICTION) && !greatGrandKidName.equals(SchemaSymbols.ELT_EXTENSION)) // REVISIT: Localize reportGenericSchemaError("a complexType child of a <redefine> must have a restriction or extension element as a grandchild"); else { String derivedBase = greatGrandKid.getAttribute( SchemaSymbols.ATT_BASE ); QName processedDerivedBase = parseBase(derivedBase); if(!processedTypeName.equals(processedDerivedBase)) // REVISIT: Localize reportGenericSchemaError("the base attribute of the restriction or extension grandchild of a complexType child of a redefine must have the same value as the complexType's type attribute"); else { // now we have to do the renaming... String newBase = derivedBase + "#redefined"; greatGrandKid.setAttribute( SchemaSymbols.ATT_BASE, newBase ); fixRedefinedSchema(SchemaSymbols.ELT_COMPLEXTYPE, typeName, typeName+"#redefined", schemaToRedefine); } } } } } else if (name.equals(SchemaSymbols.ELT_ATTRIBUTEGROUP)) { String baseName = child.getAttribute( SchemaSymbols.ATT_NAME ); QName processedBaseName = new QName(-1, fStringPool.addSymbol(baseName), fStringPool.addSymbol(baseName), fTargetNSURI); int attGroupRefsCount = changeRedefineGroup(processedBaseName, name, child); if(attGroupRefsCount > 1) // REVISIT: localize reportGenericSchemaError("if an attributeGroup child of a <redefine> element contains an attributeGroup ref'ing itself, it must have exactly 1; this one has " + attGroupRefsCount); else if (attGroupRefsCount == 1) { fixRedefinedSchema(SchemaSymbols.ELT_ATTRIBUTEGROUP, baseName, baseName+"#redefined", schemaToRedefine); } else { // REVISIT (schema PR): the case where must prove the attributeGroup restricts the redefined one. } } else if (name.equals(SchemaSymbols.ELT_GROUP)) { String baseName = child.getAttribute( SchemaSymbols.ATT_NAME ); QName processedBaseName = new QName(-1, fStringPool.addSymbol(baseName), fStringPool.addSymbol(baseName), fTargetNSURI); int groupRefsCount = changeRedefineGroup(processedBaseName, name, child); if(groupRefsCount > 1) // REVISIT: localize reportGenericSchemaError("if a group child of a <redefine> element contains a group ref'ing itself, it must have exactly 1; this one has " + groupRefsCount); else if (groupRefsCount == 1) { fixRedefinedSchema(SchemaSymbols.ELT_GROUP, baseName, baseName+"#redefined", schemaToRedefine); } else { // REVISIT (schema PR): the case where must prove the group restricts the redefined one. } } else { // REVISIT: Localize reportGenericSchemaError("invalid top-level content for <redefine>"); return; } } // for } // renameRedefinedComponents
46079 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46079/5578a982ea93cf05458e8dc39d3ce42c5c529120/TraverseSchema.java/clean/src/org/apache/xerces/validators/schema/TraverseSchema.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1152, 918, 6472, 426, 2178, 7171, 12, 1046, 283, 11255, 3456, 16, 3010, 1963, 774, 426, 11255, 13, 1216, 1185, 288, 202, 202, 1884, 261, 1046, 1151, 273, 1139, 1304, 18, 588, 3759, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1152, 918, 6472, 426, 2178, 7171, 12, 1046, 283, 11255, 3456, 16, 3010, 1963, 774, 426, 11255, 13, 1216, 1185, 288, 202, 202, 1884, 261, 1046, 1151, 273, 1139, 1304, 18, 588, 3759, ...
Rectangle maxBounds = getMainArea();
Rectangle maxBounds = new Rectangle(0,0,500,500);
public void zoomOutOnNode( NestedGraphNodeEditPart editPart) { if (editPart == null) return; Rectangle maxBounds = getMainArea(); Rectangle startBounds = editPart.getAbsoluteBounds(); doCollapseZoom(maxBounds, startBounds, 10, editPart); }
11225 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/11225/a118934ad7c5c95b4ca0fc683a885cfda986119f/NestedGraphEditPart.java/buggy/org.eclipse.zest.core/src/org/eclipse/zest/core/internal/nestedgraphviewer/parts/NestedGraphEditPart.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 7182, 1182, 1398, 907, 12, 19071, 4137, 907, 4666, 1988, 3874, 1988, 13, 288, 202, 202, 430, 261, 4619, 1988, 422, 446, 13, 1082, 202, 2463, 31, 9506, 202, 19463, 943, 56...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 7182, 1182, 1398, 907, 12, 19071, 4137, 907, 4666, 1988, 3874, 1988, 13, 288, 202, 202, 430, 261, 4619, 1988, 422, 446, 13, 1082, 202, 2463, 31, 9506, 202, 19463, 943, 56...
m_handler.startElement(namespace, localName, elemName);
m_handler.startElement(namespace, localName, elemName, null);
protected void startNode(Node node) throws org.xml.sax.SAXException { try { if ((Node.ELEMENT_NODE == node.getNodeType()) && (m_startNode == node)) { DOMHelper dhelper = m_transformer.getXPathContext().getDOMHelper(); String elemName = node.getNodeName(); String localName = dhelper.getLocalNameOfNode(node); String namespace = dhelper.getNamespaceOfNode(node); m_handler.startElement(namespace, localName, elemName); for (Node parent = node; parent != null; parent = parent.getParentNode()) { if (Node.ELEMENT_NODE != parent.getNodeType()) continue; NamedNodeMap atts = ((Element) parent).getAttributes(); int n = atts.getLength(); for (int i = 0; i < n; i++) { String nsDeclPrefix = null; Attr attr = (Attr) atts.item(i); String name = attr.getName(); String value = attr.getValue(); if (name.startsWith("xmlns:")) { // get the namespace prefix nsDeclPrefix = name.substring(name.indexOf(":") + 1); } else if (name.equals("xmlns")) { nsDeclPrefix = ""; } if ((nsDeclPrefix == null) && (node != parent)) continue; /* else if(nsDeclPrefix != null) { String desturi = m_processor.getURI(nsDeclPrefix); // Look for an alias for this URI. If one is found, use it as the result URI String aliasURI = m_elem.m_stylesheet.lookForAlias(value); if(aliasURI.equals(desturi)) // TODO: Check for extension namespaces { continue; } } */ m_handler.addAttribute(dhelper.getNamespaceOfNode(attr), dhelper.getLocalNameOfNode(attr), name, "CDATA", value); // Make sure namespace is not in the excluded list then // add to result tree /* if(!m_handler.getPendingAttributes().contains(name)) { if(nsDeclPrefix == null) { m_handler.addAttribute(name, "CDATA", value); } else { String desturi = m_handler.getURI(nsDeclPrefix); if(null == desturi) { m_handler.addAttribute(name, "CDATA", value); } else if(!desturi.equals(value)) { m_handler.addAttribute(name, "CDATA", value); } } } */ } } // m_handler.processResultNS(m_elem); } else { super.startNode(node); } } catch(javax.xml.transform.TransformerException te) { throw new org.xml.sax.SAXException(te); } }
2723 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2723/00f5ecfd3b2dafadf0ef1ecbcd3ba95d03d5e0ed/TreeWalker2Result.java/clean/src/org/apache/xalan/transformer/TreeWalker2Result.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 4750, 918, 25467, 12, 907, 756, 13, 1216, 2358, 18, 2902, 18, 87, 651, 18, 55, 2501, 503, 225, 288, 565, 775, 565, 288, 1377, 309, 14015, 907, 18, 10976, 67, 8744, 422, 756, 18, 588, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 4750, 918, 25467, 12, 907, 756, 13, 1216, 2358, 18, 2902, 18, 87, 651, 18, 55, 2501, 503, 225, 288, 565, 775, 565, 288, 1377, 309, 14015, 907, 18, 10976, 67, 8744, 422, 756, 18, 588, ...
Object newValue = null; if (value == RADIO_BTN_ON || value == RADIO_BTN_OFF) { newValue = checked ? RADIO_BTN_ON : RADIO_BTN_OFF; } else { newValue = checked ? TOGGLE_BTN_ON : TOGGLE_BTN_OFF;
Object newValue = null; if (value == null || value == VAL_TOGGLE_BTN_ON || value == VAL_TOGGLE_BTN_OFF) { newValue = checked ? VAL_TOGGLE_BTN_ON : VAL_TOGGLE_BTN_OFF; } else if (value == VAL_RADIO_BTN_ON || value == VAL_RADIO_BTN_OFF) { newValue = checked ? VAL_RADIO_BTN_ON : VAL_RADIO_BTN_OFF; } else { return; } if (newValue != value) { value = newValue; if (checked) firePropertyChange(CHECKED, Boolean.FALSE, Boolean.TRUE); else firePropertyChange(CHECKED, Boolean.TRUE, Boolean.FALSE); }
public void setChecked(boolean checked) { Object newValue = null; // For backward compatibility, if the style is not // radio button, then convert it to a toggle button. if (value == RADIO_BTN_ON || value == RADIO_BTN_OFF) { newValue = checked ? RADIO_BTN_ON : RADIO_BTN_OFF; } else { newValue = checked ? TOGGLE_BTN_ON : TOGGLE_BTN_OFF; } if (newValue != value) { value = newValue; if (checked) firePropertyChange(CHECKED, Boolean.FALSE, Boolean.TRUE); else firePropertyChange(CHECKED, Boolean.TRUE, Boolean.FALSE); }}
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/a803b1cab75d4557a59d39831eed86f5066a9020/Action.java/clean/bundles/org.eclipse.jface/src/org/eclipse/jface/action/Action.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1071, 918, 444, 11454, 12, 6494, 5950, 13, 288, 202, 921, 6129, 273, 446, 31, 202, 759, 2457, 12555, 8926, 16, 309, 326, 2154, 353, 486, 202, 759, 13512, 3568, 16, 1508, 1765, 518, 358, 279,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1071, 918, 444, 11454, 12, 6494, 5950, 13, 288, 202, 921, 6129, 273, 446, 31, 202, 759, 2457, 12555, 8926, 16, 309, 326, 2154, 353, 486, 202, 759, 13512, 3568, 16, 1508, 1765, 518, 358, 279,...
MUseCaseInstance modelElement = MFactory.getDefaultFactory().createUseCaseInstance();
MUseCaseInstance modelElement = MFactory.getDefaultFactory().createUseCaseInstance();
public MUseCaseInstance createUseCaseInstance() { MUseCaseInstance modelElement = MFactory.getDefaultFactory().createUseCaseInstance(); super.initialize(modelElement); return modelElement; }
7166 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7166/23464f9cbc3169e9d2f1919998cae2c59b514985/UseCasesFactory.java/clean/src_new/org/argouml/model/uml/behavioralelements/usecases/UseCasesFactory.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 490, 3727, 2449, 1442, 752, 3727, 2449, 1442, 1435, 288, 3639, 490, 3727, 2449, 1442, 938, 1046, 273, 490, 1733, 18, 588, 1868, 1733, 7675, 2640, 3727, 2449, 1442, 5621, 202, 9565, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 490, 3727, 2449, 1442, 752, 3727, 2449, 1442, 1435, 288, 3639, 490, 3727, 2449, 1442, 938, 1046, 273, 490, 1733, 18, 588, 1868, 1733, 7675, 2640, 3727, 2449, 1442, 5621, 202, 9565, ...
.getStringValue( );
.getIntValue( );
protected void updateBaseBorder( DesignElementHandle handle, BaseBorder border ) { border.bottomColor = handle.getPropertyHandle( StyleHandle.BORDER_BOTTOM_COLOR_PROP ) .getStringValue( ); border.bottomStyle = handle.getPropertyHandle( StyleHandle.BORDER_BOTTOM_STYLE_PROP ) .getStringValue( ); border.bottomWidth = handle.getPropertyHandle( StyleHandle.BORDER_BOTTOM_WIDTH_PROP ) .getStringValue( ); border.topColor = handle.getPropertyHandle( StyleHandle.BORDER_TOP_COLOR_PROP ) .getStringValue( ); border.topStyle = handle.getPropertyHandle( StyleHandle.BORDER_TOP_STYLE_PROP ) .getStringValue( ); border.topWidth = handle.getPropertyHandle( StyleHandle.BORDER_TOP_WIDTH_PROP ) .getStringValue( ); border.leftColor = handle.getPropertyHandle( StyleHandle.BORDER_LEFT_COLOR_PROP ) .getStringValue( ); border.leftStyle = handle.getPropertyHandle( StyleHandle.BORDER_LEFT_STYLE_PROP ) .getStringValue( ); border.leftWidth = handle.getPropertyHandle( StyleHandle.BORDER_LEFT_WIDTH_PROP ) .getStringValue( ); border.rightColor = handle.getPropertyHandle( StyleHandle.BORDER_RIGHT_COLOR_PROP ) .getStringValue( ); border.rightStyle = handle.getPropertyHandle( StyleHandle.BORDER_RIGHT_STYLE_PROP ) .getStringValue( ); border.rightWidth = handle.getPropertyHandle( StyleHandle.BORDER_RIGHT_WIDTH_PROP ) .getStringValue( ); }
46013 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46013/1ea2b4515ba6ace2b3e387f7568e91ce84efdcbe/ReportElementEditPart.java/buggy/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/editors/schematic/editparts/ReportElementEditPart.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1117, 918, 1089, 2171, 8107, 12, 29703, 1046, 3259, 1640, 16, 1082, 202, 2171, 8107, 5795, 262, 202, 95, 202, 202, 8815, 18, 9176, 2957, 273, 1640, 18, 588, 1396, 3259, 12, 9767, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1117, 918, 1089, 2171, 8107, 12, 29703, 1046, 3259, 1640, 16, 1082, 202, 2171, 8107, 5795, 262, 202, 95, 202, 202, 8815, 18, 9176, 2957, 273, 1640, 18, 588, 1396, 3259, 12, 9767, 3...
public Line getLine()
public final Line getLine()
public Line getLine() { return line; }
50763 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50763/7cc107e01ff95c250142dda3e246542e1b0c0794/LineEvent.java/buggy/core/src/classpath/javax/javax/sound/sampled/LineEvent.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 727, 5377, 9851, 1435, 225, 288, 565, 327, 980, 31, 225, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 727, 5377, 9851, 1435, 225, 288, 565, 327, 980, 31, 225, 289, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
void setConnector(BugzillaRepositoryConnector connector) { this.connector = connector;
static void setConnector(BugzillaRepositoryConnector theConnector) { connector = theConnector;
void setConnector(BugzillaRepositoryConnector connector) { this.connector = connector; }
51989 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51989/81b64d9c45af68b8fc521c261505cbb06606d27e/BugzillaCorePlugin.java/buggy/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaCorePlugin.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 6459, 444, 7487, 12, 19865, 15990, 3305, 7487, 8703, 13, 288, 202, 202, 2211, 18, 23159, 273, 8703, 31, 202, 97, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 6459, 444, 7487, 12, 19865, 15990, 3305, 7487, 8703, 13, 288, 202, 202, 2211, 18, 23159, 273, 8703, 31, 202, 97, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
return _type = Type.NodeSetDTM;
return _type = Type.NodeSet;
public Type typeCheck(SymbolTable stable) throws TypeCheckError { Type texp = _exp.typeCheck(stable); if (texp instanceof ReferenceType) { // TODO: print a warning indicating that no expansion is // possible in this case due to lack of type info throw new TypeCheckError(this); } if (texp instanceof NumberType) { if (texp instanceof IntType == false) { _exp = new CastExpr(_exp, Type.Int); } // Expand [last()] into [position() = last()] if ((_exp instanceof LastCall) || (getParent() instanceof Pattern) || (getParent() instanceof FilterExpr)) { final QName position = getParser().getQName("position"); final PositionCall positionCall; positionCall = new PositionCall(position, -1); positionCall.setParser(getParser()); positionCall.setParent(this); _exp = new EqualityExpr(EqualityExpr.EQ, positionCall, _exp); if (_exp.typeCheck(stable) != Type.Boolean) { _exp = new CastExpr(_exp, Type.Boolean); } _nthPositionFilter = false; return _type = Type.Boolean; } // Use NthPositionIterator to handle [position()] or [a] else { SyntaxTreeNode parent = getParent(); if ((parent != null) && (parent instanceof Step)) { parent = parent.getParent(); if ((parent != null) && (parent instanceof AbsoluteLocationPath)) { // TODO: Special case for "//*[n]" pattern.... _nthDescendant = true; return _type = Type.NodeSetDTM; } } _nthPositionFilter = true; return _type = Type.NodeSetDTM; } } else if (texp instanceof BooleanType == false) { _exp = new CastExpr(_exp, Type.Boolean); } _nthPositionFilter = false; return _type = Type.Boolean; }
46591 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46591/f0eadbdddedfdd79ebf4f6c6de8e4fc82241e61f/Predicate.java/buggy/src/org/apache/xalan/xsltc/compiler/Predicate.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 1412, 618, 1564, 12, 5335, 1388, 14114, 13, 1216, 1412, 1564, 668, 288, 202, 559, 268, 2749, 273, 389, 2749, 18, 723, 1564, 12, 15021, 1769, 202, 430, 261, 88, 2749, 1276, 6268, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 1412, 618, 1564, 12, 5335, 1388, 14114, 13, 1216, 1412, 1564, 668, 288, 202, 559, 268, 2749, 273, 389, 2749, 18, 723, 1564, 12, 15021, 1769, 202, 430, 261, 88, 2749, 1276, 6268, 5...
if( !transImplInterface(childClass, sc) ) continue;
private void addConstructor( IntertypeConstructorDecl icd) { SootClass sc = icd.getTarget().getSootClass(); if( sc.isInterface() ) { for( Iterator childClassIt = GlobalAspectInfo.v().getWeavableClasses().iterator(); childClassIt.hasNext(); ) { final SootClass childClass = ((AbcClass) childClassIt.next()).getSootClass(); if( childClass.isInterface() ) continue; if( !transImplInterface(childClass, sc) ) continue; if( childClass.hasSuperclass() && transImplInterface(childClass.getSuperclass(), sc) ) continue; createConstructor(childClass,icd); // System.out.println("added method "+ method.getName() + " to class " + childClass); } } else createConstructor(sc,icd); }
236 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/236/9281bf91a95525c462cb2d8e0373996fcb53c5f3/IntertypeAdjuster.java/buggy/aop/abc/src/abc/weaving/weaver/IntertypeAdjuster.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1152, 918, 527, 6293, 12, 5294, 723, 6293, 3456, 277, 4315, 13, 288, 202, 202, 55, 1632, 797, 888, 273, 277, 4315, 18, 588, 2326, 7675, 588, 55, 1632, 797, 5621, 1082, 225, 309, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1152, 918, 527, 6293, 12, 5294, 723, 6293, 3456, 277, 4315, 13, 288, 202, 202, 55, 1632, 797, 888, 273, 277, 4315, 18, 588, 2326, 7675, 588, 55, 1632, 797, 5621, 1082, 225, 309, ...
buf.append(MiscUtilities.createWhiteSpace(whitespace,tabSize));
buf.append(MiscUtilities.createWhiteSpace(whitespace,tabSize,width));
public static String spacesToTabs(String in, int tabSize) { StringBuffer buf = new StringBuffer(); int width = 0; int whitespace = 0; for(int i = 0; i < in.length(); i++) { switch(in.charAt(i)) { case ' ': whitespace++; width++; break; case '\t': int tab = tabSize - (width % tabSize); width += tab; whitespace += tab; break; case '\n': if(whitespace != 0) { buf.append(MiscUtilities .createWhiteSpace(whitespace,tabSize)); } whitespace = 0; width = 0; buf.append('\n'); break; default: if(whitespace != 0) { buf.append(MiscUtilities .createWhiteSpace(whitespace,tabSize)); whitespace = 0; } buf.append(in.charAt(i)); width++; break; } } if(whitespace != 0) { buf.append(MiscUtilities.createWhiteSpace(whitespace,tabSize)); } return buf.toString(); } //}}}
8690 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8690/c0462f6f3e12274c0942e48310c857965935f37b/TextUtilities.java/clean/org/gjt/sp/jedit/TextUtilities.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 760, 514, 7292, 774, 17348, 12, 780, 316, 16, 509, 3246, 1225, 13, 202, 95, 202, 202, 780, 1892, 1681, 273, 394, 6674, 5621, 202, 202, 474, 1835, 273, 374, 31, 202, 202, 474...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 760, 514, 7292, 774, 17348, 12, 780, 316, 16, 509, 3246, 1225, 13, 202, 95, 202, 202, 780, 1892, 1681, 273, 394, 6674, 5621, 202, 202, 474, 1835, 273, 374, 31, 202, 202, 474...
/* int logLevel;
int logLevel;
protected static Logger initLogger(ServletContext servletContext, Settings settings) throws Exception { return new ConsoleLogger(ConsoleLogger.LEVEL_DEBUG); // create a bootstrap logger /* int logLevel; final String logLevelString = settings.getBootstrapLogLevel(); if ( "DEBUG".equalsIgnoreCase(logLevelString) ) { logLevel = ServletLogger.LEVEL_DEBUG; } else if ( "WARN".equalsIgnoreCase(logLevelString) ) { logLevel = ServletLogger.LEVEL_WARN; } else if ( "ERROR".equalsIgnoreCase(logLevelString) ) { logLevel = ServletLogger.LEVEL_ERROR; } else { logLevel = ServletLogger.LEVEL_INFO; } final Logger bootstrapLogger = new ServletLogger(servletContext, "Cocoon", logLevel); // create an own context for the logger manager final DefaultContext subcontext = new SettingsContext(settings); subcontext.put("context-work", new File(settings.getWorkDirectory())); final File logSCDir = new File(settings.getWorkDirectory(), "cocoon-logs"); logSCDir.mkdirs(); subcontext.put("log-dir", logSCDir.toString()); subcontext.put("servlet-context", servletContext); final Log4JConfLoggerManager loggerManager = new Log4JConfLoggerManager(); loggerManager.enableLogging(bootstrapLogger); loggerManager.contextualize(subcontext); // Configure the log4j manager String loggerConfig = settings.getLoggingConfiguration(); if ( !loggerConfig.startsWith("/") ) { loggerConfig = '/' + loggerConfig; } if ( loggerConfig != null ) { final URL url = servletContext.getResource(loggerConfig); if ( url != null ) { final ConfigurationBuilder builder = new ConfigurationBuilder(settings); final Configuration conf = builder.build(servletContext.getResourceAsStream(loggerConfig)); // override log level? if (settings.getOverrideLogLevel() != null) { changeLogLevel(conf.getChildren(), settings.getOverrideLogLevel()); } loggerManager.configure(conf); } else { bootstrapLogger.warn("The logging configuration '" + loggerConfig + "' is not available."); loggerManager.configure(new DefaultConfiguration("empty")); } } else { loggerManager.configure(new DefaultConfiguration("empty")); } String accesslogger = settings.getEnvironmentLogger(); if (accesslogger == null) { accesslogger = "cocoon"; } return loggerManager.getLoggerForCategory(accesslogger);*/ }
46428 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46428/91653ca56945c4d69a9dbdcec18a8d7d3f025737/BeanFactoryUtil.java/buggy/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryUtil.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 4750, 760, 4242, 1208, 3328, 12, 4745, 1042, 20474, 16, 4766, 4202, 8709, 4202, 1947, 13, 565, 1216, 1185, 288, 3639, 327, 394, 9657, 3328, 12, 10215, 3328, 18, 10398, 67, 9394, 1769, 363...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 4750, 760, 4242, 1208, 3328, 12, 4745, 1042, 20474, 16, 4766, 4202, 8709, 4202, 1947, 13, 565, 1216, 1185, 288, 3639, 327, 394, 9657, 3328, 12, 10215, 3328, 18, 10398, 67, 9394, 1769, 363...
out.print("\" not-found=\"ignore\" ");
out.print("\" ");
public boolean generate(XPathContext context, ProgramWriter out) { try { out.print("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"); out.print("\n\n<!-- Generated by OpenXava: "); out.print(new Date()); out.print(" -->"); String packageName = properties.getProperty("arg3"); String componentName = properties.getProperty("arg4"); String aggregateName = properties.getProperty("arg5"); MetaComponent component = MetaComponent.get(componentName); String name=null; MetaModel metaModel=null; if (aggregateName == null) { name=componentName; metaModel = component.getMetaEntity(); } else { name=aggregateName; metaModel = component.getMetaAggregate(aggregateName); } ModelMapping mapping = metaModel.getMapping(); out.print("\n\n<!DOCTYPE hibernate-mapping SYSTEM \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n\n<hibernate-mapping package=\""); out.print(packageName); out.print("\">\n\n <class \n \tname=\""); out.print(name); out.print("\"\n \ttable=\""); out.print(mapping.getTable()); out.print("\">"); Collection keyMembers = metaModel.getMetaMembersKey(); Collection keyProperties = metaModel.getMetaPropertiesKey(); if (keyMembers.size() == 0) { throw new XavaException("model_without_key_error", name); } else if (keyProperties.size() == 1 && keyMembers.size() == 1) { MetaProperty key = (MetaProperty) keyProperties.iterator().next(); PropertyMapping pMapping = key.getMapping(); String propertyName = key.getName(); String generator = key.isHidden() && !key.hasCalculatorDefaultValueOnCreate()?"native":"assigned"; String type = pMapping.getCmpType().isArray()?"":"type='" + pMapping.getCmpTypeName() + "'"; out.print(" \t\n\t\t<id name=\""); out.print(propertyName); out.print("\" column=\""); out.print(pMapping.getColumn()); out.print("\" access=\"field\" "); out.print(type); out.print(">"); if (key.hasCalculatorDefaultValueOnCreate()) { out.print(" \n\t\t\t<generator class=\"org.openxava.hibernate.impl.DefaultValueIdentifierGenerator\">\n\t\t\t\t<param name=\"property\">"); out.print(propertyName); out.print("</param>\n\t\t\t</generator>"); } else { out.print(" \n\t\t\t<generator class=\""); out.print(generator); out.print("\"/>"); } out.print(" \n\t\t</id>"); } else { out.print(" \n\t\t<composite-id>"); for (Iterator it = keyMembers.iterator(); it.hasNext();) { MetaMember key = (MetaMember) it.next(); if (key instanceof MetaProperty) { PropertyMapping pMapping = ((MetaProperty) key).getMapping(); String propertyName = key.getName(); String type = pMapping.getCmpType().isArray()?"":"type='" + pMapping.getCmpTypeName() + "'"; out.print(" \t\n\t\t\t<key-property name=\""); out.print(propertyName); out.print("\" column=\""); out.print(pMapping.getColumn()); out.print("\" access=\"field\" "); out.print(type); out.print("/>"); } if (key instanceof MetaReference) { if (mapping.isReferenceOverlappingWithSomeProperty(key.getName())) { for (Iterator itDetails = mapping.getReferenceMapping(key.getName()).getDetails().iterator(); itDetails.hasNext(); ) { ReferenceMappingDetail detail = (ReferenceMappingDetail) itDetails.next(); if (!mapping.isReferenceOverlappingWithSomeProperty(key.getName(), detail.getReferencedModelProperty())) { out.print(" \n\t\t\t<key-property name=\""); out.print(key.getName()); out.print("_"); out.print(Strings.change(detail.getReferencedModelProperty(), ".", "_")); out.print("\" column=\""); out.print(detail.getColumn()); out.print("\" access=\"field\"/>"); } } } else { ReferenceMapping pMapping = mapping.getReferenceMapping(key.getName()); String referenceName = key.getName(); String className = ((MetaReference) key).getMetaModelReferenced().getPOJOClassName(); out.print(" \t\n\t\t\t<key-many-to-one name=\""); out.print(referenceName); out.print("\" class=\""); out.print(className); out.print("\">"); for (Iterator itC = pMapping.getColumns().iterator(); itC.hasNext();) { String col = (String) itC.next(); out.print(" \t\t\t\n\t\t\t\t<column name=\""); out.print(col); out.print("\"/>"); } out.print(" \t\t\t\t\t\t\n\t\t\t</key-many-to-one>"); } } } out.print(" \t\n\t\t</composite-id>"); } Collection properties = metaModel.getMetaPropertiesPersistents(); for (Iterator it = properties.iterator(); it.hasNext();) { MetaProperty prop = (MetaProperty) it.next(); PropertyMapping pMapping = prop.getMapping(); String propertyName = prop.getName(); if (!prop.isKey()) { if (pMapping.hasMultipleConverter()) { for (Iterator itCmpFields = pMapping.getCmpFields().iterator(); itCmpFields.hasNext();) { CmpField field = (CmpField) itCmpFields.next(); out.print(" \n\t\t<property name=\""); out.print(propertyName); out.print("_"); out.print(field.getConverterPropertyName()); out.print("\" column=\""); out.print(field.getColumn()); out.print("\" access=\"field\" type=\""); out.print(field.getCmpTypeName()); out.print("\"/>"); } } else { String type = pMapping.getCmpType().isArray()?"":"type='" + pMapping.getCmpTypeName() + "'"; out.print(" \t\n\t\t<property name=\""); out.print(propertyName); out.print("\" column=\""); out.print(pMapping.getColumn()); out.print("\" access=\"field\" "); out.print(type); out.print("/>"); } } } Iterator itReferences = metaModel.getMetaReferences().iterator(); while (itReferences.hasNext()) { MetaReference reference = (MetaReference) itReferences.next(); if (reference.isKey() && !mapping.isReferenceOverlappingWithSomeProperty(reference.getName())) continue; if (reference.getMetaModelReferenced() instanceof MetaAggregateForReference) { for (Iterator itAggregateProperties = reference.getMetaModelReferenced().getMetaPropertiesPersistentsFromReference(reference.getName()).iterator(); itAggregateProperties.hasNext();) { MetaProperty property = (MetaProperty) itAggregateProperties.next(); String propertyName = reference.getName() + "_" + property.getName(); String column = mapping.getColumn(reference.getName() + "_" + property.getName()); String type = property.getMapping().getCmpType().isArray()?"":"type='" + property.getMapping().getCmpTypeName() + "'"; out.print(" \n\t\t<property name=\""); out.print(propertyName); out.print("\" column=\""); out.print(column); out.print("\" access=\"field\" "); out.print(type); out.print("/>"); } for (Iterator itAggregateReferences = reference.getMetaModelReferenced().getMetaReferences().iterator(); itAggregateReferences.hasNext();) { MetaReference ref = (MetaReference) itAggregateReferences.next(); String refName = reference.getName() + "_" + ref.getName(); Collection columns = mapping.getReferenceMapping(reference.getName() + "_" + ref.getName()).getColumns(); boolean overlapped = mapping.isReferenceOverlappingWithSomeProperty(reference.getName() + "_" + ref.getName()); String insertUpdate = overlapped?"insert='false' update='false'":""; if (columns.size() == 1) { String column = (String) columns.iterator().next(); out.print(" \n\t\t<many-to-one name=\""); out.print(refName); out.print("\" column=\""); out.print(column); out.print("\" class=\""); out.print(ref.getMetaModelReferenced().getPOJOClassName()); out.print("\" not-found=\"ignore\" "); out.print(insertUpdate); out.print("/>"); } else { out.print(" \n\t\t<many-to-one name=\""); out.print(refName); out.print("\" class=\""); out.print(ref.getMetaModelReferenced().getPOJOClassName()); out.print("\" not-found=\"ignore\" "); out.print(insertUpdate); out.print(">"); for (Iterator itC = columns.iterator(); itC.hasNext();) { String col = (String) itC.next(); out.print(" \n\t\t\t<column name=\""); out.print(col); out.print("\" />"); } out.print(" \n\t\t</many-to-one>"); } if (overlapped) { for (Iterator itDetails = mapping.getReferenceMapping(reference.getName() + "_" + ref.getName()).getDetails().iterator(); itDetails.hasNext(); ) { ReferenceMappingDetail detail = (ReferenceMappingDetail) itDetails.next(); if (!mapping.isReferenceOverlappingWithSomeProperty(reference.getName() + "_" + ref.getName(), detail.getReferencedModelProperty())) { out.print(" \n\t\t<property name=\""); out.print(reference.getName()); out.print("_"); out.print(ref.getName()); out.print("_"); out.print(Strings.change(detail.getReferencedModelProperty(), ".", "_")); out.print("\" column=\""); out.print(detail.getColumn()); out.print("\" access=\"field\"/>"); } } } } } else { // reference to entity or persistent aggregate Collection columns = mapping.getReferenceMapping(reference.getName()).getColumns(); boolean overlapped = mapping.isReferenceOverlappingWithSomeProperty(reference.getName()); String insertUpdate = overlapped || reference.isKey()?"insert='false' update='false'":""; if (columns.size() == 1) { String column = (String) columns.iterator().next(); out.print(" \n\t\t<many-to-one name=\""); out.print(reference.getName()); out.print("\" column=\""); out.print(column); out.print("\" class=\""); out.print(reference.getMetaModelReferenced().getPOJOClassName()); out.print("\" not-found=\"ignore\" "); out.print(insertUpdate); out.print("/>"); } else { out.print(" \n\t\t<many-to-one name=\""); out.print(reference.getName()); out.print("\" class=\""); out.print(reference.getMetaModelReferenced().getPOJOClassName()); out.print("\" not-found=\"ignore\" "); out.print(insertUpdate); out.print(">"); for (Iterator itC = columns.iterator(); itC.hasNext();) { String col = (String) itC.next(); out.print(" \n\t\t\t<column name=\""); out.print(col); out.print("\"/>"); } out.print(" \n\t\t</many-to-one>"); } if (overlapped && !reference.isKey()) { for (Iterator itDetails = mapping.getReferenceMapping(reference.getName()).getDetails().iterator(); itDetails.hasNext(); ) { ReferenceMappingDetail detail = (ReferenceMappingDetail) itDetails.next(); if (!mapping.isReferenceOverlappingWithSomeProperty(reference.getName(), detail.getReferencedModelProperty())) { out.print(" \n\t\t<property name=\""); out.print(reference.getName()); out.print("_"); out.print(Strings.change(detail.getReferencedModelProperty(), ".", "_")); out.print("\" column=\""); out.print(detail.getColumn()); out.print("\" access=\"field\"/>"); } } } } } Iterator itCollections = metaModel.getMetaCollections().iterator(); while (itCollections.hasNext()) { MetaCollection col = (MetaCollection) itCollections.next(); if (col.hasCalculator() || col.hasCondition()) { continue; } boolean isAggregate = col.getMetaReference().getMetaModelReferenced() instanceof MetaAggregate; String roleName = col.getMetaReference().getRole(); boolean inverseReferenceIsKey = col.getMetaReference().getMetaModelReferenced().getMetaReference(roleName).isKey(); String cascadeDelete = isAggregate?"cascade='delete'":""; String inverse = isAggregate || inverseReferenceIsKey?"inverse='true'":""; ModelMapping referencedMapping = col.getMetaReference().getMetaModelReferenced().getMapping(); Collection columns = referencedMapping.getReferenceMapping(roleName).getColumns(); String order = col.getSQLOrder(); if (Is.emptyString(order)) { Collection cKeys = col.getMetaReference().getMetaModelReferenced().getAllKeyPropertiesNames(); StringBuffer nKeys = new StringBuffer(); for (Iterator it = cKeys.iterator(); it.hasNext();) { nKeys.append(referencedMapping.getColumn((String) it.next())); if (it.hasNext()) nKeys.append(", "); } order = nKeys.toString(); } if (columns.size() == 1) { String column = (String) columns.iterator().next(); out.print(" \n\t\t<set name=\""); out.print(col.getName()); out.print("\" order-by=\""); out.print(order); out.print("\" "); out.print(cascadeDelete); out.print(" "); out.print(inverse); out.print(">\n\t\t\t<key column=\""); out.print(column); out.print("\"/>\n\t\t\t<one-to-many class=\""); out.print(col.getMetaReference().getMetaModelReferenced().getName()); out.print("\"/>\n\t\t</set>"); } else { out.print(" \n\t\t<set name=\""); out.print(col.getName()); out.print("\" order-by=\""); out.print(order); out.print("\" "); out.print(cascadeDelete); out.print(" "); out.print(inverse); out.print(">\n\t\t\t<key>"); Iterator itCol = columns.iterator(); while (itCol.hasNext()) { String column = (String) itCol.next(); out.print(" \t\t\t\n\t\t\t\t<column name=\""); out.print(column); out.print("\"/>"); } out.print(" \n\t\t\t</key>\t\n\t\t\t<one-to-many class=\""); out.print(col.getMetaReference().getMetaModelReferenced().getName()); out.print("\"/>\n\t\t</set>"); } } for (Iterator it=mapping.getPropertyMappingsNotInModel().iterator(); it.hasNext(); ) { PropertyMapping pm = (PropertyMapping) it.next(); out.print(" \t\n\t\t<property name=\""); out.print(pm.getProperty()); out.print("\" access=\"field\" column=\""); out.print(pm.getColumn()); out.print("\"/>"); } out.print(" \n </class>\n\n</hibernate-mapping>"); } catch (Exception e) { System.out.println("Exception: "+e.getMessage()); e.printStackTrace(); return false; } return true; }
14127 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/14127/8ae6c0e462bc1e540bb7b9a83509ab1fd8c1d14b/HibernatePG.java/clean/OpenXava/generator/HibernatePG.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 1250, 2103, 12, 14124, 1042, 819, 16, 13586, 2289, 596, 13, 288, 3639, 775, 288, 565, 596, 18, 1188, 2932, 12880, 2902, 1177, 5189, 21, 18, 20, 2412, 2688, 5189, 12609, 17, 17258, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 1250, 2103, 12, 14124, 1042, 819, 16, 13586, 2289, 596, 13, 288, 3639, 775, 288, 565, 596, 18, 1188, 2932, 12880, 2902, 1177, 5189, 21, 18, 20, 2412, 2688, 5189, 12609, 17, 17258, ...
t += 15 + (src[ip++] & 0xff);
t += 31 + (src[ip++] & 0xff);
public static void lzoUncompress(byte[] src, int size, byte[] dst) throws FormatException { int ip = 0; int op = 0; int t = src[ip++] & 0xff; int mPos; if (t > 17) { t -= 17; do dst[op++] = src[ip++]; while (--t > 0); t = src[ip++] & 0xff; if (t < 16) return; } loop: for (; ; t = src[ip++] & 0xff) { if (t < 16) { if (t == 0) { while (src[ip] == 0) { t += 255; ip++; } t += 15 + (src[ip++] & 0xff); } t += 3; do dst[op++] = src[ip++]; while (--t > 0); t = src[ip++] & 0xff; if (t < 16) { mPos = op - 0x801 - (t >> 2) - ((src[ip++] & 0xff) << 2); if (mPos < 0) { t = LZO_OVERRUN; break loop; } t = 3; do dst[op++] = dst[mPos++]; while (--t > 0); t = src[ip - 2] & 3; if (t == 0) continue; do dst[op++] = src[ip++]; while (--t > 0); t = src[ip++] & 0xff; } } for (; ; t = src[ip++] & 0xff) { if (t >= 64) { mPos = op - 1 - ((t >> 2) & 7) - ((src[ip++] & 0xff) << 3); t = (t >> 5) - 1; } else if (t >= 32) { t &= 31; if (t == 0) { while (src[ip] == 0) { t += 255; ip++; } t += 31 + (src[ip++] & 0xff); } mPos = op - 1 - ((src[ip++] & 0xff) >> 2); mPos -= ((src[ip++] & 0xff) << 6); } else if (t >= 16) { mPos = op - ((t & 8) << 11); t &= 7; if (t == 0) { while (src[ip] == 0) { t += 255; ip++; } t += 7 + (src[ip++] & 0xff); } mPos -= ((src[ip++] & 0xff) >> 2); mPos -= ((src[ip++] & 0xff) << 6); if (mPos == op) break loop; mPos -= 0x4000; } else { mPos = op - 1 - (t >> 2) - ((src[ip++] & 0xff) << 2); t = 0; } if (mPos < 0) { t = LZO_OVERRUN; break loop; } t += 2; do dst[op++] = dst[mPos++]; while (--t > 0); t = src[ip - 2] & 3; if (t == 0) break; do dst[op++] = src[ip++]; while (--t > 0); } } }
55415 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55415/76f0f24f6d6757c1f4133a42b987de82878422c1/Compression.java/clean/loci/formats/Compression.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 760, 918, 328, 94, 83, 984, 14706, 12, 7229, 8526, 1705, 16, 509, 963, 16, 1160, 8526, 3046, 13, 565, 1216, 4077, 503, 225, 288, 565, 509, 2359, 273, 374, 31, 565, 509, 1061, 27...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 760, 918, 328, 94, 83, 984, 14706, 12, 7229, 8526, 1705, 16, 509, 963, 16, 1160, 8526, 3046, 13, 565, 1216, 4077, 503, 225, 288, 565, 509, 2359, 273, 374, 31, 565, 509, 1061, 27...
public void eUnset( EStructuralFeature eFeature )
public void eUnset( int featureID )
public void eUnset( EStructuralFeature eFeature ) { switch ( eDerivedStructuralFeatureID( eFeature ) ) { case LayoutPackage.CLIENT_AREA__BACKGROUND : setBackground( (Fill) null ); return; case LayoutPackage.CLIENT_AREA__OUTLINE : setOutline( (LineAttributes) null ); return; case LayoutPackage.CLIENT_AREA__SHADOW_COLOR : setShadowColor( (ColorDefinition) null ); return; case LayoutPackage.CLIENT_AREA__INSETS : setInsets( (Insets) null ); return; } eDynamicUnset( eFeature ); }
15160 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/15160/036e8c78765730b146e5854b9d6c397a296fed86/ClientAreaImpl.java/buggy/chart/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/model/layout/impl/ClientAreaImpl.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 19698, 12, 512, 14372, 4595, 425, 4595, 262, 202, 95, 202, 202, 9610, 261, 425, 21007, 14372, 4595, 734, 12, 425, 4595, 262, 262, 202, 202, 95, 1082, 202, 3593, 9995, 226...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 19698, 12, 512, 14372, 4595, 425, 4595, 262, 202, 95, 202, 202, 9610, 261, 425, 21007, 14372, 4595, 734, 12, 425, 4595, 262, 262, 202, 202, 95, 1082, 202, 3593, 9995, 226...
filter.onResource = TasksFilter.ON_WORKING_SET;
tasksFilter.onResource = TasksFilter.ON_WORKING_SET;
void updateFilterFromUI(TasksFilter filter) { filter.types = getSelectedTypes(); if (selectedResourceButton.getSelection()) filter.onResource = TasksFilter.ON_SELECTED_RESOURCE_ONLY; else if (selectedResourceAndChildrenButton.getSelection()) filter.onResource = TasksFilter.ON_SELECTED_RESOURCE_AND_CHILDREN; else if (anyResourceInSameProjectButton.getSelection()) // added by cagatayk@acm.org filter.onResource = TasksFilter.ON_ANY_RESOURCE_OF_SAME_PROJECT; else if (workingSetGroup.getSelection()) filter.onResource = TasksFilter.ON_WORKING_SET; else filter.onResource = TasksFilter.ON_ANY_RESOURCE; filter.workingSet = workingSetGroup.getWorkingSet(); filter.descriptionFilterKind = descriptionGroup.combo.getSelectionIndex(); filter.descriptionFilter = descriptionGroup.text.getText(); filter.filterOnDescription = !filter.descriptionFilter.equals("");//$NON-NLS-1$ filter.filterOnSeverity = severityGroup.getSelection(); filter.severityFilter = severityGroup.getValueMask(); filter.filterOnPriority = priorityGroup.getSelection(); filter.priorityFilter = priorityGroup.getValueMask(); filter.filterOnCompletion = completionGroup.getSelection(); filter.completionFilter = completionGroup.getValueMask(); int markerLimit = TasksFilter.DEFAULT_MARKER_LIMIT; try { markerLimit = Integer.parseInt(this.markerLimit.getText()); } catch (NumberFormatException eNumberFormat) { } filter.setMarkerLimit(markerLimit); filter.setFilterOnMarkerLimit(filterOnMarkerLimit.getSelection()); }
55805 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55805/e365c8c256fc9bd61d9d458bb74ff408ae201fd1/FiltersDialog.java/clean/bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/tasklist/FiltersDialog.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 6459, 1089, 1586, 1265, 5370, 12, 6685, 1586, 1034, 13, 288, 1082, 202, 2188, 18, 2352, 273, 16625, 2016, 5621, 9506, 202, 430, 261, 8109, 1420, 3616, 18, 588, 6233, 10756, 1082, 202...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 6459, 1089, 1586, 1265, 5370, 12, 6685, 1586, 1034, 13, 288, 1082, 202, 2188, 18, 2352, 273, 16625, 2016, 5621, 9506, 202, 430, 261, 8109, 1420, 3616, 18, 588, 6233, 10756, 1082, 202...
UIDefaults defaults = UIManager.getLookAndFeelDefaults(); InputMap focusInputMap = (InputMap) defaults.get("Tree.focusInputMap");
InputMap focusInputMap = (InputMap) UIManager.get("Tree.focusInputMap");
protected void installKeyboardActions() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); InputMap focusInputMap = (InputMap) defaults.get("Tree.focusInputMap"); InputMapUIResource parentInputMap = new InputMapUIResource(); ActionMap parentActionMap = new ActionMap(); action = new TreeAction(); Object keys[] = focusInputMap.allKeys(); for (int i = 0; i < keys.length; i++) { parentInputMap.put( KeyStroke.getKeyStroke( ((KeyStroke) keys[i]).getKeyCode(), convertModifiers(((KeyStroke) keys[i]).getModifiers())), (String) focusInputMap.get((KeyStroke) keys[i])); parentInputMap.put( KeyStroke.getKeyStroke( ((KeyStroke) keys[i]).getKeyCode(), ((KeyStroke) keys[i]).getModifiers()), (String) focusInputMap.get((KeyStroke) keys[i])); parentActionMap.put( (String) focusInputMap.get((KeyStroke) keys[i]), new ActionListenerProxy( action, (String) focusInputMap.get((KeyStroke) keys[i]))); } parentInputMap.setParent(tree.getInputMap( JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).getParent()); parentActionMap.setParent(tree.getActionMap().getParent()); tree.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).setParent( parentInputMap); tree.getActionMap().setParent(parentActionMap); }
50763 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50763/badba23052f905d992da7c32124c28f4339931fc/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 4750, 918, 3799, 17872, 6100, 1435, 225, 288, 565, 10034, 73, 643, 87, 3467, 273, 6484, 1318, 18, 588, 9794, 1876, 2954, 292, 7019, 5621, 565, 2741, 863, 7155, 1210, 863, 273, 261, 1210, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 4750, 918, 3799, 17872, 6100, 1435, 225, 288, 565, 10034, 73, 643, 87, 3467, 273, 6484, 1318, 18, 588, 9794, 1876, 2954, 292, 7019, 5621, 565, 2741, 863, 7155, 1210, 863, 273, 261, 1210, ...
public void setRemoteSync(boolean value) {
public void setRemoteSync(boolean value) {
public void setRemoteSync(boolean value) { this.remoteSync = Boolean.valueOf(value); if(value) { this.synchronous = Boolean.TRUE; } }
2370 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2370/f3db80de52533a7bcc1728c297f8d6cc6d1f68da/MuleEndpoint.java/clean/mule/src/java/org/mule/impl/endpoint/MuleEndpoint.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 444, 5169, 4047, 12, 6494, 460, 13, 288, 3639, 333, 18, 7222, 4047, 273, 3411, 18, 1132, 951, 12, 1132, 1769, 3639, 309, 12, 1132, 13, 288, 5411, 333, 18, 87, 7121, 273, 34...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 444, 5169, 4047, 12, 6494, 460, 13, 288, 3639, 333, 18, 7222, 4047, 273, 3411, 18, 1132, 951, 12, 1132, 1769, 3639, 309, 12, 1132, 13, 288, 5411, 333, 18, 87, 7121, 273, 34...
if(selectionPendent != null)
if (selectionPendent != null && !(collapseOccurred || expandOccurred)) {
public void handleEvent(final Event e) { if(e.type == SWT.DefaultSelection) { SelectionEvent event = new SelectionEvent(e); fireDefaultSelectionEvent(event); if(CURRENT_METHOD == DOUBLE_CLICK) { fireOpenEvent(event); } else { if(enterKeyDown) { fireOpenEvent(event); enterKeyDown = false; defaultSelectionPendent = null; } else { defaultSelectionPendent = event; } } return; } switch (e.type) { case SWT.MouseEnter: case SWT.MouseExit: mouseUpEvent = null; mouseMoveEvent = null; selectionPendent = null; break; case SWT.MouseMove: if((CURRENT_METHOD & SELECT_ON_HOVER) == 0) return; if(e.stateMask != 0) return; if(e.widget.getDisplay().getFocusControl() != e.widget) return; mouseMoveEvent = e; final Runnable runnable[] = new Runnable[1]; runnable[0] = new Runnable() { public void run() { long time = System.currentTimeMillis(); int diff = (int)(time - startTime); if(diff <= TIME) { display.timerExec(diff * 2 / 3,runnable[0]); } else { timerStarted = false; setSelection(mouseMoveEvent); } } }; startTime = System.currentTimeMillis(); if(!timerStarted) { timerStarted = true; display.timerExec(TIME * 2 / 3,runnable[0]); } break; case SWT.MouseDown : mouseUpEvent = null; arrowKeyDown = false; break; case SWT.MouseUp: mouseMoveEvent = null; if((e.button != 1) || ((e.stateMask & ~SWT.BUTTON1) != 0)) return; if(selectionPendent != null) mouseSelectItem(selectionPendent); else mouseUpEvent = e; break; case SWT.KeyDown: mouseMoveEvent = null; mouseUpEvent = null; arrowKeyDown = ((e.keyCode == SWT.ARROW_UP) || (e.keyCode == SWT.ARROW_DOWN)) && e.stateMask == 0; if(e.character == SWT.CR) { if(defaultSelectionPendent != null) { fireOpenEvent(new SelectionEvent(e)); enterKeyDown = false; defaultSelectionPendent = null; } else { enterKeyDown = true; } } break; case SWT.Selection: SelectionEvent event = new SelectionEvent(e); fireSelectionEvent(event); mouseMoveEvent = null; if (mouseUpEvent != null) mouseSelectItem(event); else selectionPendent = event; count[0]++; // In the case of arrowUp/arrowDown when in the arrowKeysOpen mode, we // want to delay any selection until the last arrowDown/Up occurs. This // handles the case where the user presses arrowDown/Up successively. // We only want to open an editor for the last selected item. display.asyncExec(new Runnable() { public void run() { if (arrowKeyDown) { display.timerExec(TIME, new Runnable() { int id = count[0]; public void run() { if (id == count[0]) { firePostSelectionEvent(new SelectionEvent(e)); if((CURRENT_METHOD & ARROW_KEYS_OPEN) != 0) fireOpenEvent(new SelectionEvent(e)); } } }); } else { firePostSelectionEvent(new SelectionEvent(e)); } } }); break; } }
55805 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55805/3b6c068059d07b8652ca8b52baf735d6c51cf19c/OpenStrategy.java/buggy/bundles/org.eclipse.jface/src/org/eclipse/jface/util/OpenStrategy.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1875, 202, 482, 918, 1640, 1133, 12, 6385, 2587, 425, 13, 288, 9506, 202, 430, 12, 73, 18, 723, 422, 348, 8588, 18, 1868, 6233, 13, 288, 6862, 202, 6233, 1133, 871, 273, 394, 12977, 1133, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1875, 202, 482, 918, 1640, 1133, 12, 6385, 2587, 425, 13, 288, 9506, 202, 430, 12, 73, 18, 723, 422, 348, 8588, 18, 1868, 6233, 13, 288, 6862, 202, 6233, 1133, 871, 273, 394, 12977, 1133, ...
prev_inline, prev_align_inline, isFirstLetter, box.firstLetterStyle, box.firstLineStyle,
prev_align_inline, isFirstLetter, box.firstLetterStyle, box.firstLineStyle,
public static void layoutContent(Context c, Box box, List contentList) { // Uu.p("+ InlineLayout.layoutContent(): " + box); Rectangle bounds = new Rectangle(); bounds.width = c.getExtents().width; Border border = c.getCurrentStyle().getBorderWidth(); Border margin = c.getCurrentStyle().getMarginWidth(); Border padding = c.getCurrentStyle().getPaddingWidth(); //below should maybe be done somewhere else? bounds.width -= margin.left + border.left + padding.left + padding.right + border.right + margin.right; validateBounds(bounds); bounds.x = 0; bounds.y = 0; bounds.height = 0; // prepare remaining width and first linebox int remaining_width = bounds.width; LineBox curr_line = newLine(box, bounds, null); c.setFirstLine(true); // account for text-indent CalculatedStyle parentStyle = c.getCurrentStyle(); remaining_width = TextIndent.doTextIndent(parentStyle, remaining_width, curr_line); // more setup LineBox prev_line = new LineBox(); prev_line.setParent(box); prev_line.y = bounds.y; prev_line.height = 0; InlineBox prev_inline = null; InlineBox prev_align_inline = null; // adjust the first line for float tabs remaining_width = FloatUtil.adjustForTab(c, prev_line, remaining_width); //c.translate(curr_line.x, curr_line.y); CalculatedStyle currentStyle = parentStyle; boolean isFirstLetter = true; List pendingPushStyles = null; // loop until no more nodes while (contentList.size() > 0) { Object o = contentList.get(0); contentList.remove(0); if (o instanceof FirstLineStyle) {//can actually only be the first object in list box.firstLineStyle = ((FirstLineStyle) o).getStyle(); continue; } if (o instanceof FirstLetterStyle) {//can actually only be the first or second object in list box.firstLetterStyle = ((FirstLetterStyle) o).getStyle(); continue; } if (o instanceof StylePush) { CascadedStyle style; StylePush sp = (StylePush) o; if (sp.getPseudoElement() != null) { style = c.getCss().getPseudoElementStyle(sp.getElement(), sp.getPseudoElement()); } else { style = c.getCss().getCascadedStyle(sp.getElement()); } c.pushStyle(style); if (pendingPushStyles == null) pendingPushStyles = new LinkedList(); pendingPushStyles.add((StylePush) o); Relative.translateRelative(c); continue; } if (o instanceof StylePop) { Relative.untranslateRelative(c); c.popStyle(); if (pendingPushStyles != null && pendingPushStyles.size() != 0) { pendingPushStyles.remove(pendingPushStyles.size() - 1);//was a redundant one } else { if (prev_inline != null) { if (prev_inline.popstyles == null) prev_inline.popstyles = new LinkedList(); prev_inline.popstyles.add(o); } } continue; } Content currentContent = (Content) o; if (currentContent.getStyle() != null) c.pushStyle(currentContent.getStyle()); // loop until no more text in this node InlineBox new_inline = null; int start = 0; do { new_inline = null; if (currentContent instanceof AbsolutelyPositionedContent) { // Uu.p("this might be a problem, but it could just be an absolute block"); // result = new BoxLayout().layout(c,content); Box absolute = Absolute.generateAbsoluteBox(c, currentContent); curr_line.addChild(absolute); break; } // debugging check if (bounds.width < 0) { Uu.p("bounds width = " + bounds.width); Uu.dump_stack(); System.exit(-1); } // the crash warning code if (bounds.width < 1) { Uu.p("warning. width < 1 " + bounds.width); } // test if there is no more text in the current text node // if there is a prev, and if the prev was part of this current node /*if (prev_inline != null && prev_inline.content == currentContent) { if (isEndOfBlock(prev_inline, currentContent)) { break; } }*/ currentStyle = c.getCurrentStyle(); // look at current inline // break off the longest section that will fit new_inline = calculateInline(c, currentContent, remaining_width, bounds.width, prev_inline, prev_align_inline, isFirstLetter, box.firstLetterStyle, box.firstLineStyle, curr_line, start); // Uu.p("got back inline: " + new_inline); // if this inline needs to be on a new line if (prev_align_inline != null && new_inline.break_before /*&& !new_inline.floated*/) { // Uu.p("break before"); remaining_width = bounds.width; saveLine(curr_line, currentStyle, prev_line, bounds.width, bounds.x, c, box, false); bounds.height += curr_line.height; prev_line = curr_line; curr_line = newLine(box, bounds, prev_line); remaining_width = FloatUtil.adjustForTab(c, curr_line, remaining_width); //c.translate(curr_line.x-prev_line.x, curr_line.y-prev_line.y); //have to discard it and recalculate, particularly if this was the first line //HACK: is my thinking straight? - tobe prev_align_inline.break_after = true; new_inline = null; continue; } /* not useful and may be harmful if (new_inline instanceof InlineTextBox) { if (((InlineTextBox) new_inline).getSubstring().equals("")) break; start = ((InlineTextBox) new_inline).end_index; }*/ // save the new inline to the list // Uu.p("adding inline child: " + new_inline); //the inline might be set to size 0,0 after this, if it is first whitespace on line. // Cannot discard because it may contain style-pushes curr_line.addInlineChild(c, new_inline); // Uu.p("current line = " + curr_line); if (new_inline instanceof InlineTextBox) { start = ((InlineTextBox) new_inline).end_index; } isFirstLetter = false; new_inline.pushstyles = pendingPushStyles; pendingPushStyles = null; // calc new height of the line // don't count floats, absolutes, and inline-blocks if (new_inline instanceof InlineTextBox) { adjustLineHeight(curr_line, new_inline); } if (!(currentContent instanceof FloatedBlockContent)) { // calc new width of the line curr_line.width += new_inline.width; } // reduce the available width remaining_width = remaining_width - new_inline.width; // if the last inline was at the end of a line, then go to next line if (new_inline.break_after) { // Uu.p("break after"); // then remaining_width = max_width remaining_width = bounds.width; // save the line saveLine(curr_line, currentStyle, prev_line, bounds.width, bounds.x, c, box, false); // increase bounds height to account for the new line bounds.height += curr_line.height; prev_line = curr_line; curr_line = newLine(box, bounds, prev_line); remaining_width = FloatUtil.adjustForTab(c, curr_line, remaining_width); //c.translate(curr_line.x-prev_line.x, curr_line.y-prev_line.y); } // set the inline to use for left alignment if (!isOutsideFlow(currentContent)) { prev_align_inline = new_inline; // } } prev_inline = new_inline; } while (new_inline == null || !new_inline.isEndOfParentContent()); if (currentContent.getStyle() != null) c.popStyle(); } // save the final line saveLine(curr_line, currentStyle, prev_line, bounds.width, bounds.x, c, box, true); //c.translate(-curr_line.x, -curr_line.y); finishBlock(box, curr_line, bounds); // Uu.p("- InlineLayout.layoutContent(): " + box); }
53937 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53937/71b2cfce5b6554582e24848d6c3702480ac8ba6c/InlineBoxing.java/buggy/src/java/org/xhtmlrenderer/layout/InlineBoxing.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 760, 918, 3511, 1350, 12, 1042, 276, 16, 8549, 3919, 16, 987, 913, 682, 13, 288, 3639, 368, 587, 89, 18, 84, 2932, 15, 16355, 3744, 18, 6741, 1350, 13332, 315, 397, 3919, 1769, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 760, 918, 3511, 1350, 12, 1042, 276, 16, 8549, 3919, 16, 987, 913, 682, 13, 288, 3639, 368, 587, 89, 18, 84, 2932, 15, 16355, 3744, 18, 6741, 1350, 13332, 315, 397, 3919, 1769, ...
if (nd.getOnParentVersion() != OnParentVersionAction.COPY || nd.getOnParentVersion() != OnParentVersionAction.VERSION) {
if (nd.getOnParentVersion() != OnParentVersionAction.COPY && nd.getOnParentVersion() != OnParentVersionAction.VERSION) {
public void testRestoreWithUUIDConflict() throws RepositoryException, NotExecutableException { try { Node naa = createVersionableNode(versionableNode, nodeName4, versionableNodeType); // Verify that nodes used for the test have proper opv behaviour NodeDef nd = naa.getDefinition(); if (nd.getOnParentVersion() != OnParentVersionAction.COPY || nd.getOnParentVersion() != OnParentVersionAction.VERSION) { throw new NotExecutableException("Child nodes must have OPV COPY or VERSION in order to be able to test Node.restore with uuid conflict."); } Version v = versionableNode.checkin(); superuser.move(naa.getPath(), versionableNode2.getPath() + "/" + naa.getName()); versionableNode.restore(v, false); fail("Node.restore( Version, boolean ): An ItemExistsException must be thrown if the node to be restored already exsits and removeExisting was set to false."); } catch (ItemExistsException e) { // success } }
49304 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49304/7a8dd58e4ebfafabdde3c653fa729f77220fcbbd/RestoreTest.java/clean/src/test/org/apache/jackrabbit/test/api/version/RestoreTest.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1842, 10874, 1190, 5562, 10732, 1435, 1216, 13367, 16, 2288, 17709, 503, 288, 3639, 775, 288, 5411, 2029, 290, 7598, 273, 752, 1444, 429, 907, 12, 1589, 429, 907, 16, 7553, 24,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1842, 10874, 1190, 5562, 10732, 1435, 1216, 13367, 16, 2288, 17709, 503, 288, 3639, 775, 288, 5411, 2029, 290, 7598, 273, 752, 1444, 429, 907, 12, 1589, 429, 907, 16, 7553, 24,...
if (readBufferOverflow > -1) { readBuffer [0] = (char) readBufferOverflow;
if (readBufferOverflow > -1) { readBuffer[0] = (char) readBufferOverflow;
private void readDataChunk () throws SAXException, IOException { int count; // See if we have any overflow (filterCR sets for CR at end) if (readBufferOverflow > -1) { readBuffer [0] = (char) readBufferOverflow; readBufferOverflow = -1; readBufferPos = 1; sawCR = true; } else { readBufferPos = 0; sawCR = false; } // input from a character stream. if (sourceType == INPUT_READER) { count = reader.read (readBuffer, readBufferPos, READ_BUFFER_MAX - readBufferPos); if (count < 0) readBufferLength = readBufferPos; else readBufferLength = readBufferPos + count; if (readBufferLength > 0) filterCR (count >= 0); sawCR = false; return; } // Read as many bytes as possible into the raw buffer. count = is.read (rawReadBuffer, 0, READ_BUFFER_MAX); // Dispatch to an encoding-specific reader method to populate // the readBuffer. In most parser speed profiles, these routines // show up at the top of the CPU usage chart. if (count > 0) { switch (encoding) { // one byte builtins case ENCODING_ASCII: copyIso8859_1ReadBuffer (count, (char) 0x0080); break; case ENCODING_UTF_8: copyUtf8ReadBuffer (count); break; case ENCODING_ISO_8859_1: copyIso8859_1ReadBuffer (count, (char) 0); break; // two byte builtins case ENCODING_UCS_2_12: copyUcs2ReadBuffer (count, 8, 0); break; case ENCODING_UCS_2_21: copyUcs2ReadBuffer (count, 0, 8); break; // four byte builtins case ENCODING_UCS_4_1234: copyUcs4ReadBuffer (count, 24, 16, 8, 0); break; case ENCODING_UCS_4_4321: copyUcs4ReadBuffer (count, 0, 8, 16, 24); break; case ENCODING_UCS_4_2143: copyUcs4ReadBuffer (count, 16, 24, 0, 8); break; case ENCODING_UCS_4_3412: copyUcs4ReadBuffer (count, 8, 0, 24, 16); break; } } else readBufferLength = readBufferPos; readBufferPos = 0; // Filter out all carriage returns if we've seen any // (including any saved from a previous read) if (sawCR) { filterCR (count >= 0); sawCR = false; // must actively report EOF, lest some CRs get lost. if (readBufferLength == 0 && count >= 0) readDataChunk (); } if (count > 0) currentByteCount += count; }
50763 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50763/24330cfb4cc445da21a71a819ce54efe764fab6e/XmlParser.java/buggy/core/src/classpath/gnu/gnu/xml/aelfred2/XmlParser.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 918, 20913, 5579, 1832, 565, 1216, 14366, 16, 1860, 565, 288, 202, 474, 1056, 31, 202, 759, 2164, 309, 732, 1240, 1281, 9391, 261, 2188, 5093, 1678, 364, 6732, 622, 679, 13, 202, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 918, 20913, 5579, 1832, 565, 1216, 14366, 16, 1860, 565, 288, 202, 474, 1056, 31, 202, 759, 2164, 309, 732, 1240, 1281, 9391, 261, 2188, 5093, 1678, 364, 6732, 622, 679, 13, 202, ...
public Object execMethod (int methodId, IdFunction function, Context cx, Scriptable scope, Scriptable thisObj, Object[] args) throws JavaScriptException { switch (methodId) { case Id_abs: return wrap_double (js_abs(ScriptRuntime.toNumber(args, 0))); case Id_acos: return wrap_double (js_acos(ScriptRuntime.toNumber(args, 0))); case Id_asin: return wrap_double (js_asin(ScriptRuntime.toNumber(args, 0))); case Id_atan: return wrap_double (js_atan(ScriptRuntime.toNumber(args, 0))); case Id_atan2: return wrap_double (js_atan2(ScriptRuntime.toNumber(args, 0), ScriptRuntime.toNumber(args, 1))); case Id_ceil: return wrap_double (js_ceil(ScriptRuntime.toNumber(args, 0))); case Id_cos: return wrap_double (js_cos(ScriptRuntime.toNumber(args, 0))); case Id_exp: return wrap_double (js_exp(ScriptRuntime.toNumber(args, 0))); case Id_floor: return wrap_double (js_floor(ScriptRuntime.toNumber(args, 0))); case Id_log: return wrap_double (js_log(ScriptRuntime.toNumber(args, 0))); case Id_max: return wrap_double (js_max(args)); case Id_min: return wrap_double (js_min(args)); case Id_pow: return wrap_double (js_pow(ScriptRuntime.toNumber(args, 0), ScriptRuntime.toNumber(args, 1))); case Id_random: return wrap_double (js_random()); case Id_round: return wrap_double (js_round(ScriptRuntime.toNumber(args, 0))); case Id_sin: return wrap_double (js_sin(ScriptRuntime.toNumber(args, 0))); case Id_sqrt: return wrap_double (js_sqrt(ScriptRuntime.toNumber(args, 0))); case Id_tan: return wrap_double (js_tan(ScriptRuntime.toNumber(args, 0))); } return null; }
47345 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47345/b631b3e8574543a4d24a0048cc710f305deb8ff5/NativeMath.java/buggy/org/mozilla/javascript/NativeMath.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 1033, 1196, 1305, 3639, 261, 474, 707, 548, 16, 3124, 2083, 445, 16, 540, 1772, 9494, 16, 22780, 2146, 16, 22780, 15261, 16, 1033, 8526, 833, 13, 3639, 1216, 11905, 503, 565, 288, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 1033, 1196, 1305, 3639, 261, 474, 707, 548, 16, 3124, 2083, 445, 16, 540, 1772, 9494, 16, 22780, 2146, 16, 22780, 15261, 16, 1033, 8526, 833, 13, 3639, 1216, 11905, 503, 565, 288, ...
}
}, streamId, streamSession, stream, streamSize);
void createStream(final JabberId userId, final String streamId, final UUID uniqueId, final Long versionId) { logApiId(); logVariable("userId", userId); logVariable("streamId", streamId); logVariable("uniqueId", uniqueId); logVariable("versionId", versionId); try { assertIsAuthenticatedUser(userId); final JabberId archiveId = readArchiveId(userId); if (null == archiveId) { logWarning("No archive exists for user {0}.", userId); } else { final ClientModelFactory modelFactory = getModelFactory(archiveId); final InternalArtifactModel artifactModel = modelFactory.getArtifactModel(getClass()); final InternalDocumentModel documentModel = modelFactory.getDocumentModel(getClass()); final Long documentId = artifactModel.readId(uniqueId); final InputStream stream = documentModel.openVersionStream(documentId, versionId); final Long streamSize = documentModel.readVersionSize(documentId, versionId); final InternalStreamModel streamModel = getStreamModel(); final StreamSession streamSession = streamModel.createSession(userId); final StreamWriter writer = new StreamWriter(streamSession); writer.open(); try { writer.write(streamId, stream, streamSize); } finally { try { stream.close(); } finally { writer.close(); } } } } catch (final Throwable t) { throw translateError(t); } }
53635 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53635/097e3d1d8e3fc08d7714d4041fb5caa1c8c97f04/BackupModelImpl.java/clean/remote/model/src/main/java/com/thinkparity/desdemona/model/backup/BackupModelImpl.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 918, 752, 1228, 12, 6385, 804, 378, 744, 548, 6249, 16, 727, 514, 21035, 16, 5411, 727, 5866, 22345, 16, 727, 3407, 15287, 13, 288, 3639, 613, 21592, 5621, 3639, 613, 3092, 2932, 18991, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 918, 752, 1228, 12, 6385, 804, 378, 744, 548, 6249, 16, 727, 514, 21035, 16, 5411, 727, 5866, 22345, 16, 727, 3407, 15287, 13, 288, 3639, 613, 21592, 5621, 3639, 613, 3092, 2932, 18991, ...
final Bounds boPlot = getPlotBounds( );
final PlotWithAxes pwa = (PlotWithAxes) getComputations( );
public final void renderPlot( IPrimitiveRenderer ipr, Plot p ) throws ChartException { if ( !p.isVisible( ) ) // CHECK VISIBILITY { return; } final ClipRenderEvent cre = (ClipRenderEvent) ( (EventObjectCache) getDevice( ) ).getEventObject( StructureSource.createPlot( p ), ClipRenderEvent.class ); final boolean bFirstInSequence = ( iSeriesIndex == 0 ); final boolean bLastInSequence = ( iSeriesIndex == iSeriesCount - 1 ); final Bounds boPlot = getPlotBounds( ); if ( bFirstInSequence ) { renderBackground( ipr, p ); renderAxesStructure( ipr, p ); } ISeriesRenderingHints srh = null; try { srh = ( (PlotWithAxes) getComputations( ) ).getSeriesRenderingHints( getSeriesDefinition( ), getSeries( ) ); } catch ( Exception ex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, ex ); } try { Bounds boClipping = getPlotBounds( ); Location[] loaClipping = new Location[4]; loaClipping[0] = LocationImpl.create( boClipping.getLeft( ), boClipping.getTop( ) ); loaClipping[1] = LocationImpl.create( boClipping.getLeft( ) + boClipping.getWidth( ), boClipping.getTop( ) ); loaClipping[2] = LocationImpl.create( boClipping.getLeft( ) + boClipping.getWidth( ), boClipping.getTop( ) + boClipping.getHeight( ) ); loaClipping[3] = LocationImpl.create( boClipping.getLeft( ), boClipping.getTop( ) + boClipping.getHeight( ) ); cre.setVertices( loaClipping ); getDevice( ).setClip( cre ); ScriptHandler.callFunction( getRunTimeContext( ).getScriptHandler( ), ScriptHandler.BEFORE_DRAW_SERIES, getSeries( ), this, getRunTimeContext( ).getScriptContext( ) ); getRunTimeContext( ).notifyStructureChange( IStructureDefinitionListener.BEFORE_DRAW_SERIES, getSeries( ) ); renderSeries( ipr, p, srh ); // CALLS THE APPROPRIATE SUBCLASS // FOR // GRAPHIC ELEMENT RENDERING ScriptHandler.callFunction( getRunTimeContext( ).getScriptHandler( ), ScriptHandler.AFTER_DRAW_SERIES, getSeries( ), this ); getRunTimeContext( ).notifyStructureChange( IStructureDefinitionListener.AFTER_DRAW_SERIES, getSeries( ) ); if ( bLastInSequence ) { try { if ( isDimension3D( ) ) { getDeferredCache( ).process3DEvent( get3DEngine( ), boPlot.getLeft( ), boPlot.getTop( ) ); } getDeferredCache( ).flush( ); // FLUSH DEFERRED CACHE } catch ( ChartException ex ) // NOTE: RENDERING EXCEPTION ALREADY // BEING THROWN { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, ex ); } // SETUP AXIS ARRAY final PlotWithAxes pwa = (PlotWithAxes) getComputations( ); final AllAxes aax = pwa.getAxes( ); final OneAxis[] oaxa = new OneAxis[2 + aax.getOverlayCount( ) + ( aax.getAncillaryBase( ) != null ? 1 : 0 )]; oaxa[0] = aax.getPrimaryBase( ); oaxa[1] = aax.getPrimaryOrthogonal( ); for ( int i = 0; i < aax.getOverlayCount( ); i++ ) { oaxa[2 + i] = aax.getOverlay( i ); } if ( aax.getAncillaryBase( ) != null ) { oaxa[2 + aax.getOverlayCount( )] = aax.getAncillaryBase( ); } Bounds bo = pwa.getPlotBounds( ); // RENDER MARKER LINES renderMarkerLines( oaxa, bo ); // restore clipping. cre.setVertices( null ); getDevice( ).setClip( cre ); // RENDER AXIS LABELS LAST renderAxesLabels( ipr, p, oaxa ); try { if ( isDimension3D( ) ) { getDeferredCache( ).process3DEvent( get3DEngine( ), boPlot.getLeft( ), boPlot.getTop( ) ); } getDeferredCache( ).flush( ); // FLUSH DEFERRED CACHE } catch ( ChartException ex ) // NOTE: RENDERING EXCEPTION ALREADY // BEING THROWN { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, ex ); } } } finally { // restore clipping. cre.setVertices( null ); getDevice( ).setClip( cre ); } }
12803 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12803/05b872f3bed7d4bd11be846d7b8ac2034d58c1c1/AxesRenderer.java/clean/chart/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/render/AxesRenderer.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 727, 918, 1743, 11532, 12, 467, 9840, 6747, 277, 683, 16, 15211, 293, 262, 1082, 202, 15069, 14804, 503, 202, 95, 202, 202, 430, 261, 401, 84, 18, 291, 6207, 12, 262, 262, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 727, 918, 1743, 11532, 12, 467, 9840, 6747, 277, 683, 16, 15211, 293, 262, 1082, 202, 15069, 14804, 503, 202, 95, 202, 202, 430, 261, 401, 84, 18, 291, 6207, 12, 262, 262, 3...
super(parent, modal); this.parent = parent;
super(parent, modal); this.parent = parent;
public AboutDialog(FindBugsFrame parent, boolean modal) { super(parent, modal); this.parent = parent; initComponents(); try { processPage(aboutEditorPane, "edu/umd/cs/findbugs/gui/help/About.html"); licenseEditorPane.setPage(getClass().getClassLoader().getResource("edu/umd/cs/findbugs/gui/help/License.html")); acknowldgementsEditorPane.setPage(getClass().getClassLoader().getResource("edu/umd/cs/findbugs/gui/help/Acknowledgements.html")); } catch (IOException e) { parent.getLogger().logMessage(ConsoleLogger.ERROR, e.toString()); } setTitle("About FindBugs " + Version.RELEASE); }
10715 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/10715/1d541964940eaa91b52b21469dc5b763fef1d8d1/AboutDialog.java/buggy/findbugs/src/java/edu/umd/cs/findbugs/gui/AboutDialog.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 9771, 659, 6353, 12, 3125, 31559, 3219, 982, 16, 1250, 13010, 13, 288, 202, 9565, 12, 2938, 16, 13010, 1769, 3639, 333, 18, 2938, 273, 982, 31, 202, 2738, 7171, 5621, 3639, 775, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 9771, 659, 6353, 12, 3125, 31559, 3219, 982, 16, 1250, 13010, 13, 288, 202, 9565, 12, 2938, 16, 13010, 1769, 3639, 333, 18, 2938, 273, 982, 31, 202, 2738, 7171, 5621, 3639, 775, 2...
container.setLayout( WidgetUtil.createGridLayout( 1 ) );
container.setLayout( WidgetUtil.createGridLayout( 1 ,15) );
public void buildUI( Composite parent ) { super.buildUI( parent ); container.setLayout( WidgetUtil.createGridLayout( 1 ) ); ExpressionPropertyDescriptorProvider tocProvider = new ExpressionPropertyDescriptorProvider( IReportItemModel.TOC_PROP, ReportDesignConstants.REPORT_ITEM ); ExpressionSection tocSection = new ExpressionSection( tocProvider.getDisplayName( ), container, true ); tocSection.setProvider( tocProvider ); tocSection.setWidth( 500 ); addSection( PageSectionId.TOC_EXPRESSION_TOC, tocSection ); createSections( ); layoutSections( ); }
15160 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/15160/b1c54a82f7e0fded60b986c55329f90d6daefd16/TOCExpressionPage.java/clean/UI/org.eclipse.birt.report.designer.ui.views/src/org/eclipse/birt/report/designer/internal/ui/views/attributes/page/TOCExpressionPage.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 1361, 5370, 12, 14728, 982, 225, 262, 202, 95, 202, 202, 9565, 18, 3510, 5370, 12, 982, 11272, 202, 202, 3782, 18, 542, 3744, 12, 11103, 1304, 18, 2640, 6313, 3744, 12, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 1361, 5370, 12, 14728, 982, 225, 262, 202, 95, 202, 202, 9565, 18, 3510, 5370, 12, 982, 11272, 202, 202, 3782, 18, 542, 3744, 12, 11103, 1304, 18, 2640, 6313, 3744, 12, ...
OMElement part = omfactory.createOMElement("inputFloatArray", "", null); part.addAttribute("xsi:type", "xsd:int", null); part.addAttribute("xsi:type", "SOAP-ENC:Array", null); part.addAttribute("SOAP-ENC:arrayType", "xsd:float[3]", null);
OMElement part = omfactory.createOMElement("inputFloatArray", null); part.declareNamespace(typeNs); part.declareNamespace(encNs); part.addAttribute("type", "xsd:int", typeNs); part.addAttribute("type", "SOAP-ENC:Array", typeNs); part.addAttribute("arrayType", "xsd:float[3]", encNs);
public SOAPEnvelope getEchoSoapEnvelope() { SOAPFactory omfactory = OMAbstractFactory.getSOAP11Factory(); SOAPEnvelope reqEnv = omfactory.getDefaultEnvelope(); reqEnv.declareNamespace("http://www.w3.org/2001/XMLSchema", "xsd"); reqEnv.declareNamespace("http://schemas.xmlsoap.org/soap/encoding/", "SOAP-ENC"); reqEnv.declareNamespace("http://soapinterop.org/", "tns"); reqEnv.declareNamespace("http://soapinterop.org/xsd", "s"); reqEnv.declareNamespace("http://www.w3.org/2001/XMLSchema-instance","xsi"); OMElement operation = omfactory.createOMElement("echoFloatArray", "http://soapinterop.org/", null); reqEnv.getBody().addChild(operation); operation.addAttribute("soapenv:encodingStyle", "http://schemas.xmlsoap.org/soap/encoding/", null); OMElement part = omfactory.createOMElement("inputFloatArray", "", null); part.addAttribute("xsi:type", "xsd:int", null); part.addAttribute("xsi:type", "SOAP-ENC:Array", null); part.addAttribute("SOAP-ENC:arrayType", "xsd:float[3]", null); OMElement value0 = omfactory.createOMElement("varString", "", null); value0.addAttribute("xsi:type", "xsd:float", null); value0.addChild(omfactory.createText("45.76876")); OMElement value1 = omfactory.createOMElement("varInt", "", null); value1.addAttribute("xsi:type", "xsd:float", null); value1.addChild(omfactory.createText("43.454")); OMElement value2 = omfactory.createOMElement("varFloat", "", null); value2.addAttribute("xsi:type", "xsd:float", null); value2.addChild(omfactory.createText("2523.542")); part.addChild(value0); part.addChild(value1); part.addChild(value2); operation.addChild(part); return reqEnv; }
49300 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49300/95f09abc768fee06d65b12836e31273ac0e15eb3/Round2EchoFloatArrayClientUtil.java/clean/modules/integration/src/test/interop/whitemesa/round2/util/Round2EchoFloatArrayClientUtil.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 16434, 10862, 4774, 2599, 20601, 10862, 1435, 288, 3639, 16434, 1733, 8068, 6848, 273, 531, 5535, 3336, 1733, 18, 588, 27952, 2499, 1733, 5621, 3639, 16434, 10862, 1111, 3491, 273, 8068...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 16434, 10862, 4774, 2599, 20601, 10862, 1435, 288, 3639, 16434, 1733, 8068, 6848, 273, 531, 5535, 3336, 1733, 18, 588, 27952, 2499, 1733, 5621, 3639, 16434, 10862, 1111, 3491, 273, 8068...
return fAnnotations;
return (fAnnotations != null) ? fAnnotations : XSObjectListImpl.EMPTY_LIST;
public XSObjectList getAnnotations() { return fAnnotations; }
4434 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4434/02680df93afb2b3e6e33e3582967a93229df7768/XSSimpleTypeDecl.java/clean/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 1139, 55, 25979, 23656, 1435, 288, 3639, 327, 261, 74, 5655, 480, 446, 13, 692, 284, 5655, 294, 1139, 55, 25979, 2828, 18, 13625, 67, 7085, 31, 565, 289, 2, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 1139, 55, 25979, 23656, 1435, 288, 3639, 327, 261, 74, 5655, 480, 446, 13, 692, 284, 5655, 294, 1139, 55, 25979, 2828, 18, 13625, 67, 7085, 31, 565, 289, 2, -100, -100, -100, -100...