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
negativeSuffix = buf.toString();
buf.sync(); negativeSuffix = buf.getBuffer().toString(); negativeSuffixRanges = buf.getRanges(); negativeSuffixAttrs = buf.getAttributes();
private final void applyPatternWithSymbols (String pattern, DecimalFormatSymbols syms) { // Initialize to the state the parser expects. negativePrefix = ""; negativeSuffix = ""; positivePrefix = ""; positiveSuffix = ""; decimalSeparatorAlwaysShown = false; groupingSize = 0; minExponentDigits = 0; multiplier = 1; useExponentialNotation = false; groupingUsed = false; maximumFractionDigits = 0; maximumIntegerDigits = 309; minimumFractionDigits = 0; minimumIntegerDigits = 1; StringBuffer buf = new StringBuffer (); String patChars = patternChars (syms); int max = pattern.length(); int index = scanFix (pattern, 0, buf, patChars, syms, false); positivePrefix = buf.toString(); index = scanFormat (pattern, index, patChars, syms, true); index = scanFix (pattern, index, buf, patChars, syms, true); positiveSuffix = buf.toString(); if (index == pattern.length()) { // No negative info. negativePrefix = null; negativeSuffix = null; } else { if (pattern.charAt(index) != syms.getPatternSeparator()) throw new IllegalArgumentException ("separator character " + "expected - index: " + index); index = scanFix (pattern, index + 1, buf, patChars, syms, false); negativePrefix = buf.toString(); // We parse the negative format for errors but we don't let // it side-effect this object. index = scanFormat (pattern, index, patChars, syms, false); index = scanFix (pattern, index, buf, patChars, syms, true); negativeSuffix = buf.toString(); if (index != pattern.length()) throw new IllegalArgumentException ("end of pattern expected " + "- index: " + index); } }
45713 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45713/acb928c05726e6c04a7ad32d764d8be623314a39/DecimalFormat.java/clean/libraries/javalib/java/text/DecimalFormat.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 3238, 727, 918, 2230, 3234, 1190, 14821, 261, 780, 1936, 16, 25083, 1377, 29665, 14821, 24367, 13, 225, 288, 565, 368, 9190, 358, 326, 919, 326, 2082, 10999, 18, 565, 6092, 2244, 273, 140...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 727, 918, 2230, 3234, 1190, 14821, 261, 780, 1936, 16, 25083, 1377, 29665, 14821, 24367, 13, 225, 288, 565, 368, 9190, 358, 326, 919, 326, 2082, 10999, 18, 565, 6092, 2244, 273, 140...
while (bytesWritten != contentLength) { len = is.read(buffer); if (len != -1) { baos.write(buffer, 0, len); bytesWritten += len; if (contentLengthNotSet) { contentLength = bytesWritten;
if(contentLengthNotSet) { logger.error("Header Content-Length not set on http request. Will still read content until end of stream."); while (bytesWritten != contentLength) { len = is.read(buffer); if (len != -1) { baos.write(buffer, 0, len); bytesWritten += len; if (contentLengthNotSet) { contentLength = bytesWritten; }
protected byte[] parseRequest(InputStream is, Properties p) throws IOException { byte[] payload; String line = null; try { line = HttpParser.readLine(is); } catch (SocketException e) { return null; } catch (SocketTimeoutException e) { return null; } if (line == null) { return null; } int space1 = line.indexOf(" "); int space2 = line.indexOf(" ", space1 + 1); if (space1 == -1 || space2 == -1) { throw new IOException("Http message header line is malformed: " + line); } String method = line.substring(0, space1); String request = line.substring(space1 + 1, space2); String httpVersion = line.substring(space2 + 1); p.setProperty(HttpConnector.HTTP_METHOD_PROPERTY, method); p.setProperty(HttpConnector.HTTP_REQUEST_PROPERTY, request); p.setProperty(HttpConnector.HTTP_VERSION_PROPERTY, httpVersion); // Read headers from the request as set them as properties on the event Header[] headers = HttpParser.parseHeaders(is); String name; for (int i = 0; i < headers.length; i++) { name = headers[i].getName(); if (name.startsWith("X-" + MuleProperties.PROPERTY_PREFIX)) { name = name.substring(2); } p.setProperty(name, headers[i].getValue()); } if (method.equals(HttpConstants.METHOD_GET)) { payload = request.getBytes(); } else { boolean contentLengthNotSet = p.getProperty(HttpConstants.HEADER_CONTENT_LENGTH, null) == null; int contentLength = Integer.parseInt(p.getProperty(HttpConstants.HEADER_CONTENT_LENGTH, String.valueOf(1024 * 32))); byte[] buffer = new byte[contentLength]; ByteArrayOutputStream baos = new ByteArrayOutputStream(); int len = 0; int bytesWritten = 0; // Ensure we read all bytes, http connections may be slow // to send all bytes in consistent stream. I've only seen // this when using Axis... while (bytesWritten != contentLength) { len = is.read(buffer); if (len != -1) { baos.write(buffer, 0, len); bytesWritten += len; if (contentLengthNotSet) { contentLength = bytesWritten; } } } payload = baos.toByteArray(); baos.close(); } return payload; }
2370 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2370/be4adf27466e701efbee021c2468e30e2e26392b/HttpMessageReceiver.java/buggy/providers/http/src/java/org/mule/providers/http/HttpMessageReceiver.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 4750, 1160, 8526, 1109, 691, 12, 4348, 353, 16, 6183, 293, 13, 1216, 1860, 565, 288, 3639, 1160, 8526, 2385, 31, 3639, 514, 980, 273, 446, 31, 3639, 775, 288, 5411, 980, 273, 2541, 2678...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1160, 8526, 1109, 691, 12, 4348, 353, 16, 6183, 293, 13, 1216, 1860, 565, 288, 3639, 1160, 8526, 2385, 31, 3639, 514, 980, 273, 446, 31, 3639, 775, 288, 5411, 980, 273, 2541, 2678...
if (jj_3R_208()) return true;
if (jj_scan_token(COMMA)) return true; if (jj_3R_82()) return true;
final private boolean jj_3R_195() { if (jj_3R_208()) return true; return false; }
41673 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/41673/b068fe5a79db07a544f081402e946a51a0f553c2/JavaParser.java/clean/pmd/src/net/sourceforge/pmd/ast/JavaParser.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 727, 3238, 1250, 10684, 67, 23, 54, 67, 31677, 1435, 288, 565, 309, 261, 78, 78, 67, 9871, 67, 2316, 12, 4208, 5535, 3719, 327, 638, 31, 309, 261, 78, 78, 67, 23, 54, 67, 11149, 107...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 282, 727, 3238, 1250, 10684, 67, 23, 54, 67, 31677, 1435, 288, 565, 309, 261, 78, 78, 67, 9871, 67, 2316, 12, 4208, 5535, 3719, 327, 638, 31, 309, 261, 78, 78, 67, 23, 54, 67, 11149, 107...
void createFileWindow(Dim.SourceInfo sourceInfo, int line) {
protected void createFileWindow(Dim.SourceInfo sourceInfo, int line) {
void createFileWindow(Dim.SourceInfo sourceInfo, int line) { boolean activate = true; String url = sourceInfo.url(); FileWindow w = new FileWindow(this, sourceInfo); fileWindows.put(url, w); if (line != -1) { if (currentWindow != null) { currentWindow.setPosition(-1); } try { w.setPosition(w.textArea.getLineStartOffset(line-1)); } catch (BadLocationException exc) { try { w.setPosition(w.textArea.getLineStartOffset(0)); } catch (BadLocationException ee) { w.setPosition(-1); } } } desk.add(w); if (line != -1) { currentWindow = w; } menubar.addFile(url); w.setVisible(true); if (activate) { try { w.setMaximum(true); w.setSelected(true); w.moveToFront(); } catch (Exception exc) { } } }
7555 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7555/aa29c493e59404f8c5a2c30a8f715250a43b947a/SwingGui.java/buggy/js/rhino/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 4750, 918, 21266, 3829, 12, 5225, 18, 1830, 966, 1084, 966, 16, 509, 980, 13, 288, 3639, 1250, 10235, 273, 638, 31, 3639, 514, 880, 273, 1084, 966, 18, 718, 5621, 3639, 1387, 3829, 341,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 21266, 3829, 12, 5225, 18, 1830, 966, 1084, 966, 16, 509, 980, 13, 288, 3639, 1250, 10235, 273, 638, 31, 3639, 514, 880, 273, 1084, 966, 18, 718, 5621, 3639, 1387, 3829, 341,...
Assert.assert(pointer!=null);
Assert._assert(pointer!=null);
protected PK11SymKey(byte[] pointer) { Assert.assert(pointer!=null); keyProxy = new SymKeyProxy(pointer); }
12376 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12376/6ddc297e30f1af6609057abe4502eaa3ba3bb664/PK11SymKey.java/clean/security/jss/org/mozilla/jss/pkcs11/PK11SymKey.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 4750, 11327, 2499, 11901, 653, 12, 7229, 8526, 4407, 13, 288, 3639, 5452, 6315, 11231, 12, 10437, 5, 33, 2011, 1769, 3639, 498, 3886, 225, 273, 394, 10042, 653, 3886, 12, 10437, 1769, 565...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 4750, 11327, 2499, 11901, 653, 12, 7229, 8526, 4407, 13, 288, 3639, 5452, 6315, 11231, 12, 10437, 5, 33, 2011, 1769, 3639, 498, 3886, 225, 273, 394, 10042, 653, 3886, 12, 10437, 1769, 565...
return RubyBoolean.newBoolean(recv.getRuntime(),
return recv.getRuntime().newBoolean(
public static IRubyObject exist_p(IRubyObject recv, RubyString filename) { return RubyBoolean.newBoolean(recv.getRuntime(), new File(filename.getValue()).exists()); }
45753 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45753/870e1da9b41bfdbae259e1fc5f18fc8b76686998/RubyFileTest.java/buggy/src/org/jruby/RubyFileTest.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 760, 15908, 10340, 921, 1005, 67, 84, 12, 7937, 10340, 921, 10665, 16, 19817, 780, 1544, 13, 288, 3639, 327, 10665, 18, 588, 5576, 7675, 2704, 5507, 12, 1171, 394, 1387, 12, 3459, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 377, 1071, 760, 15908, 10340, 921, 1005, 67, 84, 12, 7937, 10340, 921, 10665, 16, 19817, 780, 1544, 13, 288, 3639, 327, 10665, 18, 588, 5576, 7675, 2704, 5507, 12, 1171, 394, 1387, 12, 3459, ...
for(row = 0; row < ColumnValues.length ; ++row) { Vector thisRow = new Vector(6); Integer OriginalPosition = new Integer((String)ColumnValues[row][1]); for(col = 0; col < ((Vector)mVecVec.elementAt(row)).size(); ++col) { thisRow.addElement(((Vector)mVecVec.elementAt(OriginalPosition.intValue())).elementAt(col)); } SortedVector.addElement(thisRow); }
for(row = 0; row < ColumnValues.length ; ++row) { Vector thisRow = new Vector(6); Integer OriginalPosition = new Integer((String)ColumnValues[row][1]); for(col = 0; col < ((Vector)mVecVec.elementAt(row)).size(); ++col) { thisRow.addElement(((Vector)mVecVec.elementAt(OriginalPosition.intValue())).elementAt(col)); } SortedVector.addElement(thisRow); }
public void sortData(int column) { Object[][] ColumnValues = new String [mVecVec.size()][2]; int row; int col; for(row = 0 ; row < mVecVec.size() ; ++row) { ColumnValues[row][0] = (((Vector)mVecVec.elementAt(row)).elementAt(column)); ColumnValues[row][1] = new Integer(row).toString(); } System.out.println("Values before sorting"); for(row = 0; row < ColumnValues.length ; ++row) { System.out.println(ColumnValues[row][0] + " row: " + ColumnValues[row][1]); } QSort sorter = new QSort(new Comparer() { public int compare(Object a, Object b) { int returnValue; try { returnValue = (((String[])a)[0]).compareTo(((String[])b)[0]); } catch (NullPointerException e) { returnValue = 1; } return returnValue; } }); sorter.sort(ColumnValues); System.out.println("Values after sorting"); for(row = 0; row < ColumnValues.length ; ++row) { System.out.println(ColumnValues[row][0] + " row: " + ColumnValues[row][1]); } Vector SortedVector = new Vector(); for(row = 0; row < ColumnValues.length ; ++row) { Vector thisRow = new Vector(6); Integer OriginalPosition = new Integer((String)ColumnValues[row][1]); for(col = 0; col < ((Vector)mVecVec.elementAt(row)).size(); ++col) { thisRow.addElement(((Vector)mVecVec.elementAt(OriginalPosition.intValue())).elementAt(col)); } SortedVector.addElement(thisRow); } mVecVec = SortedVector; System.out.println("Hello"); }
13991 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/13991/b0fa2f56cd2dcc90452b768e6b38187cfb8c30eb/AddressBook.java/clean/grendel/addressbook/AddressBook.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 540, 1071, 918, 1524, 751, 12, 474, 1057, 13, 288, 5411, 1033, 63, 6362, 65, 4753, 1972, 273, 394, 514, 306, 81, 12991, 12991, 18, 1467, 1435, 6362, 22, 15533, 5411, 509, 1027, 31, 5411, 509...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1071, 918, 1524, 751, 12, 474, 1057, 13, 288, 5411, 1033, 63, 6362, 65, 4753, 1972, 273, 394, 514, 306, 81, 12991, 12991, 18, 1467, 1435, 6362, 22, 15533, 5411, 509, 1027, 31, 5411, 509...
tokenPropList.add(words[1]); if(!words[3].equals("O")) spanList.add(new CharSpan(start,end,words[3],curDocID)); }
tokenPropList.add(words[1]); if(!words[3].equals("O")) spanList.add(new CharSpan(start,end,words[3],curDocID)); }
public void loadWordPerLineFile(TextBase base, File file) throws IOException, FileNotFoundException { this.tokenizer = new Tokenizer(Tokenizer.SPLIT, " "); if (labels == null) labels = new BasicTextLabels(base); String id = file.getName(); LineNumberReader in = new LineNumberReader(new FileReader(file)); String line; this.textBase = base; StringBuffer buf = new StringBuffer(""); int docNum = 1, start = 0, end = 0; curDocID = id + "-" + docNum; spanList = new ArrayList(); tokenPropList = new ArrayList(); while((line = in.readLine()) != null) { String[] words = line.split("\\s"); if(!(words[0].equals("-DOCSTART-"))) { if(words.length > 2) { start = buf.length(); buf.append(words[0]+" "); end = buf.length()-1; tokenPropList.add(words[1]); if(!words[3].equals("O")) spanList.add(new CharSpan(start,end,words[3],curDocID)); } }else { this.tokenizer = new Tokenizer(Tokenizer.SPLIT, " "); addDocument(buf.toString()); spanList = new ArrayList(); tokenPropList = new ArrayList(); buf = new StringBuffer(""); docNum++; curDocID = id + "-" + docNum; } } in.close(); }
51753 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51753/e6f5547ded82a315c0b8bcee96ff61710888c5a2/TextBaseLoader.java/clean/src/edu/cmu/minorthird/text/TextBaseLoader.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1262, 3944, 2173, 1670, 812, 12, 1528, 2171, 1026, 16, 1387, 585, 13, 1216, 1860, 16, 13707, 565, 288, 202, 2211, 18, 2316, 1824, 273, 394, 26702, 12, 10524, 18, 17482, 16, 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, 377, 1071, 918, 1262, 3944, 2173, 1670, 812, 12, 1528, 2171, 1026, 16, 1387, 585, 13, 1216, 1860, 16, 13707, 565, 288, 202, 2211, 18, 2316, 1824, 273, 394, 26702, 12, 10524, 18, 17482, 16, 3...
Stage produceStage(MethodFrame m) { //the getVarCount method is changed to a constant for a while //because it is not set properly in our situation. //Actually it is not easy to know how many variables there are. //This is handled in the Stage class. Stage stage = new Stage(m.getMethodName()); stage.setFont(stageFont); stage.calculateSize(typeValWidth[8] + 60, valueHeight + 8 + variableInsets.top + variableInsets.bottom); stage.setBackground(new Color(0xFFCCCC)); stage.setShadow(6); stage.setShadowImage(shadowImage); return stage; }
49293 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49293/7dbe4fad8c95ecd3fdb6d4198de685889c8517d9/ActorFactory.java/clean/src/jeliot/theatre/ActorFactory.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 16531, 11402, 8755, 12, 1305, 3219, 312, 13, 288, 759, 5787, 22381, 1380, 707, 353, 3550, 358, 279, 5381, 364, 279, 1323, 759, 26274, 518, 353, 486, 444, 8214, 316, 3134, 20886, 18, 759, 2459,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 16531, 11402, 8755, 12, 1305, 3219, 312, 13, 288, 759, 5787, 22381, 1380, 707, 353, 3550, 358, 279, 5381, 364, 279, 1323, 759, 26274, 518, 353, 486, 444, 8214, 316, 3134, 20886, 18, 759, 2459,...
String explicitAcct = getAccountId().equals(zc.getAuthtokenAccountId()) ? null : getAccountId();
String explicitAcct = getAccountId().equals(zsc.getAuthtokenAccountId()) ? null : getAccountId();
public Element putNotifications(ZimbraSoapContext zc, Element ctxt, int lastKnownSeqno) { if (ctxt == null) return null; Mailbox mbox; try { mbox = Mailbox.getMailboxByAccountId(getAccountId()); } catch (ServiceException e) { ZimbraLog.session.warn("error fetching mailbox for account " + getAccountId(), e); return ctxt; } String explicitAcct = getAccountId().equals(zc.getAuthtokenAccountId()) ? null : getAccountId(); // must lock the Mailbox before locking the Session to avoid deadlock // because ToXML functions can now call back into the Mailbox synchronized (mbox) { synchronized (this) { // send the <change> block // <change token="555" [acct="4f778920-1a84-11da-b804-6b188d2a20c4"]/> ctxt.addUniqueElement(ZimbraSoapContext.E_CHANGE) .addAttribute(ZimbraSoapContext.A_CHANGE_ID, mbox.getLastChangeID()) .addAttribute(ZimbraSoapContext.A_ACCOUNT_ID, explicitAcct); if (mSentChanges.size() > 100) { // cover ourselves in case a client is doing something really stupid... ZimbraLog.session.warn("Notification Change List abnormally long, misbehaving client."); mSentChanges.clear(); } // first, clear any PM's we now know the client has received for (Iterator<PendingModifications> iter = mSentChanges.iterator(); iter.hasNext(); ) { PendingModifications pm = iter.next(); if (pm.getSeqNo() <= lastKnownSeqno) iter.remove();// assert(pm.getSeqNo() > lastKnownSeqno); } if (mNotify) { if (mChanges.hasNotifications()) { assert(mChanges.getSeqNo() >= 1); int newSeqNo = mChanges.getSeqNo() + 1; mSentChanges.add(mChanges); mChanges = new PendingModifications(newSeqNo); } // drop out if notify is off or if there is nothing to send if (mSentChanges.isEmpty()) return ctxt; // mChanges must be empty at this point (everything moved into the mSentChanges list) assert(!mChanges.hasNotifications()); // send all the old changes for (PendingModifications pm : mSentChanges) putPendingModifications(zc, pm, ctxt, mbox, explicitAcct); } } } return ctxt; }
6965 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6965/82e67e13f71419ffded554909843cc965289a387/SoapSession.java/clean/ZimbraServer/src/java/com/zimbra/cs/session/SoapSession.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 3010, 1378, 14111, 12, 62, 381, 15397, 20601, 1042, 998, 71, 16, 3010, 14286, 16, 509, 1142, 11925, 6926, 2135, 13, 288, 3639, 309, 261, 20364, 422, 446, 13, 5411, 327, 446, 31, 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, 377, 1071, 3010, 1378, 14111, 12, 62, 381, 15397, 20601, 1042, 998, 71, 16, 3010, 14286, 16, 509, 1142, 11925, 6926, 2135, 13, 288, 3639, 309, 261, 20364, 422, 446, 13, 5411, 327, 446, 31, 3...
return upperLimit.compareTo(arg) > 0; }
return upperLimit.compareTo(arg) > 0; }
public boolean eval( Object arg ) { return upperLimit.compareTo(arg) > 0; }
54028 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54028/c26c57f3ac4851e6bc9c5df8515ac73f4045eebf/IsLessThan.java/buggy/jmock/core/src/org/jmock/core/constraint/IsLessThan.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 1250, 5302, 12, 1033, 1501, 262, 288, 202, 202, 2463, 3854, 3039, 18, 9877, 774, 12, 3175, 13, 405, 374, 31, 202, 97, 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, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 1250, 5302, 12, 1033, 1501, 262, 288, 202, 202, 2463, 3854, 3039, 18, 9877, 774, 12, 3175, 13, 405, 374, 31, 202, 97, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
fos.write(line + "\n");
fos.write(line + LINE_SEPARATOR);
private void writeTemplate(Object cls, String path, BufferedWriter fos) { String templatePathName = path + "/templates/"; String fileName = Model.getFacade().getName(cls); String tagTemplatePathName = Model.getFacade().getTaggedValueValue(cls, "TemplatePath"); String authorTag = Model.getFacade().getTaggedValueValue(cls, "author"); String emailTag = Model.getFacade().getTaggedValueValue(cls, "email"); if (tagTemplatePathName != null && tagTemplatePathName.length() > 0) templatePathName = tagTemplatePathName; if (generatorPass == HEADER_PASS) { templatePathName = templatePathName + "header_template"; fileName = fileName + ".h"; } else { templatePathName = templatePathName + "cpp_template"; fileName = fileName + ".cpp"; } File templateFile = new File(templatePathName); if (templateFile.exists()) { boolean eof = false; BufferedReader templateFileReader = null; try { templateFileReader = new BufferedReader(new FileReader( templateFile.getAbsolutePath())); while (!eof) { String lineStr = templateFileReader.readLine(); if (lineStr == null) { eof = true; } else { StringBuffer line = new StringBuffer(lineStr); replaceToken(line, "|FILENAME|", fileName); replaceToken(line, "|DATE|", getDate()); replaceToken(line, "|YEAR|", getYear()); replaceToken(line, "|AUTHOR|", authorTag); replaceToken(line, "|EMAIL|", emailTag); fos.write(line + "\n"); } } templateFileReader.close(); } catch (IOException exp) { } finally { try { if (templateFileReader != null) templateFileReader.close(); } catch (IOException exp) { LOG.error("FAILED: " + templateFile.getPath()); } } } }
7166 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7166/c394f84b1db32fc3dd57c0a1956729d3451131bf/GeneratorCpp.java/clean/modules/cpp/src/org/argouml/language/cpp/generator/GeneratorCpp.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 918, 1045, 2283, 12, 921, 2028, 16, 514, 589, 16, 22490, 17615, 13, 288, 3639, 514, 20534, 461, 273, 589, 397, 2206, 8502, 4898, 31, 3639, 514, 3968, 273, 3164, 18, 588, 12467, 76...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1045, 2283, 12, 921, 2028, 16, 514, 589, 16, 22490, 17615, 13, 288, 3639, 514, 20534, 461, 273, 589, 397, 2206, 8502, 4898, 31, 3639, 514, 3968, 273, 3164, 18, 588, 12467, 76...
System.err.println("does not contain valid response?"); System.err.println(ti);
if (psl.survivor.ProcessorMain.debug) System.err.println("does not contain valid response?"); if (psl.survivor.ProcessorMain.debug) System.err.println(ti);
public void handleMessage(Object o) { System.out.println("&&&&&&&&& Received Message:\n"+o); if (o instanceof VTransportContainer) { VTransportContainer t = (VTransportContainer) o; if (t.isPingResponse()) { t.setName(t.getSourceName()); t.setHostName(t.getSourceHostName()); t.setPort(t.getSourcePort()); t.setSourceName(_processor.getName()); t.setSourceHostName(_processor.getHostName()); t.setSourcePort(_processor.getPort()); Integer ti = new Integer(t.getIdentifier()); synchronized(_pingRequests) { if (_pingRequests.contains(ti)) { _pingRequests.remove(ti); } else { System.err.println("does not contain ping response?"); } } } else if (t.isValidResponse()) { t.setName(t.getSourceName()); t.setHostName(t.getSourceHostName()); t.setPort(t.getSourcePort()); t.setSourceName(_processor.getName()); t.setSourceHostName(_processor.getHostName()); t.setSourcePort(_processor.getPort()); Integer ti = new Integer(t.getIdentifier()); synchronized(_validRequests) { if (_validRequests.contains(ti)) { _validRequests.remove(ti); } else { System.err.println("does not contain valid response?"); System.err.println(ti); } } } else if (t.isReplicatorPingResponse()) { t.setName(t.getSourceName()); t.setHostName(t.getSourceHostName()); t.setPort(t.getSourcePort()); t.setSourceName(_processor.getName()); t.setSourceHostName(_processor.getHostName()); t.setSourcePort(_processor.getPort()); synchronized(_replicatorPingRequests) { if (_replicatorPingRequests.contains(t)) { _replicatorPingRequests.remove(t); } else { System.err.println("does not contain ping reponse?"); } } } else if (t.isReplicatorPing()) { if (_replicator.ping()) { t.setReplicatorPingResponse(); t.setName(t.getSourceName()); t.setHostName(t.getSourceHostName()); t.setPort(t.getSourcePort()); t.setSourceName(_processor.getName()); t.setSourceHostName(_processor.getHostName()); t.setSourcePort(_processor.getPort()); sendMessage(t); } } else if (t.isPing()) { if (_processor.ping()) { t.setPingResponse(); t.setName(t.getSourceName()); t.setHostName(t.getSourceHostName()); t.setPort(t.getSourcePort()); t.setSourceName(_processor.getName()); t.setSourceHostName(_processor.getHostName()); t.setSourcePort(_processor.getPort()); sendMessage(t); } } else if (t.isValid()) { if (_processor.valid()) { t.setValidResponse(); t.setName(t.getSourceName()); t.setHostName(t.getSourceHostName()); t.setPort(t.getSourcePort()); t.setSourceName(_processor.getName()); t.setSourceHostName(_processor.getHostName()); t.setSourcePort(_processor.getPort()); sendMessage(t); } } else if (t.isAlertExecutingTask()) { _replicator.alertExecutingTask (t.getAlertExecutingTaskVersion()); } else if (t.isAlertDoneExecutingTask()) { _replicator.alertDoneExecutingTask (t.getAlertDoneExecutingTaskVersion()); } else if (t.isReplicate()) { _replicator.replicated(t.getReplicatedVersion(), t.getReplicatedQueue()); } else if (t.isMediate()) { // TODO implement this and make sure it gets used } else if (t.isExecuteTask()) { _processor.executeTask(t.getExecuteTask()); } else if (t.isFindRemoteProcessor()) { _processor.findRemoteProcessor (t.getFindRemoteProcessor1(), t.getFindRemoteProcessor2()); } else if (t.isAddToCloud()) { _processor.alertNewHandle(t.getAddToCloud()); } else if (t.isSendNewHandle()) { _processor.addProcessor(t.getSendNewHandle()); } else if (t.isSendPool()) { _processor.addPool(t.getSendPool()); } } else if (o instanceof RTransportContainer) { } else if (o instanceof TPTransportContainer) { } }
14654 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/14654/148c88c35160155b8309e6ce2d62c703cd114d1a/MessageHandler.java/clean/net/MessageHandler.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1640, 1079, 12, 921, 320, 13, 288, 202, 3163, 18, 659, 18, 8222, 2932, 10, 10, 10, 10, 10, 10, 10, 10, 10, 21066, 2350, 5581, 82, 6, 15, 83, 1769, 202, 430, 261, 83, 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, 918, 1640, 1079, 12, 921, 320, 13, 288, 202, 3163, 18, 659, 18, 8222, 2932, 10, 10, 10, 10, 10, 10, 10, 10, 10, 21066, 2350, 5581, 82, 6, 15, 83, 1769, 202, 430, 261, 83, 12...
FetcherContext fetchContext, ClientMetadata dm, int recursionLevel,
ClientMetadata dm, int recursionLevel,
public abstract Bucket getMetadata(ArchiveContext archiveContext, FetcherContext fetchContext, ClientMetadata dm, int recursionLevel, boolean dontEnterImplicitArchives) throws ArchiveFailureException, ArchiveRestartException, MetadataParseException, FetchException;
8026 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8026/d32229c02576d531c915059f111c468591f30e84/ArchiveHandler.java/buggy/src/freenet/client/ArchiveHandler.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 8770, 7408, 11159, 12, 7465, 1042, 5052, 1042, 16, 1082, 202, 1227, 2277, 9113, 16, 509, 13917, 2355, 16, 1875, 202, 6494, 14046, 10237, 15787, 12269, 3606, 13, 1082, 202, 15069, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 8770, 7408, 11159, 12, 7465, 1042, 5052, 1042, 16, 1082, 202, 1227, 2277, 9113, 16, 509, 13917, 2355, 16, 1875, 202, 6494, 14046, 10237, 15787, 12269, 3606, 13, 1082, 202, 15069, ...
return this.maxInsertions;
return maxInsertions;
public int getMaxInsertions() { return this.maxInsertions; }
47012 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47012/0458430a0dc8a713aa2b4d64f000cbbaaeb4adea/FCPQueueManager.java/clean/src/thaw/fcp/FCPQueueManager.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 509, 7288, 4600, 1115, 1435, 288, 202, 202, 2463, 333, 18, 1896, 4600, 1115, 31, 202, 97, 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, 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, 225, 202, 482, 509, 7288, 4600, 1115, 1435, 288, 202, 202, 2463, 333, 18, 1896, 4600, 1115, 31, 202, 97, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
fTypeNameMap.put(info.getName(), typeCollection);
fTypeNameMap.put(newType.getName(), typeCollection);
public synchronized void insert(ITypeInfo info) { // check if enclosing types are already in cache IQualifiedTypeName typeName = info.getQualifiedTypeName().getEnclosingTypeName(); if (typeName != null) { while (!typeName.isEmpty()) { boolean foundType = false; Collection typeCollection = (Collection) fTypeNameMap.get(typeName.getName()); if (typeCollection == null) { typeCollection = new HashSet(); fTypeNameMap.put(typeName.getName(), typeCollection); } else { for (Iterator typeIter = typeCollection.iterator(); typeIter.hasNext(); ) { ITypeInfo curr = (ITypeInfo) typeIter.next(); if (curr.getQualifiedTypeName().equals(typeName)) { foundType = true; break; } } } if (!foundType) { // create a dummy type to take this place (type 0 == unknown) ITypeInfo dummyType = new TypeInfo(0, typeName, this); typeCollection.add(dummyType); } typeName = typeName.removeLastSegments(1); } } Collection typeCollection = (Collection) fTypeNameMap.get(info.getName()); if (typeCollection == null) { typeCollection = new HashSet(); fTypeNameMap.put(info.getName(), typeCollection); } typeCollection.add(info); }
6192 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6192/ccfe7d8f5fb16ffce595bc26621d085f534ba238/TypeCache.java/clean/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/cache/TypeCache.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 3852, 918, 2243, 12, 45, 17305, 1123, 13, 288, 202, 202, 759, 866, 309, 16307, 1953, 854, 1818, 316, 1247, 202, 202, 45, 8708, 7947, 8173, 273, 1123, 18, 588, 8708, 7947, 7675...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3852, 918, 2243, 12, 45, 17305, 1123, 13, 288, 202, 202, 759, 866, 309, 16307, 1953, 854, 1818, 316, 1247, 202, 202, 45, 8708, 7947, 8173, 273, 1123, 18, 588, 8708, 7947, 7675...
if (!(ad instanceof DataObjectAdapter)) {
if (ad == null || !(ad instanceof DataObjectAdapter)) {
Session(MetadataRoot root, ConnectionSource source, int database) { m_root = root; m_source = source; m_database = database; com.redhat.persistence.engine.rdbms.ConnectionSource src = new com.redhat.persistence.engine.rdbms.ConnectionSource() { public Connection acquire() { return m_source.acquire(); } public void release(Connection conn) { m_source.release(conn); } }; switch (m_database) { case DbHelper.DB_ORACLE: m_engine = new RDBMSEngine(src, new OracleWriter(), m_prof); break; case DbHelper.DB_POSTGRES: m_engine = new RDBMSEngine(src, new PostgresWriter(), m_prof); break; default: DbHelper.unsupportedDatabaseError("persistence"); m_engine = null; break; } m_qs = new RDBMSQuerySource(); m_ssn = this.new PSession(m_root.getRoot(), m_engine, m_qs); m_ctx = new TransactionContext(this); m_ssn.addAfterActivate(new AfterActivate()); m_beforeFP = new FlushEventProcessor(true); m_afterFP = new FlushEventProcessor(false); m_ssn.addBeforeFlush(m_beforeFP); m_ssn.addAfterFlush(m_afterFP); Root r = m_root.getRoot(); synchronized (r) { Adapter ad = r.getAdapter(DataObjectImpl.class); if (!(ad instanceof DataObjectAdapter)) { ad = new DataObjectAdapter(); r.addAdapter(DataObjectImpl.class, ad); r.addAdapter(PropertyMap.class, ad); r.addAdapter(null, ad); } } }
12196 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12196/b9f3e00ccac7f050940559909efe26f3d27f5b32/Session.java/clean/archive/packaging/src/com/arsdigita/persistence/Session.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3877, 12, 2277, 2375, 1365, 16, 4050, 1830, 1084, 16, 509, 2063, 13, 288, 3639, 312, 67, 3085, 273, 1365, 31, 3639, 312, 67, 3168, 273, 1084, 31, 3639, 312, 67, 6231, 273, 2063, 31, 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, 377, 3877, 12, 2277, 2375, 1365, 16, 4050, 1830, 1084, 16, 509, 2063, 13, 288, 3639, 312, 67, 3085, 273, 1365, 31, 3639, 312, 67, 3168, 273, 1084, 31, 3639, 312, 67, 6231, 273, 2063, 31, 3...
(dcv.qualifier==null ? "=null" : " LIKE \"" + dcv.qualifier + "\"") +
(dcv.qualifier == null ? "=null" : " LIKE \"" + dcv.qualifier + "\"") +
public void update() throws SQLException, AuthorizeException { // FIXME: Check authorisation DatabaseManager.update(ourContext, itemRow); // Redo bundle mappings if they've changed if (bundlesChanged) { // Remove any existing mappings DatabaseManager.updateQuery(ourContext, "delete from item2bundle where item_id=" + getID()); // Add new mappings Iterator i = bundles.iterator(); while (i.hasNext()) { Bundle b = (Bundle) i.next(); TableRow mappingRow = DatabaseManager.create(ourContext, "item2bundle"); mappingRow.setColumn("bundle_id", b.getID()); mappingRow.setColumn("item_id", getID()); DatabaseManager.update(ourContext,mappingRow); } bundlesChanged = false; } // Redo Dublin Core if it's changed if (dublinCoreChanged) { // Remove existing DC removeDCFromDatabase(); // Add in-memory DC Iterator i = dublinCore.iterator(); while (i.hasNext()) { DCValue dcv = (DCValue) i.next(); // Get the DC Type // FIXME: Maybe should use RegistryManager? String query = "select * from dctyperegistry where element " + "LIKE \"" + dcv.element + "\" AND qualifier" + (dcv.qualifier==null ? "=null" : " LIKE \"" + dcv.qualifier + "\"") + ";"; TableRow dcTypeRow = DatabaseManager.querySingle(ourContext, "dctyperegistry", query); if (dcTypeRow==null) { // Bad DC field // FIXME: An error? log.warn(LogManager.getHeader(ourContext, "bad_dc", "Bad DC field. element: \"" + (dcv.element==null ? "null" : dcv.element) + "\" qualifier: \"" + (dcv.qualifier==null ? "null" : dcv.qualifier) + "\" value: \"" + (dcv.value==null ? "null" : dcv.value) + "\"")); } else { // Write DCValue TableRow valueRow = DatabaseManager.create(ourContext, "dcvalue"); valueRow.setColumn("text_value", dcv.value); valueRow.setColumn("text_lang", dcv.language); DatabaseManager.update(ourContext, valueRow); // Write mapping TableRow mappingRow = DatabaseManager.create(ourContext, "item2dcvalue"); mappingRow.setColumn("item_id", getID()); mappingRow.setColumn("dc_value_id", valueRow.getIntColumn("dc_value_id")); mappingRow.setColumn("dc_type_id", dcTypeRow.getIntColumn("dc_type_id")); DatabaseManager.update(ourContext, mappingRow); } } dublinCoreChanged = false; } }
52457 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52457/85c7430ba7691f831fafc420459d280408310eb9/Item.java/buggy/dspace/src/org/dspace/content/Item.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1089, 1435, 3639, 1216, 6483, 16, 23859, 503, 565, 288, 3639, 368, 9852, 30, 2073, 2869, 10742, 7734, 5130, 1318, 18, 2725, 12, 477, 1042, 16, 761, 1999, 1769, 7734, 368, 4621,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1089, 1435, 3639, 1216, 6483, 16, 23859, 503, 565, 288, 3639, 368, 9852, 30, 2073, 2869, 10742, 7734, 5130, 1318, 18, 2725, 12, 477, 1042, 16, 761, 1999, 1769, 7734, 368, 4621,...
input = System.in.read(); if ((input >= 49 && input <=51) ||input == -1)
input = System.in.read(); if (((input >= 49) && (input <= 51)) || (input == -1)) {
public void run (String[] args) { int input = 0; boolean display = true; boolean displayft = false; int totalNbBodies = 4; int maxIter = 10000; String xmlFileName ; // Set arguments as read on command line switch (args.length){ case 0 : usage(); System.out.println("No xml descriptor specified - aborting"); quit(); case 2 : if (args[1].equals("-nodisplay")){ display = false; System.out.println(" Running with options set to 4 bodies, 1000 iterations, display off"); break; } else if (args[1].equals("-displayft")){ displayft=true; System.out.println(" Running with options set to 4 bodies, 1000 iterations, fault-tolerance display on"); break; } case 3 : totalNbBodies = Integer.parseInt(args[1]); maxIter = Integer.parseInt(args[2]); break; case 4 : if (args[1].equals("-nodisplay")){ display = false; totalNbBodies = Integer.parseInt(args[2]); maxIter = Integer.parseInt(args[3]); break; } else if (args[1].equals("-displayft")){ displayft=true; totalNbBodies = Integer.parseInt(args[2]); maxIter = Integer.parseInt(args[3]); break; } // else : don't break, which means go to the default case default : usage(); System.out.println(" Running with options set to 4 bodies, 1000 iterations, display on"); } xmlFileName = args[0]; System.out.println(" 1 : Simplest version, one-to-one communication and master"); System.out.println(" 2 : group communication and master"); System.out.println(" 3 : group communication, odd-even-synchronization"); if (displayft){ System.out.print("Choose which version you want to run [123] : "); try { while ( true ) { // Read a character from keyboard input = System.in.read(); if ((input >= 49 && input <=51) ||input == -1) break; } } catch (IOException ioe) { abort (ioe); } }else{ System.out.println(" 4 : group communication, oospmd synchronization"); System.out.println(" 5 : Barnes-Hut, and oospmd"); System.out.print("Choose which version you want to run [12345] : "); try { while ( true ) { // Read a character from keyboard input = System.in.read(); if ((input >= 49 && input <=53) ||input == -1) break; } } catch (IOException ioe) { abort(ioe); } } System.out.println ("Thank you!"); // If need be, create a displayer Displayer displayer = null; if (display) { try { displayer = (Displayer) (ProActive.newActive( Displayer.class.getName(), new Object[] { new Integer(totalNbBodies) , new Boolean (displayft)})); } catch (ActiveObjectCreationException e) { abort (e);} catch (NodeException e) { abort (e);} } // Construct deployment-related variables: pad & nodes descriptorPad = null; VirtualNode vnode; try { descriptorPad = ProActive.getProactiveDescriptor(xmlFileName); } catch (ProActiveException e) { abort(e); } descriptorPad.activateMappings(); vnode = descriptorPad.getVirtualNode("Workers"); Node[] nodes = null; try { nodes = vnode.getNodes(); } catch (NodeException e) { abort(e); } switch (input) { case 49 : org.objectweb.proactive.examples.nbody.simple.Start.main(totalNbBodies, maxIter, displayer, nodes, this); break; case 50 : org.objectweb.proactive.examples.nbody.groupcom.Start.main(totalNbBodies, maxIter, displayer, nodes, this); break; case 51 : org.objectweb.proactive.examples.nbody.groupdistrib.Start.main(totalNbBodies, maxIter, displayer, nodes, this); break; case 52 : org.objectweb.proactive.examples.nbody.groupoospmd.Start.main(totalNbBodies, maxIter, displayer, nodes, this); break; case 53 : org.objectweb.proactive.examples.nbody.barneshut.Start.main(totalNbBodies, maxIter, displayer, nodes, this); break; } }
58694 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/58694/6a4103af87bfad7bfca1448432f5e4b1f5196ffe/Start.java/buggy/src/org/objectweb/proactive/examples/nbody/common/Start.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1086, 261, 780, 8526, 833, 13, 288, 3639, 509, 810, 273, 374, 31, 3639, 1250, 2562, 273, 638, 31, 3639, 1250, 2562, 1222, 273, 629, 31, 3639, 509, 2078, 22816, 38, 18134, 273...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1086, 261, 780, 8526, 833, 13, 288, 3639, 509, 810, 273, 374, 31, 3639, 1250, 2562, 273, 638, 31, 3639, 1250, 2562, 1222, 273, 629, 31, 3639, 509, 2078, 22816, 38, 18134, 273...
StringBuffer sql = new StringBuffer() ; sql.append("C_AdminStatistics1" + " " + metaId + ", '" + frDate + "', '" ); sql.append(toDate + "', " + mode) ; String[][] arr = ChatManager.getStatistics(ChatPoolServer, sql.toString()) ;
if( frDate.equals("0")) frDate = "1991-01-01 00:00" ; if( toDate.equals("0")) toDate = "2070-01-01 00:00" ; if( mode == null) mode = "1" ;
public void doGet(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException{ log("startar doGet"); RequestDispatcher myDispatcher = req.getRequestDispatcher("StartDoc"); // Lets validate the session, e.g has the user logged in to Janus? if (super.checkSession(req,res) == false) return ; // Lets get the standard parameters and validate them Properties params = super.getParameters(req) ; //if (super.checkParameters(req, res, params) == false) return ; // Lets get an user object imcode.server.User user = super.getUserObj(req,res) ; if(user == null) return ; int testMetaId = Integer.parseInt( params.getProperty("META_ID") ); if ( !isUserAuthorized( req, res, testMetaId, user ) ){ return; } String action = req.getParameter("action") ; if(action == null){ //OBS FIXA FELMEDELANDENA action = "" ; String header = "ChatManager servlet. " ; ChatError err = new ChatError(req,res,header,3) ; log(header + err.getErrorMsg()) ; return ; } // ********* NEW ******** //it's here we end up when we creates a new chatlink if(action.equalsIgnoreCase("NEW")) { //log("Lets add a chat"); HttpSession session = req.getSession(false) ; if (session != null){ // log("Ok nu stter vi metavrdena"); session.setAttribute("Chat.meta_id", params.getProperty("META_ID")) ; session.setAttribute("Chat.parent_meta_id", params.getProperty("PARENT_META_ID")) ; } req.setAttribute("action","NEW"); myDispatcher = req.getRequestDispatcher("ChatCreator"); myDispatcher.forward(req,res); return ; } // ********* VIEW ******** if(action.equalsIgnoreCase("VIEW")){ // Lets get userparameters Properties userParams = super.getUserParameters(user) ; String metaId = params.getProperty("META_ID") ; String userId = userParams.getProperty("USER_ID") ; RmiConf rmi = new RmiConf(user) ; // Lets detect which type of user we got String userType = userParams.getProperty("USER_TYPE") ; String loginType = userParams.getProperty("LOGIN_TYPE") ; // Lets store the standard metavalues in his session object HttpSession session = req.getSession(false) ; if (session != null){ // log("Ok nu stter vi metavrdena"); session.setAttribute("Chat.meta_id", params.getProperty("META_ID")) ; session.setAttribute("Chat.parent_meta_id", params.getProperty("PARENT_META_ID")) ; } req.setAttribute("login_type","login"); myDispatcher = req.getRequestDispatcher("ChatLogin"); myDispatcher.forward(req,res); return ; } // End of View // ********* CHANGE ******** if(action.equalsIgnoreCase("CHANGE")){ req.setAttribute("metadata","meta"); myDispatcher = req.getRequestDispatcher("ChangeExternalDoc2"); myDispatcher.forward(req,res); return ; } // End if//************** fljande metoder behver kollas ver om de fungerar eller inte ***************** // ********* STATISTICS OBS. NOT USED IN PROGRAM, ONLY FOR TEST ******** if(action.equalsIgnoreCase("STATISTICS")) { // Lets get serverinformation String host = req.getHeader("Host") ; String imcServer = Utility.getDomainPref("userserver",host) ; String ChatPoolServer = Utility.getDomainPref("conference_server",host) ; //log("confpoolserver " + ChatPoolServer ) ; String metaId = req.getParameter("meta_id") ; String frDate = req.getParameter("from_date") ; String toDate = req.getParameter("to_date") ; String mode = req.getParameter("list_mode") ; // Lets fix the date stuff if( frDate.equals("0")) frDate = "1991-01-01 00:00" ; if( toDate.equals("0")) toDate = "2070-01-01 00:00" ; if( mode == null) mode = "1" ; StringBuffer sql = new StringBuffer() ; sql.append("C_AdminStatistics1" + " " + metaId + ", '" + frDate + "', '" ); sql.append(toDate + "', " + mode) ; //log("C_AdminStatistics sql: " + sql.toString()) ; String[][] arr = ChatManager.getStatistics(ChatPoolServer, sql.toString()) ; //log("C_AdminStatistics sql: " + arr.length) ; } // End if } // End doGet
8781 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8781/a270627916b37a677a391dd9f45c54d3d6f12503/ChatManager.java/buggy/servlets/chat/ChatManager.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 23611, 12, 2940, 18572, 1111, 16, 12446, 400, 13, 15069, 16517, 16, 1860, 95, 9506, 202, 1330, 2932, 1937, 297, 23611, 8863, 202, 202, 691, 6681, 3399, 6681, 273, 1111, 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, 225, 202, 482, 918, 23611, 12, 2940, 18572, 1111, 16, 12446, 400, 13, 15069, 16517, 16, 1860, 95, 9506, 202, 1330, 2932, 1937, 297, 23611, 8863, 202, 202, 691, 6681, 3399, 6681, 273, 1111, 18,...
public void removeRequest(IProject project, IResourceDelta delta, int kind) { switch (kind) { /* case ICDTIndexer.PROJECT: this.indexAll(element.getCProject().getProject()); break; case ICDTIndexer.FOLDER: this.indexSourceFolder(element.getCProject().getProject(),element.getPath(),null); break; */ case ICDTIndexer.COMPILATION_UNIT: break; } }
6192 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6192/b4a9f102287060dde623e6f4dbc9c1f7f35294bc/CTagsIndexer.java/buggy/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/ctagsindexer/CTagsIndexer.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 6459, 4479, 691, 12, 45, 4109, 4406, 16, 45, 1420, 2837, 88, 361, 8967, 16, 474, 9224, 15329, 1082, 202, 9610, 12, 9224, 15329, 202, 202, 20308, 1082, 202, 3593, 2871, 9081, 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, 225, 202, 482, 6459, 4479, 691, 12, 45, 4109, 4406, 16, 45, 1420, 2837, 88, 361, 8967, 16, 474, 9224, 15329, 1082, 202, 9610, 12, 9224, 15329, 202, 202, 20308, 1082, 202, 3593, 2871, 9081, 2...
public void actionPerformed(ActionEvent e) { logger.debug ("Player wrote: "+playerChatText.getText()); String text = playerChatText.getText(); text = text.trim(); if (text.length() == 0) return; if(text.charAt(0)!='/') { // Chat command. The most frequent one. RPAction chat=new RPAction(); chat.put("type","chat"); chat.put("text",playerChatText.getText()); client.send(chat); } else { if(text.startsWith("//") && lastPlayerTell!=null) { String[] command = parseString(text, 2); if(command != null) { RPAction tell = new RPAction(); tell.put("type","tell"); tell.put("target", lastPlayerTell); tell.put("text", command[1]); client.send(tell); } } if(text.startsWith("/tell ") ||text.startsWith("/msg ")) // Tell command { String[] command = parseString(text, 3); if(command != null) { RPAction tell = new RPAction(); tell.put("type","tell"); lastPlayerTell= command[1]; tell.put("target", command[1]); tell.put("text", command[2]); client.send(tell); } } else if(text.startsWith("/support ")) // Support command { String[] command = parseString(text, 2); if(command != null) { RPAction tell = new RPAction(); tell.put("type","support"); tell.put("text", command[1]); client.send(tell); } } else if(text.startsWith("/where ")) // Tell command { String[] command = parseString(text, 2); if(command != null) { RPAction where = new RPAction(); where.put("type","where"); where.put("target", command[1]); client.send(where); } } else if(text.equals("/who")) // Who command { RPAction who = new RPAction(); who.put("type","who"); client.send(who); } else if(text.startsWith("/drop ")) // Drop command { String[] command = parseString(text, 3); if(command != null) { String itemName = command[2]; int quantity; try { quantity = Integer.parseInt(command[1]); } catch (NumberFormatException ex) { return; } RPObject player = client.getPlayer(); int itemID = -1; for(RPObject item: player.getSlot("bag")) { if (item.get("name").equals(itemName)) { itemID = item.getID().getObjectID(); break; } } if (itemID != -1) { RPAction drop = new RPAction(); drop.put("type", "drop"); drop.put("baseobject", player.getID().getObjectID()); drop.put("baseslot", "bag"); drop.put("x", player.get("x")); drop.put("y", player.get("y")); drop.put("quantity", quantity); drop.put("baseitem", itemID); client.send(drop); } else { client.addEventLine("You don't have any "+itemName, Color.black); } } } else if(text.startsWith("/add ")) // Add a new buddy to buddy list { String[] command = parseString(text, 2); if(command != null) { RPAction add = new RPAction(); add.put("type","addbuddy"); add.put("target", command[1]); client.send(add); } } else if(text.startsWith("/remove ")) // Removes a existing buddy from buddy list { String[] command = parseString(text, 2); if(command != null) { RPAction remove = new RPAction(); remove.put("type","removebuddy"); remove.put("target", command[1]); client.send(remove); } } else if(text.startsWith("/tellall ")) // Tell everybody admin command { String[] command = parseString(text, 2); if(command != null) { RPAction tellall = new RPAction(); tellall.put("type","tellall"); tellall.put("text", command[1]); client.send(tellall); } } else if(text.startsWith("/teleport ")) // Teleport target(PLAYER NAME) to zone-x,y { String[] command = parseString(text, 5); if(command != null) { RPAction teleport = new RPAction(); teleport.put("type","teleport"); teleport.put("target", command[1]); teleport.put("zone", command[2]); teleport.put("x", command[3]); teleport.put("y", command[4]); client.send(teleport); } } else if(text.startsWith("/teleportto ")) // TeleportTo target(PLAYER NAME) { String[] command = parseString(text, 2); if(command != null) { RPAction teleport = new RPAction(); teleport.put("type","teleportto"); teleport.put("target", command[1]); client.send(teleport); } } else if(text.startsWith("/alter ")) // Set/Add/Substract target(PLAYER NAME) attribute { String[] command = parseString(text, 5); if(command != null) { RPAction alter = new RPAction(); alter.put("type","alter"); alter.put("target", command[1]); alter.put("stat", command[2]); alter.put("mode", command[3]); alter.put("value", command[4]); client.send(alter); } } else if(text.startsWith("/summon ")) // Summon a creature at x,y { String[] command = parseString(text, 4); if(command != null) { RPAction summon = new RPAction(); summon.put("type","summon"); summon.put("creature", command[1]); summon.put("x", command[2]); summon.put("y", command[3]); client.send(summon); } } else if(text.startsWith("/summonat ")) // Summon a creature at x,y { String[] command; command = parseString(text, 5); if(command != null && !command[4].trim().equals("")) { RPAction summon = new RPAction(); summon.put("type","summonat"); summon.put("target", command[1]); summon.put("slot", command[2]); summon.put("item", command[3]); summon.put("amount", command[4]); client.send(summon); } else { command = parseString(text, 4); if(command != null) { RPAction summon = new RPAction(); summon.put("type","summonat"); summon.put("target", command[1]); summon.put("slot", command[2]); summon.put("item", command[3]); client.send(summon); } } } else if(text.startsWith("/inspect ")) // Returns a complete description of the target { String[] command = parseString(text, 2); if(command != null) { RPAction add = new RPAction(); add.put("type","inspect"); add.put("target", command[1]); client.send(add); } } else if(text.startsWith("/jail ")) // Returns a complete description of the target { String[] command = parseString(text, 2); if(command != null) { RPAction add = new RPAction(); add.put("type","jail"); add.put("target", command[1]); client.send(add); } } else if(text.startsWith("/script ")) // Script command { String[] command = parseString(text, 2); if(command != null) { RPAction script = new RPAction(); script.put("type","script"); script.put("target", command[1]); client.send(script); } } else if(text.startsWith("/quit")) { client.getGameGUI().showQuitDialog(); } else if(text.startsWith("/invisible")) // Makes admin invisible for creatures { RPAction invisible = new RPAction(); invisible.put("type","invisible"); client.send(invisible); } else if(text.equals("/help")) // Help command { String[] lines={"Detailed manual refer at http://arianne.sourceforge.net/wiki/index.php/StendhalManual", "This brief help show you the most used commands:", "- /tell <player> <message> \tWrites a private message to player", "- /msg <player> <message> \tWrites a private message to player", "- // <message> \t\tWrites a private message to last player we talked with", "- /support <message> \tAsk for support to admins", "- /who \t\tShow online players", "- /drop <quantity> <item>\tDrops a amount of items from player.", "- /add <player> \t\tAdd player to the buddy list", "- /remove <player> \tRemoves player from buddy list", "- /where <player> \t\tPrints the location of the player", "- /quit \t\tLeaves the game", "- /sound volume <value> \tsets sound system loudness (0..100)", "- /sound mute <value> \tsets sound system mute (on/off)" }; for(String line: lines) { StendhalClient.get().addEventLine(line,Color.gray); } } else if(text.equals("/gmhelp")) // Help command { String[] lines={"Detailed manual refer at http://arianne.sourceforge.net/wiki/index.php?title=Stendhal:Administration", "This brief help show you the most used gm commands:", "- /tellall <message> \t\tWrites a private message to all players", "- /jail <player> \t\tSend a player directly to jail", "- /script <scriptname> \t\tload or reload a server side groovy script", "- /teleport <player> <zone> <x> <y> \tTeleport the player ", "- /teleportto <player> \t\tTeleport us to the player ", "- /alter <player> <attrib> <mode> <value> \tChange by SETting, ADDing or SUBtracting the stat of player", "- /summon <creature|item> <x> <y> \tSummon an item or creature at x,y", "- /summonat <player> <slot> <item> <amount> Summon an item at the slot of the given player", "- /invisible \t\t\tMakes this player invisible for creatures", "- /inspect <player> \t\t\tShows detailed info about the player", "- /destroy <entity> \t\t\tDestroy completly an entity." }; for(String line: lines) { StendhalClient.get().addEventLine(line,Color.gray); } } else if(text.startsWith("/sound ")) // Sound Setup command { String[] command = parseString(text, 3); if ( command != null ) { if ( command[1].equals( "mute" ) ) { SoundSystem.get().setMute( command[2].indexOf("on") != -1 ); } if ( command[1].equals( "volume" ) ) { int vol = Integer.parseInt(command[2]); SoundSystem.get().setVolume( vol ); } } } } lines.add(playerChatText.getText()); actual=lines.size(); if(lines.size()>50) { lines.remove(0); actual--; } playerChatText.setText(""); }
4438 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4438/2c5d8c48e540e0e8bdaf2b72c3edd55f8838d406/StendhalChatLineListener.java/clean/src/games/stendhal/client/gui/StendhalChatLineListener.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1071, 6459, 1128, 13889, 12, 1803, 1133, 73, 15329, 4901, 18, 4148, 2932, 12148, 91, 21436, 2773, 15, 14872, 14163, 1528, 18, 588, 1528, 10663, 780, 955, 33, 14872, 14163, 1528, 18, 588, 1528, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6459, 1128, 13889, 12, 1803, 1133, 73, 15329, 4901, 18, 4148, 2932, 12148, 91, 21436, 2773, 15, 14872, 14163, 1528, 18, 588, 1528, 10663, 780, 955, 33, 14872, 14163, 1528, 18, 588, 1528, ...
removePkChange.apply(currentModel);
removePkChange.apply(currentModel, getPlatform().isDelimitedIdentifierModeOn());
protected void processTableStructureChanges(Database currentModel, Database desiredModel, Table sourceTable, Table targetTable, Map parameters, List changes) throws IOException { // First we drop primary keys as necessary for (Iterator changeIt = changes.iterator(); changeIt.hasNext();) { TableChange change = (TableChange)changeIt.next(); if (change instanceof RemovePrimaryKeyChange) { processChange(currentModel, desiredModel, (RemovePrimaryKeyChange)change); change.apply(currentModel); changeIt.remove(); } else if (change instanceof PrimaryKeyChange) { PrimaryKeyChange pkChange = (PrimaryKeyChange)change; RemovePrimaryKeyChange removePkChange = new RemovePrimaryKeyChange(pkChange.getChangedTable(), pkChange.getOldPrimaryKeyColumns()); processChange(currentModel, desiredModel, removePkChange); removePkChange.apply(currentModel); } } // Next we add/change/remove columns // SapDB has a ALTER TABLE MODIFY COLUMN but it is limited regarding the type conversions // it can perform, so we don't use it here but rather rebuild the table for (Iterator changeIt = changes.iterator(); changeIt.hasNext();) { TableChange change = (TableChange)changeIt.next(); if (change instanceof AddColumnChange) { AddColumnChange addColumnChange = (AddColumnChange)change; // SapDB can only add not insert columns if (addColumnChange.isAtEnd()) { processChange(currentModel, desiredModel, addColumnChange); change.apply(currentModel); changeIt.remove(); } } else if (change instanceof ColumnDefaultValueChange) { processChange(currentModel, desiredModel, (ColumnDefaultValueChange)change); change.apply(currentModel); changeIt.remove(); } else if (change instanceof ColumnRequiredChange) { processChange(currentModel, desiredModel, (ColumnRequiredChange)change); change.apply(currentModel); changeIt.remove(); } else if (change instanceof RemoveColumnChange) { processChange(currentModel, desiredModel, (RemoveColumnChange)change); change.apply(currentModel); changeIt.remove(); } } // Finally we add primary keys for (Iterator changeIt = changes.iterator(); changeIt.hasNext();) { TableChange change = (TableChange)changeIt.next(); if (change instanceof AddPrimaryKeyChange) { processChange(currentModel, desiredModel, (AddPrimaryKeyChange)change); change.apply(currentModel); changeIt.remove(); } else if (change instanceof PrimaryKeyChange) { PrimaryKeyChange pkChange = (PrimaryKeyChange)change; AddPrimaryKeyChange addPkChange = new AddPrimaryKeyChange(pkChange.getChangedTable(), pkChange.getNewPrimaryKeyColumns()); processChange(currentModel, desiredModel, addPkChange); addPkChange.apply(currentModel); changeIt.remove(); } } }
3517 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/3517/d23d6f0a3948c388abd9fe824b91091f5089c689/SapDbBuilder.java/clean/src/java/org/apache/ddlutils/platform/sapdb/SapDbBuilder.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 4750, 918, 1207, 1388, 6999, 7173, 12, 4254, 783, 1488, 16, 4766, 7734, 5130, 6049, 1488, 16, 4766, 7734, 3555, 565, 1084, 1388, 16, 4766, 7734, 3555, 565, 1018, 1388, 16, 4766, 7734, 163...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1207, 1388, 6999, 7173, 12, 4254, 783, 1488, 16, 4766, 7734, 5130, 6049, 1488, 16, 4766, 7734, 3555, 565, 1084, 1388, 16, 4766, 7734, 3555, 565, 1018, 1388, 16, 4766, 7734, 163...
right = (byte) ( startY >> 8 );
right = (byte) (startY >> 8);
public boolean writeInfo() { boolean error = false; String errorMessage = new String(); byte left, right; //must update these values before checked otherwise, check if updating fails if( !this.parseCoords() ) { errorMessage += "invalid coordinate entries.\n"; error = true; } //now check actual values if( startX < 0 || startX > 0xffff || finishX < 0 || finishX > 0xffff ) { errorMessage += "coordinate value out of bounds, must be positive and less than 0x10000.\n"; error = true; } if( teleportOffset < 0 || teleportOffset > 0xe8 ) { errorMessage += "teleport offset must be from 0 to e8.\n"; error = true; } //warn the user if they are using a different teleport offset, unless they were using one to start else if( sceneNumber != 0 && !( teleportOffset == 0x96 || teleportOffset == 0x97 || teleportOffset == bTeleportOffset ) ) { int choice = JOptionPane.showConfirmDialog( null, "Warning! changing the value of the teleport offsets will overwrite the new" + "teleport choices with the necessary values, would you like to proceed?", "Warning!", JOptionPane.YES_NO_OPTION ); if( choice == JOptionPane.NO_OPTION ) return true; //pretend that it was successful so that there's no error message } if( !textBlock.updateTextPointer() ) { errorMessage += "invalid pointer.\n"; error = true; } switch( sceneNumber ) { case 0: if( !textBlock.updateCurrentArray( scene1Area.getText() ) ) { errorMessage += "invalid text block entry for scene 1.\n"; error = true; } break; case 1: if( !textBlock.updateCurrentArray( scene2Area.getText() ) ) { errorMessage += "invalid text block entry for scene 2.\n"; error = true; } break; case 2: if( !textBlock.updateCurrentArray( scene3Area.getText() ) ) { errorMessage += "invalid text block entry for scene 3.\n"; error = true; } break; } if( ( textBlock.currentArraySize() > textBlock.originalSize() ) && preventOverwriteToggle ) { errorMessage += "uncheck prevent overwrites or make text shorter.\n"; error = true; } if( error ) { JOptionPane.showMessageDialog( null, errorMessage, "error!", JOptionPane.ERROR_MESSAGE ); return false; } textBlock.writeTextInfo(); switch( sceneNumber ) { case 0: //SCENE 1 //X: left = (byte) startX; right = (byte) ( startX >> 8 ); //start rom.write( START_X_OFFSET, left ); rom.write( START_X_OFFSET + 1, right ); //move pattern rom.write( SCENE1_X_OFFSET, left ); rom.write( SCENE1_X_OFFSET + 1, right ); //Y: left = (byte) startY; right = (byte) ( startY >> 8 ); //start rom.write( START_Y_OFFSET, left ); rom.write( START_Y_OFFSET + 1, right ); //move pattern rom.write( SCENE1_Y_OFFSET, left ); rom.write( SCENE1_Y_OFFSET + 1, right ); //direction: movement = (byte) directionScene1Combo.getSelectedIndex(); rom.write( SCENE1_MOVE_OFFSET, movement ); break; case 1: //SCENE 2: //X: left = (byte) startX; right = (byte) ( startX >> 8 ); //move pattern: rom.write( SCENE2_X_OFFSET, left ); rom.write( SCENE2_X_OFFSET + 1, right ); //teleport: left = (byte) ( startX / 8 ); right = (byte) ( ( startX / 8 ) >> 8 ); rom.write( TELE_OFFSET + teleportOffset * 0x8, left ); rom.write( TELE_OFFSET + teleportOffset * 0x8 + 1, right ); //Y: left = (byte) startY; right = (byte) ( startY >> 8 ); //move pattern: rom.write( SCENE2_Y_OFFSET, left ); rom.write( SCENE2_Y_OFFSET + 1, right ); //teleport: left = (byte) ( startY / 8 ); right = (byte) ( ( startY / 8 ) >> 8 ); rom.write( TELE_OFFSET + teleportOffset * 0x8 + 2, left ); rom.write( TELE_OFFSET + teleportOffset * 0x8 + 2 + 1, right ); //teleport table value: rom.write( SCENE2_TEL_OFFSET, teleportOffset ); //direction movement = (byte) directionScene2Combo.getSelectedIndex(); rom.write( SCENE2_MOVE_OFFSET, movement ); break; case 2: //SCENE 3: //X1: left = (byte) startX; right = (byte) ( startX >> 8 ); //move pattern: rom.write( SCENE3_X_OFFSET, left ); rom.write( SCENE3_X_OFFSET + 1, right ); //teleport: left = (byte) ( startX / 8 ); right = (byte) ( ( startX / 8 ) >> 8 ); rom.write( TELE_OFFSET + teleportOffset * 0x8, left ); rom.write( TELE_OFFSET + teleportOffset * 0x8 + 1, right ); //Y1: left = (byte) startY; right = (byte) ( startY >> 8 ); //move pattern: rom.write( SCENE3_Y_OFFSET, left ); rom.write( SCENE3_Y_OFFSET + 1, right ); //teleport: left = (byte) ( startY / 8 ); right = (byte) ( ( startY / 8 ) >> 8 ); rom.write( TELE_OFFSET + teleportOffset * 0x8 + 2, left ); rom.write( TELE_OFFSET + teleportOffset * 0x8 + 2 + 1, right ); //FINISH //X2: left = (byte) finishX; right = (byte) ( finishX >> 8 ); rom.write( SCENE3_X2_OFFSET, left ); rom.write( SCENE3_X2_OFFSET + 1, right ); //Y2: left = (byte) finishY; right = (byte) ( finishY >> 8 ); //move pattern: rom.write( SCENE3_Y2_OFFSET, left ); rom.write( SCENE3_Y2_OFFSET + 1, right ); //teleport table value: rom.write( SCENE3_TEL_OFFSET, teleportOffset ); break; } System.out.println( "Succesfully saved!" ); return true; }
3699 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/3699/e3746491678a9f0bdee74ba64d785d53772c8516/FlyoverEditor.java/clean/src/net/starmen/pkhack/eb/FlyoverEditor.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 540, 1071, 1250, 1045, 966, 1435, 3639, 288, 5411, 1250, 555, 273, 629, 31, 5411, 514, 225, 9324, 273, 394, 514, 5621, 5411, 1160, 2002, 16, 2145, 31, 13491, 368, 11926, 1089, 4259, 924, 1865,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1071, 1250, 1045, 966, 1435, 3639, 288, 5411, 1250, 555, 273, 629, 31, 5411, 514, 225, 9324, 273, 394, 514, 5621, 5411, 1160, 2002, 16, 2145, 31, 13491, 368, 11926, 1089, 4259, 924, 1865,...
List types)
TypeNode type)
public DeclareParentsExt_c(Position pos, ClassnamePatternExpr pat, List types) { super(pos); this.pat = pat; this.types = TypedList.copyAndCheck(types,TypeNode.class,true); }
236 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/236/bd450b5864091b1fa907d20c678bda7e768a0c51/DeclareParentsExt_c.java/buggy/aop/abc/src/abc/aspectj/ast/DeclareParentsExt_c.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 16110, 834, 13733, 2482, 67, 71, 12, 2555, 949, 16, 27573, 1659, 529, 3234, 4742, 9670, 16, 1171, 9079, 1412, 907, 618, 13, 565, 288, 202, 9565, 12, 917, 1769, 3639, 333, 18, 1633...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 16110, 834, 13733, 2482, 67, 71, 12, 2555, 949, 16, 27573, 1659, 529, 3234, 4742, 9670, 16, 1171, 9079, 1412, 907, 618, 13, 565, 288, 202, 9565, 12, 917, 1769, 3639, 333, 18, 1633...
Logger.error(this, "Requeueing "+messages.length+" messages!");
Logger.error(this, "Requeueing "+messages.length+" messages on "+this);
public void requeueMessages(Message[] messages) { // Will usually indicate serious problems Logger.error(this, "Requeueing "+messages.length+" messages!"); synchronized(messagesToSendNow) { for(int i=0;i<messages.length;i++) messagesToSendNow.add(messages[i]); } }
50619 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50619/f7c55c16450f673f85c304a3c998d3c274005bc3/PeerNode.java/buggy/src/freenet/node/PeerNode.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1111, 1455, 5058, 12, 1079, 8526, 2743, 13, 288, 3639, 368, 9980, 11234, 10768, 703, 22774, 9688, 3639, 4242, 18, 1636, 12, 2211, 16, 315, 426, 4000, 310, 13773, 6833, 18, 2469...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1111, 1455, 5058, 12, 1079, 8526, 2743, 13, 288, 3639, 368, 9980, 11234, 10768, 703, 22774, 9688, 3639, 4242, 18, 1636, 12, 2211, 16, 315, 426, 4000, 310, 13773, 6833, 18, 2469...
} else if ( ch == '"') {
} else if ( ch == '"' && !keepQuot) {
protected final void printXMLChar( int ch ) throws IOException { if ( ch == '<') { _printer.printText("&lt;"); } else if (ch == '&') { _printer.printText("&amp;"); } else if ( ch == '"') { // REVISIT: for character data we should not convert this into // char reference _printer.printText("&quot;"); } else if ( _encodingInfo.isPrintable((char)ch) && XML11Char.isXML11ValidLiteral(ch)) { _printer.printText((char)ch); } else { // The character is not printable, print as character reference. _printer.printText( "&#x" ); _printer.printText(Integer.toHexString(ch)); _printer.printText( ';' ); } }
1831 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1831/dc5e68c8ebf36fd347188ace2f7187c8a3a87f28/XML11Serializer.java/clean/src/org/apache/xml/serialize/XML11Serializer.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 4750, 727, 918, 1172, 4201, 2156, 12, 509, 462, 262, 1216, 1860, 288, 3639, 309, 261, 462, 422, 2368, 6134, 288, 5411, 389, 30439, 18, 1188, 1528, 2932, 10, 5618, 4868, 1769, 3639, 289, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 727, 918, 1172, 4201, 2156, 12, 509, 462, 262, 1216, 1860, 288, 3639, 309, 261, 462, 422, 2368, 6134, 288, 5411, 389, 30439, 18, 1188, 1528, 2932, 10, 5618, 4868, 1769, 3639, 289, ...
_t = __t724;
_t = __t728;
public final void color_expr(AST _t) throws RecognitionException { AST color_expr_AST_in = (_t == ASTNULL) ? null : (AST)_t; if (_t==null) _t=ASTNULL; switch ( _t.getType()) { case BGCOLOR: { AST __t721 = _t; AST tmp283_AST_in = (AST)_t; match(_t,BGCOLOR); _t = _t.getFirstChild(); expression(_t); _t = _retTree; _t = __t721; _t = _t.getNextSibling(); break; } case DCOLOR: { AST __t722 = _t; AST tmp284_AST_in = (AST)_t; match(_t,DCOLOR); _t = _t.getFirstChild(); expression(_t); _t = _retTree; _t = __t722; _t = _t.getNextSibling(); break; } case FGCOLOR: { AST __t723 = _t; AST tmp285_AST_in = (AST)_t; match(_t,FGCOLOR); _t = _t.getFirstChild(); expression(_t); _t = _retTree; _t = __t723; _t = _t.getNextSibling(); break; } case PFCOLOR: { AST __t724 = _t; AST tmp286_AST_in = (AST)_t; match(_t,PFCOLOR); _t = _t.getFirstChild(); expression(_t); _t = _retTree; _t = __t724; _t = _t.getNextSibling(); break; } default: { throw new NoViableAltException(_t); } } _retTree = _t; }
13952 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/13952/daa15e07422d3491bbbb4d0060450c81983332a4/TreeParser03.java/clean/trunk/org.prorefactor.core/src/org/prorefactor/treeparser03/TreeParser03.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 727, 918, 2036, 67, 8638, 12, 9053, 389, 88, 13, 1216, 9539, 288, 9506, 202, 9053, 2036, 67, 8638, 67, 9053, 67, 267, 273, 261, 67, 88, 422, 9183, 8560, 13, 692, 446, 294, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2036, 67, 8638, 12, 9053, 389, 88, 13, 1216, 9539, 288, 9506, 202, 9053, 2036, 67, 8638, 67, 9053, 67, 267, 273, 261, 67, 88, 422, 9183, 8560, 13, 692, 446, 294, ...
ResultSet rs = stmt.executeQuery( "SELECT java_getSystemProperty('user.dir')");
ResultSet rs = stmt .executeQuery("SELECT java_getSystemProperty('user.dir')");
public void testCurrentDir() throws SQLException { System.out.println("*** testCurrentDir()"); Statement stmt = m_connection.createStatement(); ResultSet rs = stmt.executeQuery( "SELECT java_getSystemProperty('user.dir')"); if(!rs.next()) System.out.println("Unable to position ResultSet"); else System.out.println( "Server directory = " + rs.getString(1)); rs.close(); stmt.close(); }
7270 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7270/efa76a6b7645e410731c10cec532ef6e6ea9f3f1/Tester.java/buggy/src/java/test/org/postgresql/pljava/test/Tester.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 1842, 3935, 1621, 1435, 202, 15069, 6483, 202, 95, 202, 202, 3163, 18, 659, 18, 8222, 2932, 14465, 1842, 3935, 1621, 1435, 8863, 202, 202, 3406, 3480, 273, 312, 67, 4071, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3935, 1621, 1435, 202, 15069, 6483, 202, 95, 202, 202, 3163, 18, 659, 18, 8222, 2932, 14465, 1842, 3935, 1621, 1435, 8863, 202, 202, 3406, 3480, 273, 312, 67, 4071, ...
private ServiceClient createServiceClient() throws AxisFault{
private ServiceClient createServiceClient() throws AxisFault {
private ServiceClient createServiceClient() throws AxisFault{ AxisService service = createSimpleOneWayServiceforClient(serviceName, Echo.class.getName(), operationName); ConfigurationContext configcontext = UtilServer.createClientConfigurationContext(); ServiceClient sender = null; Options options = new Options(); options.setTo(targetEPR); options.setTransportInProtocol(Constants.TRANSPORT_HTTP); options.setAction(operationName.getLocalPart()); options.setReplyTo(replyTo); options.setFaultTo(faultTo); sender = new ServiceClient(configcontext, service); sender.setOptions(options); sender.engageModule(new QName("addressing")); return sender; }
49300 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49300/bf48280bb2cc17e59a92ab2d54f54ddd09c486e7/AddressingServiceTest.java/clean/modules/integration/test/org/apache/axis2/addressing/AddressingServiceTest.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 1956, 1227, 21073, 1227, 1435, 1216, 15509, 7083, 288, 3639, 15509, 1179, 1156, 273, 5411, 752, 5784, 3335, 21831, 1179, 1884, 1227, 12, 15423, 16, 13491, 28995, 18, 1106, 18, 17994, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1956, 1227, 21073, 1227, 1435, 1216, 15509, 7083, 288, 3639, 15509, 1179, 1156, 273, 5411, 752, 5784, 3335, 21831, 1179, 1884, 1227, 12, 15423, 16, 13491, 28995, 18, 1106, 18, 17994, ...
currentScratch.getExpression(5, expressionReference);
currentScratch.getExpression(5, expressionReference);
public ExpressionActor beginBinaryExpression( Value operand, int operator, long expressionReference, Highlight h) { highlight(h); // Prepare the actors ValueActor operandAct = operand.getActor(); OperatorActor operatorAct = factory.produceBinOpActor(operator); OperatorActor dotsAct = factory.produceEllipsis(); // Create the expression actor for 5 elements and reserve // places for the three first actors. ExpressionActor expr = currentScratch.getExpression(5, expressionReference); Point operandLoc = expr.reserve(operandAct); Point operatorLoc = expr.reserve(operatorAct); Point dotsLoc = expr.reserve(dotsAct); // Prepare the theatre for animation. capture(); // Move the first operand to its place. engine.showAnimation(operandAct.fly(operandLoc)); expr.bind(operandAct); updateCapture(); // Make the operator appear. engine.showAnimation(operatorAct.appear(operatorLoc)); expr.bind(operatorAct); updateCapture(); // Make the ellipsis appear. engine.showAnimation(dotsAct.appear(dotsLoc)); expr.bind(dotsAct); // Re-activate the theatre after animation. release(); return expr; }
49293 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49293/3120a92c233114ca42e6ed661ff716e0bf8a53b4/Director.java/buggy/src/jeliot/theater/Director.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 5371, 17876, 2376, 5905, 2300, 12, 3639, 1445, 9886, 16, 3639, 509, 3726, 16, 3639, 1525, 2652, 2404, 16, 3639, 31386, 366, 13, 288, 3639, 8839, 12, 76, 1769, 3639, 368, 7730, 326, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5371, 17876, 2376, 5905, 2300, 12, 3639, 1445, 9886, 16, 3639, 509, 3726, 16, 3639, 1525, 2652, 2404, 16, 3639, 31386, 366, 13, 288, 3639, 8839, 12, 76, 1769, 3639, 368, 7730, 326, ...
public String jsFunction_blink() {
private String jsFunction_blink() {
public String jsFunction_blink() { return tagify("BLINK", null, null); }
19042 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/19042/b631b3e8574543a4d24a0048cc710f305deb8ff5/NativeString.java/clean/src/org/mozilla/javascript/NativeString.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 514, 3828, 2083, 67, 70, 1232, 1435, 288, 3639, 327, 1047, 1164, 2932, 38, 10554, 3113, 446, 16, 446, 1769, 565, 289, 2, 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, 514, 3828, 2083, 67, 70, 1232, 1435, 288, 3639, 327, 1047, 1164, 2932, 38, 10554, 3113, 446, 16, 446, 1769, 565, 289, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if (entry == null)
if (entry == null) {
public FieldDecoration getFieldDecoration(String id) { Object entry = decorations.get(id); if (entry == null) return null; FieldDecoration dec = ((Entry) entry).getDecoration(); Image image = dec.getImage(); if (image != null) { maxDecorationHeight = Math.max(0, image.getBounds().height); maxDecorationWidth = Math.max(0, image.getBounds().width); } return dec; }
56152 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56152/391f2606b4ea2c1fb5052d938ca90877ee7631f6/FieldDecorationRegistry.java/buggy/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/FieldDecorationRegistry.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 2286, 7859, 367, 5031, 7859, 367, 12, 780, 612, 13, 288, 202, 202, 921, 1241, 273, 4839, 1012, 18, 588, 12, 350, 1769, 202, 202, 430, 261, 4099, 422, 446, 13, 1082, 202, 246...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2286, 7859, 367, 5031, 7859, 367, 12, 780, 612, 13, 288, 202, 202, 921, 1241, 273, 4839, 1012, 18, 588, 12, 350, 1769, 202, 202, 430, 261, 4099, 422, 446, 13, 1082, 202, 246...
case OS.WM_QUERYENDSESSION:
} case OS.WM_QUERYENDSESSION: {
int messageProc (int hwnd, int msg, int wParam, int lParam) { switch (msg) { case SWT_KEYMSG: boolean consumed = false; MSG keyMsg = new MSG (); OS.MoveMemory (keyMsg, lParam, MSG.sizeof); Control control = findControl (keyMsg.hwnd); if (control != null) { keyMsg.hwnd = control.handle; int flags = OS.PM_REMOVE | OS.PM_NOYIELD | OS.PM_QS_INPUT | OS.PM_QS_POSTMESSAGE; do { if (!(consumed |= filterMessage (keyMsg))) { OS.TranslateMessage (keyMsg); consumed |= OS.DispatchMessage (keyMsg) == 1; } } while (OS.PeekMessage (keyMsg, keyMsg.hwnd, OS.WM_KEYFIRST, OS.WM_KEYLAST, flags)); } if (consumed) { int hHeap = OS.GetProcessHeap (); OS.HeapFree (hHeap, 0, lParam); } else { OS.PostMessage (embeddedHwnd, SWT_KEYMSG, wParam, lParam); } return 0; case SWT_SETTINGCHANGED: { settingsChanged = false; Font oldFont = getSystemFont (); updateImages (); updateFonts (); sendEvent (SWT.Settings, null); Font newFont = getSystemFont (); Shell [] shells = getShells (); for (int i=0; i<shells.length; i++) { Shell shell = shells [i]; if (!shell.isDisposed ()) { shell.updateFont (oldFont, newFont); } } break; } case SWT_TRAYICONMSG: if (tray != null) { TrayItem [] items = tray.items; for (int i=0; i<items.length; i++) { TrayItem item = items [i]; if (item != null && item.id == wParam) { return item.messageProc (hwnd, msg, wParam, lParam); } } } return 0; case OS.WM_ACTIVATEAPP: /* * Feature in Windows. When multiple shells are * disabled and one of the shells has an enabled * dialog child and the user selects a disabled * shell that does not have the enabled dialog * child using the Task bar, Windows brings the * disabled shell to the front. As soon as the * user clicks on the disabled shell, the enabled * dialog child comes to the front. This behavior * is unspecified and seems strange. Normally, a * disabled shell is frozen on the screen and the * user cannot change the z-order by clicking with * the mouse. The fix is to look for WM_ACTIVATEAPP * and force the enabled dialog child to the front. * This is typically what the user is expecting. * * NOTE: If the modal shell is disabled for any * reason, it should not be brought to the front. */ if (wParam != 0) { if (!isXMouseActive ()) { if (modalDialogShell != null && modalDialogShell.isDisposed ()) modalDialogShell = null; Shell modal = modalDialogShell != null ? modalDialogShell : getModalShell (); if (modal != null) { int hwndModal = modal.handle; if (OS.IsWindowEnabled (hwndModal)) { modal.bringToTop (); if (modal.isDisposed ()) break; } int hwndPopup = OS.GetLastActivePopup (hwndModal); if (hwndPopup != 0 && hwndPopup != modal.handle) { if (getControl (hwndPopup) == null) { if (OS.IsWindowEnabled (hwndPopup)) { OS.SetActiveWindow (hwndPopup); } } } } } } break; case OS.WM_ENDSESSION: if (wParam != 0) { dispose (); /* * When the session is ending, no SWT program can continue * to run. In order to avoid running code after the display * has been disposed, exit from Java. */ System.exit (0); } break; case OS.WM_QUERYENDSESSION: Event event = new Event (); sendEvent (SWT.Close, event); if (!event.doit) return 0; break; case OS.WM_SETTINGCHANGE: if (settingsChanged) break; settingsChanged = true; OS.PostMessage (hwnd, SWT_SETTINGCHANGED, 0 ,0); break; case OS.WM_TIMER: runTimer (wParam); break; default: if (msg == SWT_TASKBARCREATED) { if (tray != null) { TrayItem [] items = tray.items; for (int i=0; i<items.length; i++) { TrayItem item = items [i]; if (item != null) item.recreate (); } } } } return OS.DefWindowProc (hwnd, msg, wParam, lParam);}
12413 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12413/fb6d2df828bbfcf96d146011227cfe339524c82e/Display.java/buggy/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 509, 883, 15417, 261, 474, 16139, 4880, 16, 509, 1234, 16, 509, 341, 786, 16, 509, 328, 786, 13, 288, 202, 9610, 261, 3576, 13, 288, 202, 202, 3593, 348, 8588, 67, 3297, 11210, 30, 1082, 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, 509, 883, 15417, 261, 474, 16139, 4880, 16, 509, 1234, 16, 509, 341, 786, 16, 509, 328, 786, 13, 288, 202, 9610, 261, 3576, 13, 288, 202, 202, 3593, 348, 8588, 67, 3297, 11210, 30, 1082, 2...
boolean oldOutputSystem)
Properties outputProperties, boolean oldOutputSystem)
protected TemplatesImpl(byte[][] bytecodes, String transletName, boolean oldOutputSystem) { _bytecodes = bytecodes; _name = transletName; _oldOutputSystem = oldOutputSystem; }
46591 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46591/ee5f7629a90e982a1395486f1cb4e74a3269d07f/TemplatesImpl.java/buggy/src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 4750, 26212, 2828, 12, 7229, 63, 6362, 65, 635, 14537, 1145, 16, 514, 906, 1810, 461, 16, 202, 2297, 876, 2297, 16, 1250, 1592, 1447, 3163, 13, 377, 288, 202, 67, 1637, 14537, 1145, 273...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 26212, 2828, 12, 7229, 63, 6362, 65, 635, 14537, 1145, 16, 514, 906, 1810, 461, 16, 202, 2297, 876, 2297, 16, 1250, 1592, 1447, 3163, 13, 377, 288, 202, 67, 1637, 14537, 1145, 273...
{
{
public void beforeDrawSeries( Series series, ISeriesRenderer isr, IChartScriptContext icsc ) { }
5230 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5230/44939d4b2e130bad03a0143215dc4cc6db64d622/ChartEventHandlerAdapter.java/buggy/chart/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/script/ChartEventHandlerAdapter.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 1865, 6493, 6485, 12, 9225, 4166, 16, 467, 6485, 6747, 353, 86, 16, 1082, 202, 45, 7984, 3651, 1042, 13579, 1017, 262, 202, 95, 202, 97, 2, 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, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 1865, 6493, 6485, 12, 9225, 4166, 16, 467, 6485, 6747, 353, 86, 16, 1082, 202, 45, 7984, 3651, 1042, 13579, 1017, 262, 202, 95, 202, 97, 2, -100, -100, -100, -100, -100, ...
if ( patternStr == null )
if ( pattern == null )
public String getFormatString( ) { if ( category == null && patternStr == null ) { return null; } if ( category == null ) { category = ""; //$NON-NLS-1$ } if ( patternStr == null ) { patternStr = ""; //$NON-NLS-1$ } // special case: when pattern equals category, omits(eliminatess) the // pattern, only returns the category.-----> for parameter dialog use. if ( category.equals( patternStr ) ) { return category; } return category + ":" + patternStr; //$NON-NLS-1$ }
15160 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/15160/1123f2b44bade54e4b5714c702c79b94bb65dca3/FormatDateTimePage.java/clean/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/FormatDateTimePage.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 514, 10959, 780, 12, 262, 202, 95, 202, 202, 430, 261, 3150, 422, 446, 597, 1936, 1585, 422, 446, 262, 202, 202, 95, 1082, 202, 2463, 446, 31, 202, 202, 97, 202, 202, 430, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 10959, 780, 12, 262, 202, 95, 202, 202, 430, 261, 3150, 422, 446, 597, 1936, 1585, 422, 446, 262, 202, 202, 95, 1082, 202, 2463, 446, 31, 202, 202, 97, 202, 202, 430, ...
/* FIXME Assert.assertTrue( "ns0 has == 0 privs on ns1", s.naming().has(s, ns1, ns0.toMember()).size() == 0 ); Assert.assertFalse( "ns0 !STEM on ns1", s.naming().has(s, ns1, ns0.toMember(), Grouper.PRIV_STEM) ); Assert.assertFalse( "ns0 !CREATE on ns1", s.naming().has(s, ns1, ns0.toMember(), Grouper.PRIV_CREATE) ); Assert.assertTrue( "ns1 has == 0 privs on ns1", s.naming().has(s, ns1, ns1.toMember()).size() == 0 ); Assert.assertFalse( "ns1 !STEM on ns1", s.naming().has(s, ns1, ns1.toMember(), Grouper.PRIV_STEM) ); Assert.assertFalse( "ns1 !CREATE on ns1", s.naming().has(s, ns1, ns1.toMember(), Grouper.PRIV_CREATE) ); */
public void testMoF() { Subject subj = null; try { subj = SubjectFactory.getSubject(Constants.rootI, Constants.rootT); } catch (SubjectNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } GrouperSession s = GrouperSession.start(subj); // Create ns0 GrouperStem ns0 = GrouperStem.create( s, Constants.ns0s, Constants.ns0e ); Assert.assertNotNull("ns0 !null", ns0); // Create ns1 GrouperStem ns1 = GrouperStem.create( s, Constants.ns1s, Constants.ns1e ); Assert.assertNotNull("ns0 !null", ns0); // Load m0 GrouperMember m0 = Common.loadMember( s, Constants.mem0I, Constants.mem0T ); Assert.assertNotNull("m0 !null", m0); // Load m1 GrouperMember m1 = Common.loadMember( s, Constants.mem1I, Constants.mem1T ); Assert.assertNotNull("m0 !null", m0); // Grant m0 STEM on ns0 Assert.assertTrue( "grant m0 STEM on ns0", s.naming().grant(s, ns0, m0, Grouper.PRIV_STEM) ); // Grant m0 STEM on ns1 Assert.assertTrue( "grant m0 STEM on ns1", s.naming().grant(s, ns1, m0, Grouper.PRIV_STEM) ); // Assert privileges/* FIXME Assert.assertTrue( "ns0 has == 0 privs on ns0", s.naming().has(s, ns0, ns0.toMember()).size() == 0 ); Assert.assertFalse( "ns0 !STEM on ns0", s.naming().has(s, ns0, ns0.toMember(), Grouper.PRIV_STEM) ); Assert.assertFalse( "ns0 !CREATE on ns0", s.naming().has(s, ns0, ns0.toMember(), Grouper.PRIV_CREATE) ); Assert.assertTrue( "ns1 has == 0 privs on ns0", s.naming().has(s, ns0, ns1.toMember()).size() == 0 ); Assert.assertFalse( "ns1 !STEM on ns0", s.naming().has(s, ns0, ns1.toMember(), Grouper.PRIV_STEM) ); Assert.assertFalse( "ns1 !CREATE on ns0", s.naming().has(s, ns0, ns1.toMember(), Grouper.PRIV_CREATE) );*/ Assert.assertTrue( "root has == 2 privs on ns0", s.naming().has(s, ns0).size() == 2 ); Assert.assertTrue( "root STEM on ns0", s.naming().has(s, ns0, Grouper.PRIV_STEM) ); Assert.assertTrue( "root CREATE on ns0", s.naming().has(s, ns0, Grouper.PRIV_CREATE) ); Assert.assertTrue( "m0 has == 1 privs on ns0", s.naming().has(s, ns0, m0).size() == 1 ); Assert.assertTrue( "m0 STEM on ns0", s.naming().has(s, ns0, m0, Grouper.PRIV_STEM) ); Assert.assertFalse( "m0 !CREATE on ns0", s.naming().has(s, ns0, m0, Grouper.PRIV_CREATE) ); Assert.assertTrue( "m1 has == 0 privs on ns0", s.naming().has(s, ns0, m1).size() == 0 ); Assert.assertFalse( "m1 !STEM on ns0", s.naming().has(s, ns0, m1, Grouper.PRIV_STEM) ); Assert.assertFalse( "m1 !CREATE on ns0", s.naming().has(s, ns0, m1, Grouper.PRIV_CREATE) );/* FIXME Assert.assertTrue( "ns0 has == 0 privs on ns1", s.naming().has(s, ns1, ns0.toMember()).size() == 0 ); Assert.assertFalse( "ns0 !STEM on ns1", s.naming().has(s, ns1, ns0.toMember(), Grouper.PRIV_STEM) ); Assert.assertFalse( "ns0 !CREATE on ns1", s.naming().has(s, ns1, ns0.toMember(), Grouper.PRIV_CREATE) ); Assert.assertTrue( "ns1 has == 0 privs on ns1", s.naming().has(s, ns1, ns1.toMember()).size() == 0 ); Assert.assertFalse( "ns1 !STEM on ns1", s.naming().has(s, ns1, ns1.toMember(), Grouper.PRIV_STEM) ); Assert.assertFalse( "ns1 !CREATE on ns1", s.naming().has(s, ns1, ns1.toMember(), Grouper.PRIV_CREATE) );*/ Assert.assertTrue( "root has == 2 privs on ns1", s.naming().has(s, ns1).size() == 2 ); Assert.assertTrue( "root STEM on ns1", s.naming().has(s, ns1, Grouper.PRIV_STEM) ); Assert.assertTrue( "root CREATE on ns1", s.naming().has(s, ns1, Grouper.PRIV_CREATE) ); Assert.assertTrue( "m0 has == 1 privs on ns1", s.naming().has(s, ns1, m0).size() == 1 ); Assert.assertTrue( "m0 STEM on ns1", s.naming().has(s, ns1, m0, Grouper.PRIV_STEM) ); Assert.assertFalse( "m0 !CREATE on ns1", s.naming().has(s, ns1, m0, Grouper.PRIV_CREATE) ); Assert.assertTrue( "m1 has == 0 privs on ns1", s.naming().has(s, ns1, m1).size() == 0 ); Assert.assertFalse( "m1 !STEM on ns1", s.naming().has(s, ns1, m1, Grouper.PRIV_STEM) ); Assert.assertFalse( "m1 !CREATE on ns1", s.naming().has(s, ns1, m1, Grouper.PRIV_CREATE) ); s.stop(); }
5235 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5235/8f075bb2e87501a010bdabda782a43cd22f1fd61/TestNamingGrantMoF1.java/buggy/grouper/java/tests/test/edu/internet2/middleware/grouper/TestNamingGrantMoF1.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 918, 1842, 16727, 42, 1435, 288, 565, 9912, 15333, 273, 446, 31, 565, 775, 288, 1377, 15333, 273, 9912, 1733, 18, 588, 6638, 12, 2918, 18, 3085, 45, 16, 5245, 18, 3085, 56, 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, 282, 1071, 918, 1842, 16727, 42, 1435, 288, 565, 9912, 15333, 273, 446, 31, 565, 775, 288, 1377, 15333, 273, 9912, 1733, 18, 588, 6638, 12, 2918, 18, 3085, 45, 16, 5245, 18, 3085, 56, 1769, ...
delete(new File(fileName));
delete(new File(fileName));
static public void delete(String fileName) { delete(new File(fileName)); }
6336 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6336/969183c2f185ed095a32b4f4e8fe6fcf9fad609f/FileIOTest.java/clean/prevayler/src/test/org/prevayler/foundation/FileIOTest.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 3845, 1071, 918, 1430, 12, 780, 3968, 13, 288, 202, 565, 1430, 12, 2704, 1387, 12, 17812, 10019, 202, 97, 2, 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, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 3845, 1071, 918, 1430, 12, 780, 3968, 13, 288, 202, 565, 1430, 12, 2704, 1387, 12, 17812, 10019, 202, 97, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
byte[] tempbytes = AdminDoc.adminDoc(meta_id,meta_id,host,user,req,res) ; if ( tempbytes != null ) { out.write(tempbytes) ;
String output = AdminDoc.adminDoc(meta_id,meta_id,host,user,req,res) ; if ( output != null ) { out.write(output) ;
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 ) ; imcode.server.User user ; String htmlStr = "" ; String submit_name = "" ; String search_string = "" ; String text = "" ; String values[] ; int txt_no = 0 ; res.setContentType("text/html"); ServletOutputStream out = res.getOutputStream(); // get meta_id int meta_id = Integer.parseInt(req.getParameter("meta_id")) ;// int parent_meta_id = Integer.parseInt(req.getParameter("parent_meta_id")) ; // get form data imcode.server.Table doc = new imcode.server.Table() ; String template = req.getParameter("template") ; String groupId = req.getParameter("group"); //the template group admin is a ugly mess but lets try to do the best of it //we save the group_id but if the group gets deleted else where it doesn't get changed //in the text_docs table, but the system vill not crash it only shows an empty group string. if(groupId == null) groupId= "-1"; //if there isn'n anyone lets set it to -1 if ( template != null ) { doc.addField("template",template) ; // String menu_template = req.getParameter("menu_template") ; doc.addField("menu_template",template) ; // String text_template = req.getParameter("text_template") ; doc.addField("text_template",template) ; doc.addField("group_id",groupId); } // Check if user logged on if( (user=Check.userLoggedOn( req,res,start_url ))==null ) { return ; } // Check if user has write rights if ( !IMCServiceRMI.checkDocAdminRights(imcserver,meta_id,user,imcode.server.IMCConstants.PERM_DT_TEXT_CHANGE_TEMPLATE ) ) { // 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 ; } String lang_prefix = IMCServiceRMI.sqlQueryStr(imcserver, "select lang_prefix from lang_prefixes where lang_id = "+user.getInt("lang_id")) ; /*if (req.getParameter("metadata")!=null) { //htmlStr = IMCServiceRMI.interpretAdminTemplate(imcserver,meta_id,user,"change_meta.html",1,meta_id,0,0) ; htmlStr = imcode.util.MetaDataParser.parseMetaData(String.valueOf(meta_id), String.valueOf(meta_id),user,host) ; } else */ if (req.getParameter("update")!=null) { user.put("flags",new Integer(0)) ; if ( template == null ) { Vector vec = new Vector() ; vec.add("#meta_id#") ; vec.add(String.valueOf(meta_id)) ; htmlStr = IMCServiceRMI.parseDoc(imcserver,vec,"inPage_admin_no_template.html",lang_prefix) ; out.print(htmlStr) ; return ; }/* // old number of texts int old_tmpl_txt_count = IMCServiceRMI.getNoOfTxt(imcserver,meta_id,user) ;*/ // save textdoc IMCServiceRMI.saveTextDoc(imcserver,meta_id,user,doc) ; SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd") ; Date dt = IMCServiceRMI.getCurrentDate(imcserver) ; String sqlStr = "update meta set date_modified = '"+dateformat.format(dt)+"' where meta_id = "+meta_id ; IMCServiceRMI.sqlUpdateQuery(imcserver,sqlStr);/* // add more text if needed int new_tmpl_txt_count = IMCServiceRMI.getNoOfTxt(imcserver,meta_id,user) ; if ( new_tmpl_txt_count > old_tmpl_txt_count) IMCServiceRMI.insertNewTexts(imcserver,meta_id,user,new_tmpl_txt_count - old_tmpl_txt_count) ;*/ // return page// 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("preview")!=null) { // Call Magnus GetTemplateExample-procedure here if ( template == null ) { Vector vec = new Vector() ; vec.add("#meta_id#") ; vec.add(String.valueOf(meta_id)) ; htmlStr = IMCServiceRMI.parseDoc(imcserver,vec,"inPage_admin_no_template.html",lang_prefix) ; out.print(htmlStr) ; return ; } Object[] temp = null ; try { temp = IMCServiceRMI.getDemoTemplate(imcserver,Integer.parseInt(template)) ; } catch ( NumberFormatException ex ) { } if ( temp == null ) { htmlStr = IMCServiceRMI.parseDoc( imcserver, null, "no_demotemplate.html", lang_prefix ) ; } else { htmlStr = new String((byte[])temp[1],"8859_1") ; } } else if ( req.getParameter("change_group")!=null ) { user.put("flags",new Integer(imcode.server.IMCConstants.PERM_DT_TEXT_CHANGE_TEMPLATE)) ; String group = req.getParameter("group") ; if ( group != null ) { user.setTemplateGroup(Integer.parseInt(req.getParameter("group"))) ; }// 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 ; } out.print(htmlStr) ; }
8781 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8781/724e7812e834d9de044f04f1b96918c3622f1241/SaveInPage.java/clean/servlets/SaveInPage.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 741, 3349, 12, 2940, 18572, 1111, 16, 12446, 400, 13, 1216, 16517, 16, 1860, 288, 202, 202, 780, 1479, 4697, 202, 33, 1111, 18, 588, 1864, 2932, 2594, 7923, 274, 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, 741, 3349, 12, 2940, 18572, 1111, 16, 12446, 400, 13, 1216, 16517, 16, 1860, 288, 202, 202, 780, 1479, 4697, 202, 33, 1111, 18, 588, 1864, 2932, 2594, 7923, 274, 202, 202...
GridData gd= new GridData(/*GridData.VERTICAL_ALIGN_CENTER | */ GridData.FILL_HORIZONTAL);
GridData gd= new GridData(GridData.FILL_HORIZONTAL);
protected Control createAnimationItem(Composite parent) { if (okImage == null) { Display display= parent.getDisplay(); noneImage= ImageSupport.getImageDescriptor("icons/full/progress/progress_none.gif").createImage(display); //$NON-NLS-1$ okImage= ImageSupport.getImageDescriptor("icons/full/progress/progress_ok.gif").createImage(display); //$NON-NLS-1$ errorImage= ImageSupport.getImageDescriptor("icons/full/progress/progress_error.gif").createImage(display); //$NON-NLS-1$ } top = new Composite(parent, SWT.NULL); //top.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_CYAN)); top.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { FinishedJobs.getInstance().removeListener(ProgressAnimationItem.this); noneImage.dispose(); okImage.dispose(); errorImage.dispose(); } }); boolean isCarbon = "carbon".equals(SWT.getPlatform()); //$NON-NLS-1$ GridLayout gl= new GridLayout(); gl.numColumns= isCarbon ? 3 : 2; gl.marginHeight= 0; gl.marginWidth= 0; gl.horizontalSpacing= 2; top.setLayout(gl); bar = new ProgressBar(top, SWT.HORIZONTAL | SWT.INDETERMINATE); bar.setVisible(false); bar.addMouseListener(mouseListener); GridData gd= new GridData(/*GridData.VERTICAL_ALIGN_CENTER | */ GridData.FILL_HORIZONTAL); gd.heightHint= 12; bar.setLayoutData(gd); toolbar= new ToolBar(top, SWT.FLAT); toolbar.setVisible(false); gd= new GridData(GridData.FILL_VERTICAL); gd.widthHint= 22; toolbar.setLayoutData(gd); toolButton= new ToolItem(toolbar, SWT.NONE); toolButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { doAction(); } }); if (isCarbon) // prevent that Mac growbox overlaps with toolbar item new Label(top, SWT.NONE).setLayoutData(new GridData(4, 4)); refresh(); return top; }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/cc3be60494050a679a6e76d9f29fe7621439ded9/ProgressAnimationItem.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressAnimationItem.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1117, 8888, 752, 10816, 1180, 12, 9400, 982, 13, 288, 202, 377, 202, 377, 202, 565, 309, 261, 601, 2040, 422, 446, 13, 288, 202, 3639, 9311, 2562, 33, 982, 18, 588, 4236, 5621, 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, 225, 202, 1117, 8888, 752, 10816, 1180, 12, 9400, 982, 13, 288, 202, 377, 202, 377, 202, 565, 309, 261, 601, 2040, 422, 446, 13, 288, 202, 3639, 9311, 2562, 33, 982, 18, 588, 4236, 5621, 2...
int lastIndex, boolean isAdjusting) {
int lastIndex, boolean isAdjusting) {
public ListSelectionEvent(Object source, int firstIndex, int lastIndex, boolean isAdjusting) { super(source); this.firstIndex = firstIndex; this.lastIndex = lastIndex; this.isAdjusting = isAdjusting; } // ListSelectionEvent()
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/ListSelectionEvent.java/buggy/core/src/classpath/javax/javax/swing/event/ListSelectionEvent.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 987, 6233, 1133, 12, 921, 1084, 16, 509, 1122, 1016, 16, 6862, 9506, 202, 474, 7536, 16, 1250, 353, 10952, 310, 13, 288, 202, 202, 9565, 12, 3168, 1769, 202, 202, 2211, 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, 225, 202, 482, 987, 6233, 1133, 12, 921, 1084, 16, 509, 1122, 1016, 16, 6862, 9506, 202, 474, 7536, 16, 1250, 353, 10952, 310, 13, 288, 202, 202, 9565, 12, 3168, 1769, 202, 202, 2211, 18, ...
osr.write(
osr.print(
void writeSequences(Integer geneID) throws SequenceException { Hashtable geneatts = (Hashtable) geneiDs.get(geneID); TreeMap traniDs = (TreeMap) geneatts.get(Transcripts); SequenceLocation geneloc = (SequenceLocation) geneatts.get(Geneloc); try { for (Iterator tranIter = traniDs.keySet().iterator(); tranIter.hasNext();) { Hashtable tranatts = (Hashtable) traniDs.get((Integer) tranIter.next()); if (((Boolean) tranatts.get(hasUTR)).booleanValue()) { String assemblyout = (String) geneatts.get(Assembly); int gstrand = geneloc.getStrand(); String strandout = geneloc.getStrand() > 0 ? "forward" : "revearse"; osr.write((String) tranatts.get(DisplayID)); osr.write( separator + "strand=" + strandout + separator + "chr=" + geneloc.getChr() + separator + "assembly=" + assemblyout); osr.flush(); for (int j = 0, n = fields.size(); j < n; j++) { osr.write(separator); String field = (String) fields.get(j); if (tranatts.containsKey(field)) { List values = (ArrayList) tranatts.get(field); if (values.size() > 1) osr.write(field + " in "); else osr.write(field + "="); for (int vi = 0; vi < values.size(); vi++) { if (vi > 0) osr.write(","); osr.write((String) values.get(vi)); } } else osr.write(field + "= "); osr.flush(); } osr.write(separator + (String) tranatts.get(Description)); osr.write(separator); osr.flush(); TreeMap locations = (TreeMap) tranatts.get(Locations); dna.CacheSequence(species, geneloc.getChr(), geneloc.getStart(), geneloc.getEnd()); StringBuffer sequence = new StringBuffer(); // to collect all sequence before appending flanks for (Iterator lociter = locations.keySet().iterator(); lociter.hasNext();) { SequenceLocation loc = (SequenceLocation) locations.get((Integer) lociter.next()); if (loc.getStrand() < 0) sequence.append( SequenceUtil.reverseComplement(dna.getSequence(species, loc.getChr(), loc.getStart(), loc.getEnd()))); else sequence.append(dna.getSequence(species, loc.getChr(), loc.getStart(), loc.getEnd())); } if (query.getSequenceDescription().getRightFlank() > 0) { // extend flanking sequence SequenceLocation first_loc = (SequenceLocation) locations.get((Integer) locations.firstKey()); SequenceLocation last_loc = (SequenceLocation) locations.get((Integer) locations.lastKey()); SequenceLocation flank_loc; if (first_loc.getStrand() < 0) { flank_loc = first_loc.getRightFlankOnly(query.getSequenceDescription().getRightFlank()); // right flank of first location sequence.append( SequenceUtil.reverseComplement( dna.getSequence(species, flank_loc.getChr(), flank_loc.getStart(), flank_loc.getEnd()))); } else { flank_loc = last_loc.getRightFlankOnly(query.getSequenceDescription().getRightFlank()); // right flank of last location sequence.append(dna.getSequence(species, flank_loc.getChr(), flank_loc.getStart(), flank_loc.getEnd())); } } osr.write(sequence.toString()); osr.write("\n"); osr.flush(); } else { osr.write((String) tranatts.get(DisplayID)); osr.write(separator + (String) tranatts.get(Description)); osr.write(separator); osr.write(noUTRmessage); osr.write("\n"); osr.flush(); } } } catch (SequenceException e) { if (logger.isLoggable(Level.WARNING)) logger.warning(e.getMessage()); throw e; } catch (IOException e) { if (logger.isLoggable(Level.WARNING)) logger.warning("Couldnt write to OutputStream\n" + e.getMessage()); throw new SequenceException(e); } }
2000 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2000/963ec829751fd5def2be55cd75b908c39ffe6f99/DownStreamUTRSeqQueryRunner.java/clean/src/java/org/ensembl/mart/lib/DownStreamUTRSeqQueryRunner.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 3196, 202, 6459, 1045, 21710, 12, 4522, 7529, 734, 13, 1216, 8370, 503, 288, 1082, 202, 5582, 14544, 7529, 270, 3428, 273, 261, 5582, 14544, 13, 7529, 77, 22831, 18, 588, 12, 11857, 734, 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, 3196, 202, 6459, 1045, 21710, 12, 4522, 7529, 734, 13, 1216, 8370, 503, 288, 1082, 202, 5582, 14544, 7529, 270, 3428, 273, 261, 5582, 14544, 13, 7529, 77, 22831, 18, 588, 12, 11857, 734, 1769,...
public static AudioFormat getNativeAudioFormat(AudioFormat format, Mixer mixer) { Line.Info[] lineInfos; if (mixer != null) { lineInfos = mixer.getTargetLineInfo (new Line.Info(TargetDataLine.class)); } else { lineInfos = AudioSystem.getTargetLineInfo (new Line.Info(TargetDataLine.class)); } AudioFormat nativeFormat = null; for (int i = 0; i < lineInfos.length; i++) { AudioFormat[] formats = ((TargetDataLine.Info)lineInfos[i]).getFormats(); for (int j = 0; j < formats.length; j++) { AudioFormat thisFormat = formats[j]; if (thisFormat.getEncoding() == format.getEncoding() && thisFormat.isBigEndian() == format.isBigEndian() && thisFormat.getSampleSizeInBits() == format.getSampleSizeInBits() && thisFormat.getSampleRate() >= format.getSampleRate()) { nativeFormat = thisFormat; break; } } if (nativeFormat != null) { break; } } return nativeFormat;
public static AudioFormat getNativeAudioFormat(AudioFormat format) { return getNativeAudioFormat(format, null);
public static AudioFormat getNativeAudioFormat(AudioFormat format, Mixer mixer) { Line.Info[] lineInfos; if (mixer != null) { lineInfos = mixer.getTargetLineInfo (new Line.Info(TargetDataLine.class)); } else { lineInfos = AudioSystem.getTargetLineInfo (new Line.Info(TargetDataLine.class)); } AudioFormat nativeFormat = null; // find a usable target line for (int i = 0; i < lineInfos.length; i++) { AudioFormat[] formats = ((TargetDataLine.Info)lineInfos[i]).getFormats(); for (int j = 0; j < formats.length; j++) { // for now, just accept downsampling, not checking frame // size/rate (encoding assumed to be PCM) AudioFormat thisFormat = formats[j]; if (thisFormat.getEncoding() == format.getEncoding() && thisFormat.isBigEndian() == format.isBigEndian() && thisFormat.getSampleSizeInBits() == format.getSampleSizeInBits() && thisFormat.getSampleRate() >= format.getSampleRate()) { nativeFormat = thisFormat; break; } } if (nativeFormat != null) { //no need to look through remaining lineinfos break; } } return nativeFormat; }
48839 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/48839/13ad140ab718f86203f8e83ff9849b83b918dd82/DataUtil.java/buggy/sphinx4/src/sphinx4/edu/cmu/sphinx/frontend/util/DataUtil.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 760, 15045, 1630, 25945, 12719, 1630, 12, 12719, 1630, 740, 16, 4766, 10402, 31043, 264, 6843, 264, 13, 288, 3639, 5377, 18, 966, 8526, 980, 7655, 31, 7734, 309, 261, 14860, 264, 48...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 15045, 1630, 25945, 12719, 1630, 12, 12719, 1630, 740, 16, 4766, 10402, 31043, 264, 6843, 264, 13, 288, 3639, 5377, 18, 966, 8526, 980, 7655, 31, 7734, 309, 261, 14860, 264, 48...
withoutUnicodePtr = currentPosition - unicodeSize - startPosition;
this.withoutUnicodePtr = this.currentPosition - unicodeSize - this.startPosition;
public final void getNextUnicodeChar() throws IndexOutOfBoundsException, InvalidInputException { //VOID //handle the case of unicode. //when a unicode appears then we must use a buffer that holds char internal values //At the end of this method currentCharacter holds the new visited char //and currentPosition points right next after it //ALL getNextChar.... ARE OPTIMIZED COPIES int c1 = 0, c2 = 0, c3 = 0, c4 = 0, unicodeSize = 6; currentPosition++; while (source[currentPosition] == 'u') { currentPosition++; unicodeSize++; } if ((c1 = Character.getNumericValue(source[currentPosition++])) > 15 || c1 < 0 || (c2 = Character.getNumericValue(source[currentPosition++])) > 15 || c2 < 0 || (c3 = Character.getNumericValue(source[currentPosition++])) > 15 || c3 < 0 || (c4 = Character.getNumericValue(source[currentPosition++])) > 15 || c4 < 0){ throw new InvalidInputException(INVALID_UNICODE_ESCAPE); } else { currentCharacter = (char) (((c1 * 16 + c2) * 16 + c3) * 16 + c4); //need the unicode buffer if (withoutUnicodePtr == 0) { //buffer all the entries that have been left aside.... withoutUnicodePtr = currentPosition - unicodeSize - startPosition; System.arraycopy( source, startPosition, withoutUnicodeBuffer, 1, withoutUnicodePtr); } //fill the buffer with the char withoutUnicodeBuffer[++withoutUnicodePtr] = currentCharacter; } unicodeAsBackSlash = currentCharacter == '\\';}
10698 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/10698/bd0b42da240c9e3160dab0f23f741fededbd0813/Scanner.java/clean/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1071, 727, 918, 6927, 16532, 2156, 1435, 202, 15069, 17768, 16, 31989, 288, 202, 759, 58, 12945, 202, 759, 4110, 326, 648, 434, 5252, 18, 202, 759, 13723, 279, 5252, 14606, 1508, 732, 1297, 99...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 727, 918, 6927, 16532, 2156, 1435, 202, 15069, 17768, 16, 31989, 288, 202, 759, 58, 12945, 202, 759, 4110, 326, 648, 434, 5252, 18, 202, 759, 13723, 279, 5252, 14606, 1508, 732, 1297, 99...
return (FontHandle) value;
return doGetFontHandle( TOC.FONT_FAMILY_MEMBER );
public FontHandle getFontFamily( ) { Object value = getProperty( TOC.FONT_FAMILY_MEMBER ); if ( value == null ) { StyleHandle style = getStyle( ); if ( style == null ) { return null; } else { return style.getFontFamilyHandle( ); } } return (FontHandle) value; }
5230 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5230/0e4cd9ee8eeb59e50378273ae983983b1c019429/TOCHandle.java/buggy/model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/api/TOCHandle.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 10063, 3259, 18776, 9203, 12, 262, 202, 95, 202, 202, 921, 460, 273, 3911, 12, 8493, 39, 18, 25221, 67, 25002, 25554, 67, 19630, 11272, 202, 202, 430, 261, 460, 422, 446, 262,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 10063, 3259, 18776, 9203, 12, 262, 202, 95, 202, 202, 921, 460, 273, 3911, 12, 8493, 39, 18, 25221, 67, 25002, 25554, 67, 19630, 11272, 202, 202, 430, 261, 460, 422, 446, 262,...
WorkbenchMessages.getString("AboutFeaturesDialog.errorTitle"), WorkbenchMessages.getString("AboutFeaturesDialog.unableToObtainFeatureInfo"));
IDEWorkbenchMessages.getString("AboutFeaturesDialog.errorTitle"), IDEWorkbenchMessages.getString("AboutFeaturesDialog.unableToObtainFeatureInfo"));
public void run() { // this may take a few seconds try { localSiteArray[0] = SiteManager.getLocalSite(); } catch (CoreException e) { MessageDialog.openError( getShell(), WorkbenchMessages.getString("AboutFeaturesDialog.errorTitle"), //$NON-NLS-1$ WorkbenchMessages.getString("AboutFeaturesDialog.unableToObtainFeatureInfo")); //$NON-NLS-1$ } }
55805 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55805/11827c078a0649e2471215c6f22b6a98cb0993d2/AboutFeaturesDialog.java/buggy/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/dialogs/AboutFeaturesDialog.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1875, 202, 482, 918, 1086, 1435, 288, 9506, 202, 759, 333, 2026, 4862, 279, 11315, 3974, 9506, 202, 698, 288, 6862, 202, 3729, 4956, 1076, 63, 20, 65, 273, 9063, 1318, 18, 588, 2042, 4956, 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, 1875, 202, 482, 918, 1086, 1435, 288, 9506, 202, 759, 333, 2026, 4862, 279, 11315, 3974, 9506, 202, 698, 288, 6862, 202, 3729, 4956, 1076, 63, 20, 65, 273, 9063, 1318, 18, 588, 2042, 4956, 5...
public static Test suite() { return new TestSuite(IncludeLibraryRuleTest.class);
public static Test suite( ) { return new TestSuite( IncludeLibraryRuleTest.class );
public static Test suite() { return new TestSuite(IncludeLibraryRuleTest.class); }
15160 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/15160/be89bbe9dc15ff0ab4dc1c872159ed1fafbdcb6f/IncludeLibraryRuleTest.java/buggy/testsuites/org.eclipse.birt.report.tests.model/src/org/eclipse/birt/report/tests/model/api/IncludeLibraryRuleTest.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 760, 7766, 11371, 1435, 565, 288, 9506, 202, 2463, 394, 7766, 13587, 12, 8752, 9313, 2175, 4709, 18, 1106, 1769, 202, 97, 2, 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, 1071, 760, 7766, 11371, 1435, 565, 288, 9506, 202, 2463, 394, 7766, 13587, 12, 8752, 9313, 2175, 4709, 18, 1106, 1769, 202, 97, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
public TA_RetCode CDLDOJISTAR( int startIdx, int endIdx, double inOpen[], double inHigh[], double inLow[], double inClose[], MInteger outBegIdx, MInteger outNbElement, int outInteger[] ){ double BodyDojiPeriodTotal, BodyLongPeriodTotal; int i, outIdx, BodyDojiTrailingIdx, BodyLongTrailingIdx, lookbackTotal; 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; lookbackTotal = CDLDOJISTAR_Lookback (); if( startIdx < lookbackTotal ) startIdx = lookbackTotal; if( startIdx > endIdx ) { outBegIdx.value = 0 ; outNbElement.value = 0 ; return TA_RetCode. TA_SUCCESS; } BodyLongPeriodTotal = 0; BodyDojiPeriodTotal = 0; BodyLongTrailingIdx = startIdx -1 - (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].avgPeriod) ; BodyDojiTrailingIdx = startIdx - (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].avgPeriod) ; i = BodyLongTrailingIdx; while( i < startIdx-1 ) { BodyLongPeriodTotal += ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].rangeType) == TA_RangeType. TA_RangeType_RealBody ? ( Math.abs ( inClose[i] - inOpen[i] ) ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].rangeType) == TA_RangeType. TA_RangeType_HighLow ? ( inHigh[i] - inLow[i] ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? ( inHigh[i] - ( inClose[i] >= inOpen[i] ? inClose[i] : inOpen[i] ) ) + ( ( inClose[i] >= inOpen[i] ? inOpen[i] : inClose[i] ) - inLow[i] ) : 0 ) ) ) ; i++; } i = BodyDojiTrailingIdx; while( i < startIdx ) { BodyDojiPeriodTotal += ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].rangeType) == TA_RangeType. TA_RangeType_RealBody ? ( Math.abs ( inClose[i] - inOpen[i] ) ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].rangeType) == TA_RangeType. TA_RangeType_HighLow ? ( inHigh[i] - inLow[i] ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? ( inHigh[i] - ( inClose[i] >= inOpen[i] ? inClose[i] : inOpen[i] ) ) + ( ( inClose[i] >= inOpen[i] ? inOpen[i] : inClose[i] ) - inLow[i] ) : 0 ) ) ) ; i++; } outIdx = 0; do { if( ( Math.abs ( inClose[i-1] - inOpen[i-1] ) ) > ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].factor) * ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].avgPeriod) != 0.0? BodyLongPeriodTotal / (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].avgPeriod) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].rangeType) == TA_RangeType. TA_RangeType_RealBody ? ( Math.abs ( inClose[i-1] - inOpen[i-1] ) ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].rangeType) == TA_RangeType. TA_RangeType_HighLow ? ( inHigh[i-1] - inLow[i-1] ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? ( inHigh[i-1] - ( inClose[i-1] >= inOpen[i-1] ? inClose[i-1] : inOpen[i-1] ) ) + ( ( inClose[i-1] >= inOpen[i-1] ? inOpen[i-1] : inClose[i-1] ) - inLow[i-1] ) : 0 ) ) ) ) / ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? 2.0 : 1.0 ) ) && ( Math.abs ( inClose[i] - inOpen[i] ) ) <= ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].factor) * ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].avgPeriod) != 0.0? BodyDojiPeriodTotal / (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].avgPeriod) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].rangeType) == TA_RangeType. TA_RangeType_RealBody ? ( Math.abs ( inClose[i] - inOpen[i] ) ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].rangeType) == TA_RangeType. TA_RangeType_HighLow ? ( inHigh[i] - inLow[i] ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? ( inHigh[i] - ( inClose[i] >= inOpen[i] ? inClose[i] : inOpen[i] ) ) + ( ( inClose[i] >= inOpen[i] ? inOpen[i] : inClose[i] ) - inLow[i] ) : 0 ) ) ) ) / ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? 2.0 : 1.0 ) ) && ( ( ( inClose[i-1] >= inOpen[i-1] ? 1 : -1 ) == 1 && ( (((inOpen[i]) < (inClose[i])) ? (inOpen[i]) : (inClose[i])) > (((inOpen[i-1]) > (inClose[i-1])) ? (inOpen[i-1]) : (inClose[i-1])) ) ) || ( ( inClose[i-1] >= inOpen[i-1] ? 1 : -1 ) == -1 && ( (((inOpen[i]) > (inClose[i])) ? (inOpen[i]) : (inClose[i])) < (((inOpen[i-1]) < (inClose[i-1])) ? (inOpen[i-1]) : (inClose[i-1])) ) ) ) ) outInteger[outIdx++] = - ( inClose[i-1] >= inOpen[i-1] ? 1 : -1 ) * 100; else outInteger[outIdx++] = 0; BodyLongPeriodTotal += ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].rangeType) == TA_RangeType. TA_RangeType_RealBody ? ( Math.abs ( inClose[i-1] - inOpen[i-1] ) ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].rangeType) == TA_RangeType. TA_RangeType_HighLow ? ( inHigh[i-1] - inLow[i-1] ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? ( inHigh[i-1] - ( inClose[i-1] >= inOpen[i-1] ? inClose[i-1] : inOpen[i-1] ) ) + ( ( inClose[i-1] >= inOpen[i-1] ? inOpen[i-1] : inClose[i-1] ) - inLow[i-1] ) : 0 ) ) ) - ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].rangeType) == TA_RangeType. TA_RangeType_RealBody ? ( Math.abs ( inClose[BodyLongTrailingIdx] - inOpen[BodyLongTrailingIdx] ) ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].rangeType) == TA_RangeType. TA_RangeType_HighLow ? ( inHigh[BodyLongTrailingIdx] - inLow[BodyLongTrailingIdx] ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? ( inHigh[BodyLongTrailingIdx] - ( inClose[BodyLongTrailingIdx] >= inOpen[BodyLongTrailingIdx] ? inClose[BodyLongTrailingIdx] : inOpen[BodyLongTrailingIdx] ) ) + ( ( inClose[BodyLongTrailingIdx] >= inOpen[BodyLongTrailingIdx] ? inOpen[BodyLongTrailingIdx] : inClose[BodyLongTrailingIdx] ) - inLow[BodyLongTrailingIdx] ) : 0 ) ) ) ; BodyDojiPeriodTotal += ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].rangeType) == TA_RangeType. TA_RangeType_RealBody ? ( Math.abs ( inClose[i] - inOpen[i] ) ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].rangeType) == TA_RangeType. TA_RangeType_HighLow ? ( inHigh[i] - inLow[i] ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? ( inHigh[i] - ( inClose[i] >= inOpen[i] ? inClose[i] : inOpen[i] ) ) + ( ( inClose[i] >= inOpen[i] ? inOpen[i] : inClose[i] ) - inLow[i] ) : 0 ) ) ) - ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].rangeType) == TA_RangeType. TA_RangeType_RealBody ? ( Math.abs ( inClose[BodyDojiTrailingIdx] - inOpen[BodyDojiTrailingIdx] ) ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].rangeType) == TA_RangeType. TA_RangeType_HighLow ? ( inHigh[BodyDojiTrailingIdx] - inLow[BodyDojiTrailingIdx] ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? ( inHigh[BodyDojiTrailingIdx] - ( inClose[BodyDojiTrailingIdx] >= inOpen[BodyDojiTrailingIdx] ? inClose[BodyDojiTrailingIdx] : inOpen[BodyDojiTrailingIdx] ) ) + ( ( inClose[BodyDojiTrailingIdx] >= inOpen[BodyDojiTrailingIdx] ? inOpen[BodyDojiTrailingIdx] : inClose[BodyDojiTrailingIdx] ) - inLow[BodyDojiTrailingIdx] ) : 0 ) ) ) ; i++; BodyLongTrailingIdx++; BodyDojiTrailingIdx++; } while( i <= endIdx ); outNbElement.value = outIdx; 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, 39, 8914, 3191, 46, 5511, 985, 12, 474, 1937, 4223, 16, 474, 409, 4223, 16, 9056, 267, 3678, 63, 6487, 9056, 267, 8573, 63, 6487, 9056, 267, 10520, 63, 6487, 9056...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 39, 8914, 3191, 46, 5511, 985, 12, 474, 1937, 4223, 16, 474, 409, 4223, 16, 9056, 267, 3678, 63, 6487, 9056, 267, 8573, 63, 6487, 9056, 267, 10520, 63, 6487, 9056...
addFormField( "action", heroID == BORIS ? "boris" : heroID == JARLSBERG ? "jarlsberg" : "sneakypete" );
addFormField( "action", heroId == BORIS ? "boris" : heroId == JARLSBERG ? "jarlsberg" : "sneakypete" );
public HeroDonationRequest( int heroID, int amount ) { super( "shrines.php" ); addFormField( "pwd" ); addFormField( "action", heroID == BORIS ? "boris" : heroID == JARLSBERG ? "jarlsberg" : "sneakypete" ); addFormField( "howmuch", String.valueOf( amount ) ); this.amount = amount; this.statue = heroID == BORIS ? "boris" : heroID == JARLSBERG ? "jarlsberg" : "pete"; this.hasStatueKey = inventory.contains( STATUE_KEYS[ heroID ] ); }
50364 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50364/db652071b06715a4456f702f081fbe5b47aa5a70/HeroDonationRequest.java/clean/src/net/sourceforge/kolmafia/HeroDonationRequest.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 670, 2439, 22293, 367, 691, 12, 509, 366, 2439, 734, 16, 509, 3844, 262, 202, 95, 202, 202, 9565, 12, 315, 674, 86, 1465, 18, 2684, 6, 11272, 202, 202, 1289, 27317, 12, 315,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 670, 2439, 22293, 367, 691, 12, 509, 366, 2439, 734, 16, 509, 3844, 262, 202, 95, 202, 202, 9565, 12, 315, 674, 86, 1465, 18, 2684, 6, 11272, 202, 202, 1289, 27317, 12, 315,...
helpSupport.displayHelp(topic);
helpSupport.displayHelpResource(topic);
private void openHelpTopic(String topic, String href) { IHelp helpSupport = WorkbenchHelp.getHelpSupport(); if (helpSupport != null) { if (href != null) helpSupport.displayHelp(topic, href); else helpSupport.displayHelp(topic); }}
55805 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55805/be4a9d721542e08ee5ff101434eff2a59ef87f62/WelcomeItem.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WelcomeItem.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 3238, 918, 1696, 6696, 6657, 12, 780, 3958, 16, 514, 3897, 13, 288, 202, 45, 6696, 2809, 6289, 273, 4147, 22144, 6696, 18, 588, 6696, 6289, 5621, 202, 430, 261, 5201, 6289, 480, 446, 13, 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, 3238, 918, 1696, 6696, 6657, 12, 780, 3958, 16, 514, 3897, 13, 288, 202, 45, 6696, 2809, 6289, 273, 4147, 22144, 6696, 18, 588, 6696, 6289, 5621, 202, 430, 261, 5201, 6289, 480, 446, 13, 288...
if (pixel < map_size) return (int) ((generateMask (3) & rgb[pixel]) >> (3 * pixel_bits));
if (opaque || pixel >= map_size) return 255;
public final int getAlpha (int pixel) { if (pixel < map_size) return (int) ((generateMask (3) & rgb[pixel]) >> (3 * pixel_bits)); return 0; }
50763 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50763/24330cfb4cc445da21a71a819ce54efe764fab6e/IndexColorModel.java/buggy/core/src/classpath/java/java/awt/image/IndexColorModel.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 727, 509, 336, 9690, 261, 474, 4957, 13, 225, 288, 565, 309, 261, 11743, 411, 852, 67, 1467, 13, 202, 565, 327, 261, 474, 13, 14015, 7163, 5796, 261, 23, 13, 473, 6917, 63, 1174...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 509, 336, 9690, 261, 474, 4957, 13, 225, 288, 565, 309, 261, 11743, 411, 852, 67, 1467, 13, 202, 565, 327, 261, 474, 13, 14015, 7163, 5796, 261, 23, 13, 473, 6917, 63, 1174...
}
public void setDefaultAction() { MLink ml = (MLink) getOwner(); Collection col = ml.getStimuli(); Iterator it = col.iterator(); while (it.hasNext()) { MStimulus ms = (MStimulus) it.next(); Object ma = ModelFacade.getDispatchAction(ms); MNamespace ns = ms.getNamespace(); Collection elements = ns.getOwnedElements(); Iterator iterator = elements.iterator(); while (iterator.hasNext()) { MModelElement moe = (MModelElement) iterator.next(); if (moe instanceof MAction) { if (moe == ma) { ModelFacade.removeOwnedElement(ns, ma); } } } MCallAction mca = UmlFactory.getFactory().getCommonBehavior().createCallAction(); mca.setAsynchronous(ModelFacade.isAsynchronous(ma)); mca.setName(ModelFacade.getName(ma)); ms.setDispatchAction(mca); ns.addOwnedElement(mca); } }
7166 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7166/ca3bcb5d6dd283c4553bcbfe50b108dc5d499768/FigSeqLink.java/clean/src_new/org/argouml/uml/diagram/sequence/ui/FigSeqLink.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 918, 9277, 1803, 1435, 288, 565, 490, 2098, 12931, 273, 261, 1495, 754, 13, 13782, 5621, 565, 2200, 645, 273, 12931, 18, 588, 510, 381, 14826, 5621, 565, 4498, 518, 273, 645, 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, 282, 1071, 918, 9277, 1803, 1435, 288, 565, 490, 2098, 12931, 273, 261, 1495, 754, 13, 13782, 5621, 565, 2200, 645, 273, 12931, 18, 588, 510, 381, 14826, 5621, 565, 4498, 518, 273, 645, 18, ...
addWarning(warningsToLog, "Could not parse key sequence", configurationElement.getNamespace(), commandId, "keySequence", keySequenceText);
addWarning(warningsToLog, "Could not parse key sequence", configurationElement, commandId, "keySequence", keySequenceText);
private static final void readBindingsFromRegistry( final IConfigurationElement[] configurationElements, final int configurationElementCount, final BindingManager bindingManager, final ICommandService commandService) { final Collection bindings = new ArrayList(configurationElementCount); final List warningsToLog = new ArrayList(1); for (int i = 0; i < configurationElementCount; i++) { final IConfigurationElement configurationElement = configurationElements[i]; /* * Read out the command id. Doing this before determining if the key * binding is actually valid is a bit wasteful. However, it is * helpful to have the command identifier when logging syntax * errors. */ String commandId = configurationElement .getAttribute(ATTRIBUTE_COMMAND_ID); if ((commandId == null) || (commandId.length() == 0)) { commandId = configurationElement .getAttribute(ATTRIBUTE_COMMAND); } if ((commandId != null) && (commandId.length() == 0)) { commandId = null; } final Command command; if (commandId != null) { command = commandService.getCommand(commandId); if (!command.isDefined()) { // Reference to an undefined command. This is invalid. addWarning(warningsToLog, "Cannot bind to an undefined command", //$NON-NLS-1$ configurationElement.getNamespace(), commandId); continue; } } else { command = null; } // Read out the scheme id. String schemeId = configurationElement .getAttribute(ATTRIBUTE_SCHEME_ID); if ((schemeId == null) || (schemeId.length() == 0)) { schemeId = configurationElement .getAttribute(ATTRIBUTE_KEY_CONFIGURATION_ID); if ((schemeId == null) || (schemeId.length() == 0)) { schemeId = configurationElement .getAttribute(ATTRIBUTE_CONFIGURATION); if ((schemeId == null) || (schemeId.length() == 0)) { // The scheme id should never be null. This is invalid. addWarning(warningsToLog, "Key bindings need a scheme", //$NON-NLS-1$ configurationElement.getNamespace(), commandId); continue; } } } // Read out the context id. String contextId = configurationElement .getAttribute(ATTRIBUTE_CONTEXT_ID); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } else if ((contextId == null) || (contextId.length() == 0)) { contextId = configurationElement.getAttribute(ATTRIBUTE_SCOPE); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } } if ((contextId == null) || (contextId.length() == 0)) { contextId = IContextIds.CONTEXT_ID_WINDOW; } // Read out the key sequence. KeySequence keySequence = null; String keySequenceText = configurationElement .getAttribute(ATTRIBUTE_SEQUENCE); if ((keySequenceText == null) || (keySequenceText.length() == 0)) { keySequenceText = configurationElement .getAttribute(ATTRIBUTE_KEY_SEQUENCE); } if ((keySequenceText == null) || (keySequenceText.length() == 0)) { keySequenceText = configurationElement .getAttribute(ATTRIBUTE_STRING); if ((keySequenceText == null) || (keySequenceText.length() == 0)) { // The key sequence should never be null. This is pointless addWarning( warningsToLog, "Defining a key binding with no key sequence has no effect", //$NON-NLS-1$ configurationElement.getNamespace(), commandId); continue; } // The key sequence is in the old-style format. try { keySequence = convert2_1Sequence(parse2_1Sequence(keySequenceText)); } catch (final IllegalArgumentException e) { addWarning(warningsToLog, "Could not parse key sequence", //$NON-NLS-1$ configurationElement.getNamespace(), commandId, "keySequence", keySequenceText); //$NON-NLS-1$ continue; } } else { // The key sequence is in the new-style format. try { keySequence = KeySequence.getInstance(keySequenceText); } catch (final ParseException e) { addWarning(warningsToLog, "Could not parse key sequence", //$NON-NLS-1$ configurationElement.getNamespace(), commandId, "keySequence", keySequenceText); //$NON-NLS-1$ continue; } if (keySequence.isEmpty() || !keySequence.isComplete()) { addWarning( warningsToLog, "Key bindings should not have an empty or incomplete key sequence", //$NON-NLS-1$ configurationElement.getNamespace(), commandId, "keySequence", keySequence.toString()); //$NON-NLS-1$ continue; } } // Read out the locale and platform. String locale = configurationElement.getAttribute(ATTRIBUTE_LOCALE); if ((locale != null) && (locale.length() == 0)) { locale = null; } String platform = configurationElement .getAttribute(ATTRIBUTE_PLATFORM); if ((platform != null) && (platform.length() == 0)) { platform = null; } // Read out the parameters, if any. final ParameterizedCommand parameterizedCommand; if (command == null) { parameterizedCommand = null; } else { parameterizedCommand = readParametersFromRegistry( configurationElement, warningsToLog, command); } final Binding binding = new KeyBinding(keySequence, parameterizedCommand, schemeId, contextId, locale, platform, null, Binding.SYSTEM); bindings.add(binding); } final Binding[] bindingArray = (Binding[]) bindings .toArray(new Binding[bindings.size()]); bindingManager.setBindings(bindingArray); logWarnings( warningsToLog, "Warnings while parsing the key bindings from the 'org.eclipse.ui.commands' extension point"); //$NON-NLS-1$ }
55805 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55805/539b29bd9f4ed0020b6fce0d726b8d740d87469d/BindingPersistence.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1152, 760, 727, 918, 855, 10497, 1265, 4243, 12, 1082, 202, 6385, 467, 1750, 1046, 8526, 1664, 3471, 16, 1082, 202, 6385, 509, 1664, 1046, 1380, 16, 1082, 202, 6385, 15689, 1318, 508...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 760, 727, 918, 855, 10497, 1265, 4243, 12, 1082, 202, 6385, 467, 1750, 1046, 8526, 1664, 3471, 16, 1082, 202, 6385, 509, 1664, 1046, 1380, 16, 1082, 202, 6385, 15689, 1318, 508...
private boolean verify(Message msg, boolean checkTooHigh, boolean checkTooLow) throws RejectLogon, FieldNotFound, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType, IOException { String msgType; try { Message.Header header = msg.getHeader(); String senderCompID = header.getString(SenderCompID.FIELD); String targetCompID = header.getString(TargetCompID.FIELD); Date sendingTime = header.getUtcTimeStamp(SendingTime.FIELD); msgType = header.getString(MsgType.FIELD); int msgSeqNum = 0; if (checkTooHigh || checkTooLow) { msgSeqNum = header.getInt(MsgSeqNum.FIELD); } if (!validLogonState(msgType)) { throw new SessionException("Logon state is not valid for message (MsgType=" + msgType + ")"); } if (!isGoodTime(sendingTime)) { doBadTime(msg); return false; } if (!isCorrectCompID(senderCompID, targetCompID)) { doBadCompID(msg); return false; } state.setLastReceivedTime(System.currentTimeMillis()); state.clearTestRequestCounter(); if (checkTooHigh && isTargetTooHigh(msgSeqNum)) { doTargetTooHigh(msg); return false; } else if (checkTooLow && isTargetTooLow(msgSeqNum)) { doTargetTooLow(msg); return false; } if ((checkTooHigh || checkTooLow) && state.isResendRequested()) { int[] range = state.getResendRange(); if (msgSeqNum >= range[1]) { state.logEvent("ResendRequest for messages FROM: " + range[0] + " TO: " + range[1] + " has been satisfied."); state.setResendRange(0, 0); } } if ((checkTooHigh || checkTooLow) && state.isResendRequested()) { int[] range = state.getResendRange(); if (msgSeqNum >= range[1]) { state.logEvent("ResendRequest for messages FROM: " + range[0] + " TO: " + range[1] + " has been satisfied."); state.setResendRange(0, 0); } } } catch (FieldNotFound e) { throw e; } catch (Exception e) { state.logEvent(e.getClass().getName() + " " + e.getMessage()); disconnect(); return false; } fromCallback(msgType, msg, sessionID); return true; }
6791 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6791/c64396012cd88b23ea34709abc864ee2b49ed867/Session.java/clean/src/quickfix/Session.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 1250, 3929, 12, 1079, 1234, 16, 1250, 866, 10703, 8573, 16, 1250, 866, 10703, 10520, 13, 5411, 1216, 20159, 1343, 265, 16, 2286, 2768, 16, 657, 6746, 751, 1630, 16, 657, 6746, 1805,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1250, 3929, 12, 1079, 1234, 16, 1250, 866, 10703, 8573, 16, 1250, 866, 10703, 10520, 13, 5411, 1216, 20159, 1343, 265, 16, 2286, 2768, 16, 657, 6746, 751, 1630, 16, 657, 6746, 1805,...
expr = expr.createAssign(this, new BitXorExpr(expr, parseAssignExpr()));
if (expr.canRead()) expr = expr.createAssign(this, new BitXorExpr(expr.copy(), parseAssignExpr())); else expr = expr.createAssign(this, parseAssignExpr());
private Expr parseAssignExpr() throws IOException { Expr expr = parseConditionalExpr(); while (true) { int token = parseToken(); switch (token) { case '=': token = parseToken(); try { if (token == '&') expr = expr.createAssignRef(this, parseAssignExpr()); else { _peekToken = token; expr = expr.createAssign(this, parseAssignExpr()); } } catch (PhpParseException e) { throw e; } catch (IOException e) { throw error(e.getMessage()); } break; case PLUS_ASSIGN: expr = expr.createAssign(this, new AddExpr(expr, parseAssignExpr())); break; case MINUS_ASSIGN: expr = expr.createAssign(this, new SubExpr(expr, parseAssignExpr())); break; case APPEND_ASSIGN: expr = expr.createAssign(this, AppendExpr.create(expr, parseAssignExpr())); break; case MUL_ASSIGN: expr = expr.createAssign(this, new MulExpr(expr, parseAssignExpr())); break; case DIV_ASSIGN: expr = expr.createAssign(this, new DivExpr(expr, parseAssignExpr())); break; case MOD_ASSIGN: expr = expr.createAssign(this, new ModExpr(expr, parseAssignExpr())); break; case LSHIFT_ASSIGN: expr = expr.createAssign(this, new LeftShiftExpr(expr, parseAssignExpr())); break; case RSHIFT_ASSIGN: expr = expr.createAssign(this, new RightShiftExpr(expr, parseAssignExpr())); break; case AND_ASSIGN: expr = expr.createAssign(this, new BitAndExpr(expr, parseAssignExpr())); break; case OR_ASSIGN: expr = expr.createAssign(this, new BitOrExpr(expr, parseAssignExpr())); break; case XOR_ASSIGN: expr = expr.createAssign(this, new BitXorExpr(expr, parseAssignExpr())); break; default: _peekToken = token; return expr; } } }
3863 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/3863/b2db2d6325f491f6686ae90d57e531c0a2e59af3/PhpParser.java/clean/quercus/src/main/java/com/caucho/quercus/parser/PhpParser.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 3238, 8074, 1109, 4910, 4742, 1435, 565, 1216, 1860, 225, 288, 565, 8074, 3065, 273, 1109, 14132, 4742, 5621, 565, 1323, 261, 3767, 13, 288, 1377, 509, 1147, 273, 1109, 1345, 5621, 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, 8074, 1109, 4910, 4742, 1435, 565, 1216, 1860, 225, 288, 565, 8074, 3065, 273, 1109, 14132, 4742, 5621, 565, 1323, 261, 3767, 13, 288, 1377, 509, 1147, 273, 1109, 1345, 5621, 1377, ...
private void checkAndAddNamespaceDeclarations(String namespace, Map prefixMap, Element schemaElement) { //get the attribute for the current namespace String prefix = (String) prefixMap.get(namespace); //A prefix must be found at this point! String existingURL = schemaElement.getAttributeNS( XML_NAMESPACE_URI, NAMESPACE_DECLARATION_PREFIX + prefix); if (existingURL == null) { //there is no existing URL by that prefix - declare a new namespace schemaElement.setAttributeNS(XML_NAMESPACE_URI, NAMESPACE_DECLARATION_PREFIX + prefix, namespace); } else if (existingURL.equals(namespace)) { //this namespace declaration is already there with the same prefix //ignore it } else { //there is a different namespace declared in the given prefix //change the prefix in the prefix map to a new one and declare it //create a prefix String generatedPrefix = "ns" + prefixCounter++; while (prefixMap.containsKey(generatedPrefix)) { generatedPrefix = "ns" + prefixCounter++; } schemaElement.setAttributeNS(XML_NAMESPACE_URI, NAMESPACE_DECLARATION_PREFIX + generatedPrefix, namespace); //add to the map prefixMap.put(generatedPrefix, namespace); } }
49300 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49300/244aa4f43ff8119055aa57a36d41877e9626c506/WSDL11ToAxisServiceBuilder.java/clean/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 918, 30970, 986, 3402, 21408, 12, 780, 1981, 16, 4766, 5375, 1635, 1633, 863, 16, 4766, 5375, 3010, 1963, 1046, 13, 288, 3639, 368, 588, 326, 1566, 364, 326, 783, 1981, 3639, 514, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 30970, 986, 3402, 21408, 12, 780, 1981, 16, 4766, 5375, 1635, 1633, 863, 16, 4766, 5375, 3010, 1963, 1046, 13, 288, 3639, 368, 588, 326, 1566, 364, 326, 783, 1981, 3639, 514, ...
noRule = false;
public void buildClassifier(Instances instances) throws Exception { boolean noRule = true; if (instances.checkForStringAttributes()) { throw new Exception("Can't handle string attributes!"); } if (instances.classAttribute().isNumeric()) { throw new Exception("Can't handle numeric class!"); } Instances data = new Instances(instances); // new dataset without missing class values data.deleteWithMissingClass(); if (data.numInstances() == 0) { throw new Exception("No instances with a class value!"); } // for each attribute ... Enumeration enum = instances.enumerateAttributes(); while (enum.hasMoreElements()) { OneRRule r = newRule((Attribute) enum.nextElement(), data); // if this attribute is the best so far, replace the rule if (noRule || r.m_correct > m_rule.m_correct) { m_rule = r; } noRule = false; }
6866 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6866/df84e4a29d8eb3dda9351dae28ae2105840444ee/OneR.java/clean/classifiers/OneR.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 918, 1361, 13860, 12, 5361, 3884, 13, 377, 1216, 1185, 288, 3639, 1250, 1158, 2175, 273, 638, 31, 565, 309, 261, 10162, 18, 1893, 1290, 780, 2498, 10756, 288, 1377, 604, 394, 1185, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1361, 13860, 12, 5361, 3884, 13, 377, 1216, 1185, 288, 3639, 1250, 1158, 2175, 273, 638, 31, 565, 309, 261, 10162, 18, 1893, 1290, 780, 2498, 10756, 288, 1377, 604, 394, 1185, ...
return this.attributes;
AttributeMap attributeMap = new AttributeMap(this); for(int i = 0; i < attributeMap.getLength(); i++) { attributeMap.setNamedItem((Attr)attributeMap.getItem(i)); } if(this.namespaces != null) { Iterator nsDecls = this.namespaces.keySet().iterator(); while (nsDecls.hasNext()) { String prefix = (String) nsDecls.next(); OMNamespace ns = (OMNamespace)this.namespaces.get(prefix); AttrImpl attr = new AttrImpl(this.ownerNode, OMConstants.XMLNS_NS_PREFIX + ":" + prefix, ns.getName()); attributeMap.addItem(attr); } } return attributeMap;
public NamedNodeMap getAttributes() { return this.attributes; }
49300 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49300/1ecc8eebb3ffc0a9feb2fbead4d1b6fa98b69394/ElementImpl.java/clean/modules/saaj/src/org/apache/axis2/om/impl/dom/ElementImpl.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 9796, 907, 863, 10183, 1435, 288, 3639, 3601, 863, 1566, 863, 273, 225, 394, 3601, 863, 12, 2211, 1769, 282, 364, 12, 474, 277, 273, 374, 31, 277, 411, 1566, 863, 18, 588, 1782, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9796, 907, 863, 10183, 1435, 288, 3639, 3601, 863, 1566, 863, 273, 225, 394, 3601, 863, 12, 2211, 1769, 282, 364, 12, 474, 277, 273, 374, 31, 277, 411, 1566, 863, 18, 588, 1782, ...
} catch (Exception e) { } sslSock.testTlsClient(testCipher, testHost, testPort, keystoreLocation);
sslSock.testTlsClient(testCipher,testHost,testPort,keystoreLocation); } catch (Exception e) { System.out.println("Exception caught testing TLS ciphers\n" + e.getMessage()); e.printStackTrace(); System.exit(1); }
public static void main(String [] args) { String testCipher = null; String testHost = "localhost"; String keystoreLocation = "keystore.pfx"; int testPort = 29750; String usage = "java org.mozilla.jss.tests.JSSE_SSLClient" + "\n<keystore location> " + "<test port> <test cipher> <test host> "; try { if ( args[0].toLowerCase().equals("-h") || args.length < 1) { System.out.println(usage); System.exit(1); } if ( args.length >= 1 ) { keystoreLocation = (String)args[0]; } if ( args.length >= 2) { testPort = new Integer(args[1]).intValue(); System.out.println("using port: " + testPort); } if ( args.length >= 3) { testCipher = (String)args[2]; } if ( args.length == 4) { testHost = (String)args[3]; } } catch (Exception e) { System.out.println(usage); System.exit(1); } JSSE_SSLClient sslSock = new JSSE_SSLClient(); // Call TLS client cipher test try { Thread.currentThread().sleep(1000); } catch (Exception e) { } sslSock.testTlsClient(testCipher, testHost, testPort, keystoreLocation); // Call SSLv3 client cipher test try { Thread.currentThread().sleep(1000); } catch (Exception e) { } sslSock.testSslClient(testCipher, testHost, testPort, keystoreLocation); System.exit(0); }
51996 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51996/2c88207a24bea2d0af88356473969a2e94d3f349/JSSE_SSLClient.java/buggy/security/jss/org/mozilla/jss/tests/JSSE_SSLClient.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 760, 918, 2774, 12, 780, 5378, 833, 13, 288, 7734, 514, 1842, 13896, 4202, 273, 446, 31, 3639, 514, 1842, 2594, 540, 273, 315, 13014, 14432, 3639, 514, 16262, 2735, 273, 315, 856, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 780, 5378, 833, 13, 288, 7734, 514, 1842, 13896, 4202, 273, 446, 31, 3639, 514, 1842, 2594, 540, 273, 315, 13014, 14432, 3639, 514, 16262, 2735, 273, 315, 856, ...
return Boolean.valueOf(o0.compareTo(o1) < 0);
return o0.equals(o1) ? Boolean.FALSE : Boolean.TRUE;
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); }
51263 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51263/6edfd201208294a63e08eefe822045d54d51622b/BuiltinFunTable.java/buggy/src/main/mondrian/olap/fun/BuiltinFunTable.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 2398, 1071, 1033, 5956, 12, 15876, 18256, 16, 7784, 8526, 833, 13, 288, 7734, 514, 320, 20, 273, 4997, 4117, 12, 14168, 639, 16, 833, 16, 374, 16, 446, 1769, 7734, 514, 320, 21, 273, 4997, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2398, 1071, 1033, 5956, 12, 15876, 18256, 16, 7784, 8526, 833, 13, 288, 7734, 514, 320, 20, 273, 4997, 4117, 12, 14168, 639, 16, 833, 16, 374, 16, 446, 1769, 7734, 514, 320, 21, 273, 4997, ...
Vector v = Pooka.getStoreManager().getStoreList(); for (int i = 0; i < v.size(); i++) { try { ((StoreInfo)v.elementAt(i)).closeAllFolders(false, true); } catch (Exception e) { } } Pooka.resources.saveProperties(new File(Pooka.localrc)); System.exit(exitValue);
Pooka.exitPooka(exitValue);
public void exitPooka(int exitValue) { if (! processUnsentMessages()) return; if (contentPanel instanceof MessagePanel && ((MessagePanel)contentPanel).isSavingWindowLocations()) { ((MessagePanel)contentPanel).saveWindowLocations(); } Pooka.setProperty("Pooka.hsize", Integer.toString(this.getParentFrame().getWidth())); Pooka.setProperty("Pooka.vsize", Integer.toString(this.getParentFrame().getHeight())); Pooka.setProperty("Pooka.folderPanel.hsize", Integer.toString(folderPanel.getWidth())); Pooka.setProperty("Pooka.folderPanel.vsize", Integer.toString(folderPanel.getHeight())); contentPanel.savePanelSize(); if (contentPanel.isSavingOpenFolders()) { contentPanel.saveOpenFolders(); } Vector v = Pooka.getStoreManager().getStoreList(); for (int i = 0; i < v.size(); i++) { // FIXME: we should check to see if there are any messages // to be deleted, and ask the user if they want to expunge the // deleted messages. try { ((StoreInfo)v.elementAt(i)).closeAllFolders(false, true); } catch (Exception e) { // we really don't care. } } Pooka.resources.saveProperties(new File(Pooka.localrc)); System.exit(exitValue); }
967 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/967/f354177cbeef8267d436b002f39cdea12fbf9805/MainPanel.java/clean/net/suberic/pooka/gui/MainPanel.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 2427, 52, 1184, 69, 12, 474, 2427, 620, 13, 288, 1377, 309, 16051, 1207, 984, 7569, 5058, 10756, 202, 2463, 31, 5411, 309, 261, 1745, 5537, 1276, 2350, 5537, 597, 3196, 225, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2427, 52, 1184, 69, 12, 474, 2427, 620, 13, 288, 1377, 309, 16051, 1207, 984, 7569, 5058, 10756, 202, 2463, 31, 5411, 309, 261, 1745, 5537, 1276, 2350, 5537, 597, 3196, 225, ...
File cacheFile = getCacheFile( this.totalCacheNo ); fileList.add( cacheFile );
File cacheFile = null; if ( currentCacheNo < fileList.size( ) ) { cacheFile = (File) ( fileList.get( currentCacheNo ) ); } else { cacheFile = getCacheFile( this.currentCacheNo ); fileList.add( cacheFile ); }
private void saveToDisk( ) { try { File cacheFile = getCacheFile( this.totalCacheNo ); fileList.add( cacheFile ); FileOutputStream fos = new FileOutputStream( cacheFile ); DataOutputStream oos = new DataOutputStream( new BufferedOutputStream( fos ) ); writeList( oos, currentCache ); oos.close( ); this.totalCacheNo++; this.currentCacheNo = this.totalCacheNo; } catch ( FileNotFoundException e ) { logger.severe( "Exception happened when save data to disk in CachedList. Exception message: " + e.toString( ) ); e.printStackTrace( ); } catch ( IOException e ) { logger.severe( "Exception happened when save data to disk in CachedList. Exception message: " + e.toString( ) ); e.printStackTrace( ); } }
15160 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/15160/fa82a2af56d763819340dcb4920363efb3a6b242/BasicCachedList.java/buggy/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/cache/BasicCachedList.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1152, 918, 1923, 774, 6247, 12, 262, 202, 95, 202, 202, 698, 202, 202, 95, 1082, 202, 812, 18748, 273, 8577, 812, 12, 333, 18, 4963, 1649, 2279, 11272, 1082, 202, 768, 682, 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, 225, 202, 1152, 918, 1923, 774, 6247, 12, 262, 202, 95, 202, 202, 698, 202, 202, 95, 1082, 202, 812, 18748, 273, 8577, 812, 12, 333, 18, 4963, 1649, 2279, 11272, 1082, 202, 768, 682, 18, 1...
public void schedule(Runnable task, long delay, long period)
public void schedule(final Runnable task, long delay, long period)
public void schedule(Runnable task, long delay, long period) throws IllegalStateException { if (_isCancelled) throw new IllegalStateException("Timer cancelled"); if (delay<0) throw new IllegalArgumentException("Negative delay: "+delay); if (period<0) throw new IllegalArgumentException("Negative period: "+period); long now=System.currentTimeMillis(); SimpleTimerTask ttask=new SimpleTimerTask(task, period, now+delay); synchronized(_queue) { Object discarded=_queue.insert(ttask); Assert.that(discarded==null, "heap didn't resize"); _queue.notify(); } }
5134 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5134/9ce7097fffa01edac129a4db6c54e1086fa7b5ee/SimpleTimer.java/buggy/components/gnutella-core/src/main/java/com/limegroup/gnutella/util/SimpleTimer.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 4788, 12, 6385, 10254, 1562, 16, 1525, 4624, 16, 1525, 3879, 13, 2398, 1216, 5477, 288, 3639, 309, 261, 67, 291, 21890, 13, 5411, 604, 394, 5477, 2932, 6777, 13927, 8863, 3639,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4788, 12, 6385, 10254, 1562, 16, 1525, 4624, 16, 1525, 3879, 13, 2398, 1216, 5477, 288, 3639, 309, 261, 67, 291, 21890, 13, 5411, 604, 394, 5477, 2932, 6777, 13927, 8863, 3639,...
stmt.setTimestamp(8, new Timestamp(resource.getDateLastModified()));
stmt.setLong(8, resource.getDateLastModified());
public void writeBackupResource(CmsUser currentUser, CmsProject publishProject, CmsResource resource, List properties, int tagId, long publishDate, int maxVersions) throws CmsException { Connection conn = null; PreparedStatement stmt = null; CmsUUID backupPkId = new CmsUUID(); byte[] content = null; int versionId; String lastModifiedName = ""; String createdName = ""; try { CmsUser lastModified = m_driverManager.getUserDriver().readUser(resource.getUserLastModified()); lastModifiedName = lastModified.getName(); CmsUser created = m_driverManager.getUserDriver().readUser(resource.getUserCreated()); createdName = created.getName(); } catch (CmsException e) { lastModifiedName = resource.getUserCreated().toString(); createdName = resource.getUserLastModified().toString(); } try { conn = m_sqlManager.getConnectionForBackup(); // now get the new version id for this resource versionId = internalReadNextVersionId(resource); if (resource.isFile()) { if (!this.internalValidateBackupResource(resource, tagId)) { // write the file content if (resource instanceof CmsFile) { content = ((CmsFile)resource).getContents(); } internalWriteBackupFileContent(backupPkId, resource/* .getFileId() */, content, tagId, versionId); // write the resource stmt = m_sqlManager.getPreparedStatement(conn, "C_RESOURCES_WRITE_BACKUP"); stmt.setString(1, resource.getResourceId().toString()); stmt.setInt(2, resource.getType()); stmt.setInt(3, resource.getFlags()); stmt.setString(4, resource.getFileId().toString()); stmt.setInt(5, resource.getLoaderId()); stmt.setTimestamp(6, new Timestamp(publishDate)); stmt.setString(7, resource.getUserCreated().toString()); stmt.setTimestamp(8, new Timestamp(resource.getDateLastModified())); stmt.setString(9, resource.getUserLastModified().toString()); stmt.setInt(10, resource.getState()); stmt.setInt(11, resource.getLength()); stmt.setString(12, CmsUUID.getNullUUID().toString()); stmt.setInt(13, publishProject.getId()); stmt.setInt(14, 1); stmt.setInt(15, tagId); stmt.setInt(16, versionId); stmt.setString(17, backupPkId.toString()); stmt.setString(18, createdName); stmt.setString(19, lastModifiedName); stmt.executeUpdate(); m_sqlManager.closeAll(null, stmt, null); } } // write the structure stmt = m_sqlManager.getPreparedStatement(conn, "C_STRUCTURE_WRITE_BACKUP"); stmt.setString(1, resource.getStructureId().toString()); stmt.setString(2, resource.getParentStructureId().toString()); stmt.setString(3, resource.getResourceId().toString()); stmt.setString(4, resource.getName()); stmt.setInt(5, resource.getState()); stmt.setLong(6, resource.getDateReleased()); stmt.setLong(7, resource.getDateExpired()); stmt.setInt(8, tagId); stmt.setInt(9, versionId); stmt.setString(10, backupPkId.toString()); stmt.executeUpdate(); writeBackupProperties(publishProject, resource, properties, backupPkId, tagId, versionId); // now check if there are old backup versions to delete List existingBackups = readBackupFileHeaders(resource.getResourceId()); if (existingBackups.size() > maxVersions) { // delete redundant backups deleteBackups(existingBackups, maxVersions); } } catch (SQLException e) { throw m_sqlManager.getCmsException(this, null, CmsException.C_SQL_ERROR, e, false); } catch (Exception e) { throw m_sqlManager.getCmsException(this, null, CmsException.C_UNKNOWN_EXCEPTION, e, false); } finally { m_sqlManager.closeAll(conn, stmt, null); } content = null; // TODO: use this in later versions //return this.readBackupFileHeader(tagId, resource.getResourceId()); }
51784 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51784/67112c2256d26547aaed50fa52a9cf448dd26527/CmsBackupDriver.java/clean/src/org/opencms/db/generic/CmsBackupDriver.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1045, 6248, 1420, 12, 4747, 1299, 13970, 16, 2149, 4109, 3808, 4109, 16, 7630, 1058, 16, 987, 1790, 16, 509, 29238, 16, 1525, 3808, 1626, 16, 509, 943, 5940, 13, 1216, 11228, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1045, 6248, 1420, 12, 4747, 1299, 13970, 16, 2149, 4109, 3808, 4109, 16, 7630, 1058, 16, 987, 1790, 16, 509, 29238, 16, 1525, 3808, 1626, 16, 509, 943, 5940, 13, 1216, 11228, ...
if (logger.isInfoEnabled()) { logger.info("memberAdded: name=" + name);
if (logger.isDebugEnabled()) { logger.debug("memberAdded: name=" + name);
public void memberAdded(String name) { //robustness manager should publish deconfliction objects for every agent member. if (isSentinel()) { if (logger.isInfoEnabled()) { logger.info("memberAdded: name=" + name); } if (isCoordinatorEnabled()) { coordinatorHelper.addAgent(name); } if (isNode(name)) { if (logger.isInfoEnabled()) { logger.info("New node detected: node=" + name); } if (deadNodes.contains(name)) { deadNodes.remove(name); } } } if (didRestart && getState(name) == -1 && !suppressPingsOnRestart) { newState(name, HEALTH_CHECK); } }
11869 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/11869/d429c0409620027c39ac34ed3a9e6510f4d18831/DefaultRobustnessController.java/clean/mgmt_agent/src/org/cougaar/tools/robustness/ma/controllers/DefaultRobustnessController.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 918, 3140, 8602, 12, 780, 508, 13, 288, 565, 368, 303, 70, 641, 4496, 3301, 1410, 3808, 443, 3923, 549, 349, 2184, 364, 3614, 4040, 3140, 18, 565, 309, 261, 291, 7828, 12927, 1075...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3140, 8602, 12, 780, 508, 13, 288, 565, 368, 303, 70, 641, 4496, 3301, 1410, 3808, 443, 3923, 549, 349, 2184, 364, 3614, 4040, 3140, 18, 565, 309, 261, 291, 7828, 12927, 1075...
loaderScript = replaceTag( loaderScript, "/*rockAndRoll*/", "false" );
replaceTag( scriptBuffer, "/*rockAndRoll*/", "false" );
private String handleSimulatorIndex( StringBuffer replyBuffer ) throws IOException { // This is the simple Javascript which can be added // arbitrarily to the end without having to modify // the underlying HTML. StringBuffer loaderBuffer = new StringBuffer(); BufferedReader reader = DataUtilities.getReader( "html/simulator/", "index.html.js" ); String line = null; while ( (line = reader.readLine()) != null ) { loaderBuffer.append( line ); loaderBuffer.append( LINE_BREAK ); } reader.close(); String loaderScript = loaderBuffer.toString(); int classIndex = -1; for ( int i = 0; i < KoLmafiaASH.CLASSES.length; ++i ) if ( KoLmafiaASH.CLASSES[i].equalsIgnoreCase( KoLCharacter.getClassType() ) ) classIndex = i; // Basic additions of player state info loaderScript = replaceTag( loaderScript, "/*classIndex*/", classIndex ); loaderScript = replaceTag( loaderScript, "/*baseMuscle*/", KoLCharacter.getBaseMuscle() ); loaderScript = replaceTag( loaderScript, "/*baseMysticality*/", KoLCharacter.getBaseMysticality() ); loaderScript = replaceTag( loaderScript, "/*baseMoxie*/", KoLCharacter.getBaseMoxie() ); loaderScript = replaceTag( loaderScript, "/*mindControl*/", KoLCharacter.getMindControlLevel() ); // Change the player's familiar to the current // familiar. Input the weight and change the // familiar equipment. loaderScript = replaceTag( loaderScript, "/*familiar*/", KoLCharacter.getFamiliar().getRace() ); loaderScript = replaceTag( loaderScript, "/*familiarWeight*/", KoLCharacter.getFamiliar().getWeight() ); String familiarEquipment = KoLCharacter.getCurrentEquipmentName( KoLCharacter.FAMILIAR ); if ( FamiliarData.itemWeightModifier( TradeableItemDatabase.getItemID( familiarEquipment ) ) == 5 ) loaderScript = replaceTag( loaderScript, "/*familiarEquip*/", "familiar-specific +5 lbs." ); else loaderScript = replaceTag( loaderScript, "/*familiarEquip*/", familiarEquipment ); // Change the player's equipment loaderScript = replaceTag( loaderScript, "/*hat*/", KoLCharacter.getCurrentEquipmentName( KoLCharacter.HAT ) ); loaderScript = replaceTag( loaderScript, "/*weapon*/", KoLCharacter.getCurrentEquipmentName( KoLCharacter.WEAPON ) ); loaderScript = replaceTag( loaderScript, "/*offhand*/", KoLCharacter.getCurrentEquipmentName( KoLCharacter.OFFHAND ) ); loaderScript = replaceTag( loaderScript, "/*shirt*/", KoLCharacter.getCurrentEquipmentName( KoLCharacter.SHIRT ) ); loaderScript = replaceTag( loaderScript, "/*pants*/", KoLCharacter.getCurrentEquipmentName( KoLCharacter.PANTS ) ); // Change the player's accessories loaderScript = replaceTag( loaderScript, "/*accessory1*/", KoLCharacter.getCurrentEquipmentName( KoLCharacter.ACCESSORY1 ) ); loaderScript = replaceTag( loaderScript, "/*accessory2*/", KoLCharacter.getCurrentEquipmentName( KoLCharacter.ACCESSORY2 ) ); loaderScript = replaceTag( loaderScript, "/*accessory3*/", KoLCharacter.getCurrentEquipmentName( KoLCharacter.ACCESSORY3 ) ); // Load up the player's current skillset to figure // out what passive skills are available. UseSkillRequest [] skills = new UseSkillRequest[ KoLCharacter.getAvailableSkills().size() ]; KoLCharacter.getAvailableSkills().toArray( skills ); String passiveSkills = ""; for ( int i = 0; i < skills.length; ++i ) { int skillID = skills[i].getSkillID(); if ( !( ClassSkillsDatabase.getSkillType( skillID ) == ClassSkillsDatabase.PASSIVE && !(skillID < 10 || (skillID > 14 && skillID < 1000)) ) ) continue; passiveSkills += "\t"; if ( skillID < 1000 ) passiveSkills += "gnome"; else if ( skillID < 2000 ) passiveSkills += "scpassive"; else if ( skillID < 3000 ) passiveSkills += "ttpassive"; else if ( skillID < 4000 ) passiveSkills += "ppassive"; else if ( skillID < 5000 ) passiveSkills += "spassive"; else passiveSkills += "dbpassive"; passiveSkills += "." + skills[i].getSkillName().replaceAll( "[ -]", "" ).toLowerCase() + "\t"; } loaderScript = replaceTag( loaderScript, "/*passiveSkills*/", passiveSkills ); // Also load up the player's current active effects // and fill them into the buffs area. AdventureResult [] effects = new AdventureResult[ KoLCharacter.getEffects().size() ]; KoLCharacter.getEffects().toArray( effects ); String activeEffects = ""; for ( int i = 0; i < effects.length; ++i ) activeEffects += "\t" + UneffectRequest.effectToSkill( effects[i].getName() ).replaceAll( "[ -]", "" ).toLowerCase() + "\t"; loaderScript = replaceTag( loaderScript, "/*activeEffects*/", activeEffects ); if ( KoLCharacter.getInventory().contains( UseSkillRequest.ROCKNROLL_LEGEND ) ) loaderScript = replaceTag( loaderScript, "/*rockAndRoll*/", "true" ); else loaderScript = replaceTag( loaderScript, "/*rockAndRoll*/", "false" ); replyBuffer.insert( replyBuffer.indexOf( ";GoCalc()" ), ";loadKoLmafiaData()" ); replyBuffer.insert( replyBuffer.indexOf( "</html>" ), loaderScript.toString() ); return replyBuffer.toString(); }
50364 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50364/1e5aedab28b3c5837304265e2831a62ff8413e19/LocalRelayRequest.java/clean/src/net/sourceforge/kolmafia/LocalRelayRequest.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1152, 514, 1640, 7993, 11775, 1016, 12, 6674, 4332, 1892, 262, 1216, 1860, 202, 95, 202, 202, 759, 1220, 353, 326, 4143, 22326, 1492, 848, 506, 3096, 202, 202, 759, 10056, 86, 10243,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 514, 1640, 7993, 11775, 1016, 12, 6674, 4332, 1892, 262, 1216, 1860, 202, 95, 202, 202, 759, 1220, 353, 326, 4143, 22326, 1492, 848, 506, 3096, 202, 202, 759, 10056, 86, 10243,...
org.xhtmlrenderer.css.newmatch.CascadedStyle matched = _matcher.getCascadedStyle(elem);
org.xhtmlrenderer.css.newmatch.CascadedStyle matched = _matcher.matchElement(elem);
public void restyleTree( org.w3c.dom.Element elem ) { CalculatedStyle parent = null; // if this is the root, we will have no parent XRElement; otherwise // we will check to see if our parent was loaded. Since we expect to load // from root to leaves, we should always find a parent // this means, however, that root will have a null parent if ( elem.getOwnerDocument().getDocumentElement() == elem ) { _styleCache = new java.util.HashMap(); parent = new CurrentBoxStyle(_rect); } else { org.w3c.dom.Node pnode = elem.getParentNode(); if(pnode.getNodeType() == org.w3c.dom.Node.ELEMENT_NODE) parent = getCalculatedStyle( (org.w3c.dom.Element) pnode ); if ( parent == null ) { throw new RuntimeException( "Applying matches to elements, found an element with no mapped parent; can't continue." ); } } org.xhtmlrenderer.css.newmatch.CascadedStyle matched = _matcher.getCascadedStyle(elem); CalculatedStyle cs = null; StringBuffer sb = new StringBuffer(); sb.append(parent.hashCode()).append(":").append(matched.hashCode()); String fingerprint = sb.toString(); cs = (CalculatedStyle) _styleCache.get(fingerprint); if(cs == null) { cs = new CalculatedStyle(parent, matched); _styleCache.put(fingerprint, cs); } _styleMap.put( elem, cs ); //System.err.println(elem.getNodeName()+" "+cs); // apply rules from style attribute on element, if any // elementStyling is now responsibility of Matcher org.w3c.dom.NodeList nl = elem.getChildNodes(); for ( int i = 0, len = nl.getLength(); i < len; i++ ) { org.w3c.dom.Node n = nl.item( i ); if ( n.getNodeType() == org.w3c.dom.Node.ELEMENT_NODE ) { restyleTree( (org.w3c.dom.Element)n ); } } }
52947 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52947/8756fd35e9cd52c9d6dd01377122d574a0c48fc0/Styler.java/buggy/src/java/org/xhtmlrenderer/css/style/Styler.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 3127, 1362, 2471, 12, 2358, 18, 91, 23, 71, 18, 9859, 18, 1046, 3659, 262, 288, 5411, 15994, 690, 2885, 982, 273, 446, 31, 5411, 368, 309, 333, 353, 326, 1365, 16, 732, 903...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3127, 1362, 2471, 12, 2358, 18, 91, 23, 71, 18, 9859, 18, 1046, 3659, 262, 288, 5411, 15994, 690, 2885, 982, 273, 446, 31, 5411, 368, 309, 333, 353, 326, 1365, 16, 732, 903...
public org.quickfix.field.InstrRegistry getInstrRegistry() throws FieldNotFound { org.quickfix.field.InstrRegistry value = new org.quickfix.field.InstrRegistry();
public quickfix.field.InstrRegistry getInstrRegistry() throws FieldNotFound { quickfix.field.InstrRegistry value = new quickfix.field.InstrRegistry();
public org.quickfix.field.InstrRegistry getInstrRegistry() throws FieldNotFound { org.quickfix.field.InstrRegistry value = new org.quickfix.field.InstrRegistry(); getField(value); return value; }
8803 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8803/fecc27f98261270772ff182a1d4dfd94b5daa73d/ListStrikePrice.java/clean/src/java/src/quickfix/fix43/ListStrikePrice.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 2358, 18, 19525, 904, 18, 1518, 18, 382, 701, 4243, 7854, 701, 4243, 1435, 1216, 2286, 2768, 225, 288, 2358, 18, 19525, 904, 18, 1518, 18, 382, 701, 4243, 460, 273, 394, 2358, 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, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 2358, 18, 19525, 904, 18, 1518, 18, 382, 701, 4243, 7854, 701, 4243, 1435, 1216, 2286, 2768, 225, 288, 2358, 18, 19525, 904, 18, 1518, 18, 382, 701, 4243, 460, 273, 394, 2358, 18,...
String sNodePath, ISubtaskSheet sheet )
String sNodePath, String sDisplayName, ISubtaskSheet sheet )
public DefaultRegisteredSubtaskEntryImpl( String sNodeIndex, String sNodePath, ISubtaskSheet sheet ) { try { this.sNodeIndex = Integer.valueOf( sNodeIndex ).toString( ); } catch ( NumberFormatException e ) { sNodeIndex = "100"; //$NON-NLS-1$ } this.sNodePath = sNodePath; this.sheetImpl = sheet; }
15160 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/15160/eef9946fb80818064375125db752512ee55f2f3f/DefaultRegisteredSubtaskEntryImpl.java/buggy/chart/org.eclipse.birt.chart.ui/src/org/eclipse/birt/chart/ui/swt/wizard/DefaultRegisteredSubtaskEntryImpl.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 2989, 10868, 1676, 4146, 1622, 2828, 12, 514, 272, 907, 1016, 16, 1082, 202, 780, 272, 907, 743, 16, 467, 1676, 4146, 8229, 6202, 262, 202, 95, 202, 202, 698, 202, 202, 95, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2989, 10868, 1676, 4146, 1622, 2828, 12, 514, 272, 907, 1016, 16, 1082, 202, 780, 272, 907, 743, 16, 467, 1676, 4146, 8229, 6202, 262, 202, 95, 202, 202, 698, 202, 202, 95, ...
protected Expression binaryExpression(int type, AST node) { Token token = makeToken(type, node); AST leftNode = node.getFirstChild(); Expression leftExpression = expression(leftNode); AST rightNode = leftNode.getNextSibling(); if (rightNode == null) { return leftExpression; } if (Types.ofType(type, Types.ASSIGNMENT_OPERATOR)) { if (leftExpression instanceof VariableExpression || leftExpression instanceof PropertyExpression || leftExpression instanceof FieldExpression || leftExpression instanceof DeclarationExpression) { // Do nothing. } else if (leftExpression instanceof ConstantExpression) { throw new ASTRuntimeException(node, "\n[" + ((ConstantExpression) leftExpression).getValue() + "] is a constant expression, but it should be a variable expression"); } else if (leftExpression instanceof BinaryExpression) { Expression leftexp = ((BinaryExpression) leftExpression).getLeftExpression(); int lefttype = ((BinaryExpression) leftExpression).getOperation().getType(); if (!Types.ofType(lefttype, Types.ASSIGNMENT_OPERATOR) && lefttype != Types.LEFT_SQUARE_BRACKET) { throw new ASTRuntimeException(node, "\n" + ((BinaryExpression) leftExpression).getText() + " is a binary expression, but it should be a variable expression"); } } else if (leftExpression instanceof GStringExpression) { throw new ASTRuntimeException(node, "\n\"" + ((GStringExpression) leftExpression).getText() + "\" is a GString expression, but it should be a variable expression"); } else if (leftExpression instanceof MethodCallExpression) { throw new ASTRuntimeException(node, "\n\"" + ((MethodCallExpression) leftExpression).getText() + "\" is a method call expression, but it should be a variable expression"); } else if (leftExpression instanceof MapExpression) { throw new ASTRuntimeException(node, "\n'" + ((MapExpression) leftExpression).getText() + "' is a map expression, but it should be a variable expression"); } else { throw new ASTRuntimeException(node, "\n" + leftExpression.getClass() + ", with its value '" + leftExpression.getText() + "', is a bad expression as the LSH of an assignment operator"); } } /*if (rightNode == null) { throw new NullPointerException("No rightNode associated with binary expression"); }*/ Expression rightExpression = expression(rightNode); BinaryExpression binaryExpression = new BinaryExpression(leftExpression, token, rightExpression); configureAST(binaryExpression, node); return binaryExpression; }
6462 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6462/e7321c087b7c0c500269e757fe8873ccef4be01f/AntlrParserPlugin.java/clean/src/main/org/codehaus/groovy/antlr/AntlrParserPlugin.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 4750, 2300, 8578, 2300, 12, 474, 723, 16, 9053, 2159, 15329, 20477, 319, 969, 33, 6540, 1345, 12, 723, 16, 2159, 1769, 9053, 4482, 907, 33, 2159, 18, 588, 3759, 1763, 5621, 2300, 4482, 2300, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4750, 2300, 8578, 2300, 12, 474, 723, 16, 9053, 2159, 15329, 20477, 319, 969, 33, 6540, 1345, 12, 723, 16, 2159, 1769, 9053, 4482, 907, 33, 2159, 18, 588, 3759, 1763, 5621, 2300, 4482, 2300, ...
for (int i = 0;i < exporters.length;i++)
for (int i = 0; i < exporters.length; i++)
public IModule[] getAvailableExporters(R4Import pkg, boolean includeRemovalPending) { // Synchronized on the module manager to make sure that no // modules are added, removed, or resolved. synchronized (m_factory) { IModule[] exporters = getCompatibleExporters( (IModule[]) m_availPkgMap.get(pkg.getName()), pkg, includeRemovalPending); if ((exporters != null) && (System.getSecurityManager() != null)) { PackagePermission perm = new PackagePermission(pkg.getName(), PackagePermission.EXPORT); for (int i = 0;i < exporters.length;i++) { if (exporters[i] != null) { if (!((ProtectionDomain) exporters[i].getSecurityContext()).implies(perm)) { m_logger.log(Logger.LOG_DEBUG, "PackagePermission.EXPORT denied for " + pkg + "from " + exporters[i].getId()); exporters[i] = null; } } } exporters = shrinkModuleArray(exporters); } return exporters; } }
45948 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45948/5ebdb81cd2d6401c31d28ff6425bd9fd11e07775/R4SearchPolicyCore.java/clean/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 467, 3120, 8526, 15796, 22305, 87, 12, 54, 24, 5010, 3475, 16, 1250, 2341, 24543, 8579, 13, 565, 288, 3639, 368, 348, 15666, 603, 326, 1605, 3301, 358, 1221, 3071, 716, 1158, 3639, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 467, 3120, 8526, 15796, 22305, 87, 12, 54, 24, 5010, 3475, 16, 1250, 2341, 24543, 8579, 13, 565, 288, 3639, 368, 348, 15666, 603, 326, 1605, 3301, 358, 1221, 3071, 716, 1158, 3639, ...
statement.setString(3, user.getStatus()); statement.setString(4, serialize(user.getRoles()));
statement.setString(4, user.getStatus()); statement.setString(5, serialize(user.getRoles())); statement.setString(6, user.getLogin());
private void storageStore(User user) { PreparedStatement statement = null; Connection connection = ConnectionManager.getConnection(); try { statement = connection.prepareStatement("UPDATE User SET login=?, passwd=?, email=?, status=?, roles=?"); statement.setString(1, user.getLogin()); statement.setString(2, user.getPasswd()); statement.setString(3, user.getEmail()); statement.setString(3, user.getStatus()); statement.setString(4, serialize(user.getRoles())); statement.execute(); } catch (SQLException e) { e.printStackTrace(); } finally { ConnectionManager.close(statement); ConnectionManager.close(connection); } return; }
6853 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6853/0e1bfd0c159f8d204c0ecfe9b1641f2d6f09b7d4/UserManager.java/clean/src/org/snipsnap/user/UserManager.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 3238, 918, 2502, 2257, 12, 1299, 729, 13, 288, 565, 16913, 3021, 273, 446, 31, 565, 4050, 1459, 273, 4050, 1318, 18, 588, 1952, 5621, 565, 775, 288, 1377, 3021, 273, 1459, 18, 9366, 340...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 918, 2502, 2257, 12, 1299, 729, 13, 288, 565, 16913, 3021, 273, 446, 31, 565, 4050, 1459, 273, 4050, 1318, 18, 588, 1952, 5621, 565, 775, 288, 1377, 3021, 273, 1459, 18, 9366, 340...
if(peers[i].isConnected())
if(peers[i].isConnected()) try {
public void localBroadcast(Message msg) { PeerNode[] peers = connectedPeers; // avoid synchronization for(int i=0;i<peers.length;i++) { if(peers[i].isConnected()) peers[i].sendAsync(msg); } }
52909 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52909/db3bc8d8624526da4116ed2c6e8583678d958aa9/PeerManager.java/buggy/src/freenet/node/PeerManager.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1191, 15926, 12, 1079, 1234, 13, 288, 3639, 10669, 907, 8526, 10082, 273, 5840, 14858, 31, 368, 4543, 24488, 3639, 364, 12, 474, 277, 33, 20, 31, 77, 32, 30502, 18, 2469, 31,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1191, 15926, 12, 1079, 1234, 13, 288, 3639, 10669, 907, 8526, 10082, 273, 5840, 14858, 31, 368, 4543, 24488, 3639, 364, 12, 474, 277, 33, 20, 31, 77, 32, 30502, 18, 2469, 31,...
if(logMINOR) Logger.minor(this, "Already freed block "+offset+" ("+reason+")");
if(logMINOR) Logger.minor(this, "Already freed block "+offset+" ("+reason+ ')');
private void addFreeBlock(long offset, boolean loud, String reason) { if(freeBlocks.push(offset)) { if(loud) { System.err.println("Freed block "+offset+" ("+reason+")"); Logger.normal(this, "Freed block "+offset+" ("+reason+")"); } else { if(logMINOR) Logger.minor(this, "Freed block "+offset+" ("+reason+")"); } } else { if(logMINOR) Logger.minor(this, "Already freed block "+offset+" ("+reason+")"); } }
51834 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51834/62fd59041864b4ed1f43adc676de6bfb5ea977f3/BerkeleyDBFreenetStore.java/clean/src/freenet/store/BerkeleyDBFreenetStore.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1152, 918, 527, 9194, 1768, 12, 5748, 1384, 16, 1250, 437, 1100, 16, 514, 3971, 13, 288, 565, 202, 202, 430, 12, 9156, 6450, 18, 6206, 12, 3348, 3719, 288, 565, 1082, 202, 430, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9194, 1768, 12, 5748, 1384, 16, 1250, 437, 1100, 16, 514, 3971, 13, 288, 565, 202, 202, 430, 12, 9156, 6450, 18, 6206, 12, 3348, 3719, 288, 565, 1082, 202, 430, 1...
return null;
return this;
public AccessibleValue getAccessibleValue() throws NotImplementedException { return null; // TODO }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8a78b0a127a68dcc6823fee2b8bdb1cbb7ec268d/AbstractButton.java/buggy/core/src/classpath/javax/javax/swing/AbstractButton.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 5016, 1523, 620, 336, 10451, 620, 1435, 1377, 1216, 10051, 503, 565, 288, 1377, 327, 333, 31, 368, 2660, 565, 289, 2, 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, 377, 1071, 5016, 1523, 620, 336, 10451, 620, 1435, 1377, 1216, 10051, 503, 565, 288, 1377, 327, 333, 31, 368, 2660, 565, 289, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
break;
break;
private void postProcessListeners( Resource resource, File source, int requestType ) throws TransferFailedException { byte[] buffer = new byte[ DEFAULT_BUFFER_SIZE ]; TransferEvent transferEvent = new TransferEvent( this, resource , TransferEvent.TRANSFER_PROGRESS, requestType ); try { InputStream input = new FileInputStream( source ); while ( true ) { int n = input.read( buffer ) ; if ( n == -1 ) { break; } fireTransferProgress( transferEvent, buffer, n ); } } catch ( IOException e ) { throw new TransferFailedException( "Failed to post-process the source file", e ); } }
51920 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51920/adac94612140da14b889061c18fedb69a0796bbf/ScpExternalWagon.java/buggy/wagon-providers/wagon-ssh-external/src/main/java/org/apache/maven/wagon/providers/sshext/ScpExternalWagon.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 918, 1603, 2227, 5583, 12, 2591, 1058, 16, 1387, 1084, 16, 509, 27179, 262, 3639, 1216, 12279, 12417, 565, 288, 3639, 1160, 8526, 1613, 273, 394, 1160, 63, 3331, 67, 11302, 67, 4574...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1603, 2227, 5583, 12, 2591, 1058, 16, 1387, 1084, 16, 509, 27179, 262, 3639, 1216, 12279, 12417, 565, 288, 3639, 1160, 8526, 1613, 273, 394, 1160, 63, 3331, 67, 11302, 67, 4574...
JobInfo info = getJobInfo(job); info.setBlockedStatus(null); refreshJobInfo(info); if (listener != null) {
JobInfo info = getJobInfo(job); info.setBlockedStatus(null); refreshJobInfo(info); if (listener != null) {
public void clearBlocked() { JobInfo info = getJobInfo(job); info.setBlockedStatus(null); refreshJobInfo(info); if (listener != null) { listener.clearBlocked(); } }
56152 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56152/9f68fc05c49b144eebae1957b15f8f3671c54cac/ProgressManager.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 540, 1071, 918, 2424, 23722, 1435, 288, 5411, 3956, 966, 1123, 273, 13024, 966, 12, 4688, 1769, 5411, 1123, 18, 542, 23722, 1482, 12, 2011, 1769, 5411, 4460, 2278, 966, 12, 1376, 1769, 5411, 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, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 540, 1071, 918, 2424, 23722, 1435, 288, 5411, 3956, 966, 1123, 273, 13024, 966, 12, 4688, 1769, 5411, 1123, 18, 542, 23722, 1482, 12, 2011, 1769, 5411, 4460, 2278, 966, 12, 1376, 1769, 5411, 3...
byte[] bytes = streamToByteArray(valueAndData, true);
byte[] bytes = streamToByteArray(valueAndData);
public ISVNProperty propertyGet(File path, String propertyName) throws SVNClientException { try { InputStream valueAndData = _cmd.propget(toString(path), propertyName); byte[] bytes = streamToByteArray(valueAndData, true); if (bytes.length == 0) { return null; // the property does not exist } String value = new String(bytes).trim(); return new CmdLineProperty(propertyName, value, path, bytes); } catch (CmdLineException e) { throw SVNClientException.wrapException(e); } catch (IOException e) { throw SVNClientException.wrapException(e); } }
6016 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6016/018df8c10bdb8f1bb9018622a01d8d66d38423e5/CmdLineClientAdapter.java/clean/svnClientAdapter/src/main/org/tigris/subversion/svnclientadapter/commandline/CmdLineClientAdapter.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 4437, 58, 50, 1396, 1272, 967, 12, 812, 589, 16, 514, 5470, 13, 1216, 29537, 50, 3781, 288, 202, 202, 698, 288, 1082, 202, 4348, 460, 1876, 751, 273, 389, 4172, 18, 5986, 58...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4437, 58, 50, 1396, 1272, 967, 12, 812, 589, 16, 514, 5470, 13, 1216, 29537, 50, 3781, 288, 202, 202, 698, 288, 1082, 202, 4348, 460, 1876, 751, 273, 389, 4172, 18, 5986, 58...
dlConfig = (DigilibConfiguration) context.getAttribute( "digilib.servlet.configuration");
dlConfig = (DigilibConfiguration) context .getAttribute("digilib.servlet.configuration");
public void setConfig(ServletConfig conf) throws ServletException { logger.debug("setConfig"); // get our ServletContext ServletContext context = conf.getServletContext(); // see if there is a Configuration instance dlConfig = (DigilibConfiguration) context.getAttribute( "digilib.servlet.configuration"); if (dlConfig == null) { // create new Configuration try { dlConfig = new DigilibConfiguration(conf); context.setAttribute("digilib.servlet.configuration", dlConfig); } catch (Exception e) { throw new ServletException(e); } } // get cache dirCache = (DocuDirCache) dlConfig.getValue("servlet.dir.cache"); /* * authentication */ useAuthentication = dlConfig.getAsBoolean("use-authorization"); authOp = (AuthOps) dlConfig.getValue("servlet.auth.op"); authURLPath = dlConfig.getAsString("auth-url-path"); if (useAuthentication && (authOp == null)) { throw new ServletException("ERROR: use-authorization configured but no AuthOp!"); } }
53488 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53488/92fdcdce856c663709334a34a746cf11cab2e5c7/DocumentBean.java/clean/servlet/src/digilib/servlet/DocumentBean.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 15517, 12, 4745, 809, 2195, 13, 1216, 16517, 288, 202, 202, 4901, 18, 4148, 2932, 542, 809, 8863, 202, 202, 759, 336, 3134, 22717, 202, 202, 4745, 1042, 819, 273, 2195, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 15517, 12, 4745, 809, 2195, 13, 1216, 16517, 288, 202, 202, 4901, 18, 4148, 2932, 542, 809, 8863, 202, 202, 759, 336, 3134, 22717, 202, 202, 4745, 1042, 819, 273, 2195, 1...
/* * Deviate from ECMA to imitate Perl, which omits a final * split unless a limit argument is given and big enough. */
/* * Deviate from ECMA to imitate Perl, which omits a final * split unless a limit argument is given and big enough. */
public static Object jsFunction_split(Context cx, Scriptable thisObj, Object[] args, Function funObj) { String target = ScriptRuntime.toString(thisObj); // create an empty Array to return; Scriptable scope = getTopLevelScope(funObj); Scriptable result = ScriptRuntime.newObject(cx, scope, "Array", null); // return an array consisting of the target if no separator given // don't check against undefined, because we want // 'fooundefinedbar'.split(void 0) to split to ['foo', 'bar'] if (args.length < 1) { result.put(0, result, target); return result; } // Use the second argument as the split limit, if given. boolean limited = (args.length > 1) && (args[1] != Undefined.instance); long limit = 0; // Initialize to avoid warning. if (limited) { /* Clamp limit between 0 and 1 + string length. */ limit = ScriptRuntime.toUint32(args[1]); if (limit > target.length()) limit = 1 + target.length(); } String separator = null; int[] matchlen = { 0 }; Object re = null; RegExpProxy reProxy = cx.getRegExpProxy(); if (reProxy != null && reProxy.isRegExp(args[0])) { re = args[0]; } else { separator = ScriptRuntime.toString(args[0]); matchlen[0] = separator.length(); } // split target with separator or re int[] ip = { 0 }; int match; int len = 0; boolean[] matched = { false }; String[][] parens = { null }; while ((match = find_split(funObj, target, separator, re, ip, matchlen, matched, parens)) >= 0) { if ((limited && len >= limit) || (match > target.length())) break; String substr; if (target.length() == 0) substr = target; else substr = target.substring(ip[0], match); result.put(len, result, substr); len++; /* * Imitate perl's feature of including parenthesized substrings * that matched part of the delimiter in the new array, after the * split substring that was delimited. */ if (re != null && matched[0] == true) { int size = parens[0].length; for (int num = 0; num < size; num++) { if (limited && len >= limit) break; result.put(len, result, parens[0][num]); len++; } matched[0] = false; } ip[0] = match + matchlen[0]; if (cx.getLanguageVersion() < Context.VERSION_1_3 && cx.getLanguageVersion() != Context.VERSION_DEFAULT) { /* * Deviate from ECMA to imitate Perl, which omits a final * split unless a limit argument is given and big enough. */ if (!limited && ip[0] == target.length()) break; } } return result; }
47345 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47345/b631b3e8574543a4d24a0048cc710f305deb8ff5/NativeString.java/buggy/org/mozilla/javascript/NativeString.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 760, 1033, 3828, 2083, 67, 4939, 12, 1042, 9494, 16, 22780, 15261, 16, 4766, 1850, 1033, 8526, 833, 16, 4284, 9831, 2675, 13, 565, 288, 3639, 514, 1018, 273, 7739, 5576, 18, 10492, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1033, 3828, 2083, 67, 4939, 12, 1042, 9494, 16, 22780, 15261, 16, 4766, 1850, 1033, 8526, 833, 16, 4284, 9831, 2675, 13, 565, 288, 3639, 514, 1018, 273, 7739, 5576, 18, 10492, ...
public void restartButtonActionPerformed() {
private void restartButtonActionPerformed() {
public void restartButtonActionPerformed() { windowManager.getManager().getBattleManager().restart(); }
50663 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50663/ef287448b241a2131ea8102c0a9532d262ba2b6a/RobocodeFrame.java/buggy/robocode/robocode/dialog/RobocodeFrame.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 7870, 3616, 19449, 1435, 288, 202, 202, 5668, 1318, 18, 588, 1318, 7675, 588, 38, 4558, 298, 1318, 7675, 19164, 5621, 225, 202, 97, 2, 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, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 7870, 3616, 19449, 1435, 288, 202, 202, 5668, 1318, 18, 588, 1318, 7675, 588, 38, 4558, 298, 1318, 7675, 19164, 5621, 225, 202, 97, 2, -100, -100, -100, -100, -100, -100, ...
previewTextBox.setText( "" );
previewTextBox.setText( defaultDateTime );
private void createCustomPreviewPart( Composite parent ) { Group group = new Group( parent, SWT.NONE ); group.setText( LABEL_PREVIEW_GROUP ); //$NON-NLS-1$ if ( pageAlignment == PAGE_ALIGN_HORIZONTAL ) { group.setLayoutData( new GridData( GridData.FILL_BOTH ) ); group.setLayout( new GridLayout( 1, false ) ); } else { group.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); group.setLayout( new GridLayout( 2, false ) ); } new Label( group, SWT.NONE ).setText( LABEL_PREVIEW_DATETIME ); //$NON-NLS-1$ previewTextBox = new Text( group, SWT.SINGLE | SWT.BORDER ); previewTextBox.setText( "" ); //$NON-NLS-1$ GridData data = new GridData( GridData.FILL_HORIZONTAL ); if ( pageAlignment == PAGE_ALIGN_HORIZONTAL ) { data.horizontalIndent = 10; } previewTextBox.setLayoutData( data ); previewTextBox.addModifyListener( new ModifyListener( ) { public void modifyText( ModifyEvent e ) { setDefaultPreviewText( previewTextBox.getText( ) ); if ( hasLoaded ) { updatePreview( ); } if ( StringUtil.isBlank( previewTextBox.getText( ) ) ) { guideLabel.setText( "" ); //$NON-NLS-1$ } else { guideLabel.setText( ENTER_DATE_TIME_GUIDE_TEXT ); } } } ); if ( pageAlignment == PAGE_ALIGN_VIRTICAL ) { new Label( group, SWT.NONE ); } guideLabel = new Label( group, SWT.NONE ); guideLabel.setText( "" ); //$NON-NLS-1$ Font font = JFaceResources.getDialogFont( ); FontData fData = font.getFontData( )[0]; fData.setHeight( fData.getHeight( ) - 1 ); guideLabel.setFont( new Font( Display.getCurrent( ), fData ) ); data = new GridData( GridData.FILL_HORIZONTAL ); data.horizontalIndent = 10; guideLabel.setLayoutData( data ); Label label = new Label( group, SWT.NONE ); label.setText( LABEL_PREVIEW_LABEL ); //$NON-NLS-1$ label.setLayoutData( new GridData( ) ); cusPreviewLabel = new Label( group, SWT.CENTER | SWT.HORIZONTAL | SWT.VIRTUAL ); cusPreviewLabel.setText( "" ); //$NON-NLS-1$ data = new GridData( GridData.FILL_BOTH ); data.horizontalSpan = 1; cusPreviewLabel.setLayoutData( data ); }
15160 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/15160/0ad7b33e8711645b0c24fbc44cb60949bea41294/FormatDateTimePage.java/buggy/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/FormatDateTimePage.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1152, 918, 752, 3802, 11124, 1988, 12, 14728, 982, 262, 202, 95, 202, 202, 1114, 1041, 273, 394, 3756, 12, 982, 16, 348, 8588, 18, 9826, 11272, 202, 202, 1655, 18, 542, 1528, 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, 1152, 918, 752, 3802, 11124, 1988, 12, 14728, 982, 262, 202, 95, 202, 202, 1114, 1041, 273, 394, 3756, 12, 982, 16, 348, 8588, 18, 9826, 11272, 202, 202, 1655, 18, 542, 1528, 12, ...
Map env = createEnvVarMap();
Map env = createEnvVarMap(false);
private Map<String,SvnInfo> buildRevisionMap(FilePath workspace, TaskListener listener) throws IOException { PrintStream logger = listener.getLogger(); Map<String/*module name*/,SvnInfo> revisions = new HashMap<String,SvnInfo>(); Map env = createEnvVarMap(); // invoke the "svn info" for( String module : getModuleDirNames() ) { // parse the output SvnInfo info = SvnInfo.parse(module,env,workspace,listener); revisions.put(module,info); logger.println("Revision:"+info.revision); } return revisions; }
56266 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56266/68575dd13ca048ccab5d89c0cc258e8dde886aa6/SubversionSCM.java/buggy/hudson/src/hudson/scm/SubversionSCM.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 1635, 32, 780, 16, 55, 25031, 966, 34, 1361, 7939, 863, 12, 5598, 6003, 16, 3837, 2223, 2991, 13, 1216, 1860, 288, 3639, 21677, 1194, 273, 2991, 18, 588, 3328, 5621, 3639, 1635, 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, 377, 3238, 1635, 32, 780, 16, 55, 25031, 966, 34, 1361, 7939, 863, 12, 5598, 6003, 16, 3837, 2223, 2991, 13, 1216, 1860, 288, 3639, 21677, 1194, 273, 2991, 18, 588, 3328, 5621, 3639, 1635, 3...
public boolean storeCRL(Admin admin, Collection publisherids, byte[] incrl, String cafp, int number){ Iterator iter = publisherids.iterator(); boolean returnval = true; while(iter.hasNext()){ Integer id = (Integer) iter.next(); try{ PublisherDataLocal pdl = publisherhome.findByPrimaryKey(id); try{ returnval &= pdl.getPublisher().storeCRL(admin,incrl,cafp,number); getLogSession().log(admin, admin.getCAId(), LogEntry.MODULE_CA, new java.util.Date(), null, null, LogEntry.EVENT_INFO_STORECRL, "Publisher CLR successfully to publisher " + pdl.getName() +"."); }catch(PublisherException pe){ getLogSession().log(admin, admin.getCAId(), LogEntry.MODULE_CA, new java.util.Date(), null, null, LogEntry.EVENT_ERROR_STORECRL, "Error when publishing CRL to " + pdl.getName() + " : " + pe.getMessage());
public boolean storeCRL(Admin admin, Collection publisherids, byte[] incrl, String cafp, int number) { Iterator iter = publisherids.iterator(); boolean returnval = true; while (iter.hasNext()) { Integer id = (Integer) iter.next(); try { PublisherDataLocal pdl = publisherhome.findByPrimaryKey(id); try { returnval &= pdl.getPublisher().storeCRL(admin, incrl, cafp, number); getLogSession().log(admin, admin.getCAId(), LogEntry.MODULE_CA, new java.util.Date(), null, null, LogEntry.EVENT_INFO_STORECRL, "Publisher CLR successfully to publisher " + pdl.getName() + "."); } catch (PublisherException pe) { getLogSession().log(admin, admin.getCAId(), LogEntry.MODULE_CA, new java.util.Date(), null, null, LogEntry.EVENT_ERROR_STORECRL, "Error when publishing CRL to " + pdl.getName() + " : " + pe.getMessage());
public boolean storeCRL(Admin admin, Collection publisherids, byte[] incrl, String cafp, int number){ Iterator iter = publisherids.iterator(); boolean returnval = true; while(iter.hasNext()){ Integer id = (Integer) iter.next(); try{ PublisherDataLocal pdl = publisherhome.findByPrimaryKey(id); try{ returnval &= pdl.getPublisher().storeCRL(admin,incrl,cafp,number); getLogSession().log(admin, admin.getCAId(), LogEntry.MODULE_CA, new java.util.Date(), null, null, LogEntry.EVENT_INFO_STORECRL, "Publisher CLR successfully to publisher " + pdl.getName() +"."); }catch(PublisherException pe){ getLogSession().log(admin, admin.getCAId(), LogEntry.MODULE_CA, new java.util.Date(), null, null, LogEntry.EVENT_ERROR_STORECRL, "Error when publishing CRL to " + pdl.getName() + " : " + pe.getMessage()); } }catch(FinderException fe){ getLogSession().log(admin, admin.getCAId(), LogEntry.MODULE_CA, new java.util.Date(), null, null, LogEntry.EVENT_ERROR_STORECRL, "Publisher with id " + id + " doesn't exist."); } } return returnval; }
4109 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4109/6ecbb69c2d6c05971a443e2ffb0e34da367ea460/LocalPublisherSessionBean.java/buggy/src/java/se/anatom/ejbca/ca/publisher/LocalPublisherSessionBean.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 1250, 1707, 29524, 12, 4446, 3981, 16, 2200, 12855, 2232, 16, 1160, 8526, 7290, 1321, 16, 514, 276, 1727, 84, 16, 509, 1300, 15329, 1377, 4498, 1400, 273, 12855, 2232, 18, 9838, 562...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1707, 29524, 12, 4446, 3981, 16, 2200, 12855, 2232, 16, 1160, 8526, 7290, 1321, 16, 514, 276, 1727, 84, 16, 509, 1300, 15329, 1377, 4498, 1400, 273, 12855, 2232, 18, 9838, 562...
public void handleGet(URI uri, ToadletContext ctx) throws ToadletContextClosedException, IOException, RedirectException { // We ensure that we have a FCP server running if(!fcp.enabled){ this.writeReply(ctx, 400, "text/plain", "FCP server is missing", "You need to enable the FCP server to access this page"); return; } StringBuffer buf = new StringBuffer(2048); // First, get the queued requests, and separate them into different types. LinkedList completedDownloadToDisk = new LinkedList(); LinkedList completedDownloadToTemp = new LinkedList(); LinkedList completedUpload = new LinkedList(); LinkedList completedDirUpload = new LinkedList(); LinkedList failedDownload = new LinkedList(); LinkedList failedUpload = new LinkedList(); LinkedList failedDirUpload = new LinkedList(); LinkedList uncompletedDownload = new LinkedList(); LinkedList uncompletedUpload = new LinkedList(); LinkedList uncompletedDirUpload = new LinkedList(); ClientRequest[] reqs = fcp.getGlobalRequests(); Logger.minor(this, "Request count: "+reqs.length); if(reqs.length < 1){ ctx.getPageMaker().makeHead(buf, "Global Queue"); buf.append("<div class=\"infobox infobox-information\">\n"); buf.append("<div class=\"infobox-header\">\n"); buf.append("Global queue is empty!\n"); buf.append("</div>\n"); buf.append("<div class=\"infobox-content\">\n"); buf.append("There is no task queued on the global queue at the moment.\n"); buf.append("</form>\n"); buf.append("</div>\n"); buf.append("</div>\n"); ctx.getPageMaker().makeTail(buf); writeReply(ctx, 200, "text/html", "OK", buf.toString()); return; } for(int i=0;i<reqs.length;i++) { ClientRequest req = reqs[i]; if(req instanceof ClientGet) { ClientGet cg = (ClientGet) req; if(cg.hasSucceeded()) { if(cg.isDirect()) completedDownloadToTemp.add(cg); else if(cg.isToDisk()) completedDownloadToDisk.add(cg); else // FIXME Logger.error(this, "Don't know what to do with "+cg); } else if(cg.hasFinished()) { failedDownload.add(cg); } else { uncompletedDownload.add(cg); } } else if(req instanceof ClientPut) { ClientPut cp = (ClientPut) req; if(cp.hasSucceeded()) { completedUpload.add(cp); } else if(cp.hasFinished()) { failedUpload.add(cp); } else { uncompletedUpload.add(cp); } } else if(req instanceof ClientPutDir) { ClientPutDir cp = (ClientPutDir) req; if(cp.hasSucceeded()) { completedDirUpload.add(cp); } else if(cp.hasFinished()) { failedDirUpload.add(cp); } else { uncompletedDirUpload.add(cp); } } } ctx.getPageMaker().makeHead(buf, "("+(uncompletedDirUpload.size()+uncompletedDownload.size()+uncompletedUpload.size())+ "/"+(failedDirUpload.size()+failedDownload.size()+failedUpload.size())+ "/"+(completedDirUpload.size()+completedDownloadToDisk.size()+completedDownloadToTemp.size()+completedUpload.size())+ ") Queued Requests"); node.alerts.toSummaryHtml(buf); writeBigHeading("Legend", buf, "legend"); buf.append("<table class=\"queue\">\n"); buf.append("<tr>"); for(int i=0; i<7; i++){ buf.append("<td class=\"priority"+i+"\">priority "+i+"</td>"); } buf.append("</tr>\n"); writeTableEnd(buf); if(reqs.length > 1) writeDeleteAll(buf); writeBigEnding(buf); if(!(completedDownloadToTemp.isEmpty() && completedDownloadToDisk.isEmpty() && completedUpload.isEmpty() && completedDirUpload.isEmpty())) { writeBigHeading("Completed requests (" + (completedDownloadToTemp.size() + completedDownloadToDisk.size() + completedUpload.size() + completedDirUpload.size()) + ")", buf, "completed_requests"); if(!completedDownloadToTemp.isEmpty()) { if (node.getToadletContainer().isAdvancedDarknetEnabled()) writeTableHead("Completed downloads to temporary space", new String[] { "", "Identifier", "Size", "MIME-Type", "Download", "Persistence", "Key" }, buf ); else writeTableHead("Completed downloads to temporary space", new String[] { "", "Size", "MIME-Type", "Download", "Persistence", "Key" }, buf ); for(Iterator i = completedDownloadToTemp.iterator();i.hasNext();) { ClientGet p = (ClientGet) i.next(); writeRowStart(buf,p); writeDeleteCell(p, buf); if (node.getToadletContainer().isAdvancedDarknetEnabled()) writeIdentifierCell(p, p.getURI(), buf); writeSizeCell(p.getDataSize(), buf); writeTypeCell(p.getMIMEType(), buf); writeDownloadCell(p, buf); writePersistenceCell(p, buf); writeKeyCell(p.getURI(), buf); writeRowEnd(buf); } writeTableEnd(buf); } if(!completedDownloadToDisk.isEmpty()) { if (node.getToadletContainer().isAdvancedDarknetEnabled()) writeTableHead("Completed downloads to disk", new String[] { "", "Identifier", "Filename", "Size", "MIME-Type", "Download", "Persistence", "Key" }, buf); else writeTableHead("Completed downloads to disk", new String[] { "", "Filename", "Size", "MIME-Type", "Download", "Persistence", "Key" }, buf); for(Iterator i=completedDownloadToDisk.iterator();i.hasNext();) { ClientGet p = (ClientGet) i.next(); writeRowStart(buf,p); writeDeleteCell(p, buf); if (node.getToadletContainer().isAdvancedDarknetEnabled()) writeIdentifierCell(p, p.getURI(), buf); writeFilenameCell(p.getDestFilename(), buf); writeSizeCell(p.getDataSize(), buf); writeTypeCell(p.getMIMEType(), buf); writeDownloadCell(p, buf); writePersistenceCell(p, buf); writeKeyCell(p.getURI(), buf); writeRowEnd(buf); } writeTableEnd(buf); } if(!completedUpload.isEmpty()) { if (node.getToadletContainer().isAdvancedDarknetEnabled()) writeTableHead("Completed uploads", new String[] { "", "Identifier", "Filename", "Size", "MIME-Type", "Persistence", "Key" }, buf); else writeTableHead("Completed uploads", new String[] { "", "Filename", "Size", "MIME-Type", "Persistence", "Key" }, buf); for(Iterator i=completedUpload.iterator();i.hasNext();) { ClientPut p = (ClientPut) i.next(); writeRowStart(buf,p); writeDeleteCell(p, buf); if (node.getToadletContainer().isAdvancedDarknetEnabled()) writeIdentifierCell(p, p.getFinalURI(), buf); if(p.isDirect()) writeDirectCell(buf); else writeFilenameCell(p.getOrigFilename(), buf); writeSizeCell(p.getDataSize(), buf); writeTypeCell(p.getMIMEType(), buf); writePersistenceCell(p, buf); writeKeyCell(p.getFinalURI(), buf); writeRowEnd(buf); } writeTableEnd(buf); } if(!completedDirUpload.isEmpty()) { // FIXME include filename?? if (node.getToadletContainer().isAdvancedDarknetEnabled()) writeTableHead("Completed directory uploads", new String[] { "", "Identifier", "Files", "Total Size", "Persistence", "Key" }, buf); else writeTableHead("Completed directory uploads", new String[] { "", "Files", "Total Size", "Persistence", "Key" }, buf); for(Iterator i=completedDirUpload.iterator();i.hasNext();) { ClientPutDir p = (ClientPutDir) i.next(); writeRowStart(buf,p); writeDeleteCell(p, buf); if (node.getToadletContainer().isAdvancedDarknetEnabled()) writeIdentifierCell(p, p.getFinalURI(), buf); writeNumberCell(p.getNumberOfFiles(), buf); writeSizeCell(p.getTotalDataSize(), buf); writePersistenceCell(p, buf); writeKeyCell(p.getFinalURI(), buf); writeRowEnd(buf); } writeTableEnd(buf); } writeBigEnding(buf); } if(!(failedDownload.isEmpty() && failedUpload.isEmpty() && failedDirUpload.isEmpty())) { writeBigHeading("Failed requests (" + (failedDownload.size() + failedUpload.size() + failedDirUpload.size()) + ")", buf, "failed_requests"); if(!failedDownload.isEmpty()) { if (node.getToadletContainer().isAdvancedDarknetEnabled()) writeTableHead("Failed downloads", new String[] { "", "Identifier", "Filename", "Size", "MIME-Type", "Progress", "Reason", "Persistence", "Key" }, buf); else writeTableHead("Failed downloads", new String[] { "", "Filename", "Size", "MIME-Type", "Progress", "Reason", "Persistence", "Key" }, buf); for(Iterator i=failedDownload.iterator();i.hasNext();) { ClientGet p = (ClientGet) i.next(); writeRowStart(buf,p); writeDeleteCell(p, buf); if (node.getToadletContainer().isAdvancedDarknetEnabled()) writeIdentifierCell(p, p.getURI(), buf); if(p.isDirect()) writeDirectCell(buf); else writeFilenameCell(p.getDestFilename(), buf); writeSizeCell(p.getDataSize(), buf); writeTypeCell(p.getMIMEType(), buf); writeProgressFractionCell(p, buf); writeFailureReasonCell(p, buf); writePersistenceCell(p, buf); writeKeyCell(p.getURI(), buf); writeRowEnd(buf); } writeTableEnd(buf); } if(!failedUpload.isEmpty()) { if (node.getToadletContainer().isAdvancedDarknetEnabled()) writeTableHead("Failed uploads", new String[] { "", "Identifier", "Filename", "Size", "MIME-Type", "Progress", "Reason", "Persistence", "Key" }, buf); else writeTableHead("Failed uploads", new String[] { "", "Filename", "Size", "MIME-Type", "Progress", "Reason", "Persistence", "Key" }, buf); for(Iterator i=failedUpload.iterator();i.hasNext();) { ClientPut p = (ClientPut) i.next(); writeRowStart(buf,p); writeDeleteCell(p, buf); if (node.getToadletContainer().isAdvancedDarknetEnabled()) writeIdentifierCell(p, p.getFinalURI(), buf); if(p.isDirect()) writeDirectCell(buf); else writeFilenameCell(p.getOrigFilename(), buf); writeSizeCell(p.getDataSize(), buf); writeTypeCell(p.getMIMEType(), buf); writeProgressFractionCell(p, buf); writeFailureReasonCell(p, buf); writePersistenceCell(p, buf); writeKeyCell(p.getFinalURI(), buf); writeRowEnd(buf); } writeTableEnd(buf); } if(!failedDirUpload.isEmpty()) { if (node.getToadletContainer().isAdvancedDarknetEnabled()) writeTableHead("Failed directory uploads", new String[] { "", "Identifier", "Files", "Total Size", "Progress", "Reason", "Persistence", "Key" }, buf); else writeTableHead("Failed directory uploads", new String[] { "", "Files", "Total Size", "Progress", "Reason", "Persistence", "Key" }, buf); for(Iterator i=failedDirUpload.iterator();i.hasNext();) { ClientPutDir p = (ClientPutDir) i.next(); writeRowStart(buf,p); writeDeleteCell(p, buf); if (node.getToadletContainer().isAdvancedDarknetEnabled()) writeIdentifierCell(p, p.getFinalURI(), buf); writeNumberCell(p.getNumberOfFiles(), buf); writeSizeCell(p.getTotalDataSize(), buf); writeProgressFractionCell(p, buf); writeFailureReasonCell(p, buf); writePersistenceCell(p, buf); writeKeyCell(p.getFinalURI(), buf); writeRowEnd(buf); } writeTableEnd(buf); } writeBigEnding(buf); } if(!(uncompletedDownload.isEmpty() && uncompletedUpload.isEmpty() && uncompletedDirUpload.isEmpty())) { writeBigHeading("Requests in progress (" + (uncompletedDownload.size() + uncompletedUpload.size() + uncompletedDirUpload.size()) + ")", buf, "requests_in_progress"); if(!uncompletedDownload.isEmpty()) { if (node.getToadletContainer().isAdvancedDarknetEnabled()) writeTableHead("Downloads in progress", new String[] { "", "Identifier", "Filename", "Priority", "Size", "MIME-Type", "Progress", "Persistence", "Key" }, buf); else writeTableHead("Downloads in progress", new String[] { "", "Filename", "Size", "MIME-Type", "Progress", "Persistence", "Key" }, buf); for(Iterator i = uncompletedDownload.iterator();i.hasNext();) { ClientGet p = (ClientGet) i.next(); writeRowStart(buf,p); writeDeleteCell(p, buf); if (node.getToadletContainer().isAdvancedDarknetEnabled()) writeIdentifierCell(p, p.getURI(), buf); if(p.isDirect()) writeDirectCell(buf); else writeFilenameCell(p.getDestFilename(), buf); if (node.getToadletContainer().isAdvancedDarknetEnabled()) { writePriorityCell(p.getIdentifier(), p.getPriority(), buf); } writeSizeCell(p.getDataSize(), buf); writeTypeCell(p.getMIMEType(), buf); writeProgressFractionCell(p, buf); writePersistenceCell(p, buf); writeKeyCell(p.getURI(), buf); writeRowEnd(buf); } writeTableEnd(buf); } if(!uncompletedUpload.isEmpty()) { if (node.getToadletContainer().isAdvancedDarknetEnabled()) writeTableHead("Uploads in progress", new String[] { "", "Identifier", "Filename", "Size", "MIME-Type", "Progress", "Persistence", "Key" }, buf); else writeTableHead("Uploads in progress", new String[] { "", "Filename", "Size", "MIME-Type", "Progress", "Persistence", "Key" }, buf); for(Iterator i = uncompletedUpload.iterator();i.hasNext();) { ClientPut p = (ClientPut) i.next(); writeRowStart(buf,p); writeDeleteCell(p, buf); if (node.getToadletContainer().isAdvancedDarknetEnabled()) writeIdentifierCell(p, p.getFinalURI(), buf); if(p.isDirect()) writeDirectCell(buf); else writeFilenameCell(p.getOrigFilename(), buf); writeSizeCell(p.getDataSize(), buf); writeTypeCell(p.getMIMEType(), buf); writeProgressFractionCell(p, buf); writePersistenceCell(p, buf); writeKeyCell(p.getFinalURI(), buf); writeRowEnd(buf); } writeTableEnd(buf); } if(!uncompletedDirUpload.isEmpty()) { if (node.getToadletContainer().isAdvancedDarknetEnabled()) writeTableHead("Directory uploads in progress", new String[] { "", "Identifier", "Files", "Total Size", "Progress", "Persistence", "Key" }, buf); else writeTableHead("Directory uploads in progress", new String[] { "", "Files", "Total Size", "Progress", "Persistence", "Key" }, buf); for(Iterator i=uncompletedDirUpload.iterator();i.hasNext();) { ClientPutDir p = (ClientPutDir) i.next(); writeRowStart(buf,p); writeDeleteCell(p, buf); if (node.getToadletContainer().isAdvancedDarknetEnabled()) writeIdentifierCell(p, p.getFinalURI(), buf); writeNumberCell(p.getNumberOfFiles(), buf); writeSizeCell(p.getTotalDataSize(), buf); writeProgressFractionCell(p, buf); writePersistenceCell(p, buf); writeKeyCell(p.getFinalURI(), buf); writeRowEnd(buf); } writeTableEnd(buf); } writeBigEnding(buf); } ctx.getPageMaker().makeTail(buf); this.writeReply(ctx, 200, "text/html", "OK", buf.toString()); }
50653 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50653/92c3a13373f91a0169847e3371caf8a5974382e1/QueueToadlet.java/clean/src/freenet/clients/http/QueueToadlet.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 1640, 967, 12, 3098, 2003, 16, 2974, 361, 1810, 1042, 1103, 13, 225, 202, 15069, 2974, 361, 1810, 1042, 7395, 503, 16, 1860, 16, 9942, 503, 288, 9506, 202, 759, 1660, 338...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1640, 967, 12, 3098, 2003, 16, 2974, 361, 1810, 1042, 1103, 13, 225, 202, 15069, 2974, 361, 1810, 1042, 7395, 503, 16, 1860, 16, 9942, 503, 288, 9506, 202, 759, 1660, 338...
MainFrame.getInstance().getDefaultToolTimer().restart();
public void mouseReleased(MouseEvent mouseEvent) { if (mouseEvent.getButton() == MouseEvent.BUTTON1 && bActive == true) { compSource.removeMouseMotionListener(this); if (MainFrame.getInstance().getSelection() != null) edit.addEdit(new AtomicChangeSelection(null)); MainFrame.getInstance().getUndoManager().addEdit(edit); MainFrame.getInstance().getJPatchScreen().update_all();// MainFrame.getInstance().getJPatchScreen().enablePopupMenu(true); bActive = false; MainFrame.getInstance().getDefaultToolTimer().restart(); } /* if (iState == ACTIVE && mouseEvent.getButton() == MouseEvent.BUTTON1) { compSource = (Component)mouseEvent.getSource(); Selection selection = MainFrame.getInstance().getSelection(); Class classPointSelection = PointSelection.getPointSelectionClass(); if (classPointSelection.isAssignableFrom(selection.getClass())) { ControlPoint[] acp = new ControlPoint[1]; acp[0] = cpHot; compoundEdit.addEdit(new MoveControlPointsEdit(MoveControlPointsEdit.TRANSLATE,acp)); } setIdleState(); } */ }
9769 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/9769/64edd26961fe98d9e4cab60098a0d6ef3d2aba67/AddBoneMouseAdapter.java/buggy/jpatch/src/jpatch/boundary/mouse/AddBoneMouseAdapter.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 7644, 26363, 12, 9186, 1133, 7644, 1133, 13, 288, 202, 202, 430, 261, 11697, 1133, 18, 588, 3616, 1435, 422, 17013, 1133, 18, 20068, 21, 597, 324, 3896, 422, 638, 13, 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, 7644, 26363, 12, 9186, 1133, 7644, 1133, 13, 288, 202, 202, 430, 261, 11697, 1133, 18, 588, 3616, 1435, 422, 17013, 1133, 18, 20068, 21, 597, 324, 3896, 422, 638, 13, 288...
newZipOutputStream(new File(path + (fileCount++)));
newZipOutputStream(new File(path));
public void write(String outputPath, byte[] bytes, XQSyncDocumentMetadata metadata) throws IOException { /* * This method uses size metrics to automatically manage multiple zip * archives, to avoid 32-bit limits in java.util.zip * * An exception-based mechanism would be tricky, here: we definitely * want the content and the meta entries to stay in the same zipfile. */ byte[] metaBytes = metadata.toXML().getBytes(); long total = bytes.length + metaBytes.length; synchronized (outputMutex) { if (outputStream == null) { // lazily construct a new zipfile outputstream newZipOutputStream(constructorFile); fileCount = 1; } // by checking outputBytes first, we should avoid infinite loops - // at the cost of fatal exceptions. if (currentFileBytes > 0 && currentFileBytes + total > Integer.MAX_VALUE) { logger.fine("package bytes would exceed 32-bit limit"); String path = constructorFile.getCanonicalPath(); fileCount++; if (path.endsWith(".zip")) { path = path.replaceFirst("(.+)\\.zip$", "$1." + fileCount + ".zip"); } else { path = path + "." + fileCount; } newZipOutputStream(new File(path + (fileCount++))); } ZipEntry entry = new ZipEntry(outputPath); outputStream.putNextEntry(entry); outputStream.write(bytes); outputStream.closeEntry(); String metadataPath = XQSyncDocument .getMetadataPath(outputPath); entry = new ZipEntry(metadataPath); outputStream.putNextEntry(entry); outputStream.write(metaBytes); outputStream.closeEntry(); currentFileBytes += total; } }
48825 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/48825/d2734cc2c24fb7284611e0245014ade68bfbbaf6/OutputPackage.java/buggy/src/java/com/marklogic/ps/xqsync/OutputPackage.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1045, 12, 780, 19566, 16, 1160, 8526, 1731, 16, 5411, 1139, 53, 4047, 2519, 2277, 1982, 13, 1216, 1860, 288, 3639, 1748, 540, 380, 1220, 707, 4692, 963, 4309, 358, 6635, 10680,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1045, 12, 780, 19566, 16, 1160, 8526, 1731, 16, 5411, 1139, 53, 4047, 2519, 2277, 1982, 13, 1216, 1860, 288, 3639, 1748, 540, 380, 1220, 707, 4692, 963, 4309, 358, 6635, 10680,...
return new TableSorter(new IField[0], new int[0], new int[0]);
return new TableComparator(new IField[0], new int[0], new int[0]);
public TableSorter getSorterFor(String type) { if (hierarchyOrders.containsKey(type)) { return (TableSorter) hierarchyOrders.get(type); } TableSorter sorter = findSorterInChildren(type, getRootType()); if (sorter == null) { return new TableSorter(new IField[0], new int[0], new int[0]); } return sorter; }
55805 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55805/b34bac03ab70048a4b238ebb6ad2383d1ae284b3/MarkerSupportRegistry.java/buggy/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/MarkerSupportRegistry.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 3555, 24952, 1322, 4975, 1290, 12, 780, 618, 13, 288, 202, 202, 430, 261, 17937, 16528, 18, 12298, 653, 12, 723, 3719, 288, 1082, 202, 2463, 261, 1388, 24952, 13, 9360, 16528, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3555, 24952, 1322, 4975, 1290, 12, 780, 618, 13, 288, 202, 202, 430, 261, 17937, 16528, 18, 12298, 653, 12, 723, 3719, 288, 1082, 202, 2463, 261, 1388, 24952, 13, 9360, 16528, ...
if ( formatStr != null && formatStr.length( ) != 0) { numberFormat = new NumberFormatter( formatStr, context.getLocale( ) ); style.setNumberFormatObject( numberFormat ); } } } else { numberFormat = new NumberFormatter( formatStr, context.getLocale( ) ); } if (numberFormat == null) { numberFormat = new NumberFormatter( context.getLocale( ) ); } formattedStr.append( numberFormat.format( ( (Number) value ) .doubleValue( ) ) );
NumberFormatter numberFormat = context.createNumberFormatter( formatStr ); formattedStr.append( numberFormat.format( ( ( Number ) value ).doubleValue( ) ) );
protected void formatValue( Object value, String formatStr, StyleDesign style, StringBuffer formattedStr,ReportElementContent reportContent ) { if ( value == null ) { return; } assert style != null && formattedStr != null; if ( ( value instanceof Number ) ) { NumberFormatter numberFormat = null; if ( formatStr == null || formatStr.length( ) == 0 ) { numberFormat = style.getNumberFormatObject( ); //initial number-format for the first time if ( numberFormat == null ) {// formatStr = style.getNumberFormat( ); formatStr = getNumberFormat(reportContent); if ( formatStr != null && formatStr.length( ) != 0) { numberFormat = new NumberFormatter( formatStr, context.getLocale( ) ); style.setNumberFormatObject( numberFormat ); } } } else //deal with value-of for text item { numberFormat = new NumberFormatter( formatStr, context.getLocale( ) ); } if (numberFormat == null) { numberFormat = new NumberFormatter( context.getLocale( ) ); } formattedStr.append( numberFormat.format( ( (Number) value ) .doubleValue( ) ) ); return; } else if ( value instanceof Date ) { DateFormatter dateFormat = null; if ( formatStr == null || formatStr.length( ) == 0 ) { dateFormat = style.getDateFormatObject( ); //initial date-format for the first time if ( dateFormat == null ) {// formatStr = style.getDateTimeFormat( ); formatStr = getDateTimeFormat( reportContent ); if ( formatStr != null && formatStr.length( ) != 0) { dateFormat = new DateFormatter( formatStr, context.getLocale( ) ); style.setDateFormatObject( dateFormat ); } } } else //deal with value-of for text item { dateFormat = new DateFormatter( formatStr, context.getLocale( ) ); } if( dateFormat == null ) { dateFormat = new DateFormatter( context.getLocale( ) ); } formattedStr.append( dateFormat.format( (Date) value ) ); return; } else if ( value instanceof String ) { StringFormatter stringFormat = null; if ( formatStr == null || formatStr.length( ) == 0 ) { stringFormat = style.getStringFormatObject( ); //initial string-format for the first time if ( stringFormat == null ) { //get format pattern from style// formatStr = style.getStringFormat( ); formatStr = getStringFormat( reportContent ); if ( formatStr != null && formatStr.length( ) != 0) { //use default stringFormat stringFormat = new StringFormatter( formatStr, context.getLocale( ) ); style.setStringFormatObject( stringFormat ); } } } else //deal with value-of for text item { stringFormat = new StringFormatter( formatStr, context.getLocale( ) ); } if( stringFormat != null ) { formattedStr.append( stringFormat.format( value.toString( ) ) ); return; } } formattedStr.append( value.toString( ) ); }
5230 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5230/e29ffc4317fc1dab71e811072bd49e7d35a106d8/StyledItemExecutor.java/clean/engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/executor/StyledItemExecutor.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1117, 918, 740, 620, 12, 1033, 460, 16, 514, 740, 1585, 16, 1082, 202, 2885, 15478, 2154, 16, 6674, 4955, 1585, 16, 4820, 1046, 1350, 2605, 1350, 262, 202, 95, 202, 202, 430, 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, 1117, 918, 740, 620, 12, 1033, 460, 16, 514, 740, 1585, 16, 1082, 202, 2885, 15478, 2154, 16, 6674, 4955, 1585, 16, 4820, 1046, 1350, 2605, 1350, 262, 202, 95, 202, 202, 430, 261, ...
void lookup( MessageAddress clientAddr, long clientTime, Map m);
void lookup(MessageAddress clientAddr, long clientTime, Map m);
void lookup( MessageAddress clientAddr, long clientTime, Map m);
7981 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7981/5354808ad0f03d28fe7c9ad0a594809aeb06c26d/LookupServerService.java/clean/core/src/org/cougaar/core/wp/server/LookupServerService.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 918, 3689, 12, 3639, 2350, 1887, 1004, 3178, 16, 3639, 1525, 1004, 950, 16, 3639, 1635, 312, 1769, 2, 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, 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, 918, 3689, 12, 3639, 2350, 1887, 1004, 3178, 16, 3639, 1525, 1004, 950, 16, 3639, 1635, 312, 1769, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
public void testOther() { assertEquals( "optional init match in definition", findMatchesCount(s73,s74), 4 ); assertEquals( "null match", findMatchesCount(s77,s78), 0 ); assertEquals( "body of method by block search", findMatchesCount(s79,s80), 2 ); assertEquals( "first matches, next not", findMatchesCount(s95,s96), 2 ); final String s97 = "class A { int c; void b() { C d; } } class C { C() { A a; a.b(); a.c=1; } }"; final String s98 = "'_.'_:[ref('T)] ()"; final String s98_2 = "'_.'_:[ref('T)]"; final String s98_3 = "'_:[ref('T)].'_ ();"; final String s98_4 = "'_:[ref('T)] '_;"; assertEquals( "method predicate match", findMatchesCount(s97,s98), 1 ); assertEquals( "field predicate match", findMatchesCount(s97,s98_2), 1 ); assertEquals( "dcl predicate match", findMatchesCount(s97,s98_3), 1 ); final String s99 = " char s = '\\u1111'; char s1 = '\\n'; "; final String s100 = " char 'var = '\\u1111'; "; final String s100_2 = " char 'var = '\\n'; "; assertEquals( "char constants in pattern", findMatchesCount(s99,s100), 1 ); assertEquals( "char constants in pattern 2", findMatchesCount(s99,s100_2), 1 ); assertEquals( "class predicate match (from definition)", findMatchesCount(s97,s98_4), 3 ); final String s125 = "a=1;"; final String s126 = "'t:[regex(a)]"; try { findMatchesCount(s125,s126); assertFalse("spaces around reg exp check",false); } catch(MalformedPatternException ex) {} options.setDistinct(true); final String s101 = "class A { void b() { String d; String e; String[] f; f.length=1; f.length=1; } }"; final String s102 = "'_:[ref('T)] '_;"; assertEquals( "distinct match", findMatchesCount(s101,s102), 1 ); options.setDistinct(false); final String s103 = " a=1; "; final String s104 = "'T:{ ;"; try { findMatchesCount(s103,s104); assertFalse("incorrect reg exp",false); } catch(MalformedPatternException ex) { } final String s106 = "$_ReturnType$ $MethodName$($_ParameterType$ $_Parameter$);"; final String s105 = " aaa; "; try { findMatchesCount(s105,s106); assertFalse("incorrect reg exp 2",false); } catch(UnsupportedPatternException ex) { } String s107 = "class A {\n" + " /* */\n" + " void a() {\n" + " }" + " /* */\n" + " int b = 1;\n" + " /*" + " *" + " */\n" + " class C {}" + "}"; String s108 = " /*" + " *" + " */"; assertEquals("finding comments without typed var", 1, findMatchesCount(s107,s108)); // a) custom modifiers // b) hierarchy navigation support // c) or search support // d) contains support // e) xml search (down-up, nested query), navigation from xml representation <-> java code // f) impl data conversion (jdk 1.5 style) <-> other from (replace support) // false, null, true symbols of no ineterest! // @todo move all special code (declaration statement processing, absence of match) into handlers // and put them into compiler // Directions: // @todo proper node filtering // @todo different navigation on sub/supertyping relation (fixed depth), methods implementing interface, // g. contains, like predicates // i. performance // more context for top level classes, difference with interface, etc // global issues: // @todo matches out of context // @todo proper regexp support // @todo define strict equality of the matches // @todo proper results based on typed vars! // @todo search for field selection retrieves packages also }
12814 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12814/b54adb8422900a14e3e599de05227095b018ad4f/StructuralSearchTest.java/buggy/plugins/structuralsearch/testSource/com/intellij/structuralsearch/StructuralSearchTest.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 918, 1842, 8290, 1435, 288, 565, 1815, 8867, 12, 315, 10444, 1208, 845, 316, 2379, 3113, 1104, 6869, 1380, 12, 87, 9036, 16, 87, 5608, 3631, 1059, 565, 11272, 565, 1815, 8867, 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, 282, 1071, 918, 1842, 8290, 1435, 288, 565, 1815, 8867, 12, 315, 10444, 1208, 845, 316, 2379, 3113, 1104, 6869, 1380, 12, 87, 9036, 16, 87, 5608, 3631, 1059, 565, 11272, 565, 1815, 8867, 12, ...
public List<Item> getItemList() {
public List<Item> getItemList () {
public List<Item> getItemList() { if (itemList == null) itemList = new ArrayList<Item>(); return itemList; }
9667 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/9667/cd8ff9d62a253810263b2585b6b8133ba1c87c73/ShipmentNotice.java/buggy/jaxws-ri/samples/supplychain/src/supplychain/server/ShipmentNotice.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 987, 32, 1180, 34, 8143, 682, 1832, 288, 3639, 309, 261, 1726, 682, 422, 446, 13, 5411, 761, 682, 273, 394, 2407, 32, 1180, 34, 5621, 10792, 327, 761, 682, 31, 565, 289, 2, 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, 1, 1, 1, 1, 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, 32, 1180, 34, 8143, 682, 1832, 288, 3639, 309, 261, 1726, 682, 422, 446, 13, 5411, 761, 682, 273, 394, 2407, 32, 1180, 34, 5621, 10792, 327, 761, 682, 31, 565, 289, 2, -100...
test.assertEquals("2237.0", cell.getFormattedValue());
test.assertEquals("2,237", cell.getFormattedValue());
protected void defineFunctions() { // 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; } public void testDimensionHierarchy(FoodMartTestCase test) { String s = test.executeExpr("[Time].Dimension.Name"); test.assertEquals("Time", s); } }); 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(); } public void testLevelDimension(FoodMartTestCase test) { String s = test.executeExpr( "[Time].[Year].Dimension"); test.assertEquals("[Time]", s); } }); 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(); } public void testMemberDimension(FoodMartTestCase test) { String s = test.executeExpr( "[Time].[1997].[Q2].Dimension"); test.assertEquals("[Time]", s); } }); 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 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]; } public void testDimensionsNumeric(FoodMartTestCase test) { String s = test.executeExpr( "Dimensions(2).Name"); test.assertEquals("Store", s); } }); define(new FunDefBase("Dimensions", "Dimensions(<String Expression>)", "Returns the dimension whose name is specified by a string.", "fdS") { 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); } Cube cube = evaluator.getCube(); boolean fail = false; OlapElement o = Util.lookupCompound(cube, s, cube, fail); if (o == null) { throw newEvalException( this, "Dimensions '" + s + "' not found"); } else if (o instanceof Dimension) { return (Dimension) o; } else { throw newEvalException( this, "Dimensions(" + s + ") found " + o); } } public void testDimensionsString(FoodMartTestCase test) { String s = test.executeExpr( "Dimensions(\"Store\").UniqueName"); test.assertEquals("[Store]", s); } }); // // 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(); } public void testTime(FoodMartTestCase test) { String s = test.executeExpr( "[Time].[1997].[Q1].[1].Hierarchy"); test.assertEquals("[Time]", s); } public void testBasic9(FoodMartTestCase test) { String s = test.executeExpr( "[Gender].[All Genders].[F].Hierarchy"); test.assertEquals("[Gender]", s); } public void testFirstInLevel9(FoodMartTestCase test) { String s = test.executeExpr( "[Education Level].[All Education Levels].[Bachelors Degree].Hierarchy"); test.assertEquals("[Education Level]", s); } public void testHierarchyAll(FoodMartTestCase test) { String s = test.executeExpr( "[Gender].[All Genders].Hierarchy"); test.assertEquals("[Gender]", s); } public void testHierarchyNull(FoodMartTestCase test) { String s = test.executeExpr( "[Gender].[All Genders].Parent.Hierarchy"); test.assertEquals("[Gender]", s); // MSOLAP gives "#ERR" } }); // // LEVEL FUNCTIONS define(new FunDefBase("Level", "<Member>.Level", "Returns a member's level.", "plm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); return member.getLevel(); } public void testMemberLevel(FoodMartTestCase test) { String s = test.executeExpr( "[Time].[1997].[Q1].[1].Level.UniqueName"); test.assertEquals("[Time].[Month]", s); } }); define(new FunDefBase("Levels", "<Hierarchy>.Levels(<Numeric Expression>)", "Returns the level whose position in a hierarchy is specified by a numeric expression.", "mlhn") { 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 < 1)) { throw newEvalException( this, "Index '" + n + "' out of bounds"); } return levels[n - 1]; } public void testLevelsNumeric(FoodMartTestCase test) { String s = test.executeExpr("[Time].Levels(2).Name"); test.assertEquals("Quarter", s); } public void testLevelsTooSmall(FoodMartTestCase test) { test.assertExprThrows( "[Time].Levels(0).Name", "Index '0' out of bounds"); } public void testLevelsTooLarge(FoodMartTestCase test) { test.assertExprThrows( "[Time].Levels(8).Name", "Index '8' out of bounds"); } }); define(new FunDefBase("Levels", "Levels(<String Expression>)", "Returns the level whose name is specified by a string expression.", "flS") { public Object evaluate(Evaluator evaluator, Exp[] args) { String s = getStringArg(evaluator, args, 0, null); Cube cube = evaluator.getCube(); boolean fail = false; OlapElement o = null; if (s.startsWith("[")) { o = Util.lookupCompound(cube, s, cube, fail); } else { // lookupCompound barfs if "s" doesn't have matching // brackets, so don't even try o = null; } if (o == null) { throw newEvalException( this, "could not find level '" + s + "'"); } else if (o instanceof Level) { return (Level) o; } else { throw newEvalException( this, "found '" + o.getDescription() + "', not a level"); } } public void testLevelsString(FoodMartTestCase test) { String s = test.executeExpr( "Levels(\"[Time].[Year]\").UniqueName"); test.assertEquals("[Time].[Year]", s); } public void testLevelsStringFail(FoodMartTestCase test) { test.assertExprThrows( "Levels(\"nonexistent\").UniqueName", "could not find level 'nonexistent'"); } }); // // LOGICAL FUNCTIONS define(new FunDefBase("IsEmpty", "IsEmpty(<Value Expression>)", "Determines if an expression evaluates to the empty cell value.", "fbS")); define(new FunDefBase("IsEmpty", "IsEmpty(<Value Expression>)", "Determines if an expression evaluates to the empty cell value.", "fbn")); // // MEMBER FUNCTIONS // if (false) define(new FunDefBase("Ancestor", "Ancestor(<Member>, <Level>)", "Returns the ancestor of a member at a specified level.", "fm*"); define(new FunDefBase("Ancestor", "Ancestor(<Member>, <Level>)", "Returns the ancestor of a member at a specified level.", "fmml") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, false); Level level = getLevelArg(evaluator, args, 1, false); if (member.getHierarchy() != level.getHierarchy()) { throw newEvalException( this, "member '" + member + "' is not in the same hierarchy as level '" + level + "'"); } if (member.getLevel().equals(level)) { return member; } Member[] members = member.getAncestorMembers(); for (int i = 0; i < members.length; i++) { if (members[i].getLevel().equals(level)) return members[i]; } return member.getHierarchy().getNullMember(); // not found } public void testAncestor(FoodMartTestCase test) { Member member = test.executeAxis( "Ancestor([Store].[USA].[CA].[Los Angeles],[Store Country])"); test.assertEquals("USA", member.getName()); } public void testAncestorHigher(FoodMartTestCase test) { Member member = test.executeAxis( "Ancestor([Store].[USA],[Store].[Store City])"); test.assertNull(member); // MSOLAP returns null } public void testAncestorSameLevel(FoodMartTestCase test) { Member member = test.executeAxis( "Ancestor([Store].[Canada],[Store].[Store Country])"); test.assertEquals("Canada", member.getName()); } public void testAncestorWrongHierarchy(FoodMartTestCase test) { // MSOLAP gives error "Formula error - dimensions are not // valid (they do not match) - in the Ancestor function" test.assertAxisThrows( "Ancestor([Gender].[M],[Store].[Store Country])", "member '[Gender].[All Genders].[M]' is not in the same hierarchy as level '[Store].[Store Country]'"); } public void testAncestorAllLevel(FoodMartTestCase test) { Member member = test.executeAxis( "Ancestor([Store].[USA].[CA],[Store].Levels(1))"); test.assertTrue(member.isAll()); } }); define(new FunDefBase("ClosingPeriod", "ClosingPeriod([<Level>[, <Member>]])", "Returns the last sibling among the descendants of a member at a level.", "fm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Cube cube = evaluator.getCube(); Dimension timeDimension = cube.getYearLevel().getDimension(); Member member = evaluator.getContext(timeDimension); Level level = member.getLevel().getChildLevel(); return openClosingPeriod(this, member, level); } public void testClosingPeriodNoArgs(FoodMartTestCase test) { // MSOLAP returns [1997].[Q4], because [Time].CurrentMember = // [1997]. Member member = test.executeAxis("ClosingPeriod()"); test.assertEquals("[Time].[1997].[Q4]", member.getUniqueName()); } }); define(new FunDefBase("ClosingPeriod", "ClosingPeriod([<Level>[, <Member>]])", "Returns the last sibling among the descendants of a member at a level.", "fml") { public Object evaluate(Evaluator evaluator, Exp[] args) { Cube cube = evaluator.getCube(); Dimension timeDimension = cube.getYearLevel().getDimension(); Member member = evaluator.getContext(timeDimension); Level level = getLevelArg(evaluator, args, 0, true); return openClosingPeriod(this, member, level); } public void testClosingPeriodLevel(FoodMartTestCase test) { Member member = test.executeAxis( "ClosingPeriod([Month])"); test.assertEquals("[Time].[1997].[Q4].[12]", member.getUniqueName()); } public void testClosingPeriodLevelNotInTimeFails(FoodMartTestCase test) { test.assertAxisThrows( "ClosingPeriod([Store].[Store City])", "member '[Time].[1997]' must be in same hierarchy as level '[Store].[Store City]'"); } }); define(new FunDefBase("ClosingPeriod", "ClosingPeriod([<Level>[, <Member>]])", "Returns the last sibling among the descendants of a member at a level.", "fmm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); Level level = member.getLevel().getChildLevel(); return openClosingPeriod(this, member, level); } public void testClosingPeriodMember(FoodMartTestCase test) { Member member = test.executeAxis( "ClosingPeriod([USA])"); test.assertEquals("WA", member.getName()); } }); define(new FunDefBase("ClosingPeriod", "ClosingPeriod([<Level>[, <Member>]])", "Returns the last sibling among the descendants of a member at a level.", "fmlm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Level level = getLevelArg(evaluator, args, 0, true); Member member = getMemberArg(evaluator, args, 1, true); return openClosingPeriod(this, member, level); } public void testClosingPeriod(FoodMartTestCase test) { Member member = test.executeAxis( "ClosingPeriod([Month],[1997])"); test.assertEquals("[Time].[1997].[Q4].[12]", member.getUniqueName()); } public void testClosingPeriodBelow(FoodMartTestCase test) { Member member = test.executeAxis( "ClosingPeriod([Quarter],[1997].[Q3].[8])"); test.assertNull(member); } }); define(new FunDefBase("Cousin", "Cousin(<Member1>, <Member2>)", "Returns the member with the same relative position under a member as the member specified.", "fmmm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member1 = getMemberArg(evaluator, args, 0, true); Member member2 = getMemberArg(evaluator, args, 1, true); Member cousin = cousin(member1, member2); if (cousin == null) { cousin = member1.getHierarchy().getNullMember(); } return cousin; } private Member cousin(Member member1, Member member2) { if (member1.getHierarchy() != member2.getHierarchy()) { throw newEvalException( this, "Members '" + member1 + "' and '" + member2 + "' are not compatible as cousins"); } if (member1.getLevel().getDepth() < member2.getLevel().getDepth()) { return null; } return cousin2(member1, member2); } private Member cousin2(Member member1, Member member2) { if (member1.getLevel() == member2.getLevel()) { return member2; } Member uncle = cousin2(member1.getParentMember(), member2); if (uncle == null) { return null; } int ordinal = getOrdinalInParent(member1); Member[] cousins = uncle.getMemberChildren(); if (cousins.length < ordinal) { return null; } return cousins[ordinal]; } private int getOrdinalInParent(Member member) { Member parent = member.getParentMember(); Member[] siblings; if (parent == null) { siblings = member.getHierarchy().getRootMembers(); } else { siblings = parent.getMemberChildren(); } for (int i = 0; i < siblings.length; i++) { if (siblings[i] == member) { return i; } } throw Util.newInternal( "could not find member " + member + " amongst its siblings"); } public void testCousin1(FoodMartTestCase test) { Member member = test.executeAxis( "Cousin([1997].[Q4],[1998])"); test.assertEquals("[Time].[1998].[Q4]", member.getUniqueName()); } public void testCousin2(FoodMartTestCase test) { Member member = test.executeAxis( "Cousin([1997].[Q4].[12],[1998].[Q1])"); test.assertEquals("[Time].[1998].[Q1].[3]", member.getUniqueName()); } public void testCousinOverrun(FoodMartTestCase test) { Member member = test.executeAxis( "Cousin([Customers].[USA].[CA].[San Jose], [Customers].[USA].[OR])"); // CA has more cities than OR test.assertNull(member); } public void testCousinThreeDown(FoodMartTestCase test) { Member member = test.executeAxis( "Cousin([Customers].[USA].[CA].[Berkeley].[Alma Shelton], [Customers].[Mexico])"); // Alma Shelton is the 3rd child // of the 4th child (Berkeley) // of the 1st child (CA) // of USA test.assertEquals("[Customers].[All Customers].[Mexico].[DF].[Tixapan].[Albert Clouse]", member.getUniqueName()); } public void testCousinSameLevel(FoodMartTestCase test) { Member member = test.executeAxis( "Cousin([Gender].[M], [Gender].[F])"); test.assertEquals("F", member.getName()); } public void testCousinHigherLevel(FoodMartTestCase test) { Member member = test.executeAxis( "Cousin([Time].[1997], [Time].[1998].[Q1])"); test.assertNull(member); } public void testCousinWrongHierarchy(FoodMartTestCase test) { test.assertAxisThrows( "Cousin([Time].[1997], [Gender].[M])", "Members '[Time].[1997]' and '[Gender].[All Genders].[M]' are not compatible as cousins"); } }); 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); } public void testCurrentMemberFromSlicer(FoodMartTestCase test) { Result result = test.runQuery( "with member [Measures].[Foo] as '[Gender].CurrentMember.Name'" + nl + "select {[Measures].[Foo]} on columns" + nl + "from Sales where ([Gender].[F])"); test.assertEquals("F", result.getCell(new int[] {0}).getValue()); } public void testCurrentMemberFromDefaultMember(FoodMartTestCase test) { Result result = test.runQuery( "with member [Measures].[Foo] as '[Time].CurrentMember.Name'" + nl + "select {[Measures].[Foo]} on columns" + nl + "from Sales"); test.assertEquals("1997", result.getCell(new int[] {0}).getValue()); } public void testCurrentMemberFromAxis(FoodMartTestCase test) { Result result = test.runQuery( "with member [Measures].[Foo] as '[Gender].CurrentMember.Name || [Marital Status].CurrentMember.Name'" + nl + "select {[Measures].[Foo]} on columns," + nl + " CrossJoin({[Gender].children}, {[Marital Status].children}) on rows" + nl + "from Sales"); test.assertEquals("FM", result.getCell(new int[] {0,0}).getValue()); } /** * When evaluating a calculated member, MSOLAP regards that * calculated member as the current member of that dimension, so it * cycles in this case. But I disagree; it is the previous current * member, before the calculated member was expanded. */ public void testCurrentMemberInCalcMember(FoodMartTestCase test) { Result result = test.runQuery( "with member [Measures].[Foo] as '[Measures].CurrentMember.Name'" + nl + "select {[Measures].[Foo]} on columns" + nl + "from Sales"); test.assertEquals("Unit Sales", result.getCell(new int[] {0}).getValue()); } }); 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 dimension.getHierarchy().getDefaultMember(); } public void testDimensionDefaultMember(FoodMartTestCase test) { Member member = test.executeAxis( "[Measures].DefaultMember"); test.assertEquals("Unit Sales", member.getName()); } }); 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 = member.getMemberChildren(); if (children.length == 0) { return member.getHierarchy().getNullMember(); } else { return children[0]; } } public void testFirstChildFirstInLevel(FoodMartTestCase test) { Member member = test.executeAxis( "[Time].[1997].[Q4].FirstChild"); test.assertEquals("10", member.getName()); } public void testFirstChildAll(FoodMartTestCase test) { Member member = test.executeAxis( "[Gender].[All Genders].FirstChild"); test.assertEquals("F", member.getName()); } public void testFirstChildOfChildless(FoodMartTestCase test) { Member member = test.executeAxis( "[Gender].[All Genders].[F].FirstChild"); test.assertNull(member); } }); 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 = member.getHierarchy().getRootMembers(); } else { children = parent.getMemberChildren(); } return children[0]; } public void testFirstSiblingFirstInLevel(FoodMartTestCase test) { Member member = test.executeAxis( "[Gender].[F].FirstSibling"); test.assertEquals("F", member.getName()); } public void testFirstSiblingLastInLevel(FoodMartTestCase test) { Member member = test.executeAxis( "[Time].[1997].[Q4].FirstSibling"); test.assertEquals("Q1", member.getName()); } public void testFirstSiblingAll(FoodMartTestCase test) { Member member = test.executeAxis( "[Gender].[All Genders].FirstSibling"); test.assertTrue(member.isAll()); } public void testFirstSiblingRoot(FoodMartTestCase test) { // The [Measures] hierarchy does not have an 'all' member, so // [Unit Sales] does not have a parent. Member member = test.executeAxis( "[Measures].[Store Sales].FirstSibling"); test.assertEquals("Unit Sales", member.getName()); } public void testFirstSiblingNull(FoodMartTestCase test) { Member member = test.executeAxis( "[Gender].[F].FirstChild.FirstSibling"); test.assertNull(member); } }); 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"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); int n = getIntArg(evaluator, args, 1); return member.getLeadMember(-n); } public void testLag(FoodMartTestCase test) { Member member = test.executeAxis( "[Time].[1997].[Q4].[12].Lag(4)"); test.assertEquals("8", member.getName()); } public void testLagFirstInLevel(FoodMartTestCase test) { Member member = test.executeAxis( "[Gender].[F].Lag(1)"); test.assertNull(member); } public void testLagAll(FoodMartTestCase test) { Member member = test.executeAxis( "[Gender].DefaultMember.Lag(2)"); test.assertNull(member); } public void testLagRoot(FoodMartTestCase test) { Member member = test.executeAxis( "[Time].[1998].Lag(1)"); test.assertEquals("1997", member.getName()); } public void testLagRootTooFar(FoodMartTestCase test) { Member member = test.executeAxis( "[Time].[1998].Lag(2)"); test.assertNull(null); } })); 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 = member.getMemberChildren(); if (children.length == 0) { return member.getHierarchy().getNullMember(); } else { return children[children.length - 1]; } } public void testLastChild(FoodMartTestCase test) { Member member = test.executeAxis( "[Gender].LastChild"); test.assertEquals("M", member.getName()); } public void testLastChildLastInLevel(FoodMartTestCase test) { Member member = test.executeAxis( "[Time].[1997].[Q4].LastChild"); test.assertEquals("12", member.getName()); } public void testLastChildAll(FoodMartTestCase test) { Member member = test.executeAxis( "[Gender].[All Genders].LastChild"); test.assertEquals("M", member.getName()); } public void testLastChildOfChildless(FoodMartTestCase test) { Member member = test.executeAxis( "[Gender].[M].LastChild"); test.assertNull(member); } }); 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; if (parent == null) { if (member.isNull()) { return member; } children = member.getHierarchy().getRootMembers(); } else { children = parent.getMemberChildren(); } return children[children.length - 1]; } public void testLastSibling(FoodMartTestCase test) { Member member = test.executeAxis( "[Gender].[F].LastSibling"); test.assertEquals("M", member.getName()); } public void testLastSiblingFirstInLevel(FoodMartTestCase test) { Member member = test.executeAxis( "[Time].[1997].[Q1].LastSibling"); test.assertEquals("Q4", member.getName()); } public void testLastSiblingAll(FoodMartTestCase test) { Member member = test.executeAxis( "[Gender].[All Genders].LastSibling"); test.assertTrue(member.isAll()); } public void testLastSiblingRoot(FoodMartTestCase test) { // The [Time] hierarchy does not have an 'all' member, so // [1997], [1998] do not have parents. Member member = test.executeAxis( "[Time].[1998].LastSibling"); test.assertEquals("1998", member.getName()); } public void testLastSiblingNull(FoodMartTestCase test) { Member member = test.executeAxis( "[Gender].[F].FirstChild.LastSibling"); test.assertNull(member); } }); define(new MultiResolver( "Lead", "<Member>.Lead(<Numeric Expression>)", "Returns a member further along the specified member's dimension.", new String[]{"mmmn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); int n = getIntArg(evaluator, args, 1); return member.getLeadMember(n); } public void testLead(FoodMartTestCase test) { Member member = test.executeAxis( "[Time].[1997].[Q2].[4].Lead(4)"); test.assertEquals("8", member.getName()); } public void testLeadNegative(FoodMartTestCase test) { Member member = test.executeAxis( "[Gender].[M].Lead(-1)"); test.assertEquals("F", member.getName()); } public void testLeadLastInLevel(FoodMartTestCase test) { Member member = test.executeAxis( "[Gender].[M].Lead(3)"); test.assertNull(member); } })); 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 member.getLeadMember(+1); } public void testBasic2(FoodMartTestCase test) { Result result = test.runQuery( "select {[Gender].[F].NextMember} ON COLUMNS from Sales"); test.assertTrue(result.getAxes()[0].positions[0].members[0].getName().equals("M")); } public void testFirstInLevel2(FoodMartTestCase test) { Result result = test.runQuery( "select {[Gender].[M].NextMember} ON COLUMNS from Sales"); test.assertTrue(result.getAxes()[0].positions.length == 0); } public void testAll2(FoodMartTestCase test) { Result result = test.runQuery( "select {[Gender].PrevMember} ON COLUMNS from Sales"); // previous to [Gender].[All] is null, so no members are returned test.assertTrue(result.getAxes()[0].positions.length == 0); } }); if (false) define(new FunDefBase("OpeningPeriod", "OpeningPeriod([<Level>[, <Member>]])", "Returns the first sibling among the descendants of a member at a level.", "fm*")); if (false) define(new FunDefBase("ParallelPeriod", "ParallelPeriod([<Level>[, <Numeric Expression>[, <Member>]]])", "Returns a member from a prior period in the same relative position as a specified member.", "fm*")); 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 = member.getParentMember(); if (parent == null) { parent = member.getHierarchy().getNullMember(); } return parent; } public void testBasic5(FoodMartTestCase test) { Result result = test.runQuery( "select{ [Product].[All Products].[Drink].Parent} on columns from Sales"); test.assertTrue(result.getAxes()[0].positions[0].members[0].getName().equals("All Products")); } public void testFirstInLevel5(FoodMartTestCase test) { Result result = test.runQuery( "select {[Time].[1997].[Q2].[4].Parent} on columns,{[Gender].[M]} on rows from Sales"); test.assertTrue(result.getAxes()[0].positions[0].members[0].getName().equals("Q2")); } public void testAll5(FoodMartTestCase test) { Result result = test.runQuery( "select {[Time].[1997].[Q2].Parent} on columns,{[Gender].[M]} on rows from Sales"); // previous to [Gender].[All] is null, so no members are returned test.assertTrue(result.getAxes()[0].positions[0].members[0].getName().equals("1997")); } }); 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 member.getLeadMember(-1); } public void testBasic(FoodMartTestCase test) { Result result = test.runQuery( "select {[Gender].[M].PrevMember} ON COLUMNS from Sales"); test.assertTrue(result.getAxes()[0].positions[0].members[0].getName().equals("F")); } public void testFirstInLevel(FoodMartTestCase test) { Result result = test.runQuery( "select {[Gender].[F].PrevMember} ON COLUMNS from Sales"); test.assertTrue(result.getAxes()[0].positions.length == 0); } public void testAll(FoodMartTestCase test) { Result result = test.runQuery( "select {[Gender].PrevMember} ON COLUMNS from Sales"); // previous to [Gender].[All] is null, so no members are returned test.assertTrue(result.getAxes()[0].positions.length == 0); } }); 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 if (false) define(new FunDefBase("Aggregate", "Aggregate(<Set>[, <Numeric Expression>])", "Returns a calculated value using the appropriate aggregate function, based on the context of the query.", "fn*")); define(new MultiResolver( "Avg", "Avg(<Set>[, <Numeric Expression>])", "Returns the average value of a numeric expression evaluated over a set.", new String[]{"fnx", "fnxN"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Vector members = (Vector) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArg(evaluator, args, 1); return avg(evaluator.push(), members, exp); } public void testAvg(FoodMartTestCase test) { String result = test.executeExpr( "AVG({[Store].[All Stores].[USA].children},[Measures].[Store Sales])"); test.assertEquals("188412.71", result); } //todo: testAvgWithNulls })); if (false) define(new FunDefBase("Correlation", "Correlation(<Set>, <Numeric Expression>[, <Numeric Expression>])", "Returns the correlation of two series evaluated over a set.", "fn*")); 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"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Vector members = (Vector) getArg(evaluator, args, 0); String empties = (String) getArg(evaluator, args, 1, "INCLUDEEMPTY"); if (empties.equals("INCLUDEEMPTY")) { return new Double(members.size()); } else { int retval = 0; for (int i = 0; i < members.size(); i++) { if ((members.elementAt(i) != Util.nullValue) && (members.elementAt(i) != null)) { retval++; } } return new Double(retval); } } public void testCount(FoodMartTestCase test) { String result = test.executeExpr( "count({[Promotion Media].[Media Type].members})"); test.assertEquals("14.0", result); } //todo: testCountNull, testCountNoExp })); if (false) define(new FunDefBase("Covariance", "Covariance(<Set>, <Numeric Expression>[, <Numeric Expression>])", "Returns the covariance of two series evaluated over a set (biased).", "fn*")); if (false) define(new FunDefBase("CovarianceN", "CovarianceN(<Set>, <Numeric Expression>[, <Numeric Expression>])", "Returns the covariance of two series evaluated over a set (unbiased).", "fn*")); define(new FunDefBase("IIf", "IIf(<Logical Expression>, <Numeric Expression1>, <Numeric Expression2>)", "Returns one of two numeric values determined by a logical test.", "fnbnn")); if (false) define(new FunDefBase("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.", "fn*")); if (false) define(new FunDefBase("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.", "fn*")); if (false) define(new FunDefBase("LinRegR2", "LinRegR2(<Set>, <Numeric Expression>[, <Numeric Expression>])", "Calculates the linear regression of a set and returns R2 (the coefficient of determination).", "fn*")); if (false) define(new FunDefBase("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.", "fn*")); if (false) define(new FunDefBase("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.", "fn*")); define(new MultiResolver( "Max", "Max(<Set>[, <Numeric Expression>])", "Returns the maximum value of a numeric expression evaluated over a set.", new String[]{"fnx", "fnxN"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Vector members = (Vector) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArg(evaluator, args, 1); return max(evaluator.push(), members, exp); } public void testMax(FoodMartTestCase test) { String result = test.executeExpr( "MAX({[Store].[All Stores].[USA].children},[Measures].[Store Sales])"); test.assertEquals("263793.22", result); } })); define(new MultiResolver( "Median", "Median(<Set>[, <Numeric Expression>])", "Returns the median value of a numeric expression evaluated over a set.", new String[]{"fnx", "fnxN"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Vector members = (Vector) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArg(evaluator, args, 1); //todo: ignore nulls, do we need to ignore the vector? return median(evaluator.push(), members, exp); } public void testMedian(FoodMartTestCase test) { String result = test.executeExpr( "MEDIAN({[Store].[All Stores].[USA].children},[Measures].[Store Sales])"); test.assertEquals("159167.84", result); } })); define(new MultiResolver( "Min", "Min(<Set>[, <Numeric Expression>])", "Returns the minimum value of a numeric expression evaluated over a set.", new String[]{"fnx", "fnxN"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Vector members = (Vector) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArg(evaluator, args, 1); return min(evaluator.push(), members, exp); } public void testMin(FoodMartTestCase test) { String result = test.executeExpr( "MIN({[Store].[All Stores].[USA].children},[Measures].[Store Sales])"); test.assertEquals("142277.07", result); } })); define(new FunDefBase("Ordinal", "<Level>.Ordinal", "Returns the zero-based ordinal value associated with a level.", "pnl")); if (false) define(new FunDefBase("Rank", "Rank(<Tuple>, <Set>)", "Returns the one-based rank of a tuple in a set.", "fn*")); if (false) define(new FunDefBase("Stddev", "Stddev(<Set>[, <Numeric Expression>])", "Alias for Stdev.", "fn*")); if (false) define(new FunDefBase("StddevP", "StddevP(<Set>[, <Numeric Expression>])", "Alias for StdevP.", "fn*")); if (false) define(new FunDefBase("Stdev", "Stdev(<Set>[, <Numeric Expression>])", "Returns the standard deviation of a numeric expression evaluated over a set (unbiased).", "fn*")); if (false) define(new FunDefBase("StdevP", "StdevP(<Set>[, <Numeric Expression>])", "Returns the standard deviation of a numeric expression evaluated over a set (biased).", "fn*")); define(new MultiResolver( "Sum", "Sum(<Set>[, <Numeric Expression>])", "Returns the sum of a numeric expression evaluated over a set.", new String[]{"fnx", "fnxN"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Vector members = (Vector) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArg(evaluator, args, 1); return sum(evaluator.push(), members, exp); } public void testSumNoExp(FoodMartTestCase test) { String result = test.executeExpr( "SUM({[Promotion Media].[Media Type].members})"); test.assertEquals("266773.0", result); } })); 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.", "fvt") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member[] members = getTupleArg(evaluator, args, 0); Evaluator evaluator2 = evaluator.push(members); return evaluator2.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, FunDef.TypeParentheses) { public FunDef resolve(Exp[] args, int[] conversionCount) { if (args.length == 1 && args[0].getType() == FunCall.CatTuple) { return new ValueFunDef(new int[] {FunCall.CatTuple}); } for (int i = 0; i < args.length; i++) { Exp arg = args[i]; if (!canConvert(arg, FunCall.CatMember, conversionCount)) { return null; } } int[] argTypes = new int[args.length]; for (int i = 0; i < argTypes.length; i++) { argTypes[i] = FunCall.CatMember; } return new ValueFunDef(argTypes); } }); if (false) define(new FunDefBase("Var", "Var(<Set>[, <Numeric Expression>])", "Returns the variance of a numeric expression evaluated over a set (unbiased).", "fn*")); if (false) define(new FunDefBase("Variance", "Variance(<Set>[, <Numeric Expression>])", "Alias for Var.", "fn*")); if (false) define(new FunDefBase("VarianceP", "VarianceP(<Set>[, <Numeric Expression>])", "Alias for VarP.", "fn*")); if (false) define(new FunDefBase("VarP", "VarP(<Set>[, <Numeric Expression>])", "Returns the variance of a numeric expression evaluated over a set (biased).", "fn*")); // // SET FUNCTIONS if (false) define(new FunDefBase("AddCalculatedMembers", "AddCalculatedMembers(<Set>)", "Adds calculated members to a set.", "fx*")); 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"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Vector set = (Vector) getArg(evaluator, args, 0); int n = getIntArg(evaluator, args, 1); ExpBase exp = (ExpBase) getArg(evaluator, args, 2, null); if (exp != null) { boolean desc = false, brk = true; sort(evaluator, set, exp, desc, brk); } if (n < set.size()) { set.setSize(n); } return set; } public void testBottomCount(FoodMartTestCase test) { Axis axis = test.executeAxis2( "BottomCount({[Promotion Media].[Media Type].members}, 2, [Measures].[Unit Sales])"); String expected = "[Promotion Media].[All Promotion Media].[Radio]" + nl + "[Promotion Media].[All Promotion Media].[Sunday Paper, Radio, TV]"; test.assertEquals(expected, test.toString(axis.positions)); } //todo: test unordered })); 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"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Vector members = (Vector) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArg(evaluator, args, 2); Double n = getDoubleArg(evaluator, args, 1); return topOrBottom(evaluator.push(), members, exp, false, true, n.doubleValue()); } public void testBottomPercent(FoodMartTestCase test) { Axis axis = test.executeAxis2( "BottomPercent({[Promotion Media].[Media Type].members}, 1, [Measures].[Unit Sales])"); String expected = "[Promotion Media].[All Promotion Media].[Radio]" + nl + "[Promotion Media].[All Promotion Media].[Sunday Paper, Radio, TV]"; test.assertEquals(expected, test.toString(axis.positions)); } //todo: test precision })); 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"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Vector members = (Vector) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArg(evaluator, args, 2); Double n = getDoubleArg(evaluator, args, 1); return topOrBottom(evaluator.push(), members, exp, false, false, n.doubleValue()); } public void testBottomSum(FoodMartTestCase test) { Axis axis = test.executeAxis2( "BottomSum({[Promotion Media].[Media Type].members}, 5000, [Measures].[Unit Sales])"); String expected = "[Promotion Media].[All Promotion Media].[Radio]" + nl + "[Promotion Media].[All Promotion Media].[Sunday Paper, Radio, TV]"; test.assertEquals(expected, test.toString(axis.positions)); } })); 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 = member.getMemberChildren(); return toVector(children); } }); define(new FunDefBase("Crossjoin", "Crossjoin(<Set1>, <Set2>)", "Returns the cross product of two sets.", "fxxx") { public Hierarchy getHierarchy(Exp[] args) { // CROSSJOIN(<Set1>,<Set2>) has Hierarchy [Hie1] x [Hie2], which we // can't represent, so we return null. return null; } public Object evaluate(Evaluator evaluator, Exp[] args) { Vector set0 = (Vector) getArg(evaluator, args, 0), set1 = (Vector) getArg(evaluator, args, 1), result = new Vector(); for (int i = 0, m = set0.size(); i < m; i++) { Member o0 = (Member) set0.elementAt(i); for (int j = 0, n = set1.size(); j < n; j++) { Member o1 = (Member) set1.elementAt(j); result.addElement(new Member[]{o0, o1}); } } return result; } }); define(new MultiResolver( "Descendants", "Descendants(<Member>, <Level>[, <Desc_flag>])", "Returns the set of descendants of a member at a specified level, optionally including or excluding descendants in other levels.", new String[]{"fxml", "fxmls"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); Level level = getLevelArg(evaluator, args, 1, true);// String descFlag = getStringArg(evaluator, args, 2, ??); if (member.getLevel().getDepth() > level.getDepth()) { return new Member[0]; } // Expand member to its children, until we get to the right // level. We assume that all children are in the same // level. final Hierarchy hierarchy = member.getHierarchy(); Member[] children = {member}; while (children.length > 0 && children[0].getLevel().getDepth() < level.getDepth()) { children = hierarchy.getChildMembers(children); } return toVector(children); } })); if (false) define(new FunDefBase("Distinct", "Distinct(<Set>)", "Eliminates duplicate tuples from a set.", "fxx")); 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"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { //todo add fssl functionality Vector set0 = (Vector) getArg(evaluator, args, 0); int[] depthArray = new int[set0.size()]; Vector drilledSet = new Vector(); for (int i = 0, m = set0.size(); i < m; i++) { Member member = (Member) set0.elementAt(i); depthArray[i] = member.getDepth(); // Object o0 = set0.elementAt(i); // depthVector.addElement(new Object[] {o0}); } Arrays.sort(depthArray); int maxDepth = depthArray[depthArray.length - 1]; for (int i = 0, m = set0.size(); i < m; i++) { Member member = (Member) set0.elementAt(i); drilledSet.addElement(member); if (member.getDepth() == maxDepth) { Member[] childMembers = member.getMemberChildren(); for (int j = 0; j < childMembers.length; j++) { drilledSet.addElement(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*")); if (false) define(new FunDefBase("DrilldownMember", "DrilldownMember(<Set1>, <Set2>[, RECURSIVE])", "Drills down the members in a set that are present in a second specified set.", "fx*")); 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", "fxxxs"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { // todo: implement ALL HashSet set2 = toHashSet((Vector) getArg(evaluator, args, 1)); Vector set1 = (Vector) getArg(evaluator, args, 0); Vector result = new Vector(); for (int i = 0, count = set1.size(); i < count; i++) { Object o = set1.elementAt(i); if (!set2.contains(o)) { result.addElement(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) { Vector members = (Vector) getArg(evaluator, args, 0); Exp exp = args[1]; Vector result = new Vector(); Evaluator evaluator2 = evaluator.push(); for (int i = 0, count = members.size(); i < count; i++) { Object o = members.elementAt(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.booleanValue()) { result.add(o); } } return result; } /** * Make sure that slicer is in force when expression is applied * on axis, E.g. select filter([Customers].members, [Unit Sales] > 100) * from sales where ([Time].[1998]) **/ public void testFilterWithSilcer(FoodMartTestCase test) { Result result = test.execute( "select {[Measures].[Unit Sales]} on columns," + nl + " filter([Customers].[USA].children," + nl + " [Measures].[Unit Sales] > 20000) on rows" + nl + "from Sales" + nl + "where ([Time].[1997].[Q1])"); Axis rows = result.getAxes()[1]; // if slicer were ignored, there would be 3 rows test.assertEquals(1, rows.positions.length); Cell cell = result.getCell(new int[] {0,0}); test.assertEquals("30,114.00", cell.getFormattedValue()); } public void testFilterCompound(FoodMartTestCase test) { Result result = test.execute( "select {[Measures].[Unit Sales]} on columns," + nl + " Filter(" + nl + " CrossJoin(" + nl + " [Gender].Children," + nl + " [Customers].[USA].Children)," + nl + " [Measures].[Unit Sales] > 9500) on rows" + nl + "from Sales" + nl + "where ([Time].[1997].[Q1])"); Position[] rows = result.getAxes()[1].positions; test.assertTrue(rows.length == 3); test.assertEquals("F", rows[0].members[0].getName()); test.assertEquals("WA", rows[0].members[1].getName()); test.assertEquals("M", rows[1].members[0].getName()); test.assertEquals("OR", rows[1].members[1].getName()); test.assertEquals("M", rows[2].members[0].getName()); test.assertEquals("WA", rows[2].members[1].getName()); } }); if (false) define(new FunDefBase("Generate", "Generate(<Set1>, <Set2>[, ALL])", "Applies a set to each member of another set and joins the resulting sets by union.", "fx*")); if (false) define(new FunDefBase("Head", "Head(<Set>[, < Numeric Expression >])", "Returns the first specified number of elements in a set.", "fx*")); if (false) define(new FunDefBase("Hierarchize", "Hierarchize(<Set>)", "Orders the members of a set in a hierarchy.", "fx*")); if (false) define(new FunDefBase("Intersect", "Intersect(<Set1>, <Set2>[, ALL])", "Returns the intersection of two input sets, optionally retaining duplicates.", "fx*")); 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(new Vector(), 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(new Vector(), 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 toVector(level.getMembers()); } }); define(new MultiResolver( "Mtd", "Mtd([<Member>])", "A shortcut function for the PeriodsToDate function that specifies the level to be Month.", new String[]{"fx", "fxm"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { return periodsToDate( evaluator, evaluator.getCube().getMonthLevel(), getMemberArg(evaluator, args, 0, false)); } })); define(new MultiResolver( "Order", "Order(<Set>, <Value Expression>[, ASC | DESC | BASC | BDESC])", "Arranges members of a set, optionally preserving or breaking the hierarchy.", new String[]{"fxxvy", "fxxv"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Vector members = (Vector) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArg(evaluator, args, 1); String order = (String) getArg(evaluator, args, 2, "ASC"); sort( evaluator, members, exp, order.equals("DESC") || order.equals("BDESC"), order.equals("BASC") || order.equals("BDESC")); return members; } })); 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"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Level level = getLevelArg(evaluator, args, 0, false); Member member = getMemberArg(evaluator, args, 1, false); return periodsToDate(evaluator, level, member); } })); define(new MultiResolver( "Qtd", "Qtd([<Member>])", "A shortcut function for the PeriodsToDate function that specifies the level to be Quarter.", new String[]{"fx", "fxm"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { return periodsToDate( evaluator, evaluator.getCube().getQuarterLevel(), getMemberArg(evaluator, args, 0, false)); } })); if (false) define(new FunDefBase("StripCalculatedMembers", "StripCalculatedMembers(<Set>)", "Removes calculated members from a set.", "fx*")); define(new FunDefBase("StrToSet", "StrToSet(<String Expression>)", "Constructs a set from a string expression.", "fxS") { public void unparse(Exp[] args, PrintWriter pw, ElementCallback callback) { if (callback.isPlatoMdx()) { // omit extra args (they're for us, not Plato) super.unparse(new Exp[]{args[0]}, pw, callback); } else { super.unparse(args, pw, callback); } } public Hierarchy getHierarchy(Exp[] args) { // StrToSet(s, <Hie1>, ... <HieN>) is of type [Hie1] x ... x [HieN]; // so, for example, So StrToTuple("[Time].[1997]", [Time]) is of type // [Time]. But if n > 1, we cannot represent the compound type, and we // return null. return (args.length == 2) ? (Hierarchy) args[1] : null; } }); if (false) define(new FunDefBase("Subset", "Subset(<Set>, <Start>[, <Count>])", "Returns a subset of elements from a set.", "fx*")); if (false) define(new FunDefBase("Tail", "Tail(<Set>[, <Count>])", "Returns a subset from the end of a set.", "fx*")); 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", "fxxx#"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Vector v0 = (Vector) getArg(evaluator, args, 0), v1 = (Vector) getArg(evaluator, args, 1); if (args.length > 2) { throw Util.newInternal( "ToggleDrillState(RECURSIVE) not supported"); } if (v1.isEmpty()) { return v0; } HashSet set1 = toHashSet(v1); Vector result = new Vector(); int i = 0, n = v0.size(); while (i < n) { Member m = (Member) v0.elementAt(i++); result.addElement(m); if (!set1.contains(m)) { continue; } boolean isDrilledDown = false; if (i < n) { Member next = (Member) v0.elementAt(i); boolean strict = true; if (isAncestorOf(m, next, strict)) { isDrilledDown = true; } } if (isDrilledDown) { // skip descendants of this member do { Member next = (Member) v0.elementAt(i); boolean strict = true; if (isAncestorOf(m, next, strict)) { i++; } else { break; } } while (i < n); } else { Member[] children = m.getMemberChildren(); for (int j = 0; j < children.length; j++) { result.addElement(children[j]); } } } return result; } public void testToggleDrillState(FoodMartTestCase test) { Axis axis = test.executeAxis2( "ToggleDrillState({[Customers].[USA],[Customers].[Canada]},{[Customers].[USA],[Customers].[USA].[CA]})"); String expected = "[Customers].[All Customers].[USA]" + nl + "[Customers].[All Customers].[USA].[CA]" + nl + "[Customers].[All Customers].[USA].[OR]" + nl + "[Customers].[All Customers].[USA].[WA]" + nl + "[Customers].[All Customers].[Canada]"; test.assertEquals(expected, test.toString(axis.positions)); } public void testToggleDrillState2(FoodMartTestCase test) { Axis axis = test.executeAxis2( "ToggleDrillState([Product].[Product Department].members, {[Product].[All Products].[Food].[Snack Foods]})"); String expected = "[Product].[All Products].[Drink].[Alcoholic Beverages]" + nl + "[Product].[All Products].[Drink].[Beverages]" + nl + "[Product].[All Products].[Drink].[Dairy]" + nl + "[Product].[All Products].[Food].[Baked Goods]" + nl + "[Product].[All Products].[Food].[Baking Goods]" + nl + "[Product].[All Products].[Food].[Breakfast Foods]" + nl + "[Product].[All Products].[Food].[Canned Foods]" + nl + "[Product].[All Products].[Food].[Canned Products]" + nl + "[Product].[All Products].[Food].[Dairy]" + nl + "[Product].[All Products].[Food].[Deli]" + nl + "[Product].[All Products].[Food].[Eggs]" + nl + "[Product].[All Products].[Food].[Frozen Foods]" + nl + "[Product].[All Products].[Food].[Meat]" + nl + "[Product].[All Products].[Food].[Produce]" + nl + "[Product].[All Products].[Food].[Seafood]" + nl + "[Product].[All Products].[Food].[Snack Foods]" + nl + "[Product].[All Products].[Food].[Snack Foods].[Snack Foods]" + nl + "[Product].[All Products].[Food].[Snacks]" + nl + "[Product].[All Products].[Food].[Starchy Foods]" + nl + "[Product].[All Products].[Non-Consumable].[Carousel]" + nl + "[Product].[All Products].[Non-Consumable].[Checkout]" + nl + "[Product].[All Products].[Non-Consumable].[Health and Hygiene]" + nl + "[Product].[All Products].[Non-Consumable].[Household]" + nl + "[Product].[All Products].[Non-Consumable].[Periodicals]"; test.assertEquals(expected, test.toString(axis.positions)); } public void testToggleDrillState3(FoodMartTestCase test) { Axis axis = test.executeAxis2( "ToggleDrillState(" + "{[Time].[1997].[Q1]," + " [Time].[1997].[Q2]," + " [Time].[1997].[Q2].[4]," + " [Time].[1997].[Q2].[6]," + " [Time].[1997].[Q3]}," + "{[Time].[1997].[Q2]})"); String expected = "[Time].[1997].[Q1]" + nl + "[Time].[1997].[Q2]" + nl + "[Time].[1997].[Q3]"; test.assertEquals(expected, test.toString(axis.positions)); } })); 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"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Vector set = (Vector) getArg(evaluator, args, 0); int n = getIntArg(evaluator, args, 1); ExpBase exp = (ExpBase) getArg(evaluator, args, 2, null); if (exp != null) { boolean desc = true, brk = true; sort(evaluator, set, exp, desc, brk); } if (n < set.size()) { set.setSize(n); } return set; } public void testTopCount(FoodMartTestCase test) { Axis axis = test.executeAxis2( "TopCount({[Promotion Media].[Media Type].members}, 2, [Measures].[Unit Sales])"); String expected = "[Promotion Media].[All Promotion Media].[No Media]" + nl + "[Promotion Media].[All Promotion Media].[Daily Paper, Radio, TV]"; test.assertEquals(expected, test.toString(axis.positions)); } })); 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"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Vector members = (Vector) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArg(evaluator, args, 2); Double n = getDoubleArg(evaluator, args, 1); return topOrBottom(evaluator.push(), members, exp, true, true, n.doubleValue()); } public void testTopPercent(FoodMartTestCase test) { Axis axis = test.executeAxis2( "TopPercent({[Promotion Media].[Media Type].members}, 70, [Measures].[Unit Sales])"); String expected = "[Promotion Media].[All Promotion Media].[No Media]"; test.assertEquals(expected, test.toString(axis.positions)); } //todo: test precision })); 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"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Vector members = (Vector) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArg(evaluator, args, 2); Double n = getDoubleArg(evaluator, args, 1); return topOrBottom(evaluator.push(), members, exp, true, false, n.doubleValue()); } public void testTopSum(FoodMartTestCase test) { Axis axis = test.executeAxis2( "TopSum({[Promotion Media].[Media Type].members}, 200000, [Measures].[Unit Sales])"); String expected = "[Promotion Media].[All Promotion Media].[No Media]" + nl + "[Promotion Media].[All Promotion Media].[Daily Paper, Radio, TV]"; test.assertEquals(expected, test.toString(axis.positions)); } })); if (false) define(new FunDefBase("Union", "Union(<Set1>, <Set2>[, ALL])", "Returns the union of two sets, optionally retaining duplicates.", "fx*")); 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 MultiResolver( "Wtd", "Wtd([<Member>])", "A shortcut function for the PeriodsToDate function that specifies the level to be Week.", new String[]{"fx", "fxm"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { return periodsToDate( evaluator, evaluator.getCube().getWeekLevel(), getMemberArg(evaluator, args, 0, false)); } })); define(new MultiResolver( "Ytd", "Ytd([<Member>])", "A shortcut function for the PeriodsToDate function that specifies the level to be Year.", new String[]{"fx", "fxm"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { return periodsToDate( evaluator, evaluator.getCube().getYearLevel(), getMemberArg(evaluator, args, 0, false)); } })); define(new FunDefBase(":", "<Member>:<Member>", "Infix colon operator returns the set of members between a given pair of members.", "ixmm")); // special resolver for the "{...}" operator define(new ResolverBase( "{}", "{<Member> [, <Member>]...}", "Brace operator constructs a set.", FunDef.TypeBraces) { protected FunDef resolve(Exp[] args, int[] conversionCount) { int[] parameterTypes = new int[args.length]; for (int i = 0; i < args.length; i++) { if (canConvert( args[i], Exp.CatMember, conversionCount)) { parameterTypes[i] = Exp.CatMember; continue; } if (canConvert( args[i], Exp.CatSet, conversionCount)) { parameterTypes[i] = Exp.CatSet; continue; } if (canConvert( args[i], Exp.CatTuple, conversionCount)) { parameterTypes[i] = Exp.CatTuple; continue; } return null; } return new SetFunDef(this, syntacticType, parameterTypes); } public void testSetContainingLevelFails(FoodMartTestCase test) { test.assertAxisThrows( "[Store].[Store City]", "no function matches signature '{<Level>}'"); } }); // // STRING FUNCTIONS define(new FunDefBase("IIf", "IIf(<Logical Expression>, <String Expression1>, <String Expression2>)", "Returns one of two string values determined by a logical test.", "f#b##") { public Object evaluate(Evaluator evaluator, Exp[] args) { boolean logical = getBooleanArg(evaluator, args, 0); return getStringArg(evaluator, args, logical ? 1 : 2, null); } public void testIIf(FoodMartTestCase test) { String s = test.executeExpr( "IIf(([Measures].[Unit Sales],[Product].[Drink].[Alcoholic Beverages].[Beer and Wine]) > 100, \"Yes\",\"No\")"); test.assertEquals("Yes", s); } }); 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(); } public void testDimensionName(FoodMartTestCase test) { String s = test.executeExpr("[Time].[1997].Dimension.Name"); test.assertEquals("Time", s); } }); 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(); } public void testHierarchyName(FoodMartTestCase test) { String s = test.executeExpr( "[Time].[1997].Hierarchy.Name"); test.assertEquals("Time", s); } }); 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(); } public void testLevelName(FoodMartTestCase test) { String s = test.executeExpr("[Time].[1997].Level.Name"); test.assertEquals("Year", s); } }); 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(); } public void testMemberName(FoodMartTestCase test) { String s = test.executeExpr("[Time].[1997].Name"); test.assertEquals("1997", s); } }); define(new FunDefBase("SetToStr", "SetToStr(<Set>)", "Constructs a string from a set.", "fSx")); define(new FunDefBase("TupleToStr", "TupleToStr(<Tuple>)", "Constructs a string from a tuple.", "fSt")); 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(); } public void testDimensionUniqueName(FoodMartTestCase test) { String s = test.executeExpr( "[Gender].DefaultMember.Dimension.UniqueName"); test.assertEquals("[Gender]", s); } }); 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(); } public void testHierarchyUniqueName(FoodMartTestCase test) { String s = test.executeExpr( "[Gender].DefaultMember.Hierarchy.UniqueName"); test.assertEquals("[Gender]", s); } }); 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(); } public void testLevelUniqueName(FoodMartTestCase test) { String s = test.executeExpr( "[Gender].DefaultMember.Level.UniqueName"); test.assertEquals("[Gender].[(All)]", s); } }); 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(); } public void testMemberUniqueName(FoodMartTestCase test) { String s = test.executeExpr( "[Gender].DefaultMember.UniqueName"); test.assertEquals("[Gender].[All Genders]", s); } public void testMemberUniqueNameOfNull(FoodMartTestCase test) { String s = test.executeExpr( "[Measures].[Unit Sales].FirstChild.UniqueName"); test.assertEquals("[Measures].[#Null]", s); // MSOLAP gives "" here } }); // // TUPLE FUNCTIONS define(new FunDefBase("Current", "<Set>.Current", "Returns the current tuple from a set during an iteration.", "ptx")); if (false) define(new FunDefBase("Item", "<Set>.Item(<String Expression>[, <String Expression>...] | <Index>)", "Returns a tuple from a set.", "mt*")); define(new FunDefBase("StrToTuple", "StrToTuple(<String Expression>)", "Constructs a tuple from a string.", "ftS") { public void unparse(Exp[] args, PrintWriter pw, ElementCallback callback) { if (callback.isPlatoMdx()) { // omit extra args (they're for us, not Plato) super.unparse(new Exp[]{args[0]}, pw, callback); } else { super.unparse(args, pw, callback); } } public Hierarchy getHierarchy(Exp[] args) { // StrToTuple(s, <Hie1>, ... <HieN>) is of type [Hie1] x // ... x [HieN]; so, for example, So // StrToTuple("[Time].[1997]", [Time]) is of type [Time]. // But if n > 1, we cannot represent the compound type, and // we return null. return (args.length == 2) ? (Hierarchy) args[1] : null; } }); // special resolver for "()" define(new ResolverBase("()", null, null, FunDef.TypeParentheses) { public FunDef resolve(Exp[] args, int[] conversionCount) { // Compare with TupleFunDef.getReturnType(). 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. if (args.length == 1) { return new ParenthesesFunDef(args[0].getType()); } else { return 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).", FunDef.TypeFunction) { protected FunDef resolve(Exp[] args, int[] conversionCount) { if (args.length < 1) { return null; } final int[] types = {Exp.CatNumeric, Exp.CatString}; 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 FunDefBase( this, FunDef.TypeFunction, type, ExpBase.getTypes(args)); } } return null; } }); 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.", FunDef.TypeCase) { protected FunDef resolve(Exp[] args, int[] conversionCount) { if (args.length < 1) { return null; } int j = 0, clauseCount = args.length / 2, mismatchingArgs = 0; int returnType = args[1].getType(); for (int i = 0; i < clauseCount; i++) { if (!canConvert(args[j++], Exp.CatLogical, 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, FunDef.TypeFunction, returnType, ExpBase.getTypes(args)) { // implement FunDef public Object evaluate(Evaluator evaluator, Exp[] args) { return evaluateCaseTest(evaluator, args); } }; } else { return null; } } Object evaluateCaseTest(Evaluator evaluator, Exp[] args) { int clauseCount = args.length / 2, j = 0; for (int i = 0; i < clauseCount; i++) { boolean logical = getBooleanArg(evaluator, args, j++); if (logical) { return getArg(evaluator, args, j); } else { j++; } } if (j < args.length) { return getArg(evaluator, args, j); // ELSE } else { return null; } } public void testCaseTestMatch(FoodMartTestCase test) { String s = test.executeExpr( "CASE WHEN 1=0 THEN \"first\" WHEN 1=1 THEN \"second\" WHEN 1=2 THEN \"third\" ELSE \"fourth\" END"); test.assertEquals("second", s); } public void testCaseTestMatchElse(FoodMartTestCase test) { String s = test.executeExpr( "CASE WHEN 1=0 THEN \"first\" ELSE \"fourth\" END"); test.assertEquals("fourth", s); } public void testCaseTestMatchNoElse(FoodMartTestCase test) { String s = test.executeExpr( "CASE WHEN 1=0 THEN \"first\" END"); test.assertEquals("(null)", s); } }); 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.", FunDef.TypeCase) { protected FunDef resolve(Exp[] args, int[] conversionCount) { if (args.length < 3) { return null; } int valueType = args[0].getType(); int returnType = args[2].getType(); int j = 0, clauseCount = (args.length - 1) / 2, 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, FunDef.TypeFunction, returnType, ExpBase.getTypes(args)) { // implement FunDef public Object evaluate(Evaluator evaluator, Exp[] args) { return evaluateCaseMatch(evaluator, args); } }; } else { return null; } } Object evaluateCaseMatch(Evaluator evaluator, Exp[] args) { int clauseCount = (args.length - 1)/ 2, 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++; } } if (j < args.length) { return getArg(evaluator, args, j); // ELSE } else { return null; } } public void testCaseMatch(FoodMartTestCase test) { String s = test.executeExpr( "CASE 2 WHEN 1 THEN \"first\" WHEN 2 THEN \"second\" WHEN 3 THEN \"third\" ELSE \"fourth\" END"); test.assertEquals("second", s); } public void testCaseMatchElse(FoodMartTestCase test) { String s = test.executeExpr( "CASE 7 WHEN 1 THEN \"first\" ELSE \"fourth\" END"); test.assertEquals("fourth", s); } public void testCaseMatchNoElse(FoodMartTestCase test) { String s = test.executeExpr( "CASE 8 WHEN 0 THEN \"first\" END"); test.assertEquals("(null)", s); } }); define(new ResolverBase( "Properties", "<Member>.Properties(<String Expression>)", "Returns the value of a member property.", FunDef.TypeMethod) { public FunDef resolve(Exp[] args, int[] conversionCount) { final int[] argTypes = new int[]{Exp.CatMember, Exp.CatString | Exp.CatExpression}; if (args.length != 2 || args[0].getType() != Exp.CatMember || args[1].getType() != Exp.CatString) { return null; } int returnType; if (args[1] instanceof Literal) { String propertyName = (String) ((Literal) args[1]).getValue(); Hierarchy hierarchy = args[0].getHierarchy(); Level[] levels = hierarchy.getLevels(); Property property = lookupProperty( levels[levels.length - 1], propertyName); if (property == null) { // we'll likely get a runtime error returnType = Exp.CatValue; } else { switch (property.getType()) { case Property.TYPE_BOOLEAN: returnType = Exp.CatLogical; break; case Property.TYPE_NUMERIC: returnType = Exp.CatNumeric; break; case Property.TYPE_STRING: returnType = Exp.CatString; break; default: throw Util.newInternal("Unknown property type " + property.getType()); } } } else { returnType = Exp.CatValue; } return new PropertiesFunDef(name, signature, description, syntacticType, returnType, argTypes); } public void testPropertiesExpr(FoodMartTestCase test) { String s = test.executeExpr( "[Store].[USA].[CA].[Beverly Hills].[Store 6].Properties(\"Store Type\")"); test.assertEquals("Gourmet Supermarket", s); } /** Tests that non-existent property throws an error. **/ public void testPropertiesNonExistent(FoodMartTestCase test) { test.assertExprThrows( "[Store].[USA].[CA].[Beverly Hills].[Store 6].Properties(\"Foo\")", "Property 'Foo' is not valid for"); } public void testPropertiesFilter(FoodMartTestCase test) { Result result = test.execute( "SELECT { [Store Sales] } ON COLUMNS," + nl + " TOPCOUNT( Filter( [Store].[Store Name].Members," + nl + " [Store].CurrentMember.Properties(\"Store Type\") = \"Supermarket\" )," + nl + " 10, [Store Sales]) ON ROWS" + nl + "FROM [Sales]"); test.assertEquals(8, result.getAxes()[1].positions.length); } public void testPropertyInCalculatedMember(FoodMartTestCase test) { Result result = test.execute( "WITH MEMBER [Measures].[Store Sales per Sqft]" + nl + "AS '[Measures].[Store Sales] / " + " [Store].CurrentMember.Properties(\"Store Sqft\")'" + nl + "SELECT " + nl + " {[Measures].[Unit Sales], [Measures].[Store Sales per Sqft]} ON COLUMNS," + nl + " {[Store].[Store Name].members} ON ROWS" + nl + "FROM Sales"); Member member; Cell cell; member = result.getAxes()[1].positions[17].members[0]; test.assertEquals("[Store].[All Stores].[USA].[WA].[Bellingham].[Store 2]", member.getUniqueName()); cell = result.getCell(new int[] {0,17}); test.assertEquals("2237.0", cell.getFormattedValue()); cell = result.getCell(new int[] {1,17}); test.assertEquals("0.16802205204566403", cell.getFormattedValue()); member = result.getAxes()[1].positions[3].members[0]; test.assertEquals("[Store].[All Stores].[Mexico].[DF].[San Andres].[Store 21]", member.getUniqueName()); cell = result.getCell(new int[] {0,3}); test.assertEquals("(null)", cell.getFormattedValue()); cell = result.getCell(new int[] {1,3}); test.assertEquals("NaN", cell.getFormattedValue()); } }); // // PARAMETER FUNCTIONS if (false) define(new FunDefBase("Parameter", "Parameter(<Name>, <Type>, <DefaultValue>, <Description>)", "Returns default value of parameter.", "f*")); if (false) define(new FunDefBase("ParamRef", "ParamRef(<Name>)", "Returns current value of parameter. If it's null, returns default.", "f*")); // // 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), o1 = getDoubleArg(evaluator, args, 1); return new Double(o0.doubleValue() + o1.doubleValue()); } public void testPlus(FoodMartTestCase test) { String s = test.executeExpr("1+2"); test.assertEquals("3.0", s); } }); define(new FunDefBase("-", "<Numeric Expression> - <Numeric Expression>", "Subtracts two numbers.", "innn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o0 = getDoubleArg(evaluator, args, 0), o1 = getDoubleArg(evaluator, args, 1); return new Double(o0.doubleValue() - o1.doubleValue()); } public void testMinus(FoodMartTestCase test) { String s = test.executeExpr("1-3"); test.assertEquals("-2.0", s); } public void testMinusAssociativity(FoodMartTestCase test) { String s = test.executeExpr("11-7-5"); // right-associative would give 11-(7-5) = 9, which is wrong test.assertEquals("-1.0", s); } }); define(new FunDefBase("*", "<Numeric Expression> * <Numeric Expression>", "Multiplies two numbers.", "innn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o0 = getDoubleArg(evaluator, args, 0), o1 = getDoubleArg(evaluator, args, 1); return new Double(o0.doubleValue() * o1.doubleValue()); } public void testMultiply(FoodMartTestCase test) { String s = test.executeExpr("4*7"); test.assertEquals("28.0", s); } public void testMultiplyPrecedence(FoodMartTestCase test) { String s = test.executeExpr("3 + 4 * 5 + 6"); test.assertEquals("29.0", s); } }); define(new FunDefBase("/", "<Numeric Expression> / <Numeric Expression>", "Divides two numbers.", "innn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o0 = getDoubleArg(evaluator, args, 0), o1 = getDoubleArg(evaluator, args, 1); Double result = new Double(o0.doubleValue() / o1.doubleValue()); return result; } // todo: use this, via reflection public double evaluate(double d1, double d2) { return d1 / d2; } public void testDivide(FoodMartTestCase test) { String s = test.executeExpr("10 / 5"); test.assertEquals("2.0", s); } public void testDivideByZero(FoodMartTestCase test) { String s = test.executeExpr("-3 / (2 - 2)"); test.assertEquals("-Infinity", s); } public void testDividePrecedence(FoodMartTestCase test) { String s = test.executeExpr("24 / 4 / 2 * 10 - -1"); test.assertEquals("31.0", s); } }); 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); return new Double(- o0.doubleValue()); } public void testUnaryMinus(FoodMartTestCase test) { String s = test.executeExpr("-3"); test.assertEquals("-3.0", s); } public void testUnaryMinusMember(FoodMartTestCase test) { String s = test.executeExpr("- ([Measures].[Unit Sales],[Gender].[F])"); test.assertEquals("-131558.0", s); } public void testUnaryMinusPrecedence(FoodMartTestCase test) { String s = test.executeExpr("1 - -10.5 * 2 -3"); test.assertEquals("19.0", s); } }); 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), o1 = getStringArg(evaluator, args, 1, null); return o0 + o1; } public void testStringConcat(FoodMartTestCase test) { String s = test.executeExpr(" \"foo\" || \"bar\" "); test.assertEquals("foobar", s); } public void testStringConcat2(FoodMartTestCase test) { String s = test.executeExpr(" \"foo\" || [Gender].[M].Name || \"\" "); test.assertEquals("fooM", s); } }); define(new FunDefBase("AND", "<Logical Expression> AND <Logical Expression>", "Returns the conjunction of two conditions.", "ibbb") { public Object evaluate(Evaluator evaluator, Exp[] args) { return toBoolean( getBooleanArg(evaluator, args, 0) && getBooleanArg(evaluator, args, 1)); } public void testAnd(FoodMartTestCase test) { String s = test.executeBooleanExpr(" 1=1 AND 2=2 "); test.assertEquals("true", s); } public void testAnd2(FoodMartTestCase test) { String s = test.executeBooleanExpr(" 1=1 AND 2=0 "); test.assertEquals("false", s); } }); define(new FunDefBase("OR", "<Logical Expression> OR <Logical Expression>", "Returns the disjunction of two conditions.", "ibbb") { public Object evaluate(Evaluator evaluator, Exp[] args) { // Only evaluate 2nd if first is false. return toBoolean( getBooleanArg(evaluator, args, 0) || getBooleanArg(evaluator, args, 1)); } public void testOr(FoodMartTestCase test) { String s = test.executeBooleanExpr(" 1=0 OR 2=0 "); test.assertEquals("false", s); } public void testOr2(FoodMartTestCase test) { String s = test.executeBooleanExpr(" 1=0 OR 0=0 "); test.assertEquals("true", s); } public void testOrAssociativity1(FoodMartTestCase test) { String s = test.executeBooleanExpr(" 1=1 AND 1=0 OR 1=1 "); // Would give 'false' if OR were stronger than AND (wrong!) test.assertEquals("true", s); } public void testOrAssociativity2(FoodMartTestCase test) { String s = test.executeBooleanExpr(" 1=1 OR 1=0 AND 1=1 "); // Would give 'false' if OR were stronger than AND (wrong!) test.assertEquals("true", s); } public void testOrAssociativity3(FoodMartTestCase test) { String s = test.executeBooleanExpr(" (1=0 OR 1=1) AND 1=1 "); test.assertEquals("true", s); } }); define(new FunDefBase("XOR", "<Logical Expression> XOR <Logical Expression>", "Returns whether two conditions are mutually exclusive.", "ibbb") { public Object evaluate(Evaluator evaluator, Exp[] args) { final boolean b0 = getBooleanArg(evaluator, args, 0); final boolean b1 = getBooleanArg(evaluator, args, 1); return toBoolean(b0 != b1); } public void testXor(FoodMartTestCase test) { String s = test.executeBooleanExpr(" 1=1 XOR 2=2 "); test.assertEquals("false", s); } public void testXorAssociativity(FoodMartTestCase test) { // Would give 'false' if XOR were stronger than AND (wrong!) String s = test.executeBooleanExpr(" 1 = 1 AND 1 = 1 XOR 1 = 0 "); test.assertEquals("true", s); } }); define(new FunDefBase("NOT", "NOT <Logical Expression>", "Returns the negation of a condition.", "Pbb") { public Object evaluate(Evaluator evaluator, Exp[] args) { return toBoolean(!getBooleanArg(evaluator, args, 0)); } public void testNot(FoodMartTestCase test) { String s = test.executeBooleanExpr(" NOT 1=1 "); test.assertEquals("false", s); } public void testNotNot(FoodMartTestCase test) { String s = test.executeBooleanExpr(" NOT NOT 1=1 "); test.assertEquals("true", s); } public void testNotAssociativity(FoodMartTestCase test) { String s = test.executeBooleanExpr(" 1=1 AND NOT 1=1 OR NOT 1=1 AND 1=1 "); test.assertEquals("false", s); } }); 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), o1 = getStringArg(evaluator, args, 1, null); return toBoolean(o0.equals(o1)); } public void testStringEquals(FoodMartTestCase test) { String s = test.executeBooleanExpr(" \"foo\" = \"bar\" "); test.assertEquals("false", s); } public void testStringEqualsAssociativity(FoodMartTestCase test) { String s = test.executeBooleanExpr(" \"foo\" = \"fo\" || \"o\" "); test.assertEquals("true", s); } public void testStringEqualsEmpty(FoodMartTestCase test) { String s = test.executeBooleanExpr(" \"\" = \"\" "); test.assertEquals("true", s); } }); 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), o1 = getDoubleArg(evaluator, args, 1); return toBoolean(o0.equals(o1)); } public void testEq(FoodMartTestCase test) { String s = test.executeBooleanExpr(" 1.0 = 1 "); test.assertEquals("true", s); } }); 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), o1 = getStringArg(evaluator, args, 1, null); return toBoolean(!o0.equals(o1)); } public void testStringNe(FoodMartTestCase test) { String s = test.executeBooleanExpr(" \"foo\" <> \"bar\" "); test.assertEquals("true", s); } }); 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), o1 = getDoubleArg(evaluator, args, 1); return toBoolean(!o0.equals(o1)); } public void testNe(FoodMartTestCase test) { String s = test.executeBooleanExpr(" 2 <> 1.0 + 1.0 "); test.assertEquals("false", s); } public void testNeInfinity(FoodMartTestCase test) { String s = test.executeBooleanExpr("(1 / 0) <> (1 / 0)"); // Infinity does not equal itself test.assertEquals("false", s); } }); 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), o1 = getDoubleArg(evaluator, args, 1); return toBoolean(o0.compareTo(o1) < 0); } public void testLt(FoodMartTestCase test) { String s = test.executeBooleanExpr(" 2 < 1.0 + 1.0 "); test.assertEquals("false", s); } }); 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), o1 = getDoubleArg(evaluator, args, 1); return toBoolean(o0.compareTo(o1) <= 0); } public void testLe(FoodMartTestCase test) { String s = test.executeBooleanExpr(" 2 <= 1.0 + 1.0 "); test.assertEquals("true", s); } }); 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), o1 = getDoubleArg(evaluator, args, 1); return toBoolean(o0.compareTo(o1) > 0); } public void testGt(FoodMartTestCase test) { String s = test.executeBooleanExpr(" 2 > 1.0 + 1.0 "); test.assertEquals("false", s); } }); 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), o1 = getDoubleArg(evaluator, args, 1); return toBoolean(o0.compareTo(o1) >= 0); } public void testGe(FoodMartTestCase test) { String s = test.executeBooleanExpr(" 2 > 1.0 + 1.0 "); test.assertEquals("false", s); } }); }
4891 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4891/a99d355f461b0b321c9fb36c2ea44764ce9dfb05/BuiltinFunTable.java/clean/src/main/mondrian/olap/fun/BuiltinFunTable.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1117, 918, 4426, 7503, 1435, 288, 202, 202, 759, 1122, 1149, 30, 293, 33, 1396, 16, 312, 33, 1305, 16, 277, 33, 382, 904, 16, 453, 33, 2244, 202, 202, 759, 576, 4880, 30, 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, 1117, 918, 4426, 7503, 1435, 288, 202, 202, 759, 1122, 1149, 30, 293, 33, 1396, 16, 312, 33, 1305, 16, 277, 33, 382, 904, 16, 453, 33, 2244, 202, 202, 759, 576, 4880, 30, 202, ...
char ch;
char ch;
DERUTF8String( byte[] string) { int i = 0; int length = 0; while (i < string.length) { length++; if ((string[i] & 0xe0) == 0xe0) { i += 3; } else if ((string[i] & 0xc0) == 0xc0) { i += 2; } else { i += 1; } } char[] cs = new char[length]; i = 0; length = 0; while (i < string.length) { char ch; if ((string[i] & 0xe0) == 0xe0) { ch = (char)(((string[i] & 0x1f) << 12) | ((string[i + 1] & 0x3f) << 6) | (string[i + 2] & 0x3f)); i += 3; } else if ((string[i] & 0xc0) == 0xc0) { ch = (char)(((string[i] & 0x3f) << 6) | (string[i + 1] & 0x3f)); i += 2; } else { ch = (char)(string[i] & 0xff); i += 1; } cs[length++] = ch; } this.string = new String(cs); }
53000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53000/b112da6f2b9bc0b03599d0c4f87783cab94c1bf3/DERUTF8String.java/buggy/crypto/src/org/bouncycastle/asn1/DERUTF8String.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 21801, 5159, 28, 780, 12, 3639, 1160, 8526, 282, 533, 13, 565, 288, 3639, 509, 277, 273, 374, 31, 3639, 509, 769, 273, 374, 31, 3639, 1323, 261, 77, 411, 533, 18, 2469, 13, 3639, 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, 21801, 5159, 28, 780, 12, 3639, 1160, 8526, 282, 533, 13, 565, 288, 3639, 509, 277, 273, 374, 31, 3639, 509, 769, 273, 374, 31, 3639, 1323, 261, 77, 411, 533, 18, 2469, 13, 3639, 288,...
AST tmp2304_AST_in = (AST)_t;
AST tmp2308_AST_in = (AST)_t;
public final void function_param_arg(AST _t) throws RecognitionException { AST function_param_arg_AST_in = (_t == ASTNULL) ? null : (AST)_t; if (_t==null) _t=ASTNULL; switch ( _t.getType()) { case TABLE: { AST tmp2298_AST_in = (AST)_t; match(_t,TABLE); _t = _t.getNextSibling(); { if (_t==null) _t=ASTNULL; switch ( _t.getType()) { case FOR: { AST tmp2299_AST_in = (AST)_t; match(_t,FOR); _t = _t.getNextSibling(); break; } case RECORD_NAME: { break; } default: { throw new NoViableAltException(_t); } } } AST tmp2300_AST_in = (AST)_t; match(_t,RECORD_NAME); _t = _t.getNextSibling(); { if (_t==null) _t=ASTNULL; switch ( _t.getType()) { case APPEND: { AST tmp2301_AST_in = (AST)_t; match(_t,APPEND); _t = _t.getNextSibling(); break; } case 3: case BIND: { break; } default: { throw new NoViableAltException(_t); } } } { if (_t==null) _t=ASTNULL; switch ( _t.getType()) { case BIND: { AST tmp2302_AST_in = (AST)_t; match(_t,BIND); _t = _t.getNextSibling(); break; } case 3: { break; } default: { throw new NoViableAltException(_t); } } } break; } case TABLEHANDLE: { AST tmp2303_AST_in = (AST)_t; match(_t,TABLEHANDLE); _t = _t.getNextSibling(); { if (_t==null) _t=ASTNULL; switch ( _t.getType()) { case FOR: { AST tmp2304_AST_in = (AST)_t; match(_t,FOR); _t = _t.getNextSibling(); break; } case ID: { break; } default: { throw new NoViableAltException(_t); } } } AST tmp2305_AST_in = (AST)_t; match(_t,ID); _t = _t.getNextSibling(); { if (_t==null) _t=ASTNULL; switch ( _t.getType()) { case APPEND: { AST tmp2306_AST_in = (AST)_t; match(_t,APPEND); _t = _t.getNextSibling(); break; } case 3: case BIND: { break; } default: { throw new NoViableAltException(_t); } } } { if (_t==null) _t=ASTNULL; switch ( _t.getType()) { case BIND: { AST tmp2307_AST_in = (AST)_t; match(_t,BIND); _t = _t.getNextSibling(); break; } case 3: { break; } default: { throw new NoViableAltException(_t); } } } break; } case DATASET: case DATASETHANDLE: { { if (_t==null) _t=ASTNULL; switch ( _t.getType()) { case DATASET: { AST tmp2308_AST_in = (AST)_t; match(_t,DATASET); _t = _t.getNextSibling(); break; } case DATASETHANDLE: { AST tmp2309_AST_in = (AST)_t; match(_t,DATASETHANDLE); _t = _t.getNextSibling(); break; } default: { throw new NoViableAltException(_t); } } } AST tmp2310_AST_in = (AST)_t; match(_t,ID); _t = _t.getNextSibling(); { if (_t==null) _t=ASTNULL; switch ( _t.getType()) { case APPEND: { AST tmp2311_AST_in = (AST)_t; match(_t,APPEND); _t = _t.getNextSibling(); break; } case 3: case BIND: { break; } default: { throw new NoViableAltException(_t); } } } { if (_t==null) _t=ASTNULL; switch ( _t.getType()) { case BIND: { AST tmp2312_AST_in = (AST)_t; match(_t,BIND); _t = _t.getNextSibling(); break; } case 3: { break; } default: { throw new NoViableAltException(_t); } } } break; } case CHARACTER: case COMHANDLE: case DATE: case DECIMAL: case HANDLE: case INTEGER: case LOGICAL: case MEMPTR: case RAW: case RECID: case ROWID: case WIDGETHANDLE: case ID: case DATETIME: case DATETIMETZ: case LONGCHAR: case CLASS: case TYPE_NAME: { { if (_t==null) _t=ASTNULL; switch ( _t.getType()) { case ID: { AST tmp2313_AST_in = (AST)_t; match(_t,ID); _t = _t.getNextSibling(); AST tmp2314_AST_in = (AST)_t; match(_t,AS); _t = _t.getNextSibling(); break; } case CHARACTER: case COMHANDLE: case DATE: case DECIMAL: case HANDLE: case INTEGER: case LOGICAL: case MEMPTR: case RAW: case RECID: case ROWID: case WIDGETHANDLE: case DATETIME: case DATETIMETZ: case LONGCHAR: case CLASS: case TYPE_NAME: { break; } default: { throw new NoViableAltException(_t); } } } { if (_t==null) _t=ASTNULL; switch ( _t.getType()) { case CLASS: { AST tmp2315_AST_in = (AST)_t; match(_t,CLASS); _t = _t.getNextSibling(); AST tmp2316_AST_in = (AST)_t; match(_t,TYPE_NAME); _t = _t.getNextSibling(); break; } case CHARACTER: case COMHANDLE: case DATE: case DECIMAL: case HANDLE: case INTEGER: case LOGICAL: case MEMPTR: case RAW: case RECID: case ROWID: case WIDGETHANDLE: case DATETIME: case DATETIMETZ: case LONGCHAR: case TYPE_NAME: { datatype_var(_t); _t = _retTree; break; } default: { throw new NoViableAltException(_t); } } } { if (_t==null) _t=ASTNULL; switch ( _t.getType()) { case EXTENT: { extentphrase(_t); _t = _retTree; break; } case 3: { break; } default: { throw new NoViableAltException(_t); } } } break; } default: { throw new NoViableAltException(_t); } } _retTree = _t; }
13952 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/13952/daa15e07422d3491bbbb4d0060450c81983332a4/JPTreeParser.java/clean/trunk/org.prorefactor.core/src/org/prorefactor/treeparserbase/JPTreeParser.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 727, 918, 445, 67, 891, 67, 3175, 12, 9053, 389, 88, 13, 1216, 9539, 288, 9506, 202, 9053, 445, 67, 891, 67, 3175, 67, 9053, 67, 267, 273, 261, 67, 88, 422, 9183, 8560, 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, 225, 202, 482, 727, 918, 445, 67, 891, 67, 3175, 12, 9053, 389, 88, 13, 1216, 9539, 288, 9506, 202, 9053, 445, 67, 891, 67, 3175, 67, 9053, 67, 267, 273, 261, 67, 88, 422, 9183, 8560, 13...
.getVariable(ISources.ACTIVE_EDITOR_ID_NAME);
.getVariable(ISources.ACTIVE_PART_ID_NAME);
public final EvaluationResult evaluate(final IEvaluationContext context) { final Object variable = context .getVariable(ISources.ACTIVE_EDITOR_ID_NAME); if (equals(activeEditorId, variable)) { return EvaluationResult.TRUE; } return EvaluationResult.FALSE; }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/d132108e69466607a0398e6a591928187ac79730/LegacyEditorActionBarExpression.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/expressions/LegacyEditorActionBarExpression.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 727, 17340, 1253, 5956, 12, 6385, 467, 13468, 1042, 819, 13, 288, 202, 202, 6385, 1033, 2190, 273, 819, 9506, 202, 18, 588, 3092, 12, 5127, 1418, 18, 13301, 67, 13208, 67, 734...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 17340, 1253, 5956, 12, 6385, 467, 13468, 1042, 819, 13, 288, 202, 202, 6385, 1033, 2190, 273, 819, 9506, 202, 18, 588, 3092, 12, 5127, 1418, 18, 13301, 67, 13208, 67, 734...
forceInsertText(_document.getDocLength(), _prompt, DEFAULT_STYLE); _promptPos = _document.getDocLength();
forceInsertText(_document.getLength(), _prompt, DEFAULT_STYLE); _promptPos = _document.getLength();
public void insertPrompt() { acquireWriteLock(); try {// append(_prompt, DEFAULT_STYLE); // need forceAppend!// _promptPos = _document.getDocLength();// _hasPrompt = true; forceInsertText(_document.getDocLength(), _prompt, DEFAULT_STYLE); _promptPos = _document.getDocLength(); _hasPrompt = true; } catch (DocumentAdapterException e) { throw new UnexpectedException(e); } finally { releaseWriteLock(); } }
11192 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/11192/9ee7f82d7f7234787f3748460b46ad8c5d1fc967/ConsoleDocument.java/buggy/drjava/src/edu/rice/cs/drjava/model/repl/ConsoleDocument.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 918, 2243, 15967, 1435, 288, 565, 10533, 3067, 2531, 5621, 565, 775, 288, 759, 1377, 714, 24899, 13325, 16, 3331, 67, 15066, 1769, 225, 368, 1608, 2944, 5736, 5, 759, 1377, 389, 133...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2243, 15967, 1435, 288, 565, 10533, 3067, 2531, 5621, 565, 775, 288, 759, 1377, 714, 24899, 13325, 16, 3331, 67, 15066, 1769, 225, 368, 1608, 2944, 5736, 5, 759, 1377, 389, 133...
final Map partitioners= TextUtilities.removeDocumentPartitioners(document);
public void format() { super.format(); Assert.isLegal(fPartitions.size() > 0); final IDocument document= getViewer().getDocument(); final TypedPosition position= (TypedPosition)fPartitions.removeFirst(); try { final ITypedRegion partition= TextUtilities.getPartition(document, fFormatter.getDocumentPartitioning(), position.getOffset()); final String type= partition.getType(); position.offset= partition.getOffset(); position.length= partition.getLength(); final Map preferences= getPreferences(); final boolean format= preferences.get(PreferenceConstants.FORMATTER_COMMENT_FORMAT) == IPreferenceStore.TRUE; final boolean header= preferences.get(PreferenceConstants.FORMATTER_COMMENT_FORMATHEADER) == IPreferenceStore.TRUE; if (format && (header || position.getOffset() != 0 || !type.equals(IJavaPartitions.JAVA_DOC))) { final CommentRegion region= CommentObjectFactory.createRegion(this, position, TextUtilities.getDefaultLineDelimiter(document)); final String indentation= getLineIndentation(document, region, position.getOffset()); final Map partitioners= TextUtilities.removeDocumentPartitioners(document); region.format(indentation); TextUtilities.addDocumentPartitioners(document, partitioners); } } catch (BadLocationException exception) { // Should not happen } }
9698 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/9698/d038e84d98301bf45fde1532d757c5749135b675/CommentFormattingStrategy.java/buggy/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/comment/CommentFormattingStrategy.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 740, 1435, 288, 202, 202, 9565, 18, 2139, 5621, 202, 202, 8213, 18, 291, 30697, 12, 74, 13738, 18, 1467, 1435, 405, 374, 1769, 202, 202, 6385, 1599, 504, 650, 1668, 33, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 740, 1435, 288, 202, 202, 9565, 18, 2139, 5621, 202, 202, 8213, 18, 291, 30697, 12, 74, 13738, 18, 1467, 1435, 405, 374, 1769, 202, 202, 6385, 1599, 504, 650, 1668, 33, ...
for( i = 0; i < 16; i++ ) if( inUse16[ i ] ) for( j = 0; j < 16; j++ ) if( inUse[ i * 16 + j ] )
} } for( i = 0; i < 16; i++ ) { if( inUse16[ i ] ) { for( j = 0; j < 16; j++ ) { if( inUse[ i * 16 + j ] ) {
private void sendMTFValues() throws IOException { char len[][] = new char[ N_GROUPS ][ MAX_ALPHA_SIZE ]; int v; int t; int i; int j; int gs; int ge; int totc; int bt; int bc; int iter; int nSelectors = 0; int alphaSize; int minLen; int maxLen; int selCtr; int nGroups; int nBytes; alphaSize = nInUse + 2; for( t = 0; t < N_GROUPS; t++ ) for( v = 0; v < alphaSize; v++ ) len[ t ][ v ] = (char)GREATER_ICOST; /* * Decide how many coding tables to use */ if( nMTF <= 0 ) panic(); if( nMTF < 200 ) nGroups = 2; else if( nMTF < 600 ) nGroups = 3; else if( nMTF < 1200 ) nGroups = 4; else if( nMTF < 2400 ) nGroups = 5; else nGroups = 6; { /* * Generate an initial set of coding tables */ int nPart; int remF; int tFreq; int aFreq; nPart = nGroups; remF = nMTF; gs = 0; while( nPart > 0 ) { tFreq = remF / nPart; ge = gs - 1; aFreq = 0; while( aFreq < tFreq && ge < alphaSize - 1 ) { ge++; aFreq += mtfFreq[ ge ]; } if( ge > gs && nPart != nGroups && nPart != 1 && ( ( nGroups - nPart ) % 2 == 1 ) ) { aFreq -= mtfFreq[ ge ]; ge--; } for( v = 0; v < alphaSize; v++ ) if( v >= gs && v <= ge ) len[ nPart - 1 ][ v ] = (char)LESSER_ICOST; else len[ nPart - 1 ][ v ] = (char)GREATER_ICOST; nPart--; gs = ge + 1; remF -= aFreq; } } int rfreq[][] = new int[ N_GROUPS ][ MAX_ALPHA_SIZE ]; int fave[] = new int[ N_GROUPS ]; short cost[] = new short[ N_GROUPS ]; /* * Iterate up to N_ITERS times to improve the tables. */ for( iter = 0; iter < N_ITERS; iter++ ) { for( t = 0; t < nGroups; t++ ) fave[ t ] = 0; for( t = 0; t < nGroups; t++ ) for( v = 0; v < alphaSize; v++ ) rfreq[ t ][ v ] = 0; nSelectors = 0; totc = 0; gs = 0; while( true ) { /* * Set group start & end marks. */ if( gs >= nMTF ) break; ge = gs + G_SIZE - 1; if( ge >= nMTF ) ge = nMTF - 1; /* * Calculate the cost of this group as coded * by each of the coding tables. */ for( t = 0; t < nGroups; t++ ) cost[ t ] = 0; if( nGroups == 6 ) { short cost0; short cost1; short cost2; short cost3; short cost4; short cost5; cost0 = cost1 = cost2 = cost3 = cost4 = cost5 = 0; for( i = gs; i <= ge; i++ ) { short icv = szptr[ i ]; cost0 += len[ 0 ][ icv ]; cost1 += len[ 1 ][ icv ]; cost2 += len[ 2 ][ icv ]; cost3 += len[ 3 ][ icv ]; cost4 += len[ 4 ][ icv ]; cost5 += len[ 5 ][ icv ]; } cost[ 0 ] = cost0; cost[ 1 ] = cost1; cost[ 2 ] = cost2; cost[ 3 ] = cost3; cost[ 4 ] = cost4; cost[ 5 ] = cost5; } else { for( i = gs; i <= ge; i++ ) { short icv = szptr[ i ]; for( t = 0; t < nGroups; t++ ) cost[ t ] += len[ t ][ icv ]; } } /* * Find the coding table which is best for this group, * and record its identity in the selector table. */ bc = 999999999; bt = -1; for( t = 0; t < nGroups; t++ ) if( cost[ t ] < bc ) { bc = cost[ t ]; bt = t; } ; totc += bc; fave[ bt ]++; selector[ nSelectors ] = (char)bt; nSelectors++; /* * Increment the symbol frequencies for the selected table. */ for( i = gs; i <= ge; i++ ) rfreq[ bt ][ szptr[ i ] ]++; gs = ge + 1; } /* * Recompute the tables based on the accumulated frequencies. */ for( t = 0; t < nGroups; t++ ) hbMakeCodeLengths( len[ t ], rfreq[ t ], alphaSize, 20 ); } rfreq = null; fave = null; cost = null; if( !( nGroups < 8 ) ) panic(); if( !( nSelectors < 32768 && nSelectors <= ( 2 + ( 900000 / G_SIZE ) ) ) ) panic(); { /* * Compute MTF values for the selectors. */ char pos[] = new char[ N_GROUPS ]; char ll_i; char tmp2; char tmp; for( i = 0; i < nGroups; i++ ) pos[ i ] = (char)i; for( i = 0; i < nSelectors; i++ ) { ll_i = selector[ i ]; j = 0; tmp = pos[ j ]; while( ll_i != tmp ) { j++; tmp2 = tmp; tmp = pos[ j ]; pos[ j ] = tmp2; } pos[ 0 ] = tmp; selectorMtf[ i ] = (char)j; } } int code[][] = new int[ N_GROUPS ][ MAX_ALPHA_SIZE ]; /* * Assign actual codes for the tables. */ for( t = 0; t < nGroups; t++ ) { minLen = 32; maxLen = 0; for( i = 0; i < alphaSize; i++ ) { if( len[ t ][ i ] > maxLen ) maxLen = len[ t ][ i ]; if( len[ t ][ i ] < minLen ) minLen = len[ t ][ i ]; } if( maxLen > 20 ) panic(); if( minLen < 1 ) panic(); hbAssignCodes( code[ t ], len[ t ], minLen, maxLen, alphaSize ); } { /* * Transmit the mapping table. */ boolean inUse16[] = new boolean[ 16 ]; for( i = 0; i < 16; i++ ) { inUse16[ i ] = false; for( j = 0; j < 16; j++ ) if( inUse[ i * 16 + j ] ) inUse16[ i ] = true; } nBytes = bytesOut; for( i = 0; i < 16; i++ ) if( inUse16[ i ] ) bsW( 1, 1 ); else bsW( 1, 0 ); for( i = 0; i < 16; i++ ) if( inUse16[ i ] ) for( j = 0; j < 16; j++ ) if( inUse[ i * 16 + j ] ) bsW( 1, 1 ); else bsW( 1, 0 ); } /* * Now the selectors. */ nBytes = bytesOut; bsW( 3, nGroups ); bsW( 15, nSelectors ); for( i = 0; i < nSelectors; i++ ) { for( j = 0; j < selectorMtf[ i ]; j++ ) bsW( 1, 1 ); bsW( 1, 0 ); } /* * Now the coding tables. */ nBytes = bytesOut; for( t = 0; t < nGroups; t++ ) { int curr = len[ t ][ 0 ]; bsW( 5, curr ); for( i = 0; i < alphaSize; i++ ) { while( curr < len[ t ][ i ] ) { bsW( 2, 2 ); curr++; /* * 10 */ } while( curr > len[ t ][ i ] ) { bsW( 2, 3 ); curr--; /* * 11 */ } bsW( 1, 0 ); } } /* * And finally, the block data proper */ nBytes = bytesOut; selCtr = 0; gs = 0; while( true ) { if( gs >= nMTF ) break; ge = gs + G_SIZE - 1; if( ge >= nMTF ) ge = nMTF - 1; for( i = gs; i <= ge; i++ ) { bsW( len[ selector[ selCtr ] ][ szptr[ i ] ], code[ selector[ selCtr ] ][ szptr[ i ] ] ); } gs = ge + 1; selCtr++; } if( !( selCtr == nSelectors ) ) panic(); }
639 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/639/8ce1de2178a0422105fa437c327b49fb5637ff28/CBZip2OutputStream.java/buggy/proposal/myrmidon/src/java/org/apache/aut/bzip2/CBZip2OutputStream.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 918, 1366, 6152, 42, 1972, 1435, 3639, 1216, 1860, 565, 288, 3639, 1149, 562, 63, 6362, 65, 273, 394, 1149, 63, 423, 67, 28977, 308, 63, 4552, 67, 26313, 67, 4574, 308, 31, 3639, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1366, 6152, 42, 1972, 1435, 3639, 1216, 1860, 565, 288, 3639, 1149, 562, 63, 6362, 65, 273, 394, 1149, 63, 423, 67, 28977, 308, 63, 4552, 67, 26313, 67, 4574, 308, 31, 3639, ...