rem
stringlengths
1
226k
add
stringlengths
0
227k
context
stringlengths
6
326k
meta
stringlengths
143
403
input_ids
listlengths
256
256
attention_mask
listlengths
256
256
labels
listlengths
128
128
list.add(folders[i].getName());
list.add(folders[i]);
public static List getAllFolders(Store store) throws Exception { List list = new ArrayList(); Folder root = store.getDefaultFolder(); try { Folder [] folders = root.list(); for (int i = 0; i < folders.length; i++) { if ((folders[i].getType() & Folder.HOLDS_MESSAGES) != 0) { list.add(folders[i].getName()); } else { // TODO: add ability to have a hierarchy of folders } } } finally { if (root != null && root.isOpen()) { root.close(false); } } return list; }
53908 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53908/1d7c14a30ca007caff6f30e9dcdfd39099f1fe3c/MailUtil.java/clean/portal-ejb/src/com/liferay/portlet/mailbox/util/MailUtil.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 760, 987, 5514, 14885, 12, 2257, 1707, 13, 3196, 202, 15069, 1185, 288, 9506, 202, 682, 666, 273, 394, 2407, 5621, 202, 202, 3899, 1365, 273, 1707, 18, 588, 1868, 3899, 5621, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 760, 987, 5514, 14885, 12, 2257, 1707, 13, 3196, 202, 15069, 1185, 288, 9506, 202, 682, 666, 273, 394, 2407, 5621, 202, 202, 3899, 1365, 273, 1707, 18, 588, 1868, 3899, 5621, ...
fset.set(file);
if (checkFlexibleDates) { fset.set(file); }
public static void main(String[] args) { double deltaTime = System.currentTimeMillis(); UOption.parseArgs(args, options); String factoryFilter = options[FILE_FILTER].value; String checkFilter = options[TEST_FILTER].value; SHOW_EXAMPLES = options[EXAMPLES].doesOccur; // eg .*Collision.* boolean checkFlexibleDates = options[DATE_FORMATS].doesOccur; Level coverageLevel = Level.UNDETERMINED; String coverageLevelInput = options[COVERAGE].value; if (coverageLevelInput != null) coverageLevel = Level.get(coverageLevelInput); System.out.println("factoryFilter: " + factoryFilter); System.out.println("test filter: " + checkFilter); System.out.println("show examples: " + SHOW_EXAMPLES); System.out.println("coverage level: " + coverageLevel); // set up the test Factory cldrFactory = CLDRFile.Factory.make(Utility.MAIN_DIRECTORY, factoryFilter); CheckCLDR checkCldr = getCheckAll(checkFilter); setDisplayInformation(cldrFactory.make("en", true)); // call on the files Set locales = cldrFactory.getAvailable(); List result = new ArrayList(); Set paths = new TreeSet(CLDRFile.ldmlComparator); Map m = new TreeMap(); double testNumber = 0; Map options = new HashMap(); Counter totalCount = new Counter(); Counter subtotalCount = new Counter(); FlexibleSet fset = new FlexibleSet(); for (Iterator it = locales.iterator(); it.hasNext();) { String localeID = (String) it.next(); if (CLDRFile.isSupplementalName(localeID)) continue; if (SHOW_LOCALE) System.out.println("Locale:\t" + getLocaleAndName(localeID) + "\t"); boolean onlyLanguageLocale = localeID.equals(new LocaleIDParser().set(localeID).getLanguageScript()); options.clear(); if (!onlyLanguageLocale) options.put("CheckCoverage.skip","true"); options.put("CheckCoverage.requiredLevel", coverageLevel.toString()); //options.put("CheckCoverage.requiredLevel","comprehensive"); CLDRFile file = cldrFactory.make(localeID, onlyLanguageLocale); checkCldr.setCldrFileToCheck(file, options, result); for (Iterator it3 = result.iterator(); it3.hasNext();) { System.out.print("Locale:\t" + getLocaleAndName(localeID) + "\t"); System.out.println(it3.next().toString()); } paths.clear(); CollectionUtilities.addAll(file.iterator(), paths); UnicodeSet missingExemplars = new UnicodeSet(); subtotalCount.clear(); fset.set(file); for (Iterator it2 = paths.iterator(); it2.hasNext();) { String path = (String) it2.next(); String value = file.getStringValue(path); String fullPath = file.getFullXPath(path); if (checkFlexibleDates) { fset.checkFlexibles(path, value, fullPath); } checkCldr.check(path, fullPath, value, options, result); for (Iterator it3 = result.iterator(); it3.hasNext();) { CheckStatus status = (CheckStatus) it3.next(); if (status.getType().equals(status.exampleType)) { if (!SHOW_EXAMPLES) continue; System.out.print("Locale:\t" + getLocaleAndName(localeID) + "\t"); System.out.println("\t" + status); System.out.print("Locale:\t" + getLocaleAndName(localeID) + "\t"); System.out.println(status.getHTMLMessage()); SimpleDemo d = status.getDemo(); if (d != null && d instanceof FormatDemo) { FormatDemo fd = (FormatDemo)d; m.clear(); m.put("pattern", fd.getPattern()); m.put("input", fd.getRandomInput()); if (d.processPost(m)) System.out.println(m); } continue; } String statusString = status.toString(); // com.ibm.icu.impl.Utility.escape( subtotalCount.add(status.type, 1); totalCount.add(status.type, 1); System.out.print("Locale:\t" + getLocaleAndName(localeID) + "\t"); System.out.println("Value: " + value + "\t Full Path: " + fullPath); System.out.print("Locale:\t" + getLocaleAndName(localeID) + "\t"); System.out.println("\t" + statusString); Object[] parameters = status.getParameters(); if (parameters != null) for (int i = 0; i < parameters.length; ++i) { if (parameters[i] instanceof Throwable) { ((Throwable)parameters[i]).printStackTrace(); } if (status.getMessage().startsWith("Not in exemplars")) { missingExemplars.addAll(new UnicodeSet(parameters[i].toString())); } } // survey tool will use: if (status.hasHTMLMessage()) System.out.println(status.getHTMLMessage()); } } if (missingExemplars.size() != 0) { System.out.print("Locale:\t" + getLocaleAndName(localeID) + "\t"); System.out.println("Total missing:\t" + missingExemplars); } for (Iterator it2 = new TreeSet(subtotalCount.keySet()).iterator(); it2.hasNext();) { String type = (String)it2.next(); System.out.println("Locale:\t" + getLocaleAndName(localeID) + "\tSubtotal " + type + ":\t" + subtotalCount.getCount(type)); } fset.showFlexibles(); } for (Iterator it2 = new TreeSet(totalCount.keySet()).iterator(); it2.hasNext();) { String type = (String)it2.next(); System.out.println("Total " + type + ":\t" + totalCount.getCount(type)); } deltaTime = System.currentTimeMillis() - deltaTime; System.out.println("Elapsed: " + deltaTime/60000 + " minutes"); }
27800 /local/tlutelli/issta_data/temp/all_java2context/java/2006_temp/2006/27800/e32a6b990e9a60b13dc59a42b80ed7df38edda9a/CheckCLDR.java/clean/tools/java/org/unicode/cldr/test/CheckCLDR.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 760, 918, 2774, 12, 780, 8526, 833, 13, 288, 3639, 1645, 3622, 950, 273, 2332, 18, 2972, 28512, 5621, 3639, 587, 1895, 18, 2670, 2615, 12, 1968, 16, 702, 1769, 3639, 514, 3272...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 760, 918, 2774, 12, 780, 8526, 833, 13, 288, 3639, 1645, 3622, 950, 273, 2332, 18, 2972, 28512, 5621, 3639, 587, 1895, 18, 2670, 2615, 12, 1968, 16, 702, 1769, 3639, 514, 3272...
if (_cat.isDebugEnabled()) _cat.debug( "Pumping propertySet event with name " + e.getName() + " and source " + e.getSource());
public void propertySet(MElementEvent e) { if (_cat.isDebugEnabled()) _cat.debug( "Pumping propertySet event with name " + e.getName() + " and source " + e.getSource()); if (e.getNewValue() == null || !(e.getNewValue().equals(e.getOldValue()))) { MElementListener[] listeners = getListenerList(e); for (int i = 0; i < listeners.length; i++) { listeners[i].propertySet(e); } } }
7166 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7166/fae020294552f14e03f65923bdd5eaa012d69781/UmlModelEventPump.java/clean/src_new/org/argouml/model/uml/UmlModelEventPump.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1272, 694, 12, 12310, 1133, 425, 13, 288, 3639, 309, 261, 67, 2574, 18, 291, 2829, 1526, 10756, 5411, 389, 2574, 18, 4148, 12, 7734, 315, 52, 379, 1382, 1272, 694, 871, 598, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1272, 694, 12, 12310, 1133, 425, 13, 288, 3639, 309, 261, 67, 2574, 18, 291, 2829, 1526, 10756, 5411, 389, 2574, 18, 4148, 12, 7734, 315, 52, 379, 1382, 1272, 694, 871, 598, ...
public void visitMethodCallExpression(@NotNull PsiMethodCallExpression expression) { super.visitMethodCallExpression(expression); final PsiReferenceExpression methodExpression = expression.getMethodExpression(); if (methodExpression == null) { return; } if (!isThreadSetPriority(expression)) { return; } registerMethodCallError(expression); }
public void visitMethodCallExpression( @NotNull PsiMethodCallExpression methodCallExpression) { super.visitMethodCallExpression(methodCallExpression); if (!isThreadSetPriority(methodCallExpression)) { return; } if (hasNormalPriorityArgument(methodCallExpression)) { return; } registerMethodCallError(methodCallExpression); }
public void visitMethodCallExpression(@NotNull PsiMethodCallExpression expression) { super.visitMethodCallExpression(expression); final PsiReferenceExpression methodExpression = expression.getMethodExpression(); if (methodExpression == null) { return; } if (!isThreadSetPriority(expression)) { return; } registerMethodCallError(expression); }
17306 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/17306/6ed3ce6a1bf3ab9ddd19b09193cb224e390b047c/ThreadPriorityInspection.java/clean/plugins/InspectionGadgets/src/com/siyeh/ig/threading/ThreadPriorityInspection.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 3757, 12592, 2300, 26964, 5962, 453, 7722, 12592, 2300, 2652, 13, 288, 1377, 2240, 18, 11658, 12592, 2300, 12, 8692, 1769, 1377, 727, 453, 7722, 2404, 2300, 707, 2300, 273, 2652,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3757, 12592, 2300, 26964, 5962, 453, 7722, 12592, 2300, 2652, 13, 288, 1377, 2240, 18, 11658, 12592, 2300, 12, 8692, 1769, 1377, 727, 453, 7722, 2404, 2300, 707, 2300, 273, 2652,...
if (parentDescriptor != null && elementDescriptor == null) {
if (parentDescriptor != null && elementDescriptor == null && parentTag.getUserData(DO_NOT_VALIDATE_KEY) == null ) {
private void checkTagByDescriptor(final XmlTag tag) { String name = tag.getName(); if (tag instanceof JspDirective) { checkDirective(name, tag); } XmlElementDescriptor elementDescriptor = null; final PsiElement parent = tag.getParent(); if (parent instanceof XmlTag) { XmlTag parentTag = (XmlTag)parent; final XmlElementDescriptor parentDescriptor = parentTag.getDescriptor(); if (parentDescriptor != null) { elementDescriptor = parentDescriptor.getElementDescriptor(tag); } if (parentDescriptor != null && elementDescriptor == null) { addElementsForTag( tag, "Element " + name + " is not allowed here", myResult, getTagProblemInfoType(tag), null ); return; } if (elementDescriptor instanceof AnyXmlElementDescriptor || parentDescriptor == null) { elementDescriptor = tag.getDescriptor(); } if (elementDescriptor == null) return; } else { //root tag elementDescriptor = tag.getDescriptor(); if (elementDescriptor == null) { addElementsForTag(tag, "Element " + name + " must be declared", myResult, HighlightInfoType.WRONG_REF, null); return; } } XmlAttributeDescriptor[] attributeDescriptors = elementDescriptor.getAttributesDescriptors(); Set<String> requiredAttributes = null; for (XmlAttributeDescriptor attribute : attributeDescriptors) { if (attribute != null && attribute.isRequired()) { if (requiredAttributes == null) { requiredAttributes = new HashSet<String>(); } requiredAttributes.add(attribute.getName(tag)); } } if (requiredAttributes != null) { for (final String attrName : requiredAttributes) { if (tag.getAttribute(attrName, tag.getNamespace()) == null) { if (!(elementDescriptor instanceof JspElementDescriptor) || !((JspElementDescriptor)elementDescriptor).isRequiredAttributeImplicitlyPresent(tag, attrName) ) { final InsertRequiredAttributeIntention insertRequiredAttributeIntention = new InsertRequiredAttributeIntention( tag, attrName, null); final String localizedMessage = "Element " + name + " doesn't have required attribute " + attrName; reportOneTagProblem( tag, attrName, localizedMessage, insertRequiredAttributeIntention, mySettings.getInspectionProfile(tag).getAdditionalNotRequiredHtmlAttributes(), HighlightInfoType.REQUIRED_HTML_ATTRIBUTE, HighlightDisplayKey.REQUIRED_HTML_ATTRIBUTE ); } } } } if (elementDescriptor instanceof Validator) { ((Validator)elementDescriptor).validate(tag,this); } }
12814 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12814/c40cb998390bb4778cba72b53ea9cd4f810629df/XmlHighlightVisitor.java/buggy/source/com/intellij/codeInsight/daemon/impl/analysis/XmlHighlightVisitor.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 3238, 918, 866, 1805, 858, 3187, 12, 6385, 5714, 1805, 1047, 13, 288, 565, 514, 508, 273, 1047, 18, 17994, 5621, 565, 309, 261, 2692, 1276, 19300, 13307, 13, 288, 1377, 866, 13307, 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, 3238, 918, 866, 1805, 858, 3187, 12, 6385, 5714, 1805, 1047, 13, 288, 565, 514, 508, 273, 1047, 18, 17994, 5621, 565, 309, 261, 2692, 1276, 19300, 13307, 13, 288, 1377, 866, 13307, 12, ...
Control control = getControl(); if (control != null && !control.isDisposed()) { updateSelection(getSelection()); } }
Control control = getControl(); if (control != null && !control.isDisposed()) { updateSelection(getSelection()); } }
protected void handleSelect(SelectionEvent event) { // handle case where an earlier selection listener disposed the control. Control control = getControl(); if (control != null && !control.isDisposed()) { updateSelection(getSelection()); } }
55805 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55805/dc85f0b1334fe6aa79c5c32e8024d573af99e0d2/StructuredViewer.java/clean/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/StructuredViewer.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 4750, 918, 1640, 3391, 12, 6233, 1133, 871, 13, 288, 3639, 368, 1640, 648, 1625, 392, 13805, 4421, 2991, 1015, 7423, 326, 3325, 18, 3639, 8888, 3325, 273, 27174, 5621, 3639, 309, 261, 709...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1640, 3391, 12, 6233, 1133, 871, 13, 288, 3639, 368, 1640, 648, 1625, 392, 13805, 4421, 2991, 1015, 7423, 326, 3325, 18, 3639, 8888, 3325, 273, 27174, 5621, 3639, 309, 261, 709...
out.write("<!-- jobQueue rendering: after stats -->\n".getBytes());
out.write("<!-- jobQueue rendering: after stats -->\n");
public void renderStatusHTML(OutputStream out) throws IOException { ArrayList readyJobs = null; ArrayList timedJobs = null; ArrayList activeJobs = new ArrayList(1); ArrayList justFinishedJobs = new ArrayList(4); out.write("<!-- jobQueue rendering -->\n".getBytes()); out.flush(); synchronized (_readyJobs) { readyJobs = new ArrayList(_readyJobs); } out.write("<!-- jobQueue rendering: after readyJobs sync -->\n".getBytes()); out.flush(); synchronized (_timedJobs) { timedJobs = new ArrayList(_timedJobs); } out.write("<!-- jobQueue rendering: after timedJobs sync -->\n".getBytes()); out.flush(); int numRunners = 0; synchronized (_queueRunners) { for (Iterator iter = _queueRunners.values().iterator(); iter.hasNext();) { JobQueueRunner runner = (JobQueueRunner)iter.next(); Job job = runner.getCurrentJob(); if (job != null) { activeJobs.add(job); } else { job = runner.getLastJob(); justFinishedJobs.add(job); } } numRunners = _queueRunners.size(); } out.write("<!-- jobQueue rendering: after queueRunners sync -->\n".getBytes()); out.flush(); StringBuffer buf = new StringBuffer(32*1024); buf.append("<h2>JobQueue</h2>"); buf.append("# runners: ").append(numRunners); buf.append("<br />\n"); long now = _context.clock().now(); buf.append("# active jobs: ").append(activeJobs.size()).append("<ol>\n"); for (int i = 0; i < activeJobs.size(); i++) { Job j = (Job)activeJobs.get(i); buf.append("<li> [started ").append(now-j.getTiming().getStartAfter()).append("ms ago]: "); buf.append(j.toString()).append("</li>\n"); } buf.append("</ol>\n"); buf.append("# just finished jobs: ").append(justFinishedJobs.size()).append("<ol>\n"); for (int i = 0; i < justFinishedJobs.size(); i++) { Job j = (Job)justFinishedJobs.get(i); buf.append("<li> [finished ").append(now-j.getTiming().getActualEnd()).append("ms ago]: "); buf.append(j.toString()).append("</li>\n"); } buf.append("</ol>\n"); buf.append("# ready/waiting jobs: ").append(readyJobs.size()).append(" <i>(lots of these mean there's likely a big problem)</i><ol>\n"); for (int i = 0; i < readyJobs.size(); i++) { Job j = (Job)readyJobs.get(i); buf.append("<li> [waiting ").append(now-j.getTiming().getStartAfter()).append("ms]: "); buf.append(j.toString()).append("</li>\n"); } buf.append("</ol>\n"); buf.append("# timed jobs: ").append(timedJobs.size()).append("<ol>\n"); TreeMap ordered = new TreeMap(); for (int i = 0; i < timedJobs.size(); i++) { Job j = (Job)timedJobs.get(i); ordered.put(new Long(j.getTiming().getStartAfter()), j); } for (Iterator iter = ordered.values().iterator(); iter.hasNext(); ) { Job j = (Job)iter.next(); buf.append("<li>").append(j.getName()).append(" @ "); buf.append(new Date(j.getTiming().getStartAfter())).append("</li>\n"); } buf.append("</ol>\n"); out.write("<!-- jobQueue rendering: after main buffer, before stats -->\n".getBytes()); out.flush(); getJobStats(buf); out.write("<!-- jobQueue rendering: after stats -->\n".getBytes()); out.flush(); out.write(buf.toString().getBytes()); }
27433 /local/tlutelli/issta_data/temp/all_java2context/java/2006_temp/2006/27433/62ed6c6a58f9adaa081ae5a6cb591d18c6ad4f85/JobQueue.java/buggy/router/java/src/net/i2p/router/JobQueue.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1743, 1482, 4870, 12, 4632, 596, 13, 1216, 1860, 288, 3639, 2407, 5695, 7276, 273, 446, 31, 3639, 2407, 7491, 7276, 273, 446, 31, 3639, 2407, 2695, 7276, 273, 394, 2407, 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, 1743, 1482, 4870, 12, 4632, 596, 13, 1216, 1860, 288, 3639, 2407, 5695, 7276, 273, 446, 31, 3639, 2407, 7491, 7276, 273, 446, 31, 3639, 2407, 2695, 7276, 273, 394, 2407, 12, ...
canonicalizer.write(doc.query("(
canonicalizer.setInclusiveNamespacePrefixList("n0"); Nodes subset = doc.query( "( context); canonicalizer.write(subset);
public void testExclusiveWithInclusiveNamespaces() throws IOException { Element pdu = new Element("n0:pdu", "http://a.example"); Element elem1 = new Element("n1:elem1", "http://b.example"); elem1.appendChild("content"); pdu.appendChild(elem1); String expected = "<n1:elem1 xmlns:n0=\"http://a.example\"" + " xmlns:n1=\"http://b.example\">content</n1:elem1>"; ByteArrayOutputStream out = new ByteArrayOutputStream(); Canonicalizer canonicalizer = new Canonicalizer(out, Canonicalizer.EXCLUSIVE_XML_CANONICALIZATION_WITH_COMMENTS); XPathContext context = new XPathContext("n1", "http://b.example"); Document doc = new Document(pdu); canonicalizer.write(doc.query("(//. | //@* | //namespace::*)[ancestor-or-self::n1:elem1]", context), "n0"); byte[] result = out.toByteArray(); out.close(); String s = new String(out.toByteArray(), "UTF8"); assertEquals(expected, s); }
8327 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8327/d2a19bcb336b5aae0ded1fb03984f4e48e23d2a0/CanonicalizerTest.java/buggy/src/nu/xom/tests/CanonicalizerTest.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1842, 17075, 1190, 19146, 13180, 1435, 1216, 1860, 288, 2398, 3010, 21160, 273, 394, 3010, 2932, 82, 20, 30, 84, 2544, 3113, 315, 2505, 2207, 69, 18, 8236, 8863, 3639, 3010, 36...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1842, 17075, 1190, 19146, 13180, 1435, 1216, 1860, 288, 2398, 3010, 21160, 273, 394, 3010, 2932, 82, 20, 30, 84, 2544, 3113, 315, 2505, 2207, 69, 18, 8236, 8863, 3639, 3010, 36...
groupSlots = new LayoutGroupBand[GroupElement.SLOT_COUNT];
groupSlots = new LayoutGroupBand[IGroupElementModel.SLOT_COUNT];
public LayoutTable( TableItem table, Module module ) { assert table != null; this.table = table; this.module = module; tableSlots = new LayoutSlot[TableItem.FOOTER_SLOT + 1]; for ( int i = 0; i < tableSlots.length; i++ ) tableSlots[i] = null; groupSlots = new LayoutGroupBand[GroupElement.SLOT_COUNT]; for ( int i = 0; i < groupSlots.length; i++ ) groupSlots[i] = null; }
5230 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5230/d802c33711e0d111551ae23575895cd060f085b6/LayoutTable.java/buggy/model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/api/elements/table/LayoutTable.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 9995, 1388, 12, 3555, 1180, 1014, 16, 5924, 1605, 262, 202, 95, 202, 202, 11231, 1014, 480, 446, 31, 202, 202, 2211, 18, 2121, 273, 1014, 31, 202, 202, 2211, 18, 2978, 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, 225, 202, 482, 9995, 1388, 12, 3555, 1180, 1014, 16, 5924, 1605, 262, 202, 95, 202, 202, 11231, 1014, 480, 446, 31, 202, 202, 2211, 18, 2121, 273, 1014, 31, 202, 202, 2211, 18, 2978, 273, ...
public IStatus runInUIThread(IProgressMonitor monitor) { Control control = site.getPane().getControl(); if (control == null || control.isDisposed()) return Status.CANCEL_STATUS; synchronized (lock) { //Update cursors if we are doing that if (useWaitCursor) { Cursor cursor = null; if (busy) cursor = getWaitCursor(control.getDisplay()); control.setCursor(cursor); } for (int i = 0; i < changeListeners.length; i++) { changeListeners[i].propertyChange( new PropertyChangeEvent( this, BUSY_PROPERTY, new Boolean(!busy), new Boolean(busy))); } IWorkbenchPart part = site.getPart(); if (part instanceof WorkbenchPart) ((WorkbenchPart) part).showBusy(busy); } return Status.OK_STATUS; }
58148 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/58148/fc7008c8b3623a62b191667f8fb1db2144a12300/WorkbenchSiteProgressService.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/WorkbenchSiteProgressService.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 3196, 202, 482, 45, 1482, 2681, 382, 57, 1285, 76, 896, 12, 45, 5491, 11415, 305, 535, 4089, 15329, 1082, 202, 3367, 7098, 33, 4256, 18, 588, 8485, 7675, 588, 3367, 5621, 1082, 202, 430, 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, 3196, 202, 482, 45, 1482, 2681, 382, 57, 1285, 76, 896, 12, 45, 5491, 11415, 305, 535, 4089, 15329, 1082, 202, 3367, 7098, 33, 4256, 18, 588, 8485, 7675, 588, 3367, 5621, 1082, 202, 430, 12,...
tried = null;
public ViewTemplate locateTemplate(ViewParameters viewparams) { TemplateResolverStrategy rootstrategy = null; int highestpriority = 0; // NB if we really want this optimisation, it must be based on # // of RETURNED templates, not the number of strategies! XMLCompositeViewTemplate xcvt = strategies.size() == 1 ? null : new XMLCompositeViewTemplate(); for (int i = 0; i < strategies.size(); ++i) { TemplateResolverStrategy trs = (TemplateResolverStrategy) strategies .get(i); int thispri = trs instanceof RootAwareTRS ? ((RootAwareTRS) trs) .getRootResolverPriority() : 1; if (thispri == highestpriority && thispri != 0) { if (rootstrategy != null) { Logger.log.warn("Duplicate root TemplateResolverStrategy " + trs + " found, using first entry " + rootstrategy); } } if (thispri > highestpriority) { rootstrategy = trs; highestpriority = thispri; } } if (rootstrategy == null) { rootstrategy = (TemplateResolverStrategy) strategies.get(0); Logger.log .warn("No root TemplateResolverStrategy found, using first entry of " + rootstrategy); } StringList tried = new StringList(); for (int i = 0; i < strategies.size(); ++i) { TemplateResolverStrategy trs = (TemplateResolverStrategy) strategies .get(i); boolean isexpected = trs instanceof ExpectedTRS ? ((ExpectedTRS) trs) .isExpected() : true; boolean ismultiple = trs instanceof MultipleTemplateResolverStrategy ? ((MultipleTemplateResolverStrategy) trs) .isMultiple() : false; StringList bases = trs.resolveTemplatePath(viewparams); StringList[] usebases; if (ismultiple) { usebases = new StringList[bases.size()]; for (int j = 0; j < usebases.length; ++j) { usebases[j] = new StringList(bases.stringAt(j)); } } else { usebases = new StringList[] { bases }; } for (int j = 0; j < usebases.length; ++j) { XMLViewTemplate template = locateTemplate(viewparams, trs, usebases[j], isexpected ? tried : null); if (template != null) { tried = null; if (xcvt != null) { xcvt.globalmap.aggregate(template.globalmap); if (trs == rootstrategy) { xcvt.roottemplate = template; } } else { return template; } } // end if template returned } } if (tried != null) { throw UniversalRuntimeException.accumulate(new FileNotFoundException(), "Cannot load template file from any of paths " + tried.toString()); } return xcvt; }
45809 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45809/278735540f5307d8082b6da6aa4fb379f2d83192/BasicTemplateResolver.java/buggy/src/uk/org/ponder/rsf/templateresolver/BasicTemplateResolver.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 4441, 2283, 10627, 2283, 12, 1767, 2402, 1476, 2010, 13, 288, 565, 5035, 4301, 4525, 1365, 14914, 273, 446, 31, 565, 509, 9742, 8457, 273, 374, 31, 565, 368, 20096, 309, 732, 8654, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4441, 2283, 10627, 2283, 12, 1767, 2402, 1476, 2010, 13, 288, 565, 5035, 4301, 4525, 1365, 14914, 273, 446, 31, 565, 509, 9742, 8457, 273, 374, 31, 565, 368, 20096, 309, 732, 8654, ...
match(_t,OPSYS); _t = _t.getNextSibling(); break; } case RETRY:
match(_t,RETRY); _t = _t.getNextSibling(); break; } case AASERIAL:
public final void pseudfn(AST _t) throws RecognitionException { AST pseudfn_AST_in = (_t == ASTNULL) ? null : (AST)_t; if (_t==null) _t=ASTNULL; switch ( _t.getType()) { case FIXCODEPAGE: { AST __t244 = _t; AST tmp75_AST_in = (AST)_t; match(_t,FIXCODEPAGE); _t = _t.getFirstChild(); funargs(_t); _t = _retTree; _t = __t244; _t = _t.getNextSibling(); break; } case OVERLAY: { AST __t245 = _t; AST tmp76_AST_in = (AST)_t; match(_t,OVERLAY); _t = _t.getFirstChild(); funargs(_t); _t = _retTree; _t = __t245; _t = _t.getNextSibling(); break; } case PUTBITS: { AST __t246 = _t; AST tmp77_AST_in = (AST)_t; match(_t,PUTBITS); _t = _t.getFirstChild(); funargs(_t); _t = _retTree; _t = __t246; _t = _t.getNextSibling(); break; } case PUTBYTE: { AST __t247 = _t; AST tmp78_AST_in = (AST)_t; match(_t,PUTBYTE); _t = _t.getFirstChild(); funargs(_t); _t = _retTree; _t = __t247; _t = _t.getNextSibling(); break; } case PUTBYTES: { AST __t248 = _t; AST tmp79_AST_in = (AST)_t; match(_t,PUTBYTES); _t = _t.getFirstChild(); funargs(_t); _t = _retTree; _t = __t248; _t = _t.getNextSibling(); break; } case PUTDOUBLE: { AST __t249 = _t; AST tmp80_AST_in = (AST)_t; match(_t,PUTDOUBLE); _t = _t.getFirstChild(); funargs(_t); _t = _retTree; _t = __t249; _t = _t.getNextSibling(); break; } case PUTFLOAT: { AST __t250 = _t; AST tmp81_AST_in = (AST)_t; match(_t,PUTFLOAT); _t = _t.getFirstChild(); funargs(_t); _t = _retTree; _t = __t250; _t = _t.getNextSibling(); break; } case PUTLONG: { AST __t251 = _t; AST tmp82_AST_in = (AST)_t; match(_t,PUTLONG); _t = _t.getFirstChild(); funargs(_t); _t = _retTree; _t = __t251; _t = _t.getNextSibling(); break; } case PUTSHORT: { AST __t252 = _t; AST tmp83_AST_in = (AST)_t; match(_t,PUTSHORT); _t = _t.getFirstChild(); funargs(_t); _t = _retTree; _t = __t252; _t = _t.getNextSibling(); break; } case PUTSTRING: { AST __t253 = _t; AST tmp84_AST_in = (AST)_t; match(_t,PUTSTRING); _t = _t.getFirstChild(); funargs(_t); _t = _retTree; _t = __t253; _t = _t.getNextSibling(); break; } case PUTUNSIGNEDSHORT: { AST __t254 = _t; AST tmp85_AST_in = (AST)_t; match(_t,PUTUNSIGNEDSHORT); _t = _t.getFirstChild(); funargs(_t); _t = _retTree; _t = __t254; _t = _t.getNextSibling(); break; } case SETBYTEORDER: { AST __t255 = _t; AST tmp86_AST_in = (AST)_t; match(_t,SETBYTEORDER); _t = _t.getFirstChild(); funargs(_t); _t = _retTree; _t = __t255; _t = _t.getNextSibling(); break; } case SETPOINTERVALUE: { AST __t256 = _t; AST tmp87_AST_in = (AST)_t; match(_t,SETPOINTERVALUE); _t = _t.getFirstChild(); funargs(_t); _t = _retTree; _t = __t256; _t = _t.getNextSibling(); break; } case SETSIZE: { AST __t257 = _t; AST tmp88_AST_in = (AST)_t; match(_t,SETSIZE); _t = _t.getFirstChild(); funargs(_t); _t = _retTree; _t = __t257; _t = _t.getNextSibling(); break; } case AAMSG: { AST tmp89_AST_in = (AST)_t; match(_t,AAMSG); _t = _t.getNextSibling(); break; } case CURRENTVALUE: { currentvaluefunc(_t); _t = _retTree; break; } case CURRENTWINDOW: { AST tmp90_AST_in = (AST)_t; match(_t,CURRENTWINDOW); _t = _t.getNextSibling(); break; } case DYNAMICCURRENTVALUE: { dynamiccurrentvaluefunc(_t); _t = _retTree; break; } case ENTRY: { entryfunc(_t); _t = _retTree; break; } case LENGTH: { lengthfunc(_t); _t = _retTree; break; } case NEXTVALUE: { nextvaluefunc(_t); _t = _retTree; break; } case RAW: { rawfunc(_t); _t = _retTree; break; } case SUBSTRING: { substringfunc(_t); _t = _retTree; break; } case Widget_ref: { widattr(_t); _t = _retTree; break; } case PAGESIZE_KW: { AST tmp91_AST_in = (AST)_t; match(_t,PAGESIZE_KW); _t = _t.getNextSibling(); break; } case LINECOUNTER: { AST tmp92_AST_in = (AST)_t; match(_t,LINECOUNTER); _t = _t.getNextSibling(); break; } case PAGENUMBER: { AST tmp93_AST_in = (AST)_t; match(_t,PAGENUMBER); _t = _t.getNextSibling(); break; } case FRAMECOL: { AST tmp94_AST_in = (AST)_t; match(_t,FRAMECOL); _t = _t.getNextSibling(); break; } case FRAMEDOWN: { AST tmp95_AST_in = (AST)_t; match(_t,FRAMEDOWN); _t = _t.getNextSibling(); break; } case FRAMELINE: { AST tmp96_AST_in = (AST)_t; match(_t,FRAMELINE); _t = _t.getNextSibling(); break; } case FRAMEROW: { AST tmp97_AST_in = (AST)_t; match(_t,FRAMEROW); _t = _t.getNextSibling(); break; } case USERID: { AST tmp98_AST_in = (AST)_t; match(_t,USERID); _t = _t.getNextSibling(); break; } case ETIME_KW: { AST tmp99_AST_in = (AST)_t; match(_t,ETIME_KW); _t = _t.getNextSibling(); break; } case DBNAME: { AST tmp100_AST_in = (AST)_t; match(_t,DBNAME); _t = _t.getNextSibling(); break; } case TIME: { AST tmp101_AST_in = (AST)_t; match(_t,TIME); _t = _t.getNextSibling(); break; } case OPSYS: { AST tmp102_AST_in = (AST)_t; match(_t,OPSYS); _t = _t.getNextSibling(); break; } case RETRY: { AST tmp103_AST_in = (AST)_t; match(_t,RETRY); _t = _t.getNextSibling(); break; } case AASERIAL: { AST tmp104_AST_in = (AST)_t; match(_t,AASERIAL); _t = _t.getNextSibling(); break; } case AACONTROL: { AST tmp105_AST_in = (AST)_t; match(_t,AACONTROL); _t = _t.getNextSibling(); break; } case MESSAGELINES: { AST tmp106_AST_in = (AST)_t; match(_t,MESSAGELINES); _t = _t.getNextSibling(); break; } case TERMINAL: { AST tmp107_AST_in = (AST)_t; match(_t,TERMINAL); _t = _t.getNextSibling(); break; } case PROPATH: { AST tmp108_AST_in = (AST)_t; match(_t,PROPATH); _t = _t.getNextSibling(); break; } case CURRENTLANGUAGE: { AST tmp109_AST_in = (AST)_t; match(_t,CURRENTLANGUAGE); _t = _t.getNextSibling(); break; } case PROMSGS: { AST tmp110_AST_in = (AST)_t; match(_t,PROMSGS); _t = _t.getNextSibling(); break; } case SCREENLINES: { AST tmp111_AST_in = (AST)_t; match(_t,SCREENLINES); _t = _t.getNextSibling(); break; } case LASTKEY: { AST tmp112_AST_in = (AST)_t; match(_t,LASTKEY); _t = _t.getNextSibling(); break; } case FRAMEFIELD: { AST tmp113_AST_in = (AST)_t; match(_t,FRAMEFIELD); _t = _t.getNextSibling(); break; } case FRAMEFILE: { AST tmp114_AST_in = (AST)_t; match(_t,FRAMEFILE); _t = _t.getNextSibling(); break; } case FRAMEVALUE: { AST tmp115_AST_in = (AST)_t; match(_t,FRAMEVALUE); _t = _t.getNextSibling(); break; } case GOPENDING: { AST tmp116_AST_in = (AST)_t; match(_t,GOPENDING); _t = _t.getNextSibling(); break; } case PROGRESS: { AST tmp117_AST_in = (AST)_t; match(_t,PROGRESS); _t = _t.getNextSibling(); break; } case FRAMEINDEX: { AST tmp118_AST_in = (AST)_t; match(_t,FRAMEINDEX); _t = _t.getNextSibling(); break; } case FRAMEDB: { AST tmp119_AST_in = (AST)_t; match(_t,FRAMEDB); _t = _t.getNextSibling(); break; } case FRAMENAME: { AST tmp120_AST_in = (AST)_t; match(_t,FRAMENAME); _t = _t.getNextSibling(); break; } case DATASERVERS: { AST tmp121_AST_in = (AST)_t; match(_t,DATASERVERS); _t = _t.getNextSibling(); break; } case NUMDBS: { AST tmp122_AST_in = (AST)_t; match(_t,NUMDBS); _t = _t.getNextSibling(); break; } case NUMALIASES: { AST tmp123_AST_in = (AST)_t; match(_t,NUMALIASES); _t = _t.getNextSibling(); break; } case ISATTRSPACE: { AST tmp124_AST_in = (AST)_t; match(_t,ISATTRSPACE); _t = _t.getNextSibling(); break; } case PROCSTATUS: { AST tmp125_AST_in = (AST)_t; match(_t,PROCSTATUS); _t = _t.getNextSibling(); break; } case PROCHANDLE: { AST tmp126_AST_in = (AST)_t; match(_t,PROCHANDLE); _t = _t.getNextSibling(); break; } case CURSOR: { AST tmp127_AST_in = (AST)_t; match(_t,CURSOR); _t = _t.getNextSibling(); break; } case OSERROR: { AST tmp128_AST_in = (AST)_t; match(_t,OSERROR); _t = _t.getNextSibling(); break; } case RETURNVALUE: { AST tmp129_AST_in = (AST)_t; match(_t,RETURNVALUE); _t = _t.getNextSibling(); break; } case OSDRIVES: { AST tmp130_AST_in = (AST)_t; match(_t,OSDRIVES); _t = _t.getNextSibling(); break; } case PROVERSION: { AST tmp131_AST_in = (AST)_t; match(_t,PROVERSION); _t = _t.getNextSibling(); break; } case TRANSACTION: { AST tmp132_AST_in = (AST)_t; match(_t,TRANSACTION); _t = _t.getNextSibling(); break; } case MACHINECLASS: { AST tmp133_AST_in = (AST)_t; match(_t,MACHINECLASS); _t = _t.getNextSibling(); break; } case AAPCONTROL: { AST tmp134_AST_in = (AST)_t; match(_t,AAPCONTROL); _t = _t.getNextSibling(); break; } case GETCODEPAGES: { AST tmp135_AST_in = (AST)_t; match(_t,GETCODEPAGES); _t = _t.getNextSibling(); break; } case COMSELF: { AST tmp136_AST_in = (AST)_t; match(_t,COMSELF); _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, 29606, 4293, 12, 9053, 389, 88, 13, 1216, 9539, 288, 9506, 202, 9053, 29606, 4293, 67, 9053, 67, 267, 273, 261, 67, 88, 422, 9183, 8560, 13, 692, 446, 294, 261, 90...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 29606, 4293, 12, 9053, 389, 88, 13, 1216, 9539, 288, 9506, 202, 9053, 29606, 4293, 67, 9053, 67, 267, 273, 261, 67, 88, 422, 9183, 8560, 13, 692, 446, 294, 261, 90...
switch ( TradeableItemDatabase.getConsumptionType( item.getItemID() ) )
switch ( TradeableItemDatabase.getConsumptionType( item.getItemId() ) )
public void run() { switch ( TradeableItemDatabase.getConsumptionType( item.getItemID() ) ) { case ConsumeItemRequest.EQUIP_FAMILIAR: case ConsumeItemRequest.EQUIP_ACCESSORY: case ConsumeItemRequest.EQUIP_HAT: case ConsumeItemRequest.EQUIP_PANTS: case ConsumeItemRequest.EQUIP_SHIRT: case ConsumeItemRequest.EQUIP_WEAPON: case ConsumeItemRequest.EQUIP_OFFHAND: break; default: return; } if ( !KoLCharacter.hasSkill( "Pulverize" ) ) { KoLmafia.updateDisplay( ERROR_STATE, "You don't know how to pulverize objects." ); return; } if ( !AdventureDatabase.retrieveItem( ConcoctionsDatabase.HAMMER ) ) return; if ( item.getCount( inventory ) < item.getCount() ) { KoLmafia.updateDisplay( ERROR_STATE, "You don't have a " + item.getName() + "." ); return; } KoLmafia.updateDisplay( "Pulverizing " + item.getName() + "..." ); super.run(); }
50364 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50364/db652071b06715a4456f702f081fbe5b47aa5a70/PulverizeRequest.java/clean/src/net/sourceforge/kolmafia/PulverizeRequest.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 1086, 1435, 202, 95, 202, 202, 9610, 261, 2197, 323, 429, 1180, 4254, 18, 588, 11911, 375, 559, 12, 761, 18, 588, 1180, 734, 1435, 262, 262, 202, 202, 95, 202, 202, 359...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 1086, 1435, 202, 95, 202, 202, 9610, 261, 2197, 323, 429, 1180, 4254, 18, 588, 11911, 375, 559, 12, 761, 18, 588, 1180, 734, 1435, 262, 262, 202, 202, 95, 202, 202, 359...
((I_CmsSyncModification)i.next()).modifyVfs(m_cms, vfsFile, fsFile);
((I_CmsSynchonizeModification)i.next()).modifyVfs(m_cms, vfsFile, fsFile);
private void updateFromFs(CmsResource res) throws CmsException { CmsFile vfsFile; // to get the name of the file in the FS, we must look it up in the // sync list. This is nescessary, since the VFS could use a tranlated // filename. String resourcename = m_cms.readAbsolutePath(res); CmsSynchronizeList sync = (CmsSynchronizeList)m_syncList.get(translate(resourcename)); File fsFile = getFileInFs(sync.getResName()); try { // lock the file in the VFS, so that it can be updated m_cms.lockResource(resourcename); // read the file in the VFS vfsFile = m_cms.readFile(resourcename); // import the content from the FS vfsFile.setContents(getFileBytes(fsFile)); m_cms.writeFile(vfsFile); // now check if there is some external method to be called which // should modify // the updated resource in the VFS Iterator i = m_checkFile.iterator(); while (i.hasNext()) { try { ((I_CmsSyncModification)i.next()).modifyVfs(m_cms, vfsFile, fsFile); } catch (CmsSynchronizeException e) { break; } } // everything is done now, so unlock the resource m_cms.unlockResource(resourcename, false); //read the resource again, nescessary to get the actual timestamps res = m_cms.readFileHeader(resourcename); //add resource to synchronisation list CmsSynchronizeList syncList = new CmsSynchronizeList(sync.getResName(), translate(resourcename), res.getDateLastModified(), fsFile.lastModified()); m_newSyncList.put(translate(resourcename), syncList); // and remove it from the old one m_syncList.remove(translate(resourcename)); vfsFile = null; } catch (CmsException ex) { // if this resource could not be locked, it could not be // synchronized // mark this in the error list and the new sync list if (ex.getType() == 13) { // add the file to the new sync list... CmsSynchronizeList syncList = (CmsSynchronizeList)m_syncList.get(translate(resourcename)); m_newSyncList.put(translate(resourcename), syncList); m_errorList.put(translate(resourcename), syncList); // and remove it from the old one m_syncList.remove(translate(resourcename)); } else { throw ex; } } catch (Exception e) { throw new CmsException(e.getMessage()); } }
8585 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8585/746d87cf1b462b024e0d674cc23746f57bea9e5d/CmsSynchronize.java/clean/src/org/opencms/file/CmsSynchronize.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 918, 1089, 1265, 12432, 12, 4747, 1420, 400, 13, 1216, 11228, 288, 3639, 28118, 20682, 812, 31, 3639, 368, 358, 336, 326, 508, 434, 326, 585, 316, 326, 9247, 16, 732, 1297, 2324, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 918, 1089, 1265, 12432, 12, 4747, 1420, 400, 13, 1216, 11228, 288, 3639, 28118, 20682, 812, 31, 3639, 368, 358, 336, 326, 508, 434, 326, 585, 316, 326, 9247, 16, 732, 1297, 2324, ...
public IRubyObject[] scanArgs(IRuby runtime, IRubyObject[] args, int required, int optional) {
public IRubyObject[] scanArgs(IRubyObject[] args, int required, int optional) {
public IRubyObject[] scanArgs(IRuby runtime, IRubyObject[] args, int required, int optional) { int total = required+optional; int real = checkArgumentCount(args,required,total); IRubyObject[] narr = new IRubyObject[total]; System.arraycopy(args,0,narr,0,real); for(int i=real; i<total; i++) { narr[i] = runtime.getNil(); } return narr; }
47273 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47273/510a41b06f3103200e881725915b7cc1a5a10b39/RubyObject.java/buggy/src/org/jruby/RubyObject.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 15908, 10340, 921, 8526, 4135, 2615, 12, 7937, 10340, 921, 8526, 833, 16, 509, 1931, 16, 509, 3129, 13, 288, 3639, 509, 2078, 273, 1931, 15, 10444, 31, 3639, 509, 2863, 273, 10788, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 15908, 10340, 921, 8526, 4135, 2615, 12, 7937, 10340, 921, 8526, 833, 16, 509, 1931, 16, 509, 3129, 13, 288, 3639, 509, 2078, 273, 1931, 15, 10444, 31, 3639, 509, 2863, 273, 10788, ...
boolean paintedLine = false;
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { Rectangle bounds = new Rectangle(x + halfGapWidth, y + halfGapHeight + 1, width - gap.width + 1, height - gap.height); if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c), table.getModel(), table.getSelectionModel().getLeadSelectionIndex(), table.getColumnModel().getSelectionModel().getLeadSelectionIndex()); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); boolean paintedLine = false; for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); paintedLine = true; } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); boolean paintedLine = false; for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); paintedLine = true; } gfx.setColor(save); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8a49a412752cdcc88a774cac2de160a23c6f550/BasicTableUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicTableUI.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 918, 12574, 12, 17558, 30940, 16, 29058, 5455, 13, 282, 288, 565, 509, 21330, 273, 1014, 18, 588, 1494, 1380, 5621, 565, 509, 18871, 273, 1014, 18, 588, 26359, 5621, 565, 309, 261, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 918, 12574, 12, 17558, 30940, 16, 29058, 5455, 13, 282, 288, 565, 509, 21330, 273, 1014, 18, 588, 1494, 1380, 5621, 565, 509, 18871, 273, 1014, 18, 588, 26359, 5621, 565, 309, 261, ...
" AND resource_filter = " + Constants.COLLECTION + " AND resource_filter_arg in " +
" AND container_type_id = " + Constants.COLLECTION + " AND container_id in " +
private static TableRowIterator policyLookup(Context c, int resource_type, int resource_id, int action_id) throws SQLException { String myquery = ""; // get the policies eonly for this object (rare) TableRowIterator specific_policies = DatabaseManager.query(c, "resourcepolicy", "SELECT resourcepolicy.* FROM resourcepolicy WHERE" + " resource_type_id=" + resource_type + " AND action_id=" + action_id + " AND resource_id=" + resource_id );/* // find all policies specific to this object String myquery = "SELECT * from ResourcePolicy where" + " resource_type_id = " + resource_type + " AND action_id = " + action_id + " AND resource_id = " + resource_id; DatabaseBeanIterator specific_policies = ResourcePolicy.query(myquery); DatabaseBeanIterator item_policies = null; DatabaseBeanIterator collection_policies = null;*/ if (resource_type == Constants.BITSTREAM) { // if there are item specific policies, they have // the highest priority - return them if (specific_policies.hasNext()) { return specific_policies; } // need to look for policies from containing items myquery = "SELECT * from ResourcePolicy where" + " resource_type_id = " + resource_type + " AND action_id = " + action_id + " AND resource_filter = " + Constants.ITEM + " AND resource_filter_arg in " + "(select item_id from Item2Bundle where bundle_id in" + "(select bundle_id from Bundle2Bitstream where " + " bitstream_id = " + resource_id + "))"; TableRowIterator item_policies = DatabaseManager.query(c, "resourcepolicy", myquery ); if (item_policies.hasNext()) { return item_policies; } // now look for policies from containing collections myquery = "SELECT * from ResourcePolicy where" + " resource_type_id = " + resource_type + " AND action_id = " + action_id + " AND resource_filter = " + Constants.COLLECTION + " AND resource_filter_arg in " + "(select collection_id from Collection2Item where" + " item_id in " + "(select item_id from Item2Bundle where bundle_id in" + "(select bundle_id from Bundle2Bitstream where " + " bitstream_id = " + resource_id + ")))"; TableRowIterator collection_policies = DatabaseManager.query(c, "resourcepolicy", myquery ); if (collection_policies.hasNext()) { return collection_policies; } } // bundles use the same permissions as bitstreams? // inheriting from items and collections if (resource_type == Constants.BUNDLE) { if (specific_policies.hasNext()) { return specific_policies; } // need to look for policies from containing items myquery = "SELECT * from ResourcePolicy where" + " resource_type_id = " + resource_type + " AND action_id = " + action_id + " AND resource_filter = " + Constants.ITEM + " AND resource_filter_arg in " + "(select item_id from Item2Bundle where " + " bundle_id = " + resource_id + ")"; TableRowIterator item_policies = DatabaseManager.query(c, "resourcepolicy", myquery ); if (item_policies.hasNext()) { return item_policies; } // now look for policies from containing collections myquery = "SELECT * from ResourcePolicy where" + " resource_type_id = " + resource_type + " AND action_id = " + action_id + " AND resource_filter = " + Constants.COLLECTION + " AND resource_filter_arg in " + "(select collection_id from Collection2Item where" + " item_id in " + "(select item_id from Item2Bundle where " + " bundle_id =" + resource_id + "))"; TableRowIterator collection_policies = DatabaseManager.query(c, "resourcepolicy", myquery ); if (collection_policies.hasNext()) { return collection_policies; } } // items just inherit from collections if (resource_type == Constants.ITEM) { if (specific_policies.hasNext()) { return specific_policies; } myquery = "SELECT * from ResourcePolicy where" + " resource_type_id = " + resource_type + " AND action_id = " + action_id + " AND resource_filter = " + Constants.COLLECTION + " AND resource_filter_arg in " + "(select collection_id from Collection2Item where" + " item_id = " + resource_id + ")"; TableRowIterator collection_policies = DatabaseManager.query(c, "resourcepolicy", myquery ); if (collection_policies.hasNext()) { return collection_policies; } } // end of special inheritance - handle any other // type return specific_policies; }
52457 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52457/25c111afaa1f5e74f536b77770b15ee76ec8e3f4/AuthorizeManager.java/buggy/dspace/src/org/dspace/authorize/AuthorizeManager.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 760, 3555, 1999, 3198, 3329, 6609, 12, 1042, 276, 16, 509, 1058, 67, 723, 16, 509, 1058, 67, 350, 16, 509, 1301, 67, 350, 13, 3639, 1216, 6483, 565, 288, 3639, 514, 3399, 2271, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 760, 3555, 1999, 3198, 3329, 6609, 12, 1042, 276, 16, 509, 1058, 67, 723, 16, 509, 1058, 67, 350, 16, 509, 1301, 67, 350, 13, 3639, 1216, 6483, 565, 288, 3639, 514, 3399, 2271, ...
buf.delete(where, where + nitems);
int length = length(); if (where >= length) throw new BadLocationException("the where argument cannot be greater" + " than the content length", where); if ((where + nitems) > length) throw new BadLocationException("where + nitems cannot be greater" + " than the content length", where + nitems); if (where != gapStart) shiftGap(where); gapEnd += nitems;
public UndoableEdit remove(int where, int nitems) throws BadLocationException { buf.delete(where, where + nitems); return null; }
13625 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/13625/66e2f6e7d39d0673c04409215da42eef752afe5f/GapContent.java/buggy/libjava/javax/swing/text/GapContent.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 1351, 2896, 429, 4666, 1206, 12, 474, 1625, 16, 509, 290, 3319, 13, 565, 1216, 6107, 2735, 503, 225, 288, 377, 509, 769, 273, 769, 5621, 225, 309, 261, 6051, 1545, 769, 13, 604, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 1351, 2896, 429, 4666, 1206, 12, 474, 1625, 16, 509, 290, 3319, 13, 565, 1216, 6107, 2735, 503, 225, 288, 377, 509, 769, 273, 769, 5621, 225, 309, 261, 6051, 1545, 769, 13, 604, ...
index = store.addRecord (null, 0, 0);
index = store.addRecord (DUMMY, 0, 0);
Node () throws RecordStoreException { index = store.addRecord (null, 0, 0); }
4841 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4841/668a3e29ec3f229b02a89c92bbc5c9052293754b/RmsIndex.java/clean/src/org/kobjects/rms/RmsIndex.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 907, 1832, 1216, 5059, 21151, 288, 202, 565, 770, 273, 1707, 18, 1289, 2115, 261, 2011, 16, 374, 16, 374, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 907, 1832, 1216, 5059, 21151, 288, 202, 565, 770, 273, 1707, 18, 1289, 2115, 261, 2011, 16, 374, 16, 374, 1769, 202, 97, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
popup.show(mainTable.this, me.getX(), me.getY());
popup.show(mainTable.this, me.getX(), me.getY());
public void mouseReleased(MouseEvent me) { if (me.isPopupTrigger()) { popup.show(mainTable.this, me.getX(), me.getY()); } else if (getSelectedRow() != -1) { get_mail(); } if (getSelectedRow() != -1 && !(getSelectedRow() >= frame.listOfMails.size())) { Vector v = (Vector) frame.listOfMails. elementAt(getSelectedRow()); String outbox = YAMM.home + YAMM.sep + "boxes" + YAMM.sep + YAMM.getString("box.outbox"); if (v.elementAt(4).toString().equals("Unread") && !frame.selectedbox.equals(outbox)) { long skip = Long.parseLong( ((Vector) listOfMails.elementAt( getSelectedRow())). elementAt(5).toString()); Mailbox.setStatus(frame.selectedbox, getSelectedRow(), skip, "Read"); Mailbox.createList(frame.selectedbox, frame.listOfMails); frame.tree.repaint(); } changeButtonMode(true); } else { changeButtonMode(false); } }
3248 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/3248/d34f0b921d886e2ea79ca1692b8cb4efbc3811c5/mainTable.java/buggy/gui/main/mainTable.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 3196, 202, 482, 918, 7644, 26363, 12, 9186, 1133, 1791, 13, 288, 1082, 202, 430, 261, 3501, 18, 291, 13770, 6518, 10756, 288, 9506, 202, 16086, 18, 4500, 12, 5254, 1388, 18, 2211, 16, 1791, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 482, 918, 7644, 26363, 12, 9186, 1133, 1791, 13, 288, 1082, 202, 430, 261, 3501, 18, 291, 13770, 6518, 10756, 288, 9506, 202, 16086, 18, 4500, 12, 5254, 1388, 18, 2211, 16, 1791, ...
ImageDescriptor imageDescriptor = getImageDescriptor(imageName);
ImageDescriptor imageDescriptor = getImageDescriptor(imageName);
public void testGetUniqueDisabledImageForDescriptor() { ImageDescriptor imageDescriptor = getImageDescriptor(imageName); Image image1 = imageCache.getDisabledImage(imageDescriptor).getImage(); Image image2 = imageCache.getDisabledImage(imageDescriptor).getImage(); assertSame(image1, image2); }
55805 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55805/c7a7ac8adf47655ae8f464f116999526a88cb658/ImageCacheTest.java/buggy/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/images/ImageCacheTest.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 1842, 967, 6303, 8853, 2040, 1290, 3187, 1435, 288, 202, 202, 2040, 3187, 1316, 3187, 273, 10567, 3187, 12, 2730, 461, 1769, 202, 202, 2040, 1316, 21, 273, 1316, 1649, 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, 1842, 967, 6303, 8853, 2040, 1290, 3187, 1435, 288, 202, 202, 2040, 3187, 1316, 3187, 273, 10567, 3187, 12, 2730, 461, 1769, 202, 202, 2040, 1316, 21, 273, 1316, 1649, 18, ...
if (limit == null) limit = DEFAULT_LIMIT; Justify just = limit.getJustification();
Justify just = limit.getJustify();
public void apply() { if (container == null) return; int[] absoluteWidths = getAbsoluteSizes(container.getInnerWidth(), getVisibleColumns()); int[] absoluteHeights = getAbsoluteSizes(container.getInnerHeight(), getVisibleRows()); for (Component c : (List<Component>) container.getChildren()) { Range limit = (Range)c.getLimit(); if (limit == null) limit = DEFAULT_LIMIT; Justify just = limit.getJustification(); int x = margin, y = margin, width = 0, height = 0; for (int i = 0, cnt = limit.width, column = limit.columnIndex; i < cnt; i++) { width += absoluteWidths[i + column] + spacing; } width -= spacing; if (just != Justify.FULL && c.getWidth() < width) width = c.getWidth(); for (int i = 0, cnt = limit.height, row = limit.rowIndex; i < cnt; i++) { height += absoluteHeights[i + row] + spacing; } height -= spacing; if (just != Justify.FULL && c.getHeight() < height) height = c.getHeight(); for (int i = 0, cnt = limit.columnIndex; i < cnt; i++) { x += absoluteWidths[i] + spacing; } if (width == c.getWidth()) { if (just.name().indexOf("RIGHT") > -1) { x += absoluteWidths[limit.columnIndex] - width; } else if (just == Justify.CENTER || just == Justify.CENTER_BOTTOM || just == Justify.CENTER_FULL || just == Justify.CENTER_TOP) { x += (absoluteWidths[limit.columnIndex] / 2) - (width / 2); } } for (int i = 0, cnt = limit.rowIndex; i < cnt; i++) { y += absoluteHeights[i] + spacing; } if (height == c.getHeight()) { if (just.name().indexOf("BOTTOM") > -1) { y += absoluteHeights[limit.rowIndex] - height; } else if (just == Justify.CENTER || just == Justify.FULL_CENTER || just == Justify.LEFT_CENTER || just == Justify.RIGHT_CENTER) { y += (absoluteHeights[limit.rowIndex] / 2) - (height / 2); } } if (width >= 0 && height >= 0) c.setBounds(x, y, width, height); } }
51553 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51553/cfa7cacc22cf44240d4fdac2a16ac0b70fe21708/TableLayout.java/clean/src/thinwire/ui/layout/TableLayout.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 2230, 1435, 288, 3639, 309, 261, 3782, 422, 446, 13, 327, 31, 3639, 509, 8526, 4967, 22407, 273, 8469, 11923, 12, 3782, 18, 588, 2857, 2384, 9334, 31564, 3380, 10663, 3639, 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, 377, 1071, 918, 2230, 1435, 288, 3639, 309, 261, 3782, 422, 446, 13, 327, 31, 3639, 509, 8526, 4967, 22407, 273, 8469, 11923, 12, 3782, 18, 588, 2857, 2384, 9334, 31564, 3380, 10663, 3639, 509...
closeJob.cancel(); cleanNotified();
closeJob.cancel();
public void run() { if ((popup != null && popup.close()) || popup == null) { closeJob.cancel(); cleanNotified(); collectNotifications(); synchronized (TaskListNotificationManager.class) { if (currentlyNotifying.size() > 0) { popup = new TaskListNotificationPopup(PlatformUI.getWorkbench().getDisplay() .getActiveShell()); popup.setContents(new ArrayList<ITaskListNotification>(currentlyNotifying)); popup.setBlockOnOpen(false); popup.open(); closeJob.setSystem(runSystem); closeJob.schedule(CLOSE_POPUP_DELAY); popup.getShell().addShellListener(SHELL_LISTENER); } } } }
51151 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51151/376468c4ba28400bd64ae41664789f947784c0af/TaskListNotificationManager.java/buggy/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/TaskListNotificationManager.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 9944, 202, 482, 918, 1086, 1435, 288, 6862, 1082, 202, 430, 14015, 16086, 480, 446, 597, 10431, 18, 4412, 10756, 747, 10431, 422, 446, 13, 288, 6862, 9506, 202, 4412, 2278, 18, 10996, 5621, 68...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9944, 202, 482, 918, 1086, 1435, 288, 6862, 1082, 202, 430, 14015, 16086, 480, 446, 597, 10431, 18, 4412, 10756, 747, 10431, 422, 446, 13, 288, 6862, 9506, 202, 4412, 2278, 18, 10996, 5621, 68...
TreeVector trees = treeFillerTask.getBlock(taxa, iBlock, commandRec);
TreeVector trees = treeFillerTask.getBlock(taxa, iBlock, commandRec);
public Object doCommand(String commandName, String arguments, CommandRecord commandRec, CommandChecker checker) { if (checker.compare(this.getClass(), "Returns a trees block", "[number of trees block; 0 based]", commandName, "getTreeBlock")) { int t = MesquiteInteger.fromFirstToken(arguments, pos); if (MesquiteInteger.isCombinable(t) && t<treesVector.size()) { TreeVector tx = (TreeVector)treesVector.elementAt(t); return tx; } } else if (checker.compare(this.getClass(), "Shows lists of trees in a trees block", "[number of trees block; 0 based]", commandName, "showTrees")) { int t = MesquiteInteger.fromFirstToken(arguments, pos); if (StringUtil.blank(arguments) || !MesquiteInteger.isCombinable(t) || t>treesVector.size()) { for (int i = 0; i< treesVector.size(); i++) { showTrees((TreeVector)treesVector.elementAt(i), commandRec); } } else { TreeVector tx = (TreeVector)treesVector.elementAt(t); return showTrees(tx, commandRec); } } else if (checker.compare(this.getClass(), "Shows a tree window showing a particular trees block", "[number of tree block to show]", commandName, "showTreesInWindow")) { //Check to see if already has lister for this int t = MesquiteInteger.fromFirstToken(arguments, pos); if (MesquiteInteger.isCombinable(t) && t<getProject().getNumberOfFileElements(TreeVector.class)) { MesquiteModule fCoord = getFileCoordinator(); MesquiteModule treeWindowCoord = null; if (fCoord!=null) treeWindowCoord = fCoord.findEmployeeWithName("Tree Window Coordinator"); if (treeWindowCoord!=null){ TreeVector trees = (TreeVector)getProject().getFileElement(TreeVector.class, t); if (trees == null) return null; Taxa taxa = trees.getTaxa(); //send script to tree window coord to makeTreeWindow with set of taxa and then set to stored trees and this tree vector int whichTreeBlock = getTreeBlockNumber(taxa, trees); String commands = "makeTreeWindow " + getProject().getTaxaReferenceInternal(taxa) + " #BasicTreeWindowMaker; tell It; setTreeSource #StoredTrees;"; commands += " tell It; setTaxa " + getProject().getTaxaReferenceInternal(taxa) + " ; setTreeBlock " + TreeVector.toExternal(whichTreeBlock) + "; endTell; showWindow; endTell; "; MesquiteInteger pos = new MesquiteInteger(0); Puppeteer p = new Puppeteer(this); p.execute(treeWindowCoord, commands, pos, null, false); /* */ } } } else if (checker.compare(this.getClass(), "Saves copy of a trees block to a separate file", "[id number of trees block]", commandName, "exportTreesBlock")) { int t = MesquiteInteger.fromString(parser.getFirstToken(arguments)); if (MesquiteInteger.isCombinable(t) && t< getProject().getNumberOfFileElements(TreeVector.class)) { long id = MesquiteLong.fromString(parser.getNextToken()); TreeVector d = (TreeVector)getProject().getFileElement(TreeVector.class, t); if (d!=null) { String path = MesquiteFile.saveFileAsDialog("Save copy of tree block to file"); if (!StringUtil.blank(path)) exportTreesBlock(d, path, commandRec); } } } else if (checker.compare(this.getClass(), "Saves copies of a series of tree blocks to files", "[name of module to fill the trees blocks]", commandName, "exportTreesBlocks")) { //ask user how which taxa, how many characters //create chars block and add to file //return chars TreeVector newTrees=null; Taxa taxa = null; if (getProject().getNumberTaxas()==0) { alert("Trees blocks cannot be created until taxa exist in file."); return null; } else taxa = getProject().chooseTaxa(containerOfModule(), "For which block of taxa do you want to save copies of trees blocks?",commandRec); if (taxa == null) return null; TreeBlockSource treeFillerTask; if (StringUtil.blank(arguments)) treeFillerTask = (TreeBlockSource)hireEmployee(commandRec, TreeBlockSource.class, "Save copies of trees blocks from:"); else treeFillerTask = (TreeBlockSource)hireNamedEmployee(commandRec, TreeBlockSource.class, arguments); if (treeFillerTask != null) { String basePath = MesquiteFile.saveFileAsDialog("Base name for files (files will be named <name>1.nex, <name>2.nex, etc.)"); if (StringUtil.blank(basePath)) { fireEmployee(treeFillerTask); resetAllMenuBars(); return null; } treeFillerTask.initialize(taxa, commandRec); int num = treeFillerTask.getNumberOfTreeBlocks(taxa, commandRec); if (!MesquiteInteger.isCombinable(num)) num = MesquiteInteger.queryInteger(containerOfModule(), "How many trees blocks?", "How many trees blocks of which to save copies?", 10); if (!MesquiteInteger.isCombinable(num)) { fireEmployee(treeFillerTask); resetAllMenuBars(); return null; } MesquiteTrunk.mesquiteTrunk.incrementProjectBrowserRefreshSuppression(); for (int iBlock = 0; iBlock<num; iBlock++){ TreeVector trees = treeFillerTask.getBlock(taxa, iBlock, commandRec); if (trees!=null) exportTreesBlock(trees, basePath + iBlock + ".nex", commandRec); } MesquiteTrunk.mesquiteTrunk.decrementProjectBrowserRefreshSuppression(); if (!showTreeFiller) fireEmployee(treeFillerTask); resetAllMenuBars(); } } else if (checker.compare(this.getClass(), "Shows a list of the stored tree blocks", null, commandName, "showTreeBlocks")) { //Check to see if already has lister for this boolean found = false; for (int i = 0; i<getNumberOfEmployees(); i++) { Object e=getEmployeeVector().elementAt(i); if (e instanceof ManagerAssistant) if ( ((ManagerAssistant)e).getName().equals("Tree Blocks List")) { ((ManagerAssistant)e).getModuleWindow().setVisible(true); return e; } } ManagerAssistant lister= (ManagerAssistant)hireNamedEmployee(commandRec, ManagerAssistant.class, StringUtil.tokenize("Tree Blocks List")); if (lister==null){ alert("Sorry, no module was found to list the tree blocks"); return null; } lister.showListWindow(null, commandRec); if (!commandRec.scripting() && lister.getModuleWindow()!=null) lister.getModuleWindow().setVisible(true); return lister; } else if (checker.compare(this.getClass(), "Sets the tree source for use in filling newly created tree blocks", "[name of tree block filler module]", commandName, "setTreeSource")) { TreeBlockFiller temp= (TreeBlockFiller)replaceEmployee(commandRec, TreeBlockFiller.class, arguments, "Source of trees", treeFillerTask); if (temp!=null) { treeFillerTask= temp; } return treeFillerTask; } else if (checker.compare(this.getClass(), "Fires the tree source for use in filling newly created tree blocks",null, commandName, "fireTreeSource")) { if (treeFillerTask!=null) { fireEmployee(treeFillerTask); treeFillerTask = null; } } else if (checker.compare(this.getClass(), "Links file with trees", null, commandName, "linkTreeFile")) { MesquiteModule fCoord = getFileCoordinator(); fCoord.doCommand("linkTreeFile", StringUtil.argumentMarker + "fuseTreeBlocks", commandRec, checker); } else if (checker.compare(this.getClass(), "Includes file with trees", null, commandName, "includeTreeFile")) { MesquiteModule fCoord = getFileCoordinator(); fCoord.doCommand("includeTreeFile", null, commandRec, checker); } else if (checker.compare(this.getClass(), "Includes file with trees", null, commandName, "includePartialTreeFile")) { //this changed considerably between 1.0 and 1.01, using ManyTreesFromFile to avoid memory overflow if (!commandRec.scripting()){ //only non-scripting MesquiteInteger buttonPressed = new MesquiteInteger(); ExtensibleDialog dialog = new ExtensibleDialog(containerOfModule(), "Trees to Include", buttonPressed); IntegerField firstTree = dialog.addIntegerField("First Tree to Read:", 1, 16); IntegerField lastTree = dialog.addIntegerField("Last Tree to Read:", MesquiteInteger.infinite, 16); IntegerField everyNth = dialog.addIntegerField("Sample Every nth tree:", 1, 16); dialog.completeAndShowDialog(true); dialog.dispose(); if (buttonPressed.getValue()!=0) return null; arguments = ""; TreeSource temp = (TreeSource)hireNamedEmployee(commandRec, TreeSource.class, "#mesquite.trees.ManyTreesFromFile.ManyTreesFromFile"); if (temp == null) discreetAlert(commandRec, "Sorry, the file could not be read because the module \"Trees Directly from File\" could not be started"); else { int start = 0; int last = MesquiteInteger.infinite; int every = 1; if (MesquiteInteger.isCombinable(firstTree.getValue()) && firstTree.getValue() != 1) start = firstTree.getValue() - 1; if (MesquiteInteger.isCombinable(lastTree.getValue())) last = (lastTree.getValue() - 1); if (MesquiteInteger.isCombinable(everyNth.getValue()) && everyNth.getValue() != 1) every = (everyNth.getValue()); Tree first = temp.getTree(null, 0, commandRec); //get first tree to figure out taxa block! if (first == null) { fireEmployee(temp); discreetAlert(commandRec, "Sorry, no tree was obtained"); return null; } Taxa taxa = first.getTaxa(); MesquiteFile file = chooseFile(commandRec, taxa); if (file == null){ fireEmployee(temp); return null; } TreeVector trees = new TreeVector(taxa); Tree tree = null; for (int i= start; (i < last) && (i == start || tree !=null); i+= every){ tree = temp.getTree(taxa, i, commandRec); if (tree !=null) trees.addElement(tree, false); } trees.setName(temp.getParameters()); trees.addToFile(file, getProject(), this); fireEmployee(temp); resetAllMenuBars(); } } } else if (checker.compare(this.getClass(), "Creates a new tree block", "[reference of taxa block] [identification number of file to which tree block will belong] [name of tree block]", commandName, "newTreeBlock")) { //first argument: taxa; second argument: id of file to which to add; third argument name of tree block Taxa taxa=null; MesquiteFile file=null; String listName = null; if (StringUtil.blank(arguments)){ //no taxa specified && no file specified if (getProject().getNumberTaxas()==1 || commandRec.scripting()) { taxa = getProject().getTaxa(0); } else { ListableVector taxas = getProject().getTaxas(); taxa = (Taxa)ListDialog.queryList(containerOfModule(), "Select taxa", "Select taxa (for new tree block)", MesquiteString.helpString,taxas, 0); } file = chooseFile(commandRec, taxa); } else { taxa = getProject().getTaxa(parser.getFirstToken(arguments)); int fileID = MesquiteInteger.fromString(parser.getNextToken()); if (!MesquiteInteger.isCombinable(fileID)) file = getProject().getHomeFile(); else file = getProject().getFileByID(fileID); listName = parser.getNextToken(); } if (taxa==null || file == null) return null; TreeVector trees = makeNewTreeBlock(taxa, treesVector.getUniqueName("Untitled Trees Block"), file); if (!StringUtil.blank(listName)) { trees.setName(listName); resetAllMenuBars(); } else if (!commandRec.scripting()) { String name = MesquiteString.queryShortString(containerOfModule(), "Name of trees block", "Name of trees block", treesVector.getUniqueName("Untitled Trees Block")); if (StringUtil.blank(name)) trees.setName(treesVector.getUniqueName("Untitled Trees Block")); else trees.setName(name); resetAllMenuBars(); } return trees; } else if (checker.compare(this.getClass(), "Concatenates the last tree block into the second last", null, commandName, "concatLastTwo")) { int n = treesVector.size(); if (n<2) return null; TreeVector ultimate = (TreeVector)treesVector.elementAt(n-1); TreeVector penultimate = (TreeVector)treesVector.elementAt(n-2); int target = n-3; while (penultimate.getTaxa()!=ultimate.getTaxa() && target>0) penultimate = (TreeVector)treesVector.elementAt(target); if (penultimate.getTaxa()!=ultimate.getTaxa()) return null; for (int j=0; j<ultimate.size(); j++){ Tree tree = ultimate.getTree(j); if (tree!=null) penultimate.addElement(tree.cloneTree(), false); } getProject().removeFileElement(ultimate);//must remove first, before disposing ultimate.dispose(); } else if (checker.compare(this.getClass(), "Disposes the last block of trees", null, commandName, "disposeLastTreeBlock")) { int n = treesVector.size(); if (n<1) return null; TreeVector ultimate = (TreeVector)treesVector.elementAt(n-1); getProject().removeFileElement(ultimate); ultimate.dispose(); } else if (checker.compare(this.getClass(), "Creates a new filled tree block (internally called, used for scripting)", "[reference of taxa block] [optional -- if id then next token is id not number][number of file in which the tree block should be stored] [name of tree block] [how many trees to make]", commandName, "newFilledTreeBlockIntS")) { if (treeFillerTask == null) //needs to have been previously set return null; Taxa taxa = getProject().getTaxa(parser.getFirstToken(arguments)); if (taxa == null) return null; boolean useID = false; MesquiteFile file=null; String idd = parser.getNextToken(); if ("home".equalsIgnoreCase(idd)) file = getProject().getHomeFile(); else { if ("id".equalsIgnoreCase(idd)) { idd = parser.getNextToken(); useID = true; } int whichFile = MesquiteInteger.fromString(idd); if (!MesquiteInteger.isCombinable(whichFile)) return null; if (useID) file = getProject().getFileByID(whichFile); else file = getProject().getFile(whichFile); } if (file == null) return null; String name = parser.getNextToken(); TreeVector trees = new TreeVector(taxa); if (trees == null) return null; int howManyTrees =0; if (treeFillerTask instanceof TreeSource) howManyTrees =((TreeSource)treeFillerTask).getNumberOfTrees(trees.getTaxa(), commandRec); if (!treeFillerTask.hasLimitedTrees(trees.getTaxa(), commandRec)) { howManyTrees = MesquiteInteger.fromString(parser.getNextToken()); if (!MesquiteInteger.isCombinable(howManyTrees)) return null; } boolean separateThread = false; if (separateThread) { TreeBlockThread tLT = new TreeBlockThread(this, treeFillerTask, trees, howManyTrees, file, commandRec); tLT.start(); } else { long s = System.currentTimeMillis(); int before = trees.size(); treeFillerTask.fillTreeBlock(trees, howManyTrees, commandRec); if (trees.size()==before) { logln("Sorry, no trees were returned by " + treeFillerTask.getName()); return null; } trees.setName(name); logln(Integer.toString(trees.size()) + " trees stored in tree block, from " + treeFillerTask.getName()); trees.addToFile(file, getProject(), this); return trees; } } else if (checker.compare(this.getClass(), "Creates a new filled tree block (internally called from menu item)", "[name of tree source module]", commandName, "newFilledTreeBlockInt")) { //arguments that should be accepted: (1) tree source, (2) which taxa, (3) file id, (4) name of tree block, (5) how many trees [number of taxa block] [identification number of file in which the tree block should be stored] [name of tree block] [how many trees to make] Taxa taxa=null; MesquiteFile file=null; if (getProject().getNumberTaxas()==1) taxa = getProject().getTaxa(0); else { ListableVector taxas = getProject().getTaxas(); taxa = (Taxa)ListDialog.queryList(containerOfModule(), "Select taxa", "Select taxa (for new trees block)",MesquiteString.helpString, taxas, 0); } doCommand("setTreeSource", arguments, commandRec, checker); if (treeFillerTask==null) return null; file = chooseFile(commandRec, taxa); if (taxa==null || file == null) return null; TreeVector trees = new TreeVector(taxa); if (trees == null) return null; int howManyTrees = 0; if (!treeFillerTask.hasLimitedTrees(trees.getTaxa(), commandRec)) { if (treeFillerTask instanceof TreeSource) howManyTrees =((TreeSource)treeFillerTask).getNumberOfTrees(trees.getTaxa(), commandRec); if (!MesquiteInteger.isCombinable(howManyTrees)) howManyTrees = MesquiteInteger.queryInteger(containerOfModule(), "How many trees?", "How many trees?", 100, 1, 100000000); if (!MesquiteInteger.isCombinable(howManyTrees)) return null; } boolean separateThread = true; //TODO: what if the treeFillerTask quits while running? if (separateThread) { TreeBlockThread tLT = new TreeBlockThread(this, treeFillerTask, trees, howManyTrees, file, commandRec); tLT.start(); } else { long s = System.currentTimeMillis(); int before = trees.size(); treeFillerTask.fillTreeBlock(trees, howManyTrees, commandRec); if (trees.size()==before) { alert("Sorry, no trees were returned by " + treeFillerTask.getName()); return null; } if (trees.getName()==null || "Untitled".equalsIgnoreCase(trees.getName())) trees.setName("Trees from " + treeFillerTask.getName()); trees.addToFile(file, getProject(), this); doneQuery(treeFillerTask, taxa, trees); if (!showTreeFiller) fireEmployee(treeFillerTask); resetAllMenuBars(); } } else return super.doCommand(commandName, arguments, commandRec, checker); return null; }
57538 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57538/6415c3612051354f7fa8f1508f4686d6b2783a71/ManageTrees.java/buggy/trunk/Mesquite Project/Source/mesquite/trees/ManageTrees/ManageTrees.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1377, 202, 1071, 1033, 741, 2189, 12, 780, 20893, 16, 514, 1775, 16, 3498, 2115, 1296, 5650, 16, 3498, 8847, 12489, 13, 288, 377, 202, 225, 202, 430, 261, 19243, 18, 9877, 12, 2211, 18, 588,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1377, 202, 1071, 1033, 741, 2189, 12, 780, 20893, 16, 514, 1775, 16, 3498, 2115, 1296, 5650, 16, 3498, 8847, 12489, 13, 288, 377, 202, 225, 202, 430, 261, 19243, 18, 9877, 12, 2211, 18, 588,...
this.proxyGroup.add(this.index,ProActive.newActive(className, param, node));
this.proxyGroup.set(this.index,ProActive.newActive(className, param, node));
public void run() { try { this.proxyGroup.add(this.index,ProActive.newActive(className, param, node)); this.proxyGroup.decrementWaitedAndNotifyAll(); } catch (Exception e) { e.printStackTrace(); } }
23362 /local/tlutelli/issta_data/temp/all_java2context/java/2006_temp/2006/23362/fb82c18fe6ca26349fbd0d510a30995cea2ea1f1/ProcessForGroupCreation.java/clean/src/org/objectweb/proactive/core/group/ProcessForGroupCreation.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 1086, 1435, 288, 202, 202, 698, 288, 1082, 202, 2211, 18, 5656, 1114, 18, 1289, 12, 2211, 18, 1615, 16, 626, 3896, 18, 2704, 3896, 12, 12434, 16, 579, 16, 756, 10019, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 1086, 1435, 288, 202, 202, 698, 288, 1082, 202, 2211, 18, 5656, 1114, 18, 1289, 12, 2211, 18, 1615, 16, 626, 3896, 18, 2704, 3896, 12, 12434, 16, 579, 16, 756, 10019, 1...
|| lastSegment.endsWith(".plist")
public IPath asResourcePath(IPath path, IResource res) { /*if (IResource.FOLDER == res.getType()) { if ( lastSegment.endsWith (".wo") || lastSegment.endsWith (".eomodeld") ) { return (getResourceOutputPath().append(lastSegment)); } } else */ if (IResource.FILE == res.getType()) { String lastSegment = path.lastSegment(); if (lastSegment.equals("Properties") || lastSegment.endsWith(".api") || lastSegment.endsWith(".d2wmodel") || lastSegment.endsWith(".plist") || lastSegment.endsWith(".xml") || lastSegment.endsWith(".strings") && (-1 == path.toString().indexOf(".wo/")) && (-1 == path.toString().indexOf(".eomodeld/"))) { return (_appendSpecial(getResourceOutputPath(), path)); } String parentName = res.getParent().getName(); if (parentName.endsWith(".wo") || parentName.endsWith(".eomodeld")) { return ( _appendSpecial( getResourceOutputPath(), res.getParent().getProjectRelativePath()).append( lastSegment)); //return (getResourceOutputPath().append(parentName).append(lastSegment)); } } return (null); }
47899 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47899/2f6f0e6dab4a1d8f1b694de7c192362b301393a1/IncrementalNature.java/buggy/src/wolips-projectbuild/java/org/objectstyle/wolips/projectbuild/natures/IncrementalNature.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 467, 743, 487, 29906, 12, 45, 743, 589, 16, 467, 1420, 400, 13, 288, 202, 202, 20308, 430, 261, 45, 1420, 18, 17357, 422, 400, 18, 588, 559, 10756, 288, 1082, 225, 309, 261,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 467, 743, 487, 29906, 12, 45, 743, 589, 16, 467, 1420, 400, 13, 288, 202, 202, 20308, 430, 261, 45, 1420, 18, 17357, 422, 400, 18, 588, 559, 10756, 288, 1082, 225, 309, 261,...
logln("==test_03: CertificateEncodingException==");
public void testCertificateEncodingException03() { logln("==test_03: CertificateEncodingException=="); String msg = null; CertificateEncodingException tE = new CertificateEncodingException(msg); assertTrue(errNotExc, tE instanceof CertificateEncodingException); assertNull("getMessage() must return null.", tE.getMessage()); assertNull("getCause() must return null", tE.getCause()); try { throw tE; } catch (Exception e) { assertTrue(createErr(tE, e), tE.equals(e)); } }
54769 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54769/a9fd98c8fca0593ca0da8ba774c48808f903f221/CertificateEncodingExceptionTest.java/buggy/modules/security2/test/common/unit/java/security/cert/CertificateEncodingExceptionTest.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1842, 4719, 13836, 4630, 1435, 288, 2868, 514, 1234, 273, 446, 31, 3639, 6660, 13836, 268, 41, 273, 394, 6660, 13836, 12, 3576, 1769, 3639, 1815, 5510, 12, 370, 1248, 29924, 16...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1842, 4719, 13836, 4630, 1435, 288, 2868, 514, 1234, 273, 446, 31, 3639, 6660, 13836, 268, 41, 273, 394, 6660, 13836, 12, 3576, 1769, 3639, 1815, 5510, 12, 370, 1248, 29924, 16...
/* if the call is asynchronous the group of result will be a group a future */ else { int size = memberListProxy.size(); /* Creates a stub + ProxyForGroup for representing the result */ Object[] paramProxy = new Object[0]; result = MOP.newInstance (c.getReifiedMethod().getReturnType().getName(), null, "org.objectweb.proactive.core.group.ProxyForGroup", paramProxy); ((ProxyForGroup)((StubObject)result).getProxy()).className = c.getReifiedMethod().getReturnType().getName(); List memberListStubOfResult = ((ProxyForGroup)((StubObject)result).getProxy()).memberListStub; List memberListProxyOfResult = ((ProxyForGroup)((StubObject)result).getProxy()).memberListProxy; for (int i = 0 ; i < size ; i++) { memberListStubOfResult.add(null); memberListProxyOfResult.add(null);
/* if the call is asynchronous the group of result will be a group a future */ else { System.out.println(" APPEL ASYNCHRONE : " + c.getName()); result = asynchronousCallOnGroup(c); } /* A barrier of synchronisation to be sur that all calls are done before continuing the execution */ this.waitForAllCallsDone(); return result;
public Object reify (MethodCall c) throws Throwable { /* result will be a stub on a proxy for group representing the group of results */ Object result = null; this.waitForAllCallsDone(); /* if OneWay : do not construct result */ if (AbstractProxy.isOneWayCall (c)) { oneWayCallOnGroup(c); } /* if the call is asynchronous the group of result will be a group a future */ else // if (AbstractProxy.isAsynchronousCall (c)) // SYNC == ASYNC !!!! { int size = memberListProxy.size(); /* Creates a stub + ProxyForGroup for representing the result */ Object[] paramProxy = new Object[0]; result = MOP.newInstance (c.getReifiedMethod().getReturnType().getName(), null, "org.objectweb.proactive.core.group.ProxyForGroup", paramProxy); ((ProxyForGroup)((StubObject)result).getProxy()).className = c.getReifiedMethod().getReturnType().getName(); // Init the lists of result with null value to permit the "set(index)" operation List memberListStubOfResult = ((ProxyForGroup)((StubObject)result).getProxy()).memberListStub; List memberListProxyOfResult = ((ProxyForGroup)((StubObject)result).getProxy()).memberListProxy; for (int i = 0 ; i < size ; i++) { memberListStubOfResult.add(null); memberListProxyOfResult.add(null); } // Creating Threads for (int i = 0 ; i < size ; i++) { Object tmp = ((Proxy)(memberListProxy.get(i))).reify(c); addToListOfResult(memberListProxyOfResult,memberListStubOfResult,tmp,i); memberListStubOfResult.set(i,tmp); memberListProxyOfResult.set(i,((StubObject)tmp).getProxy()); //((ProxyForGroup)((StubObject)result).getProxy()).createThreadForAsync(this.memberListProxy,memberListProxyOfResult,memberListStubOfResult,i,c); } } return result; }
14315 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/14315/fc27e74d94166bb2e12de628d05e73311efa407a/ProxyForGroup.java/clean/src/org/objectweb/proactive/core/group/ProxyForGroup.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 1033, 283, 1164, 261, 12592, 276, 13, 1216, 4206, 288, 202, 20308, 563, 903, 506, 279, 7168, 603, 279, 2889, 364, 1041, 5123, 326, 1041, 434, 1686, 1195, 202, 921, 563, 273, 446, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 1033, 283, 1164, 261, 12592, 276, 13, 1216, 4206, 288, 202, 20308, 563, 903, 506, 279, 7168, 603, 279, 2889, 364, 1041, 5123, 326, 1041, 434, 1686, 1195, 202, 921, 563, 273, 446, ...
i1 = Integer.parseInt(((CourseMember) o1).getId());
i1 = Integer.parseInt(((CourseMember) o1).getUniqname());
public int compare ( Object o1, Object o2) { int result = -1; if(m_criterion==null) m_criterion = SORTED_BY_TITLE; /************* for sorting site list *******************/ if (m_criterion.equals (SORTED_BY_TITLE)) { // sorted by the worksite title String s1 = ((Site) o1).getTitle(); String s2 = ((Site) o2).getTitle(); result = s1.compareToIgnoreCase (s2); } else if (m_criterion.equals (SORTED_BY_DESCRIPTION)) { // sorted by the site short description String s1 = ((Site) o1).getShortDescription(); String s2 = ((Site) o2).getShortDescription(); if (s1==null && s2==null) { result = 0; } else if (s2==null) { result = 1; } else if (s1==null) { result = -1; } else { result = s1.compareToIgnoreCase (s2); } } else if (m_criterion.equals (SORTED_BY_TYPE)) { // sorted by the site type String s1 = ((Site) o1).getType(); String s2 = ((Site) o2).getType(); if (s1==null && s2==null) { result = 0; } else if (s2==null) { result = 1; } else if (s1==null) { result = -1; } else { result = s1.compareToIgnoreCase (s2); } } else if (m_criterion.equals (SORTED_BY_OWNER)) { // sorted by the site creator String s1 = ((Site) o1).getProperties().getProperty("CHEF:creator"); String s2 = ((Site) o2).getProperties().getProperty("CHEF:creator"); if (s1==null && s2==null) { result = 0; } else if (s2==null) { result = 1; } else if (s1==null) { result = -1; } else { result = s1.compareToIgnoreCase (s2); } } else if (m_criterion.equals (SORTED_BY_STATUS)) { // sort by the status, published or unpublished int i1 = ((Site)o1).isPublished() ? 1 : 0; int i2 = ((Site)o2).isPublished() ? 1 : 0; if (i1 > i2) { result = 1; } else { result = -1; } } else if (m_criterion.equals (SORTED_BY_JOINABLE)) { // sort by whether the site is joinable or not boolean b1 = ((Site)o1).isJoinable(); boolean b2 = ((Site)o2).isJoinable(); if (b1 == b2) { result = 0; } else if (b1 == true) { result = 1; } else { result = -1; } } else if (m_criterion.equals (SORTED_BY_PARTICIPANT_NAME)) { // sort by whether the site is joinable or not String s1 = null; if (o1.getClass().equals(Participant.class)) { s1 = ((Participant) o1).getName(); } else if (o1.getClass().equals(CourseMember.class)) { s1 = ((CourseMember) o1).getName(); } String s2 = null; if (o2.getClass().equals(Participant.class)) { s2 = ((Participant) o2).getName(); } else if (o2.getClass().equals(CourseMember.class)) { s2 = ((CourseMember) o2).getName(); } if (s1==null && s2==null) { result = 0; } else if (s2==null) { result = 1; } else if (s1==null) { result = -1; } else { result = s1.compareToIgnoreCase (s2); } } else if (m_criterion.equals (SORTED_BY_PARTICIPANT_UNIQNAME)) { // sort by whether the site is joinable or not String s1 = null; if (o1.getClass().equals(Participant.class)) { s1 = ((Participant) o1).getUniqname(); } else if (o1.getClass().equals(CourseMember.class)) { s1 = ((CourseMember) o1).getUniqname(); } String s2 = null; if (o2.getClass().equals(Participant.class)) { s2 = ((Participant) o2).getUniqname(); } else if (o2.getClass().equals(CourseMember.class)) { s2 = ((CourseMember) o2).getUniqname(); } if (s1==null && s2==null) { result = 0; } else if (s2==null) { result = 1; } else if (s1==null) { result = -1; } else { result = s1.compareToIgnoreCase (s2); } } else if (m_criterion.equals (SORTED_BY_PARTICIPANT_ROLE)) { String s1 = ""; if (o1.getClass().equals(Participant.class)) { s1 = ((Participant) o1).getRole(); } else if (o1.getClass().equals(CourseMember.class)) { s1 = ((CourseMember) o1).getRole(); } String s2 = ""; if (o2.getClass().equals(Participant.class)) { s2 = ((Participant) o2).getRole(); } else if (o2.getClass().equals(CourseMember.class)) { s2 = ((CourseMember) o2).getRole(); } if (s1.length() == 0 && s2.length() == 0) { result = 0; } else if (s2.length() == 0) { result = 1; } else if (s1.length() == 0) { result = -1; } else { result = s1.compareToIgnoreCase (s2); } } else if (m_criterion.equals (SORTED_BY_PARTICIPANT_COURSE)) { // sort by whether the site is joinable or not String s1 = null; if (o1.getClass().equals(Participant.class)) { } else if (o1.getClass().equals(CourseMember.class)) { s1 = ((CourseMember) o1).getCourse() + " " + ((CourseMember) o1).getSection(); } String s2 = null; if (o2.getClass().equals(Participant.class)) { } else if (o2.getClass().equals(CourseMember.class)) { s2 = ((CourseMember) o2).getCourse() + " " + ((CourseMember) o2).getSection(); } if (s1==null && s2==null) { result = 0; } else if (s2==null) { result = 1; } else if (s1==null) { result = -1; } else { result = s1.compareToIgnoreCase (s2); } } else if (m_criterion.equals (SORTED_BY_PARTICIPANT_ID)) { int i1 = -1; if (o1.getClass().equals(Participant.class)) { } else if (o1.getClass().equals(CourseMember.class)) { try { i1 = Integer.parseInt(((CourseMember) o1).getId()); } catch (Exception e) {} } int i2 = -1; if (o2.getClass().equals(Participant.class)) { } else if (o2.getClass().equals(CourseMember.class)) { try { i2 = Integer.parseInt(((CourseMember) o2).getId()); } catch (Exception e) {} } if (i1 > i2) { result = 1; } else { result = -1; } } else if (m_criterion.equals (SORTED_BY_PARTICIPANT_CREDITS)) { int i1 = -1; if (o1.getClass().equals(Participant.class)) { } else if (o1.getClass().equals(CourseMember.class)) { try { i1 = Integer.parseInt(((CourseMember) o1).getCredits()); } catch (Exception e) {} } int i2 = -1; if (o2.getClass().equals(Participant.class)) { } else if (o2.getClass().equals(CourseMember.class)) { try { i2 = Integer.parseInt(((CourseMember) o2).getCredits()); } catch (Exception e) {} } if (i1 > i2) { result = 1; } else { result = -1; } } else if (m_criterion.equals (SORTED_BY_CREATION_DATE)) { // sort by the site's creation date Time t1 = null; Time t2 = null; // get the times try { t1 = ((Site)o1).getProperties().getTimeProperty(ResourceProperties.PROP_CREATION_DATE); } catch (EntityPropertyNotDefinedException e) { } catch (EntityPropertyTypeException e) { } try { t2 = ((Site)o2).getProperties().getTimeProperty(ResourceProperties.PROP_CREATION_DATE); } catch (EntityPropertyNotDefinedException e) { } catch (EntityPropertyTypeException e) { } if (t1==null) { result = -1; } else if (t2==null) { result = 1; } else if (t1.before (t2)) { result = -1; } else { result = 1; } } else if (m_criterion.equals (rb.getString("group.title"))) { // sorted by the group title String s1 = ((Group) o1).getTitle(); String s2 = ((Group) o2).getTitle(); result = s1.compareToIgnoreCase (s2); } else if (m_criterion.equals (rb.getString("group.number"))) { // sorted by the group title int n1 = ((Group) o1).getMembers().size(); int n2 = ((Group) o2).getMembers().size(); result = (n1 > n2)?1:-1; } else if (m_criterion.equals (SORTED_BY_MEMBER_NAME)) { // sorted by the member name String s1 = ""; String s2 = ""; try { s1 = UserDirectoryService.getUser(((Member) o1).getUserId()).getSortName(); } catch(Exception ignore) { } try { s2 = UserDirectoryService.getUser(((Member) o2).getUserId()).getSortName(); } catch (Exception ignore) { } result = s1.compareToIgnoreCase (s2); } if(m_asc == null) m_asc = Boolean.TRUE.toString (); // sort ascending or descending if (m_asc.equals (Boolean.FALSE.toString ())) { result = -result; } return result; } // compare
2021 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2021/f876704fe8e0b6521187b14035cd18ad3374e047/SiteAction.java/clean/site-manage/site-manage-tool/tool/src/java/org/sakaiproject/site/tool/SiteAction.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 3196, 202, 482, 509, 3400, 261, 1033, 320, 21, 16, 1033, 320, 22, 13, 202, 202, 95, 1082, 202, 474, 563, 273, 300, 21, 31, 25083, 202, 430, 12, 81, 67, 71, 7082, 631, 2011, 13, 312, 67, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 3196, 202, 482, 509, 3400, 261, 1033, 320, 21, 16, 1033, 320, 22, 13, 202, 202, 95, 1082, 202, 474, 563, 273, 300, 21, 31, 25083, 202, 430, 12, 81, 67, 71, 7082, 631, 2011, 13, 312, 67, ...
public boolean isBlocked(){
public boolean isBlocked() {
public boolean isBlocked(){ return getBlockedStatus() != null; }
58148 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/58148/e6af75d1024403d1ef1e4ec4c9024c6f7fac26a7/JobInfo.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobInfo.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 1250, 353, 23722, 1435, 95, 202, 202, 2463, 11902, 329, 1482, 1435, 480, 446, 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, 1250, 353, 23722, 1435, 95, 202, 202, 2463, 11902, 329, 1482, 1435, 480, 446, 31, 202, 97, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
String name = fn.getFunctionName();
String name = ofn.getFunctionName();
public ScriptOrFnNode transform(Context cx, ScriptOrFnNode tree) { initOptFunctions_r(tree); int optLevel = cx.getOptimizationLevel(); Hashtable possibleDirectCalls = null; if (optLevel > 0) { /* * Collect all of the contained functions into a hashtable * so that the call optimizer can access the class name & parameter * count for any call it encounters */ if (tree.getType() == Token.SCRIPT) { int functionCount = tree.getFunctionCount(); for (int i = 0; i != functionCount; ++i) { OptFunctionNode fn; fn = (OptFunctionNode)tree.getFunctionNode(i); if (fn.getFunctionType() == FunctionNode.FUNCTION_STATEMENT) { String name = fn.getFunctionName(); if (name.length() != 0) { if (possibleDirectCalls == null) { possibleDirectCalls = new Hashtable(); } possibleDirectCalls.put(name, fn); } } } } } if (possibleDirectCalls != null) { directCallTargets = new ObjArray(); } OptTransformer ot = new OptTransformer(this, possibleDirectCalls, directCallTargets); ot.transform(tree); if (optLevel > 0) { (new Optimizer()).optimize(tree, optLevel); } return tree; }
19042 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/19042/6505e7e507fe59e4b215af49f763bdb10394b83d/Codegen.java/clean/src/org/mozilla/javascript/optimizer/Codegen.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 7739, 1162, 5372, 907, 2510, 12, 1042, 9494, 16, 7739, 1162, 5372, 907, 2151, 13, 565, 288, 3639, 1208, 6179, 7503, 67, 86, 12, 3413, 1769, 3639, 509, 2153, 2355, 273, 9494, 18, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 7739, 1162, 5372, 907, 2510, 12, 1042, 9494, 16, 7739, 1162, 5372, 907, 2151, 13, 565, 288, 3639, 1208, 6179, 7503, 67, 86, 12, 3413, 1769, 3639, 509, 2153, 2355, 273, 9494, 18, 5...
rewrite.markAsRemoved((ASTNode) decls.get(1));
rewrite.markAsRemoved((ASTNode) decls.get(1), null);
public void testRemove2() throws Exception { // remove second IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); StringBuffer buf= new StringBuffer(); buf.append("package test1;\n"); buf.append("public class C {\n"); buf.append("//c1\n"); buf.append("\n"); buf.append(" public void foo1();\n"); buf.append("\n"); buf.append("//c2\n"); buf.append("\n"); buf.append(" public void foo2();\n"); buf.append("\n"); buf.append("//c3\n"); buf.append("\n"); buf.append(" public void foo3();\n"); buf.append("\n"); buf.append("//c4\n"); buf.append("}\n"); ICompilationUnit cu= pack1.createCompilationUnit("C.java", buf.toString(), false, null); CompilationUnit astRoot= createAST(cu); NewASTRewrite rewrite= new NewASTRewrite(astRoot.getAST()); TypeDeclaration type= findTypeDeclaration(astRoot, "C"); List decls= type.bodyDeclarations(); rewrite.markAsRemoved((ASTNode) decls.get(1)); String preview= evaluateRewrite(cu, rewrite); buf= new StringBuffer(); buf.append("package test1;\n"); buf.append("public class C {\n"); buf.append("//c1\n"); buf.append("\n"); buf.append(" public void foo1();\n"); buf.append("\n"); buf.append("//c2\n"); buf.append("\n"); buf.append(" public void foo3();\n"); buf.append("\n"); buf.append("//c4\n"); buf.append("}\n"); assertEqualString(preview, buf.toString()); }
9698 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/9698/57e3aa581b2bf9d9c15ee310aa69c71cec638595/ASTRewritingInsertBoundTest.java/buggy/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingInsertBoundTest.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 1842, 3288, 22, 1435, 1216, 1185, 288, 202, 202, 759, 1206, 2205, 9506, 202, 45, 2261, 7456, 2298, 21, 33, 284, 1830, 3899, 18, 2640, 2261, 7456, 2932, 3813, 21, 3113, 62...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3288, 22, 1435, 1216, 1185, 288, 202, 202, 759, 1206, 2205, 9506, 202, 45, 2261, 7456, 2298, 21, 33, 284, 1830, 3899, 18, 2640, 2261, 7456, 2932, 3813, 21, 3113, 62...
} else if (statement instanceof PsiDoWhileStatement) {
} else if(statement instanceof PsiDoWhileStatement){
public static boolean statementMayCompleteNormally(PsiStatement statement) { if (statement == null) { return true; } if (statement instanceof PsiBreakStatement || statement instanceof PsiContinueStatement || statement instanceof PsiReturnStatement || statement instanceof PsiThrowStatement) { return false; } else if (statement instanceof PsiExpressionListStatement || statement instanceof PsiExpressionStatement || statement instanceof PsiEmptyStatement || statement instanceof PsiAssertStatement || statement instanceof PsiDeclarationStatement) { return true; } else if (statement instanceof PsiForStatement) { return forStatementMayReturnNormally((PsiForStatement) statement); } else if (statement instanceof PsiForeachStatement) { return foreachStatementMayReturnNormally((PsiForeachStatement) statement); } else if (statement instanceof PsiWhileStatement) { return whileStatementMayReturnNormally((PsiWhileStatement) statement); } else if (statement instanceof PsiDoWhileStatement) { return doWhileStatementMayReturnNormally((PsiDoWhileStatement) statement); } else if (statement instanceof PsiSynchronizedStatement) { final PsiCodeBlock body = ((PsiSynchronizedStatement) statement).getBody(); return codeBlockMayCompleteNormally(body); } else if (statement instanceof PsiBlockStatement) { final PsiCodeBlock codeBlock = ((PsiBlockStatement) statement).getCodeBlock(); return codeBlockMayCompleteNormally(codeBlock); } else if (statement instanceof PsiLabeledStatement) { return labeledStatementMayCompleteNormally((PsiLabeledStatement) statement); } else if (statement instanceof PsiIfStatement) { return ifStatementMayReturnNormally((PsiIfStatement) statement); } else if (statement instanceof PsiTryStatement) { return tryStatementMayReturnNormally((PsiTryStatement) statement); } else if (statement instanceof PsiSwitchStatement) { return switchStatementMayReturnNormally((PsiSwitchStatement) statement); } else // unknown statement type { return true; } }
56598 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56598/dba8b183fc1b08e7ad664812bfc0c64d1e4abd3c/ControlFlowUtils.java/buggy/plugins/InspectionGadgets/src/com/siyeh/ig/psiutils/ControlFlowUtils.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 760, 1250, 3021, 49, 528, 6322, 14624, 1230, 12, 52, 7722, 3406, 3021, 13, 288, 3639, 309, 261, 11516, 422, 446, 13, 288, 5411, 327, 638, 31, 3639, 289, 3639, 309, 261, 11516, 127...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1250, 3021, 49, 528, 6322, 14624, 1230, 12, 52, 7722, 3406, 3021, 13, 288, 3639, 309, 261, 11516, 422, 446, 13, 288, 5411, 327, 638, 31, 3639, 289, 3639, 309, 261, 11516, 127...
protected void createDescriptionLayout(Composite composite) {
protected void createDescriptionLayout(Composite composite) {
protected void createDescriptionLayout(Composite composite) { FormToolkit toolkit = new FormToolkit(composite.getDisplay()); Section section = toolkit.createSection(composite, ExpandableComposite.TITLE_BAR); section.setText(LABEL_SECTION_DESCRIPTION); section.setExpanded(true); section.setLayout(new GridLayout()); section.setLayoutData(new GridData(GridData.FILL_BOTH)); Composite descriptionComposite = toolkit.createComposite(section); GridLayout descriptionLayout = new GridLayout(); descriptionComposite.setLayout(descriptionLayout); GridData descriptionData = new GridData(GridData.FILL_BOTH); descriptionData.grabExcessVerticalSpace = true; descriptionComposite.setLayoutData(descriptionData); section.setClient(descriptionComposite); descriptionTextViewer = addTextEditor(repository, descriptionComposite, getRepositoryTaskData() .getNewComment(), true, SWT.FLAT | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL); descriptionTextViewer.setEditable(true); GridData descriptionTextData = new GridData(GridData.FILL_BOTH); descriptionTextViewer.getControl().setLayoutData(descriptionTextData); descriptionTextViewer.getControl().setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); toolkit.paintBordersFor(descriptionComposite); }
51151 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51151/f9020b3fa8e2bdf1cdc4fdb4e6ab827b16d8aa20/NewBugEditor.java/clean/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/NewBugEditor.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1117, 918, 752, 3291, 3744, 12, 9400, 9635, 13, 288, 3196, 202, 1204, 6364, 8691, 5226, 8691, 273, 394, 2748, 6364, 8691, 12, 27676, 18, 588, 4236, 10663, 202, 202, 5285, 2442, 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, 225, 202, 1117, 918, 752, 3291, 3744, 12, 9400, 9635, 13, 288, 3196, 202, 1204, 6364, 8691, 5226, 8691, 273, 394, 2748, 6364, 8691, 12, 27676, 18, 588, 4236, 10663, 202, 202, 5285, 2442, 273, ...
Vector ticket = (Vector) call("ticket.get", id); Hashtable values = (Hashtable) ticket.get(3);
Object[] ticket = (Object[]) call("ticket.get", id); Map values = (Map) ticket[3];
public void testUpdateTicket() throws XmlRpcException, IOException { int id = (Integer) call("ticket.create", "summary", "description", new Hashtable()); Hashtable<String, Object> attributes = new Hashtable<String, Object>(); attributes.put("summary", "changed"); call("ticket.update", id, "my comment", attributes); attributes.put("description", "description"); Vector ticket = (Vector) call("ticket.get", id); Hashtable values = (Hashtable) ticket.get(3); for (String attribute : attributes.keySet()) { assertEquals(attributes.get(attribute), values.get(attribute)); } call("ticket.delete", id); }
51989 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51989/e002989b589109218ad9aca7da8010c05cb98eb8/TracXmlRpcTest.java/clean/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcTest.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 1842, 1891, 13614, 1435, 1216, 5714, 11647, 503, 16, 1860, 288, 202, 202, 474, 612, 273, 261, 4522, 13, 745, 2932, 16282, 18, 2640, 3113, 315, 7687, 3113, 315, 3384, 3113, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1891, 13614, 1435, 1216, 5714, 11647, 503, 16, 1860, 288, 202, 202, 474, 612, 273, 261, 4522, 13, 745, 2932, 16282, 18, 2640, 3113, 315, 7687, 3113, 315, 3384, 3113, ...
private Object js_parseInt(Context cx, Object[] args) {
private Object js_parseInt(Object[] args) {
private Object js_parseInt(Context cx, Object[] args) { String s = ScriptRuntime.toString(args, 0); int radix = ScriptRuntime.toInt32(args, 1); int len = s.length(); if (len == 0) return ScriptRuntime.NaNobj; boolean negative = false; int start = 0; char c; do { c = s.charAt(start); if (!Character.isWhitespace(c)) break; start++; } while (start < len); if (c == '+' || (negative = (c == '-'))) start++; final int NO_RADIX = -1; if (radix == 0) { radix = NO_RADIX; } else if (radix < 2 || radix > 36) { return ScriptRuntime.NaNobj; } else if (radix == 16 && len - start > 1 && s.charAt(start) == '0') { c = s.charAt(start+1); if (c == 'x' || c == 'X') start += 2; } if (radix == NO_RADIX) { radix = 10; if (len - start > 1 && s.charAt(start) == '0') { c = s.charAt(start+1); if (c == 'x' || c == 'X') { radix = 16; start += 2; } else if ('0' <= c && c <= '9') { radix = 8; start++; } } } double d = ScriptRuntime.stringToNumber(s, start, radix); return new Double(negative ? -d : d); }
51275 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51275/4ad826a35e76cb27011d7ce32f9515c2d80a93c0/NativeGlobal.java/clean/js/rhino/src/org/mozilla/javascript/NativeGlobal.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 1033, 3828, 67, 2670, 1702, 12, 921, 8526, 833, 13, 288, 3639, 514, 272, 273, 7739, 5576, 18, 10492, 12, 1968, 16, 374, 1769, 3639, 509, 19015, 273, 7739, 5576, 18, 869, 1702, 157...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1033, 3828, 67, 2670, 1702, 12, 921, 8526, 833, 13, 288, 3639, 514, 272, 273, 7739, 5576, 18, 10492, 12, 1968, 16, 374, 1769, 3639, 509, 19015, 273, 7739, 5576, 18, 869, 1702, 157...
case 172: break;
case 175: break;
public Symbol next_token() throws java.io.IOException { int yyFlexInput; int yyFlexAction; int [] yyFlexTransL = YY_TRANS; int [] yyFlexRowMapL = YY_ROWMAP; int [] yyFlexAttrL = YY_ATTRIBUTE; int yyFlexPushbackPos_l = yyFlexPushbackPos = -1; boolean yy_was_pushback; while (true) { // cached fields: int yyFlexCurrentPosL; int yyFlexMarkedPosL = yyFlexMarkedPos; int yyFlexEndReadL = yyFlexEndRead; char [] yyFlexBufferL = yyFlexBuffer; char [] yyCMapL = YY_CMAP; boolean yyFlexR = false; for (yyFlexCurrentPosL = yyFlexStartRead; yyFlexCurrentPosL < yyFlexMarkedPosL; yyFlexCurrentPosL++) { switch (yyFlexBufferL[yyFlexCurrentPosL]) { case '\u000B': case '\u000C': case '\u0085': case '\u2028': case '\u2029': yyline++; yycolumn = 0; yyFlexR = false; break; case '\r': yyline++; yycolumn = 0; yyFlexR = true; break; case '\n': if (yyFlexR) yyFlexR = false; else { yyline++; yycolumn = 0; } break; default: yyFlexR = false; yycolumn++; } } if (yyFlexR) { // peek one character ahead if it is \n (if we have counted one line too much) boolean yyFlexPeek; if (yyFlexMarkedPosL < yyFlexEndReadL) yyFlexPeek = yyFlexBufferL[yyFlexMarkedPosL] == '\n'; else if (yyFlexAtEOF) yyFlexPeek = false; else { boolean eof = yyFlexRefill(); yyFlexMarkedPosL = yyFlexMarkedPos; yyFlexBufferL = yyFlexBuffer; if (eof) yyFlexPeek = false; else yyFlexPeek = yyFlexBufferL[yyFlexMarkedPosL] == '\n'; } if (yyFlexPeek) yyline--; } if (yyFlexMarkedPosL > yyFlexStartRead) { switch (yyFlexBufferL[yyFlexMarkedPosL-1]) { case '\n': case '\u000B': case '\u000C': case '\u0085': case '\u2028': case '\u2029': yyFlexAtBOL = true; break; case '\r': if (yyFlexMarkedPosL < yyFlexEndReadL) yyFlexAtBOL = yyFlexBufferL[yyFlexMarkedPosL] != '\n'; else if (yyFlexAtEOF) yyFlexAtBOL = false; else { boolean eof = yyFlexRefill(); yyFlexMarkedPosL = yyFlexMarkedPos; yyFlexBufferL = yyFlexBuffer; if (eof) yyFlexAtBOL = false; else yyFlexAtBOL = yyFlexBufferL[yyFlexMarkedPosL] != '\n'; } break; default: yyFlexAtBOL = false; } } yyFlexAction = -1; yyFlexCurrentPosL = yyFlexCurrentPos = yyFlexStartRead = yyFlexMarkedPosL; if (yyFlexAtBOL) yyFlexState = YY_LEXSTATE[yyFlexLexicalState+1]; else yyFlexState = YY_LEXSTATE[yyFlexLexicalState]; yy_was_pushback = false; yy_forAction: { while (true) { if (yyFlexCurrentPosL < yyFlexEndReadL) yyFlexInput = yyFlexBufferL[yyFlexCurrentPosL++]; else if (yyFlexAtEOF) { yyFlexInput = YYEOF; break yy_forAction; } else { // store back cached positions yyFlexCurrentPos = yyFlexCurrentPosL; yyFlexMarkedPos = yyFlexMarkedPosL; yyFlexPushbackPos = yyFlexPushbackPos_l; boolean eof = yyFlexRefill(); // get translated positions and possibly new buffer yyFlexCurrentPosL = yyFlexCurrentPos; yyFlexMarkedPosL = yyFlexMarkedPos; yyFlexBufferL = yyFlexBuffer; yyFlexEndReadL = yyFlexEndRead; yyFlexPushbackPos_l = yyFlexPushbackPos; if (eof) { yyFlexInput = YYEOF; break yy_forAction; } else { yyFlexInput = yyFlexBufferL[yyFlexCurrentPosL++]; } } int yyFlexNext = yyFlexTransL[ yyFlexRowMapL[yyFlexState] + yyCMapL[yyFlexInput] ]; if (yyFlexNext == -1) break yy_forAction; yyFlexState = yyFlexNext; int yyFlexAttributes = yyFlexAttrL[yyFlexState]; if ( (yyFlexAttributes & 2) == 2 ) yyFlexPushbackPos_l = yyFlexCurrentPosL; if ( (yyFlexAttributes & 1) == 1 ) { yy_was_pushback = (yyFlexAttributes & 4) == 4; yyFlexAction = yyFlexState; yyFlexMarkedPosL = yyFlexCurrentPosL; if ( (yyFlexAttributes & 8) == 8 ) break yy_forAction; } } } // store back cached position yyFlexMarkedPos = yyFlexMarkedPosL; if (yy_was_pushback) yyFlexMarkedPos = yyFlexPushbackPos_l; switch (yyFlexAction < 0 ? yyFlexAction : YY_ACTION[yyFlexAction]) { case 85: { return symbol(FULL); } case 141: break; case 92: { debugOption = true; } case 142: break; case 57: { return symbol(CHAR,new Character('\t')); } case 143: break; case 107: { throw new ScannerException(file,ErrorMessages.NO_BUFFER_SIZE, yyline); } case 144: break; case 91: { isYYEOF = true; } case 145: break; case 54: { return symbol(CHAR, new Character(yytext().charAt(1))); } case 146: break; case 11: { yybegin(REGEXP); } case 147: break; case 112: { isAbstract = true; } case 148: break; case 101: { initCode = conc(initCode,string); yybegin(MACROS); } case 149: break; case 45: { throw new ScannerException(file,ErrorMessages.UNEXPECTED_NL, yyline, yycolumn); } case 150: break; case 12: { return symbol_countUpdate(RBRACE, null); } case 151: break; case 74: { return symbol(REPEAT, new Integer(yytext().substring(1).trim())); } case 152: break; case 55: { return symbol(CHAR, new Character( (char) Integer.parseInt(yytext().substring(1,yytext().length()), 8))); } case 153: break; case 97: { columnCount = true; } case 154: break; case 122: { return symbol(LETTERCLASS); } case 155: break; case 15: { if (macroDefinition) { yybegin(MACROS); } return symbol(REGEXPEND); } case 156: break; case 77: { inclusive_states = true; yybegin(STATELIST); } case 157: break; case 56: { return symbol(CHAR,new Character('\n')); } case 158: break; case 81: { return symbol(MACROUSE, yytext().substring(1,yytext().length()-1)); } case 159: break; case 25: { return symbol(OPENBRACKET); } case 160: break; case 123: { throw new ScannerException(file,ErrorMessages.QUIL_INITTHROW, yyline); } case 161: break; case 126: { visibility = "private"; Skeleton.makePrivate(); } case 162: break; case 49: { commentbalance++; } case 163: break; case 9: { throw new ScannerException(file,ErrorMessages.UNKNOWN_OPTION, yyline, yycolumn); } case 164: break; case 68: { string.append('\n'); } case 165: break; case 33: { balance++; actionText.append('{'); } case 166: break; case 48: { if (commentbalance > 0) commentbalance--; else yybegin(nextState); } case 167: break; case 67: { string.append('\"'); } case 168: break; case 95: { tokenType = yytext().substring(6).trim(); } case 169: break; case 79: { return symbol_countUpdate(MACROUSE, makeMacroIdent()); } case 170: break; case 14: { return symbol(CHAR, new Character(yytext().charAt(0))); } case 171: break; case 32: { if (balance > 0) { balance--; actionText.append('}'); } else { yybegin(REGEXPSTART); Action a = new Action(actionText.toString(), action_line); actions.addElement(a); return symbol(ACTION, a); } } case 172: break; case 108: { actionText.setLength(0); yybegin(JAVA_CODE); action_line = yyline+1; return symbol_countUpdate(EOFRULE, null); } case 173: break; case 120: { isExtending = yytext().substring(9).trim(); } case 174: break; case 113: { cupSymbol = yytext().substring(8).trim(); if (cupCompatible) Out.warning(ErrorMessages.CUPSYM_AFTER_CUP, yyline); } case 175: break; case 63: { yybegin(REPEATEXP); return symbol(REPEAT, new Integer(yytext().trim().substring(1).trim())); } case 176: break; case 88: { packed = true; useRowMap = true; } case 177: break; case 27: { return symbol(PLUS); } case 178: break; case 99: { isPublic = true; } case 179: break; case 70: { string.append('\r'); } case 180: break; case 76: { inclusive_states = false; yybegin(STATELIST); } case 181: break; case 3: { userCode.append(yytext()); } case 182: break; case 19: { lookAheadUsed = true; return symbol(LOOKAHEAD); } case 183: break; case 110: { lexThrow = concExc(lexThrow,yytext().substring(8).trim()); } case 184: break; case 26: { return symbol(CLOSEBRACKET); } case 185: break; case 80: { string.append( (char) Integer.parseInt(yytext().substring(2,yytext().length()), 16)); } case 186: break; case 37: { throw new ScannerException(file,ErrorMessages.UNTERMINATED_STR, yyline, yycolumn); } case 187: break; case 111: { eofCode = conc(eofCode, " yyclose();"); eofThrow = concExc(eofThrow, "java.io.IOException"); } case 188: break; case 69: { string.append('\t'); } case 189: break; case 23: { return symbol(BANG); } case 190: break; case 17: { yybegin(CHARCLASS); return symbol(OPENCLASS); } case 191: break; case 114: { cupDebug = true; } case 192: break; case 87: { charCount = true; } case 193: break; case 58: { return symbol(CHAR,new Character('\r')); } case 194: break; case 66: { string.append( (char) Integer.parseInt(yytext().substring(1,yytext().length()), 8)); } case 195: break; case 134: { scanErrorException = yytext().substring(11).trim(); } case 196: break; case 60: { return symbol(CHAR,new Character('\b')); } case 197: break; case 35: { yybegin(REGEXP); return symbol(MORETHAN); } case 198: break; case 132: { isImplementing = concExc(isImplementing, yytext().substring(12).trim()); } case 199: break; case 78: { return symbol(CHAR, new Character( (char) Integer.parseInt(yytext().substring(2,yytext().length()), 16))); } case 200: break; case 90: { isFinal = true; } case 201: break; case 137: { return symbol(UPPERCLASS); } case 202: break; case 46: { yybegin(REGEXP); return symbol(RBRACE); } case 203: break; case 51: { Out.warning(ErrorMessages.NOT_AT_BOL, yyline); yypushback(1); } case 204: break; case 28: { return symbol(QUESTION); } case 205: break; case 36: { string.append(yytext()); } case 206: break; case 135: { initThrow = concExc(initThrow,string); yybegin(MACROS); } case 207: break; case 140: { return symbol(JLETTERDIGITCLASS); } case 208: break; case 53: { nextState = REGEXPSTART; yybegin(COMMENT); } case 209: break; case 130: { eofThrow = concExc(eofThrow,string); yybegin(MACROS); } case 210: break; case 61: { actionText.setLength(0); yybegin(JAVA_CODE); action_line = yyline+1; return symbol(REGEXPEND); } case 211: break; case 138: { return symbol(LOWERCLASS); } case 212: break; case 38: { yybegin(nextState); return symbol(STRING, string.toString()); } case 213: break; case 82: { classCode = conc(classCode,string); yybegin(MACROS); } case 214: break; case 8: { return symbol(IDENT, yytext()); } case 215: break; case 43: { return symbol(HAT); } case 216: break; case 29: { lookAheadUsed = true; return symbol(DOLLAR); } case 217: break; case 124: { eofThrow = concExc(eofThrow,yytext().substring(10).trim()); } case 218: break; case 5: { states.insert(yytext(),inclusive_states); } case 219: break; case 84: { cupCompatible = true; isImplementing = concExc(isImplementing, "java_cup.runtime.Scanner"); if (functionName == null) functionName = "next_token"; if (tokenType == null) tokenType = "java_cup.runtime.Symbol"; if (eofVal == null) eofVal = "return new java_cup.runtime.Symbol("+cupSymbol+".EOF);"; eofCode = conc(eofCode, " yyclose();"); eofThrow = concExc(eofThrow, "java.io.IOException"); } case 220: break; case 127: { standalone = true; isInteger = true; } case 221: break; case 4: { throw new ScannerException(file,ErrorMessages.UNEXPECTED_CHAR, yyline, yycolumn); } case 222: break; case 47: { t.start(); yybegin(MACROS); macroDefinition = true; return symbol(USERCODE,userCode); } case 223: break; case 59: { return symbol(CHAR,new Character('\f')); } case 224: break; case 94: { eofCode = conc(eofCode,string); yybegin(MACROS); } case 225: break; case 65: { string.append(yytext().charAt(1)); } case 226: break; case 115: { caseless = true; } case 227: break; case 39: { throw new ScannerException(file,ErrorMessages.EOL_IN_CHARCLASS,yyline,yycolumn); } case 228: break; case 117: { return symbol(DIGITCLASS); } case 229: break; case 64: { if (macroDefinition) { yybegin(EATWSPNL); return symbol(BAR); } else { yybegin(REGEXPSTART); return symbol(NOACTION); } } case 230: break; case 30: { bolUsed = true; return symbol(HAT); } case 231: break; case 105: { throw new ScannerException(file,ErrorMessages.QUIL_CUPSYM, yyline); } case 232: break; case 102: { isIntWrap = true; } case 233: break; case 41: { if (balance > 0) balance--; else yybegin(REGEXP); return symbol(CLOSECLASS); } case 234: break; case 116: { bufferSize = Integer.parseInt(yytext().substring(8).trim()); } case 235: break; case 31: { actionText.append(yytext()); } case 236: break; case 86: { lineCount = true; } case 237: break; case 128: { throw new ScannerException(file,ErrorMessages.QUIL_SCANERROR, yyline); } case 238: break; case 104: { throw new ScannerException(file,ErrorMessages.QUIL_THROW, yyline); } case 239: break; case 83: { isInteger = true; } case 240: break; case 129: { return symbol(JLETTERCLASS); } case 241: break; case 98: { isInteger = true; if (eofVal == null) eofVal = "return 0;"; eofCode = conc(eofCode, " yyclose();"); eofThrow = concExc(eofThrow, "java.io.IOException"); } case 242: break; case 18: { return symbol(STAR); } case 243: break; case 121: { throw new ScannerException(file,ErrorMessages.QUIL_EOFTHROW, yyline); } case 244: break; case 44: { return symbol(DASH); } case 245: break; case 106: { className = yytext().substring(7).trim(); } case 246: break; case 62: { nextState = REGEXP; yybegin(COMMENT); } case 247: break; case 136: { lexThrow = concExc(lexThrow,yytext().substring(12).trim()); } case 248: break; case 22: { return symbol(BAR); } case 249: break; case 125: { functionName = yytext().substring(10).trim(); } case 250: break; case 13: { yybegin(STATES); return symbol_countUpdate(LESSTHAN, null); } case 251: break; case 119: { eofVal = string.toString(); yybegin(MACROS); } case 252: break; case 73: { yypushback(1); yycolumn--; return symbol(CHAR, new Character(yytext().charAt(0))); } case 253: break; case 24: { return symbol(TILDE); } case 254: break; case 139: { lexThrow = concExc(lexThrow,string); yybegin(MACROS); } case 255: break; case 103: { notUnix = true; } case 256: break; case 89: { packed = false; useRowMap = true; } case 257: break; case 20: { string.setLength(0); nextState = REGEXP; yybegin(STRING_CONTENT); } case 258: break; case 2: { /* ignore */ } case 259: break; case 93: { return symbol(UNICODE); } case 260: break; case 16: { return symbol(POINT); } case 261: break; case 72: { string.append('\b'); } case 262: break; case 21: { yybegin(REGEXPSTART); return symbol(LBRACE); } case 263: break; case 131: { initThrow = concExc(initThrow,yytext().substring(11).trim()); } case 264: break; case 96: { packed = false; useRowMap = false; } case 265: break; case 7: { yybegin(MACROS); } case 266: break; case 75: { string.setLength(0); yybegin(COPY); } case 267: break; case 42: { string.setLength(0); nextState = CHARCLASS; yybegin(STRING_CONTENT); } case 268: break; case 118: { actionText.setLength(0); yybegin(JAVA_CODE); action_line = yyline+1; return symbol(EOFRULE); } case 269: break; case 52: { macroDefinition = false; yybegin(REGEXPSTART); return symbol(DELIMITER); } case 270: break; case 50: { nextState = MACROS; yybegin(COMMENT); } case 271: break; case 10: { yybegin(REGEXP); return symbol(EQUALS); } case 272: break; case 34: { return symbol(COMMA); } case 273: break; case 1: { return symbol(EOF); } case 274: break; case 100: { throw new ScannerException(file,ErrorMessages.EOF_WO_ACTION); } case 275: break; case 71: { string.append('\f'); } case 276: break; case 40: { balance++; return symbol(OPENCLASS); } case 277: break; case 133: { throw new ScannerException(file,ErrorMessages.QUIL_YYLEXTHROW, yyline); } case 278: break; case 109: { File f = new File(yytext().substring(9).trim()); if ( !f.canRead() ) throw new ScannerException(file,ErrorMessages.NOT_READABLE, yyline); // check for cycle if (files.search(f) > 0) throw new ScannerException(file,ErrorMessages.FILE_CYCLE, yyline); try { yypushStream( new FileReader(f) ); files.push(file); file = f; Out.println("Including \""+file+"\""); } catch (FileNotFoundException e) { throw new ScannerException(file,ErrorMessages.NOT_READABLE, yyline); } } case 279: break; case 6: { } case 280: break; default: if (yyFlexInput == YYEOF && yyFlexStartRead == yyFlexCurrentPos) { yyFlexAtEOF = true; yyFlexDoEOF(); switch (yyFlexLexicalState) { case STRING_CONTENT: { throw new ScannerException(file,ErrorMessages.EOF_IN_STRING); } case 745: break; case MACROS: { if ( yymoreStreams() ) { file = (File) files.pop(); yypopStream(); } else throw new ScannerException(file,ErrorMessages.EOF_IN_MACROS); } case 746: break; case STATELIST: { throw new ScannerException(file,ErrorMessages.EOF_IN_MACROS); } case 747: break; case CHARCLASS: { throw new ScannerException(file,ErrorMessages.EOF_IN_REGEXP); } case 748: break; case JAVA_CODE: { throw new ScannerException(file,ErrorMessages.EOF_IN_ACTION, action_line-1); } case 749: break; case REPEATEXP: { throw new ScannerException(file,ErrorMessages.EOF_IN_REGEXP); } case 750: break; case COMMENT: { throw new ScannerException(file,ErrorMessages.EOF_IN_COMMENT); } case 751: break; case STATES: { throw new ScannerException(file,ErrorMessages.EOF_IN_STATES); } case 752: break; case COPY: { throw new ScannerException(file,ErrorMessages.EOF_IN_MACROS); } case 753: break; default: { if ( yymoreStreams() ) { file = (File) files.pop(); yypopStream(); } else return symbol(EOF); } } } else { yyFlexScanError(YY_NO_MATCH); } } } }
45285 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45285/7127ef36c07cc747ba55753a94d44dca753c5c62/LexScan.java/buggy/src/JFlex/LexScan.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 8565, 1024, 67, 2316, 1435, 1216, 2252, 18, 1594, 18, 14106, 288, 565, 509, 9016, 19667, 1210, 31, 565, 509, 9016, 19667, 1803, 31, 565, 509, 5378, 9016, 19667, 1429, 48, 273, 1624,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8565, 1024, 67, 2316, 1435, 1216, 2252, 18, 1594, 18, 14106, 288, 565, 509, 9016, 19667, 1210, 31, 565, 509, 9016, 19667, 1803, 31, 565, 509, 5378, 9016, 19667, 1429, 48, 273, 1624,...
assertEquals( m_baseFolder.getURL(), parentURL );
assertEquals( baseFolder.getURL(), parentURL );
public void testURL() throws Exception { FileObject file = m_baseFolder.resolveFile( "some-dir/" ); URL url = file.getURL(); assertEquals( file.getName().getURI(), url.toExternalForm() ); URL parentURL = new URL( url, ".." ); assertEquals( m_baseFolder.getURL(), parentURL ); URL rootURL = new URL( url, "/" ); assertEquals( file.getFileSystem().getRoot().getURL(), rootURL ); }
50122 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50122/ddeae60cbba0895248225ffc6fa3541309d0946c/AbstractFileSystemTestCase.java/buggy/src/test/org/apache/commons/vfs/test/AbstractFileSystemTestCase.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1842, 1785, 1435, 1216, 1185, 565, 288, 3639, 1387, 921, 585, 273, 312, 67, 1969, 3899, 18, 10828, 812, 12, 315, 19068, 17, 1214, 4898, 11272, 3639, 1976, 880, 273, 585, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1842, 1785, 1435, 1216, 1185, 565, 288, 3639, 1387, 921, 585, 273, 312, 67, 1969, 3899, 18, 10828, 812, 12, 315, 19068, 17, 1214, 4898, 11272, 3639, 1976, 880, 273, 585, 18, ...
this.actException = actException; }
this.actException = actException; }
public RaiseException(RubyException actException) { this.actException = actException; }
46454 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46454/0a7181933af700ea8025a4197f3a5ebcc08333c3/RaiseException.java/buggy/org/jruby/exceptions/RaiseException.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 20539, 503, 12, 54, 10340, 503, 1328, 503, 13, 288, 202, 202, 2211, 18, 621, 503, 273, 1328, 503, 31, 202, 97, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 20539, 503, 12, 54, 10340, 503, 1328, 503, 13, 288, 202, 202, 2211, 18, 621, 503, 273, 1328, 503, 31, 202, 97, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
Application.get().logResponseTarget(requestTarget);
IRequestLogger logger = Application.get().getRequestLogger(); if(logger != null) { logger.logResponseTarget(requestTarget); }
public void respond(RequestCycle requestCycle) { IRequestTarget requestTarget = requestCycle.getRequestTarget(); if (requestTarget != null) { Application.get().logResponseTarget(requestTarget); requestTarget.respond(requestCycle); } }
46434 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46434/8ca2fb1d0304341a71620b6508917c9031cab4ea/DefaultResponseStrategy.java/clean/wicket/src/java/wicket/request/compound/DefaultResponseStrategy.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 6846, 12, 691, 13279, 590, 13279, 13, 202, 95, 202, 202, 45, 691, 2326, 590, 2326, 273, 590, 13279, 18, 588, 691, 2326, 5621, 202, 202, 430, 261, 2293, 2326, 480, 446, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 6846, 12, 691, 13279, 590, 13279, 13, 202, 95, 202, 202, 45, 691, 2326, 590, 2326, 273, 590, 13279, 18, 588, 691, 2326, 5621, 202, 202, 430, 261, 2293, 2326, 480, 446, ...
" POST)"); final String expected = "[Product].[All Products].[Drink].[Dairy]" + nl +
" POST)", "[Product].[All Products].[Drink].[Dairy]" + nl +
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 Gender].[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 Gender].Hierarchy"); test.assertEquals("[Gender]", s); } public void testHierarchyNull(FoodMartTestCase test) { String s = test.executeExpr( "[Gender].[All Gender].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 Gender].[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 Gender].[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 Gender].FirstChild"); test.assertEquals("F", member.getName()); } public void testFirstChildOfChildless(FoodMartTestCase test) { Member member = test.executeAxis( "[Gender].[All Gender].[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 Gender].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 FunkResolver( "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(member); } })); 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 Gender].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 Gender].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 FunkResolver( "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 FunkResolver( "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 })); define(new FunkResolver( "Correlation", "Correlation(<Set>, <Numeric Expression>[, <Numeric Expression>])", "Returns the correlation of two series evaluated over a set.", new String[]{"fnxn","fnxnn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Vector members = (Vector) getArg(evaluator, args, 0); ExpBase exp1 = (ExpBase) getArg(evaluator, args, 1); ExpBase exp2 = (ExpBase) getArg(evaluator, args, 2); return correlation(evaluator.push(), members, exp1, exp2); } public void testCorrelation(FoodMartTestCase test) { String result = test.executeExpr("Correlation({[Store].[All Stores].[USA].children}, [Measures].[Unit Sales], [Measures].[Store Sales])"); test.assertEquals("0.9999063938016924", result); } })); define(new FunkResolver( "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 })); define(new FunkResolver( "Covariance", "Covariance(<Set>, <Numeric Expression>[, <Numeric Expression>])", "Returns the covariance of two series evaluated over a set (biased).", new String[]{"fnxn","fnxnn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Vector members = (Vector) getArg(evaluator, args, 0); ExpBase exp1 = (ExpBase) getArg(evaluator, args, 1); ExpBase exp2 = (ExpBase) getArg(evaluator, args, 2); return covariance(evaluator.push(), members, exp1, exp2, true); } public void testCovariance(FoodMartTestCase test) { String result = test.executeExpr("Covariance({[Store].[All Stores].[USA].children}, [Measures].[Unit Sales], [Measures].[Store Sales])"); test.assertEquals("1.3557618990466664E9", result); } })); define(new FunkResolver( "CovarianceN", "CovarianceN(<Set>, <Numeric Expression>[, <Numeric Expression>])", "Returns the covariance of two series evaluated over a set (unbiased).", new String[]{"fnxn","fnxnn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Vector members = (Vector) getArg(evaluator, args, 0); ExpBase exp1 = (ExpBase) getArg(evaluator, args, 1); ExpBase exp2 = (ExpBase) getArg(evaluator, args, 2); return covariance(evaluator.push(), members, exp1, exp2, false); } public void testCovarianceN(FoodMartTestCase test) { String result = test.executeExpr("CovarianceN({[Store].[All Stores].[USA].children}, [Measures].[Unit Sales], [Measures].[Store Sales])"); test.assertEquals("2.0336428485699995E9", result); } })); 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 FunkResolver( "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 FunkResolver( "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 FunkResolver( "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*")); define(new FunkResolver( "Stddev", "Stddev(<Set>[, <Numeric Expression>])", "Alias for Stdev.", 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 stdev(evaluator.push(), members, exp, false); } })); define(new FunkResolver( "Stdev", "Stdev(<Set>[, <Numeric Expression>])", "Returns the standard deviation of a numeric expression evaluated over a set (unbiased).", 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 stdev(evaluator.push(), members, exp, false); } public void testStdev(FoodMartTestCase test) { String result = test.executeExpr( "STDEV({[Store].[All Stores].[USA].children},[Measures].[Store Sales])"); test.assertEquals("65825.4547549297", result); } })); define(new FunkResolver( "StddevP", "StddevP(<Set>[, <Numeric Expression>])", "Alias for StdevP.", 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 stdev(evaluator.push(), members, exp, true); } })); define(new FunkResolver( "StdevP", "StdevP(<Set>[, <Numeric Expression>])", "Returns the standard deviation of a numeric expression evaluated over a set (biased).", 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 stdev(evaluator.push(), members, exp, true); } public void testStdevP(FoodMartTestCase test) { String result = test.executeExpr( "STDEVP({[Store].[All Stores].[USA].children},[Measures].[Store Sales])"); test.assertEquals("53746.25874541283", result); } })); define(new FunkResolver( "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); } }); define(new FunkResolver( "Var", "Var(<Set>[, <Numeric Expression>])", "Returns the variance of a numeric expression evaluated over a set (unbiased).", 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 var(evaluator.push(), members, exp, false); } public void testVar(FoodMartTestCase test) { String result = test.executeExpr( "VAR({[Store].[All Stores].[USA].children},[Measures].[Store Sales])"); test.assertEquals("4.332990493693297E9", result); } })); define(new FunkResolver( "Variance", "Variance(<Set>[, <Numeric Expression>])", "Alias for Var.", 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 var(evaluator.push(), members, exp, false); } })); define(new FunkResolver( "VarianceP", "VarianceP(<Set>[, <Numeric Expression>])", "Alias for VarP.", 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 var(evaluator.push(), members, exp, true); } })); define(new FunkResolver( "VarP", "VarP(<Set>[, <Numeric Expression>])", "Returns the variance of a numeric expression evaluated over a set (biased).", 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 var(evaluator.push(), members, exp, true); } public void testVarP(FoodMartTestCase test) { String result = test.executeExpr( "VARP({[Store].[All Stores].[USA].children},[Measures].[Store Sales])"); test.assertEquals("2.888660329128865E9", result); } })); // // SET FUNCTIONS if (false) define(new FunDefBase("AddCalculatedMembers", "AddCalculatedMembers(<Set>)", "Adds calculated members to a set.", "fx*")); define(new FunkResolver( "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 Media].[Radio]" + nl + "[Promotion Media].[All Media].[Sunday Paper, Radio, TV]"; test.assertEquals(expected, test.toString(axis.positions)); } //todo: test unordered })); define(new FunkResolver( "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 Media].[Radio]" + nl + "[Promotion Media].[All Media].[Sunday Paper, Radio, TV]"; test.assertEquals(expected, test.toString(axis.positions)); } //todo: test precision })); define(new FunkResolver( "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 Media].[Radio]" + nl + "[Promotion Media].[All 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); if (set0.isEmpty() || set1.isEmpty()) { return emptyVector; } int arity0 = 1, arity1 = 1; if (set0.elementAt(0) instanceof Member[]) { arity0 = ((Member[]) set0.elementAt(0)).length; } if (set1.elementAt(0) instanceof Member[]) { arity1 = ((Member[]) set1.elementAt(0)).length; } Vector result = new Vector(); if (arity0 == 1 && arity1 == 1) { // Simpler routine if we know neither side is an array. 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}); } } } else { // More complex routine if one or both sides are arrays // (probably the product of nested CrossJoins). Member[] row = new Member[arity0 + arity1]; for (int i = 0, m = set0.size(); i < m; i++) { int x = 0; Object o0 = set0.elementAt(i); if (o0 instanceof Member) { row[x++] = (Member) o0; } else { assertTrue(o0 instanceof Member[]); final Member[] members = (Member[]) o0; for (int k = 0; k < members.length; k++) { row[x++] = members[k]; } } for (int j = 0, n = set1.size(); j < n; j++) { Object o1 = set1.elementAt(j); if (o1 instanceof Member) { row[x++] = (Member) o1; } else { assertTrue(o1 instanceof Member[]); final Member[] members = (Member[]) o1; for (int k = 0; k < members.length; k++) { row[x++] = members[k]; } } result.addElement(row.clone()); x = arity0; } } } return result; } public void testCrossjoinNested(FoodMartTestCase test) { final Axis axis = test.executeAxis2( " CrossJoin(" + nl + " CrossJoin(" + nl + " [Gender].members," + nl + " [Marital Status].members)," + nl + " {[Store], [Store].children})"); test.assertEquals( "{[Gender].[All Gender], [Marital Status].[All Marital Status], [Store].[All Stores]}" + nl + "{[Gender].[All Gender], [Marital Status].[All Marital Status], [Store].[All Stores].[Canada]}" + nl + "{[Gender].[All Gender], [Marital Status].[All Marital Status], [Store].[All Stores].[Mexico]}" + nl + "{[Gender].[All Gender], [Marital Status].[All Marital Status], [Store].[All Stores].[USA]}" + nl + "{[Gender].[All Gender], [Marital Status].[All Marital Status].[M], [Store].[All Stores]}" + nl + "{[Gender].[All Gender], [Marital Status].[All Marital Status].[M], [Store].[All Stores].[Canada]}" + nl + "{[Gender].[All Gender], [Marital Status].[All Marital Status].[M], [Store].[All Stores].[Mexico]}" + nl + "{[Gender].[All Gender], [Marital Status].[All Marital Status].[M], [Store].[All Stores].[USA]}" + nl + "{[Gender].[All Gender], [Marital Status].[All Marital Status].[S], [Store].[All Stores]}" + nl + "{[Gender].[All Gender], [Marital Status].[All Marital Status].[S], [Store].[All Stores].[Canada]}" + nl + "{[Gender].[All Gender], [Marital Status].[All Marital Status].[S], [Store].[All Stores].[Mexico]}" + nl + "{[Gender].[All Gender], [Marital Status].[All Marital Status].[S], [Store].[All Stores].[USA]}" + nl + "{[Gender].[All Gender].[F], [Marital Status].[All Marital Status], [Store].[All Stores]}" + nl + "{[Gender].[All Gender].[F], [Marital Status].[All Marital Status], [Store].[All Stores].[Canada]}" + nl + "{[Gender].[All Gender].[F], [Marital Status].[All Marital Status], [Store].[All Stores].[Mexico]}" + nl + "{[Gender].[All Gender].[F], [Marital Status].[All Marital Status], [Store].[All Stores].[USA]}" + nl + "{[Gender].[All Gender].[F], [Marital Status].[All Marital Status].[M], [Store].[All Stores]}" + nl + "{[Gender].[All Gender].[F], [Marital Status].[All Marital Status].[M], [Store].[All Stores].[Canada]}" + nl + "{[Gender].[All Gender].[F], [Marital Status].[All Marital Status].[M], [Store].[All Stores].[Mexico]}" + nl + "{[Gender].[All Gender].[F], [Marital Status].[All Marital Status].[M], [Store].[All Stores].[USA]}" + nl + "{[Gender].[All Gender].[F], [Marital Status].[All Marital Status].[S], [Store].[All Stores]}" + nl + "{[Gender].[All Gender].[F], [Marital Status].[All Marital Status].[S], [Store].[All Stores].[Canada]}" + nl + "{[Gender].[All Gender].[F], [Marital Status].[All Marital Status].[S], [Store].[All Stores].[Mexico]}" + nl + "{[Gender].[All Gender].[F], [Marital Status].[All Marital Status].[S], [Store].[All Stores].[USA]}" + nl + "{[Gender].[All Gender].[M], [Marital Status].[All Marital Status], [Store].[All Stores]}" + nl + "{[Gender].[All Gender].[M], [Marital Status].[All Marital Status], [Store].[All Stores].[Canada]}" + nl + "{[Gender].[All Gender].[M], [Marital Status].[All Marital Status], [Store].[All Stores].[Mexico]}" + nl + "{[Gender].[All Gender].[M], [Marital Status].[All Marital Status], [Store].[All Stores].[USA]}" + nl + "{[Gender].[All Gender].[M], [Marital Status].[All Marital Status].[M], [Store].[All Stores]}" + nl + "{[Gender].[All Gender].[M], [Marital Status].[All Marital Status].[M], [Store].[All Stores].[Canada]}" + nl + "{[Gender].[All Gender].[M], [Marital Status].[All Marital Status].[M], [Store].[All Stores].[Mexico]}" + nl + "{[Gender].[All Gender].[M], [Marital Status].[All Marital Status].[M], [Store].[All Stores].[USA]}" + nl + "{[Gender].[All Gender].[M], [Marital Status].[All Marital Status].[S], [Store].[All Stores]}" + nl + "{[Gender].[All Gender].[M], [Marital Status].[All Marital Status].[S], [Store].[All Stores].[Canada]}" + nl + "{[Gender].[All Gender].[M], [Marital Status].[All Marital Status].[S], [Store].[All Stores].[Mexico]}" + nl + "{[Gender].[All Gender].[M], [Marital Status].[All Marital Status].[S], [Store].[All Stores].[USA]}", test.toString(axis.positions)); } }); 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"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { String descFlag = getLiteralArg(args, 2, "SELF", new String[] {"SELF","AFTER","BEFORE","BEFORE_AND_AFTER","SELF_AND_AFTER","SELF_AND_BEFORE","SELF_BEFORE_AFTER","LEAVES"}, dummyFunDef); if (!descFlag.equals("SELF")) { throw newEvalException(null, "SELF is the only value of Desc_flag currently supported"); } return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); Level level = getLevelArg(evaluator, args, 1, true); 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 FunkResolver("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 FunkResolver( "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 testFilterWithSlicer(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", 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*")); define(new MultiResolver( "Hierarchize", "Hierarchize(<Set>[, POST])", "Orders the members of a set in a hierarchy.", new String[] {"fxx", "fxxy"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { String order = getLiteralArg(args, 1, "PRE", new String[] {"PRE", "POST"}, dummyFunDef); final boolean post = order.equals("POST"); return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { Vector members = (Vector) getArg(evaluator, args, 0); hierarchize(members, post); return members; } }; } public void testHierarchize(FoodMartTestCase test) { final Axis axis = test.executeAxis2( "Hierarchize(" + nl + " {[Product].[All Products], " + " [Product].[Food]," + nl + " [Product].[Drink]," + nl + " [Product].[Non-Consumable]," + nl + " [Product].[Food].[Eggs]," + nl + " [Product].[Drink].[Dairy]})"); final String expected = "[Product].[All Products]" + nl + "[Product].[All Products].[Drink]" + nl + "[Product].[All Products].[Drink].[Dairy]" + nl + "[Product].[All Products].[Food]" + nl + "[Product].[All Products].[Food].[Eggs]" + nl + "[Product].[All Products].[Non-Consumable]"; test.assertEquals(expected, test.toString(axis.positions)); } public void testHierarchizePost(FoodMartTestCase test) { final Axis axis = test.executeAxis2( "Hierarchize(" + nl + " {[Product].[All Products], " + " [Product].[Food]," + nl + " [Product].[Food].[Eggs]," + nl + " [Product].[Drink].[Dairy]}," + nl + " POST)"); final String expected = "[Product].[All Products].[Drink].[Dairy]" + nl + "[Product].[All Products].[Food].[Eggs]" + nl + "[Product].[All Products].[Food]" + nl + "[Product].[All Products]"; test.assertEquals(expected, test.toString(axis.positions)); } public void testHierarchizeCrossJoinPre(FoodMartTestCase test) { final Axis axis = test.executeAxis2( "Hierarchize(" + nl + " CrossJoin(" + nl + " {[Product].[All Products], " + " [Product].[Food]," + nl + " [Product].[Food].[Eggs]," + nl + " [Product].[Drink].[Dairy]}," + nl + " [Gender].MEMBERS)," + nl + " PRE)"); final String expected = "{[Product].[All Products], [Gender].[All Gender]}" + nl + "{[Product].[All Products], [Gender].[All Gender].[F]}" + nl + "{[Product].[All Products], [Gender].[All Gender].[M]}" + nl + "{[Product].[All Products].[Drink].[Dairy], [Gender].[All Gender]}" + nl + "{[Product].[All Products].[Drink].[Dairy], [Gender].[All Gender].[F]}" + nl + "{[Product].[All Products].[Drink].[Dairy], [Gender].[All Gender].[M]}" + nl + "{[Product].[All Products].[Food], [Gender].[All Gender]}" + nl + "{[Product].[All Products].[Food], [Gender].[All Gender].[F]}" + nl + "{[Product].[All Products].[Food], [Gender].[All Gender].[M]}" + nl + "{[Product].[All Products].[Food].[Eggs], [Gender].[All Gender]}" + nl + "{[Product].[All Products].[Food].[Eggs], [Gender].[All Gender].[F]}" + nl + "{[Product].[All Products].[Food].[Eggs], [Gender].[All Gender].[M]}"; test.assertEquals(expected, test.toString(axis.positions)); } public void testHierarchizeCrossJoinPost(FoodMartTestCase test) { final Axis axis = test.executeAxis2( "Hierarchize(" + nl + " CrossJoin(" + nl + " {[Product].[All Products], " + " [Product].[Food]," + nl + " [Product].[Food].[Eggs]," + nl + " [Product].[Drink].[Dairy]}," + nl + " [Gender].MEMBERS)," + nl + " POST)"); final String expected = "{[Product].[All Products].[Drink].[Dairy], [Gender].[All Gender].[F]}" + nl + "{[Product].[All Products].[Drink].[Dairy], [Gender].[All Gender].[M]}" + nl + "{[Product].[All Products].[Drink].[Dairy], [Gender].[All Gender]}" + nl + "{[Product].[All Products].[Food].[Eggs], [Gender].[All Gender].[F]}" + nl + "{[Product].[All Products].[Food].[Eggs], [Gender].[All Gender].[M]}" + nl + "{[Product].[All Products].[Food].[Eggs], [Gender].[All Gender]}" + nl + "{[Product].[All Products].[Food], [Gender].[All Gender].[F]}" + nl + "{[Product].[All Products].[Food], [Gender].[All Gender].[M]}" + nl + "{[Product].[All Products].[Food], [Gender].[All Gender]}" + nl + "{[Product].[All Products], [Gender].[All Gender].[F]}" + nl + "{[Product].[All Products], [Gender].[All Gender].[M]}" + nl + "{[Product].[All Products], [Gender].[All Gender]}"; test.assertEquals(expected, test.toString(axis.positions)); } }); 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 FunkResolver( "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 new Vector(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"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { String order = getLiteralArg(args, 2, "ASC", new String[] {"ASC","DESC","BASC","BDESC"}, dummyFunDef); final boolean desc = order.equals("DESC") || order.equals("BDESC"); final boolean brk = order.equals("BASC") || order.equals("BDESC"); return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { Vector members = (Vector) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1); sort(evaluator, members, exp, desc, brk); return members; } }; } public void testOrder(FoodMartTestCase test) { test.runQueryCheckResult( "select {[Measures].[Unit Sales]} on columns," + nl + " order({" + nl + " [Product].[All Products].[Drink]," + nl + " [Product].[All Products].[Drink].[Beverages]," + nl + " [Product].[All Products].[Drink].[Dairy]," + nl + " [Product].[All Products].[Food]," + nl + " [Product].[All Products].[Food].[Baked Goods]," + nl + " [Product].[All Products].[Food].[Eggs]," + nl + " [Product].[All Products]}," + nl + " [Measures].[Unit Sales]) on rows" + nl + "from Sales", "Axis #0:" + nl + "{}" + nl + "Axis #1:" + nl + "{[Measures].[Unit Sales]}" + nl + "Axis #2:" + nl + "{[Product].[All Products]}" + nl + "{[Product].[All Products].[Drink]}" + nl + "{[Product].[All Products].[Drink].[Dairy]}" + nl + "{[Product].[All Products].[Drink].[Beverages]}" + nl + "{[Product].[All Products].[Food]}" + nl + "{[Product].[All Products].[Food].[Eggs]}" + nl + "{[Product].[All Products].[Food].[Baked Goods]}" + nl + "Row #0: 266,773" + nl + "Row #1: 24,597" + nl + "Row #2: 4,186" + nl + "Row #3: 13,573" + nl + "Row #4: 191,940" + nl + "Row #5: 4,132" + nl + "Row #6: 7,870" + nl); } public void testOrderParentsMissing(FoodMartTestCase test) { // Paradoxically, [Alcoholic Beverages] comes before // [Eggs] even though it has a larger value, because // its parent [Drink] has a smaller value than [Food]. test.runQueryCheckResult( "select {[Measures].[Unit Sales]} on columns," + " order({" + nl + " [Product].[All Products].[Drink].[Alcoholic Beverages]," + nl + " [Product].[All Products].[Food].[Eggs]}," + nl + " [Measures].[Unit Sales], ASC) on rows" + nl + "from Sales", "Axis #0:" + nl + "{}" + nl + "Axis #1:" + nl + "{[Measures].[Unit Sales]}" + nl + "Axis #2:" + nl + "{[Product].[All Products].[Drink].[Alcoholic Beverages]}" + nl + "{[Product].[All Products].[Food].[Eggs]}" + nl + "Row #0: 6,838" + nl + "Row #1: 4,132" + nl); } public void testOrderCrossJoinBreak(FoodMartTestCase test) { test.runQueryCheckResult( "select {[Measures].[Unit Sales]} on columns," + nl + " Order(" + nl + " CrossJoin(" + nl + " [Gender].children," + nl + " [Marital Status].children)," + nl + " [Measures].[Unit Sales]," + nl + " BDESC) on rows" + nl + "from Sales" + nl + "where [Time].[1997].[Q1]", "Axis #0:" + nl + "{[Time].[1997].[Q1]}" + nl + "Axis #1:" + nl + "{[Measures].[Unit Sales]}" + nl + "Axis #2:" + nl + "{[Gender].[All Gender].[F], [Marital Status].[All Marital Status].[M]}" + nl + "{[Gender].[All Gender].[M], [Marital Status].[All Marital Status].[S]}" + nl + "{[Gender].[All Gender].[M], [Marital Status].[All Marital Status].[M]}" + nl + "{[Gender].[All Gender].[F], [Marital Status].[All Marital Status].[S]}" + nl + "Row #0: 17,097" + nl + "Row #1: 16,845" + nl + "Row #2: 16,536" + nl + "Row #3: 15,813" + nl); } public void testOrderCrossJoin(FoodMartTestCase test) { // Note: // 1. [Alcoholic Beverages] collates before [Eggs] and // [Seafood] because its parent, [Drink], is less // than [Food] // 2. [Seattle] generally sorts after [CA] and [OR] // because invisible parent [WA] is greater. test.runQueryCheckResult( "select CrossJoin(" + nl + " {[Time].[1997]," + nl + " [Time].[1997].[Q1]}," + nl + " {[Measures].[Unit Sales]}) on columns," + nl + " Order(" + nl + " CrossJoin( " + nl + " {[Product].[All Products].[Food].[Eggs]," + nl + " [Product].[All Products].[Food].[Seafood]," + nl + " [Product].[All Products].[Drink].[Alcoholic Beverages]}," + nl + " {[Store].[USA].[WA].[Seattle]," + nl + " [Store].[USA].[CA]," + nl + " [Store].[USA].[OR]})," + nl + " ([Time].[1997].[Q1], [Measures].[Unit Sales])," + nl + " ASC) on rows" + nl + "from Sales", "Axis #0:" + nl + "{}" + nl + "Axis #1:" + nl + "{[Time].[1997], [Measures].[Unit Sales]}" + nl + "{[Time].[1997].[Q1], [Measures].[Unit Sales]}" + nl + "Axis #2:" + nl + "{[Product].[All Products].[Drink].[Alcoholic Beverages], [Store].[All Stores].[USA].[OR]}" + nl + "{[Product].[All Products].[Drink].[Alcoholic Beverages], [Store].[All Stores].[USA].[CA]}" + nl + "{[Product].[All Products].[Drink].[Alcoholic Beverages], [Store].[All Stores].[USA].[WA].[Seattle]}" + nl + "{[Product].[All Products].[Food].[Seafood], [Store].[All Stores].[USA].[CA]}" + nl + "{[Product].[All Products].[Food].[Seafood], [Store].[All Stores].[USA].[OR]}" + nl + "{[Product].[All Products].[Food].[Seafood], [Store].[All Stores].[USA].[WA].[Seattle]}" + nl + "{[Product].[All Products].[Food].[Eggs], [Store].[All Stores].[USA].[CA]}" + nl + "{[Product].[All Products].[Food].[Eggs], [Store].[All Stores].[USA].[OR]}" + nl + "{[Product].[All Products].[Food].[Eggs], [Store].[All Stores].[USA].[WA].[Seattle]}" + nl + "Row #0: 1,680" + nl + "Row #0: 393" + nl + "Row #1: 1,936" + nl + "Row #1: 431" + nl + "Row #2: 635" + nl + "Row #2: 142" + nl + "Row #3: 441" + nl + "Row #3: 91" + nl + "Row #4: 451" + nl + "Row #4: 107" + nl + "Row #5: 217" + nl + "Row #5: 44" + nl + "Row #6: 1,116" + nl + "Row #6: 240" + nl + "Row #7: 1,119" + nl + "Row #7: 251" + nl + "Row #8: 373" + nl + "Row #8: 57" + nl); } public void testOrderHierarchicalDesc(FoodMartTestCase test) { final Axis axis = test.executeAxis2( "Order(" + nl + " {[Product].[All Products], " + " [Product].[Food]," + nl + " [Product].[Drink]," + nl + " [Product].[Non-Consumable]," + nl + " [Product].[Food].[Eggs]," + nl + " [Product].[Drink].[Dairy]}," + nl + " [Measures].[Unit Sales]," + nl + " DESC)"); final String expected = "[Product].[All Products]" + nl + "[Product].[All Products].[Food]" + nl + "[Product].[All Products].[Food].[Eggs]" + nl + "[Product].[All Products].[Non-Consumable]" + nl + "[Product].[All Products].[Drink]" + nl + "[Product].[All Products].[Drink].[Dairy]"; test.assertEquals(expected, test.toString(axis.positions)); } public void testOrderCrossJoinDesc(FoodMartTestCase test) { final Axis axis = test.executeAxis2( "Order(" + nl + " CrossJoin(" + nl + " {[Gender].[M], [Gender].[F]}," + nl + " {[Product].[All Products], " + " [Product].[Food]," + nl + " [Product].[Drink]," + nl + " [Product].[Non-Consumable]," + nl + " [Product].[Food].[Eggs]," + nl + " [Product].[Drink].[Dairy]})," + nl + " [Measures].[Unit Sales]," + nl + " DESC)"); final String expected = "{[Gender].[All Gender].[M], [Product].[All Products]}" + nl + "{[Gender].[All Gender].[M], [Product].[All Products].[Food]}" + nl + "{[Gender].[All Gender].[M], [Product].[All Products].[Food].[Eggs]}" + nl + "{[Gender].[All Gender].[M], [Product].[All Products].[Non-Consumable]}" + nl + "{[Gender].[All Gender].[M], [Product].[All Products].[Drink]}" + nl + "{[Gender].[All Gender].[M], [Product].[All Products].[Drink].[Dairy]}" + nl + "{[Gender].[All Gender].[F], [Product].[All Products]}" + nl + "{[Gender].[All Gender].[F], [Product].[All Products].[Food]}" + nl + "{[Gender].[All Gender].[F], [Product].[All Products].[Food].[Eggs]}" + nl + "{[Gender].[All Gender].[F], [Product].[All Products].[Non-Consumable]}" + nl + "{[Gender].[All Gender].[F], [Product].[All Products].[Drink]}" + nl + "{[Gender].[All Gender].[F], [Product].[All Products].[Drink].[Dairy]}"; test.assertEquals(expected, test.toString(axis.positions)); } public void testOrderBug656802(FoodMartTestCase test) { // Note: // 1. [Alcoholic Beverages] collates before [Eggs] and // [Seafood] because its parent, [Drink], is less // than [Food] // 2. [Seattle] generally sorts after [CA] and [OR] // because invisible parent [WA] is greater. test.runQueryCheckResult( "select {[Measures].[Unit Sales], [Measures].[Store Cost], [Measures].[Store Sales]} ON columns, " + nl + "Order(" + nl + " ToggleDrillState(" + nl + " {([Promotion Media].[All Media], [Product].[All Products])}," + nl + " {[Product].[All Products]} ), " + nl + " [Measures].[Unit Sales], DESC) ON rows " + nl + "from [Sales] where ([Time].[1997])", "Axis #0:" + nl + "{[Time].[1997]}" + nl + "Axis #1:" + nl + "{[Measures].[Unit Sales]}" + nl + "{[Measures].[Store Cost]}" + nl + "{[Measures].[Store Sales]}" + nl + "Axis #2:" + nl + "{[Promotion Media].[All Media], [Product].[All Products]}" + nl + "{[Promotion Media].[All Media], [Product].[All Products].[Food]}" + nl + "{[Promotion Media].[All Media], [Product].[All Products].[Non-Consumable]}" + nl + "{[Promotion Media].[All Media], [Product].[All Products].[Drink]}" + nl + "Row #0: 266,773" + nl + "Row #0: 225,627.23" + nl + "Row #0: 565,238.13" + nl + "Row #1: 191,940" + nl + "Row #1: 163,270.72" + nl + "Row #1: 409,035.59" + nl + "Row #2: 50,236" + nl + "Row #2: 42,879.28" + nl + "Row #2: 107,366.33" + nl + "Row #3: 24,597" + nl + "Row #3: 19,477.23" + nl + "Row #3: 48,836.21" + nl); } }); define(new FunkResolver( "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 new Vector(periodsToDate(evaluator, level, member)); } })); define(new FunkResolver( "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 new Vector(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 FunkResolver( "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; } if (v0.isEmpty()) { return v0; } HashSet set1 = toHashSet(v1); Vector result = new Vector(); int i = 0, n = v0.size(); while (i < n) { Object o = v0.elementAt(i++); result.addElement(o); Member m = null; int k = -1; if (o instanceof Member) { if (!set1.contains(o)) { continue; } m = (Member) o; k = -1; } else { Util.assertTrue(o instanceof Member[]); Member[] members = (Member[]) o; for (int j = 0; j < members.length; j++) { Member member = members[j]; if (set1.contains(member)) { k = j; m = member; break; } } if (k == -1) { continue; } } boolean isDrilledDown = false; if (i < n) { Object next = v0.elementAt(i); Member nextMember = (k < 0) ? (Member) next : ((Member[]) next)[k]; boolean strict = true; if (isAncestorOf(m, nextMember, strict)) { isDrilledDown = true; } } if (isDrilledDown) { // skip descendants of this member do { Object next = v0.elementAt(i); Member nextMember = (k < 0) ? (Member) next : ((Member[]) next)[k]; boolean strict = true; if (isAncestorOf(m, nextMember, strict)) { i++; } else { break; } } while (i < n); } else { Member[] children = m.getMemberChildren(); for (int j = 0; j < children.length; j++) { if (k < 0) { result.addElement(children[j]); } else { Member[] members = (Member[]) ((Member[]) o).clone(); members[k] = children[j]; result.addElement(members); } } } } 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)); } // bug 634860 public void testToggleDrillStateTuple(FoodMartTestCase test) { Axis axis = test.executeAxis2( "ToggleDrillState(" + nl + "{([Store].[All Stores].[USA].[CA]," + " [Product].[All Products].[Drink].[Alcoholic Beverages])," + nl + " ([Store].[All Stores].[USA]," + " [Product].[All Products].[Drink])}," + nl + "{[Store].[All stores].[USA].[CA]})"); String expected = "{[Store].[All Stores].[USA].[CA], [Product].[All Products].[Drink].[Alcoholic Beverages]}" + nl + "{[Store].[All Stores].[USA].[CA].[Beverly Hills], [Product].[All Products].[Drink].[Alcoholic Beverages]}" + nl + "{[Store].[All Stores].[USA].[CA].[Los Angeles], [Product].[All Products].[Drink].[Alcoholic Beverages]}" + nl + "{[Store].[All Stores].[USA].[CA].[San Diego], [Product].[All Products].[Drink].[Alcoholic Beverages]}" + nl + "{[Store].[All Stores].[USA].[CA].[San Francisco], [Product].[All Products].[Drink].[Alcoholic Beverages]}" + nl + "{[Store].[All Stores].[USA], [Product].[All Products].[Drink]}"; test.assertEquals(expected, test.toString(axis.positions)); } })); define(new FunkResolver( "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 Media].[No Media]" + nl + "[Promotion Media].[All Media].[Daily Paper, Radio, TV]"; test.assertEquals(expected, test.toString(axis.positions)); } })); define(new FunkResolver( "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 Media].[No Media]"; test.assertEquals(expected, test.toString(axis.positions)); } //todo: test precision })); define(new FunkResolver( "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 Media].[No Media]" + nl + "[Promotion Media].[All Media].[Daily Paper, Radio, TV]"; test.assertEquals(expected, test.toString(axis.positions)); } })); define(new MultiResolver( "Union", "Union(<Set1>, <Set2>[, ALL])", "Returns the union of two sets, optionally retaining duplicates.", new String[] {"fxxx", "fxxxy"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { String allString = getLiteralArg(args, 2, "DISTINCT", new String[] {"ALL", "DISTINCT"}, dummyFunDef); final boolean all = allString.equalsIgnoreCase("ALL"); checkCompatible(args[0], args[1], dummyFunDef); return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { Vector left = (Vector) getArg(evaluator, args, 0), right = (Vector) getArg(evaluator, args, 1); if (all) { if (left == null || left.isEmpty()) { return right; } add(left, right); return left; } else { HashSet added = new HashSet(); Vector result = new Vector(); addUnique(result, left, added); addUnique(result, right, added); return result; } } }; } public void testUnionAll(FoodMartTestCase test) { final Axis axis = test.executeAxis2("Union({[Gender].[M]}, {[Gender].[F]}, ALL)"); String expected = "[Gender].[All Gender].[M]" + nl + "[Gender].[All Gender].[F]"; // order is preserved test.assertEquals(expected, test.toString(axis.positions)); } public void testUnion(FoodMartTestCase test) { final Axis axis = test.executeAxis2("Union({[Store].[USA], [Store].[USA], [Store].[USA].[OR]}, {[Store].[USA].[CA], [Store].[USA]})"); String expected = "[Store].[All Stores].[USA]" + nl + "[Store].[All Stores].[USA].[OR]" + nl + "[Store].[All Stores].[USA].[CA]"; test.assertEquals(expected, test.toString(axis.positions)); } public void testUnionEmptyBoth(FoodMartTestCase test) { final Axis axis = test.executeAxis2("Union({}, {})"); String expected = ""; test.assertEquals(expected, test.toString(axis.positions)); } public void testUnionEmptyRight(FoodMartTestCase test) { final Axis axis = test.executeAxis2("Union({[Gender].[M]}, {})"); String expected = "[Gender].[All Gender].[M]"; test.assertEquals(expected, test.toString(axis.positions)); } public void testUnionTuple(FoodMartTestCase test) { final Axis axis = test.executeAxis2( "Union({" + " ([Gender].[M], [Marital Status].[S])," + " ([Gender].[F], [Marital Status].[S])" + "}, {" + " ([Gender].[M], [Marital Status].[M])," + " ([Gender].[M], [Marital Status].[S])" + "})"); String expected = "{[Gender].[All Gender].[M], [Marital Status].[All Marital Status].[S]}" + nl + "{[Gender].[All Gender].[F], [Marital Status].[All Marital Status].[S]}" + nl + "{[Gender].[All Gender].[M], [Marital Status].[All Marital Status].[M]}"; test.assertEquals(expected, test.toString(axis.positions)); } public void testUnionQuery(FoodMartTestCase test) { Result result = test.runQuery( "select {[Measures].[Unit Sales], [Measures].[Store Cost], [Measures].[Store Sales]} on columns," + nl + " Hierarchize( " + nl + " Union(" + nl + " Crossjoin(" + nl + " Crossjoin([Gender].[All Gender].children," + nl + " [Marital Status].[All Marital Status].children )," + nl + " Crossjoin([Customers].[All Customers].children," + nl + " [Product].[All Products].children ) ) ," + nl + " Crossjoin( {([Gender].[All Gender].[M], [Marital Status].[All Marital Status].[M] )}," + nl + " Crossjoin(" + nl + " [Customers].[All Customers].[USA].children," + nl + " [Product].[All Products].children ) ) )) on rows" +nl + "from Sales where ([Time].[1997])"); final Axis rowsAxis = result.getAxes()[1]; test.assertEquals(45, rowsAxis.positions.length); } }); 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 FunkResolver( "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 new Vector(periodsToDate( evaluator, evaluator.getCube().getWeekLevel(), getMemberArg(evaluator, args, 0, false))); } })); define(new FunkResolver( "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 new Vector(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") { // implement FunDef public Object evaluate(Evaluator evaluator, Exp[] args) { final Member member0 = getMemberArg(evaluator, args, 0, true); final Member member1 = getMemberArg(evaluator, args, 1, true); if (member0.isNull() || member1.isNull()) { return emptyVector; } if (member0.getLevel() != member1.getLevel()) { throw newEvalException(this, "Members must belong to the same level"); } return new Vector(FunUtil.memberRange(member0, member1)); } public void testRange(FoodMartTestCase test) { final Axis axis = test.executeAxis2("[Time].[1997].[Q1].[2] : [Time].[1997].[Q2].[5]"); String expected = "[Time].[1997].[Q1].[2]" + nl + "[Time].[1997].[Q1].[3]" + nl + "[Time].[1997].[Q2].[4]" + nl + "[Time].[1997].[Q2].[5]"; // not parents test.assertEquals(expected, test.toString(axis.positions)); } public void _testRangeLarge(FoodMartTestCase test) { final Axis axis = test.executeAxis2("[Customers].[USA].[CA].[San Francisco] : [Customers].[USA].[WA].[Seattle]"); String expected = "[Time].[1997].[Q1].[2]" + nl + "[Time].[1997].[Q1].[3]" + nl + "[Time].[1997].[Q2].[4]" + nl + "[Time].[1997].[Q2].[5]"; // not parents test.assertEquals(expected, test.toString(axis.positions)); } public void testRangeStartEqualsEnd(FoodMartTestCase test) { final Axis axis = test.executeAxis2("[Time].[1997].[Q3].[7] : [Time].[1997].[Q3].[7]"); String expected = "[Time].[1997].[Q3].[7]"; test.assertEquals(expected, test.toString(axis.positions)); } public void testRangeEndBeforeStart(FoodMartTestCase test) { final Axis axis = test.executeAxis2("[Time].[1997].[Q3].[7] : [Time].[1997].[Q2].[5]"); String expected = "[Time].[1997].[Q2].[5]" + nl + "[Time].[1997].[Q2].[6]" + nl + "[Time].[1997].[Q3].[7]"; // same as if reversed test.assertEquals(expected, test.toString(axis.positions)); } public void testRangeBetweenDifferentLevelsIsError(FoodMartTestCase test) { test.assertAxisThrows( "[Time].[1997].[Q2] : [Time].[1997].[Q2].[5]", "Members must belong to the same level"); } public void testRangeBoundedByAll(FoodMartTestCase test) { final Axis axis = test.executeAxis2("[Gender] : [Gender]"); String expected = "[Gender].[All Gender]"; test.assertEquals(expected, test.toString(axis.positions)); } public void testRangeBoundedByNull(FoodMartTestCase test) { final Axis axis = test.executeAxis2("[Gender].[F] : [Gender].[M].NextMember"); test.assertTrue(axis.positions.length == 0); } }); // 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.", "fSbSS") { 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 Gender]", 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}; 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("2,237", 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 define(new MultiResolver("Parameter", "Parameter(<Name>, <Type>, <DefaultValue>, <Description>)", "Returns default value of parameter.", new String[] { "fS#yS#", "fs#yS", // Parameter(string const, symbol, string[, string const]): string "fn#yn#", "fn#yn", // Parameter(string const, symbol, numeric[, string const]): numeric "fm#hm#", "fm#hm", // Parameter(string const, hierarchy constant, member[, string const]): member }) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { String parameterName; if (args[0] instanceof Literal && args[0].getType() == Exp.CatString) { parameterName = (String) ((Literal) args[0]).getValue(); } else { throw newEvalException(dummyFunDef, "Parameter name must be a string constant"); } Exp typeArg = args[1]; Hierarchy hierarchy; int type; switch (typeArg.getType()) { case Exp.CatHierarchy: case Exp.CatDimension: hierarchy = typeArg.getHierarchy(); if (hierarchy == null || !isConstantHierarchy(typeArg)) { throw newEvalException(dummyFunDef, "Invalid hierarchy for parameter '" + parameterName + "'"); } type = Exp.CatMember; break; case Exp.CatSymbol: hierarchy = null; String s = (String) ((Literal) typeArg).getValue(); if (s.equalsIgnoreCase("NUMERIC")) { type = Exp.CatNumeric; break; } else if (s.equalsIgnoreCase("STRING")) { type = Exp.CatString; break; } // fall through and throw error default: // Error is internal because the function call has already been // type-checked. throw newEvalException(dummyFunDef, "Invalid type for parameter '" + parameterName + "'; expecting NUMERIC, STRING or a hierarchy"); } Exp exp = args[2]; if (exp.getType() != type) { String typeName = Exp.catEnum.getName(type).toUpperCase(); throw newEvalException(dummyFunDef, "Default value of parameter '" + parameterName + "' is inconsistent with its type, " + typeName); } if (type == Exp.CatMember) { Hierarchy expHierarchy = exp.getHierarchy(); if (expHierarchy != hierarchy) { throw newEvalException(dummyFunDef, "Default value of parameter '" + parameterName + "' must belong to the hierarchy " + hierarchy); } } String parameterDescription = null; if (args.length > 3) { if (args[3] instanceof Literal && args[3].getType() == Exp.CatString) { parameterDescription = (String) ((Literal) args[3]).getValue(); } else { throw newEvalException(dummyFunDef, "Description of parameter '" + parameterName + "' must be a string constant"); } } return new ParameterFunDef(dummyFunDef, parameterName, hierarchy, type, exp, parameterDescription); } }); define(new MultiResolver("ParamRef", "ParamRef(<Name>)", "Returns current value of parameter. If it's null, returns default.", new String[] {"fv#"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { String parameterName; if (args[0] instanceof Literal && args[0].getType() == Exp.CatString) { parameterName = (String) ((Literal) args[0]).getValue(); } else { throw newEvalException(dummyFunDef, "Parameter name must be a string constant"); } return new ParameterFunDef(dummyFunDef, parameterName, null, Exp.CatUnknown, null, null); } }); // // 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); } }); }
51263 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51263/70c4270c1bff30f538d792913a6023b7dd613649/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, ...
public org.exolab.castor.tests.framework.testDescriptor.UnitTestCase[] getUnitTestCase()
public org.exolab.castor.tests.framework.testDescriptor.UnitTestCase getUnitTestCase(int index) throws java.lang.IndexOutOfBoundsException
public org.exolab.castor.tests.framework.testDescriptor.UnitTestCase[] getUnitTestCase() { int size = this._unitTestCaseList.size(); org.exolab.castor.tests.framework.testDescriptor.UnitTestCase[] array = new org.exolab.castor.tests.framework.testDescriptor.UnitTestCase[size]; for (int index = 0; index < size; index++){ array[index] = (org.exolab.castor.tests.framework.testDescriptor.UnitTestCase) _unitTestCaseList.get(index); } return array; } //-- org.exolab.castor.tests.framework.testDescriptor.UnitTestCase[] getUnitTestCase()
3614 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/3614/374decd6a3e15cc2c6cc18bf6f30d5ebf4b0be59/OnlySourceGenerationTest.java/buggy/castor/trunk/src/tests/main/org/exolab/castor/tests/framework/testDescriptor/OnlySourceGenerationTest.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 2358, 18, 338, 355, 378, 18, 4155, 280, 18, 16341, 18, 12303, 18, 3813, 3187, 18, 2802, 4709, 2449, 19194, 4709, 2449, 12, 474, 770, 13, 1216, 2252, 18, 4936, 18, 30548, 565, 288,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 2358, 18, 338, 355, 378, 18, 4155, 280, 18, 16341, 18, 12303, 18, 3813, 3187, 18, 2802, 4709, 2449, 19194, 4709, 2449, 12, 474, 770, 13, 1216, 2252, 18, 4936, 18, 30548, 565, 288,...
public Hashtable checkAttributes(Element element, int eleContext) throws Exception { if (element == null) return null; // Get the proper name: // G_ for global; // LN_ for local + name; // LR_ for local + ref; String elName = element.getLocalName(), name; if (eleContext == ELE_CONTEXT_GLOBAL) { name = PRE_GLOBAL + element.getLocalName(); } else { if (element.getAttributeNode(SchemaSymbols.ATT_REF) == null) name = PRE_LOC_NAME + element.getLocalName(); else name = PRE_LOC_REF + element.getLocalName(); } // get desired attribute list of this element OneElement oneEle = (OneElement)fEleAttrsMap.get(name); if (oneEle == null) { reportSchemaError (SchemaMessageProvider.GenericError, new Object[] {"Element '"+elName+"' cannot appear here"}); return null; } Hashtable attrValues = new Hashtable(); Hashtable attrList = oneEle.attrList; // traverse all attributes NamedNodeMap attrs = element.getAttributes(); Attr sattr = null; int i = 0; while ((sattr = (Attr)attrs.item(i++)) != null) { // skip anything starts with x/X m/M l/L ??? // simply put their values in the return hashtable if (sattr.getName().toLowerCase().startsWith("xml")) { attrValues.put(sattr.getName(), sattr.getValue()); continue; } // check whether this attribute is allowed String attrName = sattr.getLocalName(); OneAttr oneAttr = (OneAttr)attrList.get(attrName); if (oneAttr == null) { reportSchemaError (SchemaMessageProvider.GenericError, new Object[] {"Attribute '"+attrName+"' cannot appear in '"+elName+"'"}); continue; } // get the attribute valud, and check it against the datatype String attrVal = sattr.getValue(); try { // values of ID type might be validated more than once, // which would fail the validation. // disable this temprorily. Enable it after modify TraverseSchema. //??? // and URI doesn't validate relative URIs, so disable it too. //??? // no checking on string needs to be done here. // no checking on xpath needs to be done here. // xpath values are validated in xpath parser if (oneAttr.dvIndex >= 0) { if (oneAttr.dvIndex != DT_ID && oneAttr.dvIndex != DT_ANYURI && oneAttr.dvIndex != DT_STRING && oneAttr.dvIndex != DT_XPATH && oneAttr.dvIndex != DT_XPATH1) fExtraDVs[oneAttr.dvIndex].validate(attrVal, null); attrValues.put(attrName, attrVal); } else { attrVal = validate(attrName, attrVal, oneAttr.dvIndex); attrValues.put(attrName, attrVal); } } catch(InvalidDatatypeValueException ide) { reportSchemaError (SchemaMessageProvider.GenericError, new Object[] {"Invalid attribute value '"+attrVal+"' for '"+attrName+"' in '"+ elName +"'"}); } } // traverse all required attributes Object[] reqAttrs = oneEle.attrArray; for (i = 0; i < reqAttrs.length; i++) { OneAttr oneAttr = (OneAttr)reqAttrs[i]; // if the attribute appreared, skip to the next one if (element.getAttributeNode(oneAttr.name) != null) continue; // if the attribute is required, report an error if (oneAttr.optdflt == ATT_REQUIRED) { reportSchemaError (SchemaMessageProvider.GenericError, new Object[] {"Attribute '"+oneAttr.name+"' must appear in '"+elName+"'"}); } // if the attribute is optional with default value, apply it else if (oneAttr.optdflt == ATT_OPT_DFLT) { attrValues.put(oneAttr.name, oneAttr.dfltValue); } } return attrValues; }
1831 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1831/45e22dff1ad897916568881983b72f7b21d75377/GeneralAttrCheck.java/buggy/src/org/apache/xerces/validators/schema/GeneralAttrCheck.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 1071, 18559, 866, 2498, 12, 1046, 930, 16, 509, 5043, 1042, 13, 1216, 1185, 288, 225, 309, 261, 2956, 422, 446, 13, 282, 327, 446, 31, 225, 368, 968, 326, 5338, 508, 30, 225, 368, 611...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1071, 18559, 866, 2498, 12, 1046, 930, 16, 509, 5043, 1042, 13, 1216, 1185, 288, 225, 309, 261, 2956, 422, 446, 13, 282, 327, 446, 31, 225, 368, 968, 326, 5338, 508, 30, 225, 368, 611...
msgs = ((InternalEObject)lineAttributes).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TypePackage.STOCK_SERIES__LINE_ATTRIBUTES, null, msgs);
msgs = ((InternalEObject) lineAttributes).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TypePackage.STOCK_SERIES__LINE_ATTRIBUTES, null, msgs);
public void setLineAttributes(LineAttributes newLineAttributes) { if (newLineAttributes != lineAttributes) { NotificationChain msgs = null; if (lineAttributes != null) msgs = ((InternalEObject)lineAttributes).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TypePackage.STOCK_SERIES__LINE_ATTRIBUTES, null, msgs); if (newLineAttributes != null) msgs = ((InternalEObject)newLineAttributes).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - TypePackage.STOCK_SERIES__LINE_ATTRIBUTES, null, msgs); msgs = basicSetLineAttributes(newLineAttributes, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, TypePackage.STOCK_SERIES__LINE_ATTRIBUTES, newLineAttributes, newLineAttributes)); }
5230 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5230/e5c78f0e8317166d02fa384e14c3dd7aa1796f2c/StockSeriesImpl.java/buggy/chart/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/model/type/impl/StockSeriesImpl.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 26482, 2498, 12, 1670, 2498, 8093, 2498, 13, 565, 288, 3639, 309, 261, 2704, 1670, 2498, 480, 980, 2498, 13, 3639, 288, 5411, 27050, 8733, 273, 446, 31, 5411, 309, 261, 1369, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 26482, 2498, 12, 1670, 2498, 8093, 2498, 13, 565, 288, 3639, 309, 261, 2704, 1670, 2498, 480, 980, 2498, 13, 3639, 288, 5411, 27050, 8733, 273, 446, 31, 5411, 309, 261, 1369, ...
public void paintBorder(Context c, Box box) { Box block = box; // get the border parts // paint the border BorderPainter bp = new BorderPainter(); // adjust to a fixed height, if necessary //if (!block.auto_height) { //bnds.y = block.height - block.margin.top - block.margin.bottom; //} bp.paint(c, block); }
53937 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53937/07ab625b03cad242caa27ac48e830592130b24a1/BoxLayout.java/clean/src/java/org/joshy/html/BoxLayout.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1071, 6459, 84, 1598, 8107, 12, 1042, 71, 16, 3514, 2147, 15329, 3514, 2629, 33, 2147, 31, 759, 588, 5787, 8815, 6019, 759, 84, 1598, 5787, 8815, 8107, 15775, 17152, 33, 2704, 8107, 15775, 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, 1071, 6459, 84, 1598, 8107, 12, 1042, 71, 16, 3514, 2147, 15329, 3514, 2629, 33, 2147, 31, 759, 588, 5787, 8815, 6019, 759, 84, 1598, 5787, 8815, 8107, 15775, 17152, 33, 2704, 8107, 15775, 562...
this.printBugs = printBugs; }
this.printBugs = printBugs; }
public void setPrintBugs(boolean printBugs) { this.printBugs = printBugs; }
45827 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45827/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyRuntime.java/clean/org/jruby/runtime/RubyRuntime.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 444, 5108, 31559, 12, 6494, 1172, 31559, 13, 288, 202, 202, 2211, 18, 1188, 31559, 273, 1172, 31559, 31, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 444, 5108, 31559, 12, 6494, 1172, 31559, 13, 288, 202, 202, 2211, 18, 1188, 31559, 273, 1172, 31559, 31, 202, 97, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
final double dStart = daEndPoints[0] - insCA.getLeft( ), dEnd = daEndPoints[1]
double dStart = daEndPoints[0] - insCA.getLeft( ), dEnd = daEndPoints[1]
public final void renderEachAxis( IPrimitiveRenderer ipr, Plot pl, OneAxis ax, int iWhatToDraw ) throws ChartException { final RunTimeContext rtc = getRunTimeContext( ); final Axis axModel = ax.getModelAxis( ); final PlotWithAxes pwa = (PlotWithAxes) getComputations( ); final Insets insCA = pwa.getAxes( ).getInsets( ); final ScriptHandler sh = getRunTimeContext( ).getScriptHandler( ); double dLocation = ax.getAxisCoordinate( ); double dAngleInDegrees = ax.getLabel( ) .getCaption( ) .getFont( ) .getRotation( ); AutoScale sc = ax.getScale( ); IntersectionValue iv = ax.getIntersectionValue( ); int iMajorTickStyle = ax.getGrid( ).getTickStyle( IConstants.MAJOR ); int iMinorTickStyle = ax.getGrid( ).getTickStyle( IConstants.MINOR ); int iLabelLocation = ax.getLabelPosition( ); int iOrientation = ax.getOrientation( ); Label la = (Label) EcoreUtil.copy( ax.getLabel( ) ); final IDisplayServer xs = this.getDevice( ).getDisplayServer( ); double[] daEndPoints = sc.getEndPoints( ); double[] da = sc.getTickCordinates( ); double[] daMinor = sc.getMinorCoordinates( ax.getGrid( ) .getMinorCountPerMajor( ) ); String sText = null; int iDimension = pwa.getDimension( ); double dSeriesThickness = pwa.getSeriesThickness( ); final NumberDataElement nde = NumberDataElementImpl.create( 0 ); final FormatSpecifier fs = ax.getModelAxis( ).getFormatSpecifier( ); final double dStaggeredLabelOffset = sc.computeStaggeredAxisLabelOffset( xs, la, iOrientation ); final boolean bAxisLabelStaggered = sc.isAxisLabelStaggered( ); DecimalFormat df = null; LineAttributes lia = ax.getLineAttributes( ); LineAttributes liaMajorTick = ax.getGrid( ) .getTickAttributes( IConstants.MAJOR ); LineAttributes liaMinorTick = ax.getGrid( ) .getTickAttributes( IConstants.MINOR ); if ( !lia.isSetVisible( ) ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, "exception.unset.axis.visibility", //$NON-NLS-1$ ResourceBundle.getBundle( Messages.ENGINE, getRunTimeContext( ).getLocale( ) ) ); } final boolean bRenderAxisLabels = ( ( iWhatToDraw & IConstants.LABELS ) == IConstants.LABELS && la.isVisible( ) ); final boolean bRenderAxisTitle = ( ( iWhatToDraw & IConstants.LABELS ) == IConstants.LABELS ); Location lo = LocationImpl.create( 0, 0 ); final TransformationEvent trae = (TransformationEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), TransformationEvent.class ); final TextRenderEvent tre = (TextRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), TextRenderEvent.class ); tre.setLabel( la ); tre.setTextPosition( iLabelLocation ); tre.setLocation( lo ); final LineRenderEvent lre = (LineRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), LineRenderEvent.class ); lre.setLineAttributes( lia ); lre.setStart( LocationImpl.create( 0, 0 ) ); lre.setEnd( LocationImpl.create( 0, 0 ) ); // Prepare 3D rendering variables. final boolean bRendering3D = iDimension == IConstants.THREE_D; final boolean bRenderOrthogonal3DAxis = ( iWhatToDraw & IConstants.ORTHOGONAL_AXIS ) == IConstants.ORTHOGONAL_AXIS && bRendering3D; final boolean bRenderBase3DAxis = ( iWhatToDraw & IConstants.BASE_AXIS ) == IConstants.BASE_AXIS && bRendering3D; final boolean bRenderAncillary3DAxis = ( iWhatToDraw & IConstants.ANCILLARY_AXIS ) == IConstants.ANCILLARY_AXIS && bRendering3D; final DeferredCache dc = getDeferredCache( ); final int axisType = ax.getAxisType( ); final Bounds boPlot = getPlotBounds( ); double[] daEndPoints3D = null; double[] da3D = null; Location3D lo3d = null; Text3DRenderEvent t3dre = null; Line3DRenderEvent l3dre = null; double dXStart = 0; double dZStart = 0; double dXEnd = 0; double dZEnd = 0; if ( iDimension == IConstants.THREE_D ) { AllAxes aax = pwa.getAxes( ); dXEnd = aax.getPrimaryBase( ).getScale( ).getEnd( ); dZEnd = aax.getAncillaryBase( ).getScale( ).getEnd( ); dXStart = aax.getPrimaryBase( ).getScale( ).getStart( ); dZStart = aax.getAncillaryBase( ).getScale( ).getStart( ); daEndPoints3D = sc.getEndPoints( ); da3D = sc.getTickCordinates( ); lo3d = Location3DImpl.create( 0, 0, 0 ); t3dre = (Text3DRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), Text3DRenderEvent.class ); t3dre.setLabel( la ); t3dre.setAction( Text3DRenderEvent.RENDER_TEXT_AT_LOCATION ); t3dre.setTextPosition( iLabelLocation ); t3dre.setLocation3D( lo3d ); l3dre = (Line3DRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), Line3DRenderEvent.class ); l3dre.setLineAttributes( lia ); l3dre.setStart3D( Location3DImpl.create( 0, 0, 0 ) ); l3dre.setEnd3D( Location3DImpl.create( 0, 0, 0 ) ); } if ( iOrientation == IConstants.VERTICAL ) { int y; int y3d = 0; double dX = dLocation; double dZ = 0; if ( bRendering3D ) { Location3D l3d = ax.getAxisCoordinate3D( ); dX = l3d.getX( ); dZ = l3d.getZ( ); } if ( iv != null && iv.getType( ) == IntersectionValue.MAX && iDimension == IConstants.TWO_5_D ) { trae.setTransform( TransformationEvent.TRANSLATE ); trae.setTranslation( dSeriesThickness, -dSeriesThickness ); ipr.applyTransformation( trae ); } double dXTick1 = ( ( iMajorTickStyle & IConstants.TICK_LEFT ) == IConstants.TICK_LEFT ) ? ( dX - IConstants.TICK_SIZE ) : dX; double dXTick2 = ( ( iMajorTickStyle & IConstants.TICK_RIGHT ) == IConstants.TICK_RIGHT ) ? dX + IConstants.TICK_SIZE : dX; if ( ( iWhatToDraw & IConstants.AXIS ) == IConstants.AXIS && lia.isVisible( ) ) { if ( bRenderOrthogonal3DAxis ) { final double dStart = daEndPoints3D[0]; final double dEnd = daEndPoints3D[1]; l3dre.setLineAttributes( lia ); // center l3dre.setStart3D( dX, dStart, dZ ); l3dre.setEnd3D( dX, dEnd, dZ ); dc.addLine( l3dre ); // left l3dre.setStart3D( dX, dStart, dZEnd ); l3dre.setEnd3D( dX, dEnd, dZEnd ); dc.addLine( l3dre ); // right l3dre.setStart3D( dXEnd, dStart, dZ ); l3dre.setEnd3D( dXEnd, dEnd, dZ ); dc.addLine( l3dre ); if ( isInteractivityEnabled( ) ) { Trigger tg; EList elTriggers = axModel.getTriggers( ); if ( !elTriggers.isEmpty( ) ) { ArrayList cachedTriggers = null; Location3D[] loaHotspot = new Location3D[4]; Polygon3DRenderEvent pre3d = (Polygon3DRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), Polygon3DRenderEvent.class ); // process center y-axis. loaHotspot[0] = Location3DImpl.create( dX - IConstants.LINE_EXPAND_DOUBLE_SIZE, dStart, dZ + IConstants.LINE_EXPAND_DOUBLE_SIZE ); loaHotspot[1] = Location3DImpl.create( dX + IConstants.LINE_EXPAND_DOUBLE_SIZE, dStart, dZ - IConstants.LINE_EXPAND_DOUBLE_SIZE ); loaHotspot[2] = Location3DImpl.create( dX + IConstants.LINE_EXPAND_DOUBLE_SIZE, dEnd, dZ - IConstants.LINE_EXPAND_DOUBLE_SIZE ); loaHotspot[3] = Location3DImpl.create( dX - IConstants.LINE_EXPAND_DOUBLE_SIZE, dEnd, dZ + IConstants.LINE_EXPAND_DOUBLE_SIZE ); pre3d.setPoints3D( loaHotspot ); pre3d.setDoubleSided( true ); if ( get3DEngine( ).processEvent( pre3d, boPlot.getLeft( ), boPlot.getTop( ) ) != null ) { final InteractionEvent iev = (InteractionEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), InteractionEvent.class ); cachedTriggers = new ArrayList( ); for ( int t = 0; t < elTriggers.size( ); t++ ) { tg = (Trigger) EcoreUtil.copy( (Trigger) elTriggers.get( t ) ); processTrigger( tg, StructureSource.createAxis( axModel ) ); cachedTriggers.add( tg ); iev.addTrigger( (Trigger) EcoreUtil.copy( tg ) ); } iev.setHotSpot( pre3d ); ipr.enableInteraction( iev ); } // process left y-axis. pre3d = (Polygon3DRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), Polygon3DRenderEvent.class ); loaHotspot = new Location3D[4]; loaHotspot[0] = Location3DImpl.create( dXStart - IConstants.LINE_EXPAND_DOUBLE_SIZE, dStart, dZEnd + IConstants.LINE_EXPAND_DOUBLE_SIZE ); loaHotspot[1] = Location3DImpl.create( dXStart + IConstants.LINE_EXPAND_DOUBLE_SIZE, dStart, dZEnd - IConstants.LINE_EXPAND_DOUBLE_SIZE ); loaHotspot[2] = Location3DImpl.create( dXStart + IConstants.LINE_EXPAND_DOUBLE_SIZE, dEnd, dZEnd - IConstants.LINE_EXPAND_DOUBLE_SIZE ); loaHotspot[3] = Location3DImpl.create( dXStart - IConstants.LINE_EXPAND_DOUBLE_SIZE, dEnd, dZEnd + IConstants.LINE_EXPAND_DOUBLE_SIZE ); pre3d.setPoints3D( loaHotspot ); pre3d.setDoubleSided( true ); if ( get3DEngine( ).processEvent( pre3d, boPlot.getLeft( ), boPlot.getTop( ) ) != null ) { final InteractionEvent iev = (InteractionEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), InteractionEvent.class ); if ( cachedTriggers == null ) { cachedTriggers = new ArrayList( ); for ( int t = 0; t < elTriggers.size( ); t++ ) { tg = (Trigger) EcoreUtil.copy( (Trigger) elTriggers.get( t ) ); processTrigger( tg, StructureSource.createAxis( axModel ) ); cachedTriggers.add( tg ); iev.addTrigger( (Trigger) EcoreUtil.copy( tg ) ); } } else { for ( int t = 0; t < cachedTriggers.size( ); t++ ) { iev.addTrigger( (Trigger) EcoreUtil.copy( (Trigger) cachedTriggers.get( t ) ) ); } } iev.setHotSpot( pre3d ); ipr.enableInteraction( iev ); } // process right y-axis. pre3d = (Polygon3DRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), Polygon3DRenderEvent.class ); loaHotspot = new Location3D[4]; loaHotspot[0] = Location3DImpl.create( dXEnd - IConstants.LINE_EXPAND_DOUBLE_SIZE, dStart, dZStart + IConstants.LINE_EXPAND_DOUBLE_SIZE ); loaHotspot[1] = Location3DImpl.create( dXEnd + IConstants.LINE_EXPAND_DOUBLE_SIZE, dStart, dZStart - IConstants.LINE_EXPAND_DOUBLE_SIZE ); loaHotspot[2] = Location3DImpl.create( dXEnd + IConstants.LINE_EXPAND_DOUBLE_SIZE, dEnd, dZStart - IConstants.LINE_EXPAND_DOUBLE_SIZE ); loaHotspot[3] = Location3DImpl.create( dXEnd - IConstants.LINE_EXPAND_DOUBLE_SIZE, dEnd, dZStart + IConstants.LINE_EXPAND_DOUBLE_SIZE ); pre3d.setPoints3D( loaHotspot ); pre3d.setDoubleSided( true ); if ( get3DEngine( ).processEvent( pre3d, boPlot.getLeft( ), boPlot.getTop( ) ) != null ) { final InteractionEvent iev = (InteractionEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), InteractionEvent.class ); if ( cachedTriggers == null ) { for ( int t = 0; t < elTriggers.size( ); t++ ) { tg = (Trigger) EcoreUtil.copy( (Trigger) elTriggers.get( t ) ); processTrigger( tg, StructureSource.createAxis( axModel ) ); iev.addTrigger( tg ); } } else { for ( int t = 0; t < cachedTriggers.size( ); t++ ) { iev.addTrigger( (Trigger) cachedTriggers.get( t ) ); } } iev.setHotSpot( pre3d ); ipr.enableInteraction( iev ); } } } } else { final double dStart = daEndPoints[0] + insCA.getBottom( ), dEnd = daEndPoints[1] - insCA.getTop( ); if ( iv != null && iv.getType( ) == IntersectionValue.VALUE && iDimension == IConstants.TWO_5_D ) { final Location[] loa = new Location[4]; loa[0] = LocationImpl.create( dX, dStart ); loa[1] = LocationImpl.create( dX + dSeriesThickness, dStart - dSeriesThickness ); loa[2] = LocationImpl.create( dX + dSeriesThickness, dEnd - dSeriesThickness ); loa[3] = LocationImpl.create( dX, dEnd ); final PolygonRenderEvent pre = (PolygonRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), PolygonRenderEvent.class ); pre.setPoints( loa ); pre.setBackground( ColorDefinitionImpl.create( 255, 255, 255, 127 ) ); pre.setOutline( lia ); ipr.fillPolygon( pre ); } lre.setLineAttributes( lia ); lre.getStart( ).set( dX, dStart ); lre.getEnd( ).set( dX, dEnd ); ipr.drawLine( lre ); if ( isInteractivityEnabled( ) ) { Trigger tg; EList elTriggers = axModel.getTriggers( ); if ( !elTriggers.isEmpty( ) ) { final InteractionEvent iev = (InteractionEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), InteractionEvent.class ); for ( int t = 0; t < elTriggers.size( ); t++ ) { tg = (Trigger) EcoreUtil.copy( (Trigger) elTriggers.get( t ) ); processTrigger( tg, StructureSource.createAxis( axModel ) ); iev.addTrigger( tg ); } Location[] loaHotspot = new Location[4]; loaHotspot[0] = LocationImpl.create( dX - IConstants.LINE_EXPAND_SIZE, dStart ); loaHotspot[1] = LocationImpl.create( dX + IConstants.LINE_EXPAND_SIZE, dStart ); loaHotspot[2] = LocationImpl.create( dX + IConstants.LINE_EXPAND_SIZE, dEnd ); loaHotspot[3] = LocationImpl.create( dX - IConstants.LINE_EXPAND_SIZE, dEnd ); final PolygonRenderEvent pre = (PolygonRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), PolygonRenderEvent.class ); pre.setPoints( loaHotspot ); iev.setHotSpot( pre ); ipr.enableInteraction( iev ); } } } } if ( ( sc.getType( ) & IConstants.TEXT ) == IConstants.TEXT || sc.isCategoryScale( ) ) { double dOffset = 0; double dUnitSize = sc.getUnitSize( ); DataSetIterator dsi = sc.getData( ); final int iDateTimeUnit = ( sc.getType( ) == IConstants.DATE_TIME ) ? CDateTime.computeUnit( dsi ) : IConstants.UNDEFINED; final ITextMetrics itmText = xs.getTextMetrics( la ); if ( dAngleInDegrees == 90 || dAngleInDegrees == 0 ) { dOffset = -dUnitSize / 2; } double x = ( iLabelLocation == IConstants.LEFT ) ? dXTick1 - 1 : dXTick2 + 1; dsi.reset( ); for ( int i = 0; i < da.length - 1; i++ ) { if ( bRenderAxisLabels ) { la.getCaption( ) .setValue( sc.formatCategoryValue( sc.getType( ), dsi.next( ), iDateTimeUnit ) ); if ( sc.isTickLabelVisible( i ) ) { ScriptHandler.callFunction( sh, ScriptHandler.BEFORE_DRAW_AXIS_LABEL, axModel, la, getRunTimeContext( ).getScriptContext( ) ); getRunTimeContext( ).notifyStructureChange( IStructureDefinitionListener.BEFORE_DRAW_AXIS_LABEL, la ); itmText.reuse( la ); // RECYCLED dOffset = -dUnitSize / 2; } } y = (int) da[i]; if ( bRendering3D ) { y3d = (int) da3D[i]; } if ( ( iWhatToDraw & IConstants.AXIS ) == IConstants.AXIS ) { double dXMinorTick1 = ( ( iMinorTickStyle & IConstants.TICK_LEFT ) == IConstants.TICK_LEFT ) ? ( dX - IConstants.TICK_SIZE ) : dX; double dXMinorTick2 = ( ( iMinorTickStyle & IConstants.TICK_RIGHT ) == IConstants.TICK_RIGHT ) ? dX + IConstants.TICK_SIZE : dX; if ( dXMinorTick1 != dXMinorTick2 ) { // RENDER THE MINOR TICKS FIRST (For ALL but the // last Major tick) if ( i != da.length - 1 ) { if ( bRenderOrthogonal3DAxis ) { Line3DRenderEvent l3dreMinor = null; for ( int k = 0; k < daMinor.length - 1; k++ ) { l3dreMinor = (Line3DRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), Line3DRenderEvent.class ); l3dreMinor.setLineAttributes( liaMinorTick ); l3dreMinor.setStart3D( Location3DImpl.create( dXMinorTick1, y3d + daMinor[k], dZ ) ); l3dreMinor.setEnd3D( Location3DImpl.create( dXMinorTick2, y3d + daMinor[k], dZ ) ); dc.addLine( l3dreMinor ); } } else { LineRenderEvent lreMinor = null; for ( int k = 0; k < daMinor.length - 1; k++ ) { lreMinor = (LineRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), LineRenderEvent.class ); lreMinor.setLineAttributes( liaMinorTick ); lreMinor.setStart( LocationImpl.create( dXMinorTick1, y - daMinor[k] ) ); lreMinor.setEnd( LocationImpl.create( dXMinorTick2, y - daMinor[k] ) ); ipr.drawLine( lreMinor ); } } } } if ( dXTick1 != dXTick2 ) { if ( bRenderOrthogonal3DAxis ) { l3dre.setLineAttributes( liaMajorTick ); l3dre.setStart3D( dXTick1, y3d, dZ ); l3dre.setEnd3D( dXTick2, y3d, dZ ); dc.addLine( l3dre ); } else { lre.setLineAttributes( liaMajorTick ); lre.getStart( ).set( dXTick1, y ); lre.getEnd( ).set( dXTick2, y ); ipr.drawLine( lre ); } if ( iv != null && iDimension == IConstants.TWO_5_D && iv.getType( ) == IntersectionValue.VALUE ) { lre.setStart( LocationImpl.create( dX, y ) ); lre.setEnd( LocationImpl.create( dX + dSeriesThickness, y - dSeriesThickness ) ); ipr.drawLine( lre ); } } } if ( bRenderAxisLabels && sc.isTickLabelVisible( i ) ) { double sx = x; double sx2 = dXEnd; if ( bAxisLabelStaggered && sc.isTickLabelStaggered( i ) ) { if ( iLabelLocation == IConstants.LEFT ) { sx -= dStaggeredLabelOffset; sx2 -= dStaggeredLabelOffset; } else { sx += dStaggeredLabelOffset; sx2 += dStaggeredLabelOffset; } } if ( ax.getLabel( ).isVisible( ) ) { if ( bRendering3D ) { // Left wall lo3d.set( sx, y3d + dOffset, dZEnd ); t3dre.setLocation3D( lo3d ); t3dre.setTextPosition( TextRenderEvent.LEFT ); t3dre.setAction( TextRenderEvent.RENDER_TEXT_AT_LOCATION ); dc.addLabel( t3dre ); // Right wall lo3d.set( sx2, y3d + dOffset, dZ ); t3dre.setLocation3D( lo3d ); t3dre.setTextPosition( TextRenderEvent.RIGHT ); t3dre.setAction( TextRenderEvent.RENDER_TEXT_AT_LOCATION ); dc.addLabel( t3dre ); } else { lo.set( sx, y + dOffset ); tre.setAction( TextRenderEvent.RENDER_TEXT_AT_LOCATION ); ipr.drawText( tre ); } } ScriptHandler.callFunction( sh, ScriptHandler.AFTER_DRAW_AXIS_LABEL, axModel, la, getRunTimeContext( ).getScriptContext( ) ); getRunTimeContext( ).notifyStructureChange( IStructureDefinitionListener.AFTER_DRAW_AXIS_LABEL, la ); } } y = (int) da[da.length - 1]; if ( bRendering3D ) { y3d = (int) da3D[da3D.length - 1]; } if ( dXTick1 != dXTick2 ) { if ( bRenderOrthogonal3DAxis ) { l3dre.setLineAttributes( liaMajorTick ); l3dre.setStart3D( dXTick1, y3d, dZ ); l3dre.setEnd3D( dXTick2, y3d, dZ ); dc.addLine( l3dre ); } else { lre.setLineAttributes( liaMajorTick ); lre.getStart( ).set( dXTick1, y ); lre.getEnd( ).set( dXTick2, y ); ipr.drawLine( lre ); } if ( iv != null && iDimension == IConstants.TWO_5_D && iv.getType( ) == IntersectionValue.VALUE ) { lre.setStart( LocationImpl.create( dX, y ) ); lre.setEnd( LocationImpl.create( dX + dSeriesThickness, y - dSeriesThickness ) ); ipr.drawLine( lre ); } } itmText.dispose( );// DISPOSED } else if ( ( sc.getType( ) & IConstants.LOGARITHMIC ) == IConstants.LOGARITHMIC ) { double dAxisValue = Methods.asDouble( sc.getMinimum( ) ) .doubleValue( ); final double dAxisStep = Methods.asDouble( sc.getStep( ) ) .doubleValue( ); dAxisValue = Methods.asDouble( sc.getMinimum( ) ).doubleValue( ); // RESET double x = ( iLabelLocation == IConstants.LEFT ) ? dXTick1 - 1 : dXTick2 + 1; for ( int i = 0; i < da.length; i++ ) { if ( bRenderAxisLabels ) // PERFORM COMPUTATIONS ONLY IF // AXIS LABEL IS VISIBLE { if ( fs == null ) { df = new DecimalFormat( sc.getNumericPattern( dAxisValue ) ); } nde.setValue( dAxisValue ); try { sText = ValueFormatter.format( nde, fs, ax.getRunTimeContext( ).getLocale( ), df ); } catch ( ChartException dfex ) { logger.log( dfex ); sText = IConstants.NULL_STRING; } } y = (int) da[i]; if ( bRendering3D ) { y3d = (int) da3D[i]; } if ( ( iWhatToDraw & IConstants.AXIS ) == IConstants.AXIS ) { double dXMinorTick1 = ( ( iMinorTickStyle & IConstants.TICK_LEFT ) == IConstants.TICK_LEFT ) ? ( dX - IConstants.TICK_SIZE ) : dX; double dXMinorTick2 = ( ( iMinorTickStyle & IConstants.TICK_RIGHT ) == IConstants.TICK_RIGHT ) ? dX + IConstants.TICK_SIZE : dX; if ( dXMinorTick1 != dXMinorTick2 ) { // RENDER THE MINOR TICKS FIRST (For ALL but the // last Major tick) if ( i != da.length - 1 ) { if ( bRenderOrthogonal3DAxis ) { Line3DRenderEvent l3dreMinor = null; for ( int k = 0; k < daMinor.length - 1; k++ ) { l3dreMinor = (Line3DRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), Line3DRenderEvent.class ); l3dreMinor.setLineAttributes( liaMinorTick ); l3dreMinor.setStart3D( Location3DImpl.create( dXMinorTick1, y3d + daMinor[k], dZ ) ); l3dreMinor.setEnd3D( Location3DImpl.create( dXMinorTick2, y3d + daMinor[k], dZ ) ); dc.addLine( l3dreMinor ); } } else { LineRenderEvent lreMinor = null; for ( int k = 0; k < daMinor.length - 1; k++ ) { lreMinor = (LineRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), LineRenderEvent.class ); lreMinor.setLineAttributes( liaMinorTick ); lreMinor.setStart( LocationImpl.create( dXMinorTick1, y - daMinor[k] ) ); lreMinor.setEnd( LocationImpl.create( dXMinorTick2, y - daMinor[k] ) ); ipr.drawLine( lreMinor ); } } } } if ( dXTick1 != dXTick2 ) { if ( bRenderOrthogonal3DAxis ) { l3dre.setLineAttributes( liaMajorTick ); l3dre.setStart3D( dXTick1, y3d, dZ ); l3dre.setEnd3D( dXTick2, y3d, dZ ); dc.addLine( l3dre ); } else { lre.setLineAttributes( liaMajorTick ); lre.getStart( ).set( dXTick1, y ); lre.getEnd( ).set( dXTick2, y ); ipr.drawLine( lre ); } if ( iv != null && iDimension == IConstants.TWO_5_D && iv.getType( ) == IntersectionValue.VALUE ) { lre.setLineAttributes( lia ); lre.setStart( LocationImpl.create( dX, y ) ); lre.setEnd( LocationImpl.create( dX + dSeriesThickness, y - dSeriesThickness ) ); ipr.drawLine( lre ); } } } if ( bRenderAxisLabels && sc.isTickLabelVisible( i ) ) // RENDER // LABELS // ONLY // IF // REQUESTED { double sx = x; double sx2 = dXEnd; if ( bAxisLabelStaggered && sc.isTickLabelStaggered( i ) ) { if ( iLabelLocation == IConstants.LEFT ) { sx -= dStaggeredLabelOffset; sx2 -= dStaggeredLabelOffset; } else { sx += dStaggeredLabelOffset; sx2 += dStaggeredLabelOffset; } } ScriptHandler.callFunction( sh, ScriptHandler.BEFORE_DRAW_AXIS_LABEL, axModel, la, getRunTimeContext( ).getScriptContext( ) ); getRunTimeContext( ).notifyStructureChange( IStructureDefinitionListener.BEFORE_DRAW_AXIS_LABEL, la ); if ( ax.getLabel( ).isVisible( ) ) { if ( bRendering3D ) { // Left wall lo3d.set( sx, y3d, dZEnd ); la.getCaption( ).setValue( sText ); t3dre.setLocation3D( lo3d ); t3dre.setTextPosition( TextRenderEvent.LEFT ); t3dre.setAction( TextRenderEvent.RENDER_TEXT_AT_LOCATION ); dc.addLabel( t3dre ); // Right wall lo3d.set( sx2, y3d, dZ ); la.getCaption( ).setValue( sText ); t3dre.setLocation3D( lo3d ); t3dre.setTextPosition( TextRenderEvent.RIGHT ); t3dre.setAction( TextRenderEvent.RENDER_TEXT_AT_LOCATION ); dc.addLabel( t3dre ); } else { lo.set( sx, y ); la.getCaption( ).setValue( sText ); tre.setAction( TextRenderEvent.RENDER_TEXT_AT_LOCATION ); ipr.drawText( tre ); } } ScriptHandler.callFunction( sh, ScriptHandler.AFTER_DRAW_AXIS_LABEL, axModel, la, getRunTimeContext( ).getScriptContext( ) ); getRunTimeContext( ).notifyStructureChange( IStructureDefinitionListener.AFTER_DRAW_AXIS_LABEL, la ); } dAxisValue *= dAxisStep; } } else if ( ( sc.getType( ) & IConstants.LINEAR ) == IConstants.LINEAR ) { double dAxisValue = Methods.asDouble( sc.getMinimum( ) ) .doubleValue( ); final double dAxisStep = Methods.asDouble( sc.getStep( ) ) .doubleValue( ); if ( fs == null ) { df = new DecimalFormat( sc.getNumericPattern( ) ); } dAxisValue = Methods.asDouble( sc.getMinimum( ) ).doubleValue( ); // RESET double x = ( iLabelLocation == IConstants.LEFT ) ? dXTick1 - 1 : dXTick2 + 1; for ( int i = 0; i < da.length; i++ ) { nde.setValue( dAxisValue ); try { sText = ValueFormatter.format( nde, fs, ax.getRunTimeContext( ).getLocale( ), df ); } catch ( ChartException dfex ) { logger.log( dfex ); sText = IConstants.NULL_STRING; } y = (int) da[i]; if ( bRendering3D ) { y3d = (int) da3D[i]; } if ( ( iWhatToDraw & IConstants.AXIS ) == IConstants.AXIS ) { double dXMinorTick1 = ( ( iMinorTickStyle & IConstants.TICK_LEFT ) == IConstants.TICK_LEFT ) ? ( dX - IConstants.TICK_SIZE ) : dX, dXMinorTick2 = ( ( iMinorTickStyle & IConstants.TICK_RIGHT ) == IConstants.TICK_RIGHT ) ? dX + IConstants.TICK_SIZE : dX; if ( dXMinorTick1 != dXMinorTick2 ) { // RENDER THE MINOR TICKS FIRST (For ALL but the // last Major tick) if ( i != da.length - 1 ) { if ( bRenderOrthogonal3DAxis ) { Line3DRenderEvent l3dreMinor = null; for ( int k = 0; k < daMinor.length - 1; k++ ) { l3dreMinor = (Line3DRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), Line3DRenderEvent.class ); l3dreMinor.setLineAttributes( liaMinorTick ); l3dreMinor.setStart3D( Location3DImpl.create( dXMinorTick1, y3d + daMinor[k], dZ ) ); l3dreMinor.setEnd3D( Location3DImpl.create( dXMinorTick2, y3d + daMinor[k], dZ ) ); dc.addLine( l3dreMinor ); } } else { LineRenderEvent lreMinor = null; for ( int k = 0; k < daMinor.length - 1; k++ ) { lreMinor = (LineRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), LineRenderEvent.class ); lreMinor.setLineAttributes( liaMinorTick ); lreMinor.setStart( LocationImpl.create( dXMinorTick1, y - daMinor[k] ) ); lreMinor.setEnd( LocationImpl.create( dXMinorTick2, y - daMinor[k] ) ); ipr.drawLine( lreMinor ); } } } } if ( dXTick1 != dXTick2 ) { if ( bRenderOrthogonal3DAxis ) { l3dre.setLineAttributes( liaMajorTick ); l3dre.setStart3D( dXTick1, y3d, dZ ); l3dre.setEnd3D( dXTick2, y3d, dZ ); dc.addLine( l3dre ); } else { lre.setLineAttributes( liaMajorTick ); lre.getStart( ).set( dXTick1, y ); lre.getEnd( ).set( dXTick2, y ); ipr.drawLine( lre ); } if ( iv != null && iDimension == IConstants.TWO_5_D && iv.getType( ) == IntersectionValue.VALUE ) { lre.setLineAttributes( lia ); lre.setStart( LocationImpl.create( dX, y ) ); lre.setEnd( LocationImpl.create( dX + dSeriesThickness, y - dSeriesThickness ) ); ipr.drawLine( lre ); } } } if ( bRenderAxisLabels && sc.isTickLabelVisible( i ) ) { double sx = x; double sx2 = dXEnd; if ( bAxisLabelStaggered && sc.isTickLabelStaggered( i ) ) { if ( iLabelLocation == IConstants.LEFT ) { sx -= dStaggeredLabelOffset; sx2 -= dStaggeredLabelOffset; } else { sx += dStaggeredLabelOffset; sx2 += dStaggeredLabelOffset; } } ScriptHandler.callFunction( sh, ScriptHandler.BEFORE_DRAW_AXIS_LABEL, axModel, la, getRunTimeContext( ).getScriptContext( ) ); getRunTimeContext( ).notifyStructureChange( IStructureDefinitionListener.BEFORE_DRAW_AXIS_LABEL, la ); if ( ax.getLabel( ).isVisible( ) ) { if ( bRendering3D ) { // Left wall lo3d.set( sx, y3d, dZEnd ); la.getCaption( ).setValue( sText ); t3dre.setLocation3D( lo3d ); t3dre.setTextPosition( TextRenderEvent.LEFT ); t3dre.setAction( TextRenderEvent.RENDER_TEXT_AT_LOCATION ); dc.addLabel( t3dre ); // Right wall lo3d.set( sx2, y3d, dZ ); la.getCaption( ).setValue( sText ); t3dre.setLocation3D( lo3d ); t3dre.setTextPosition( TextRenderEvent.RIGHT ); t3dre.setAction( TextRenderEvent.RENDER_TEXT_AT_LOCATION ); dc.addLabel( t3dre ); } else { lo.set( sx, y ); la.getCaption( ).setValue( sText ); tre.setAction( TextRenderEvent.RENDER_TEXT_AT_LOCATION ); ipr.drawText( tre ); } } ScriptHandler.callFunction( sh, ScriptHandler.AFTER_DRAW_AXIS_LABEL, axModel, la, getRunTimeContext( ).getScriptContext( ) ); getRunTimeContext( ).notifyStructureChange( IStructureDefinitionListener.AFTER_DRAW_AXIS_LABEL, la ); } dAxisValue += dAxisStep; } } else if ( ( sc.getType( ) & IConstants.DATE_TIME ) == IConstants.DATE_TIME ) { CDateTime cdt, cdtAxisValue = Methods.asDateTime( sc.getMinimum( ) ); final int iUnit = Methods.asInteger( sc.getUnit( ) ); final int iStep = Methods.asInteger( sc.getStep( ) ); SimpleDateFormat sdf = null; if ( fs == null ) { sdf = new SimpleDateFormat( CDateTime.getPreferredFormat( iUnit ) ); } cdt = cdtAxisValue; double x = ( iLabelLocation == IConstants.LEFT ) ? dXTick1 - 1 : dXTick2 + 1; for ( int i = 0; i < da.length; i++ ) { try { sText = ValueFormatter.format( cdt, ax.getFormatSpecifier( ), ax.getRunTimeContext( ).getLocale( ), sdf ); } catch ( ChartException dfex ) { logger.log( dfex ); sText = IConstants.NULL_STRING; } y = (int) da[i]; if ( bRendering3D ) { y3d = (int) da3D[i]; } if ( ( iWhatToDraw & IConstants.AXIS ) == IConstants.AXIS ) { double dXMinorTick1 = ( ( iMinorTickStyle & IConstants.TICK_LEFT ) == IConstants.TICK_LEFT ) ? ( dX - IConstants.TICK_SIZE ) : dX, dXMinorTick2 = ( ( iMinorTickStyle & IConstants.TICK_RIGHT ) == IConstants.TICK_RIGHT ) ? dX + IConstants.TICK_SIZE : dX; if ( dXMinorTick1 != dXMinorTick2 ) { // RENDER THE MINOR TICKS FIRST (For ALL but the // last Major tick) if ( i != da.length - 1 ) { if ( bRenderOrthogonal3DAxis ) { Line3DRenderEvent l3dreMinor = null; for ( int k = 0; k < daMinor.length - 1; k++ ) { l3dreMinor = (Line3DRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), Line3DRenderEvent.class ); l3dreMinor.setLineAttributes( liaMinorTick ); l3dreMinor.setStart3D( Location3DImpl.create( dXMinorTick1, y3d + daMinor[k], dZ ) ); l3dreMinor.setEnd3D( Location3DImpl.create( dXMinorTick2, y3d + daMinor[k], dZ ) ); dc.addLine( l3dreMinor ); } } else { LineRenderEvent lreMinor = null; for ( int k = 0; k < daMinor.length - 1; k++ ) { lreMinor = (LineRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), LineRenderEvent.class ); lreMinor.setLineAttributes( liaMinorTick ); lreMinor.setStart( LocationImpl.create( dXMinorTick1, y - daMinor[k] ) ); lreMinor.setEnd( LocationImpl.create( dXMinorTick2, y - daMinor[k] ) ); ipr.drawLine( lreMinor ); } } } } if ( dXTick1 != dXTick2 ) { if ( bRenderOrthogonal3DAxis ) { l3dre.setLineAttributes( liaMajorTick ); l3dre.setStart3D( dXTick1, y3d, dZ ); l3dre.setEnd3D( dXTick2, y3d, dZ ); dc.addLine( l3dre ); } else { lre.setLineAttributes( liaMajorTick ); lre.getStart( ).set( dXTick1, y ); lre.getEnd( ).set( dXTick2, y ); ipr.drawLine( lre ); } if ( iv != null && iDimension == IConstants.TWO_5_D && iv.getType( ) == IntersectionValue.VALUE ) { lre.setStart( LocationImpl.create( dX, y ) ); lre.setEnd( LocationImpl.create( dX + dSeriesThickness, y - dSeriesThickness ) ); ipr.drawLine( lre ); } } } if ( bRenderAxisLabels && sc.isTickLabelVisible( i ) ) { double sx = x; double sx2 = dXEnd; if ( bAxisLabelStaggered && sc.isTickLabelStaggered( i ) ) { if ( iLabelLocation == IConstants.LEFT ) { sx -= dStaggeredLabelOffset; sx2 -= dStaggeredLabelOffset; } else { sx += dStaggeredLabelOffset; sx2 += dStaggeredLabelOffset; } } ScriptHandler.callFunction( sh, ScriptHandler.BEFORE_DRAW_AXIS_LABEL, axModel, la, getRunTimeContext( ).getScriptContext( ) ); getRunTimeContext( ).notifyStructureChange( IStructureDefinitionListener.BEFORE_DRAW_AXIS_LABEL, la ); if ( ax.getLabel( ).isVisible( ) ) { if ( bRendering3D ) { // Left wall lo3d.set( sx, y3d, dZEnd ); la.getCaption( ).setValue( sText ); t3dre.setLocation3D( lo3d ); t3dre.setTextPosition( TextRenderEvent.LEFT ); t3dre.setAction( TextRenderEvent.RENDER_TEXT_AT_LOCATION ); dc.addLabel( t3dre ); // Right wall lo3d.set( sx2, y3d, dZ ); la.getCaption( ).setValue( sText ); t3dre.setLocation3D( lo3d ); t3dre.setTextPosition( TextRenderEvent.RIGHT ); t3dre.setAction( TextRenderEvent.RENDER_TEXT_AT_LOCATION ); dc.addLabel( t3dre ); } else { lo.set( sx, y ); la.getCaption( ).setValue( sText ); tre.setAction( TextRenderEvent.RENDER_TEXT_AT_LOCATION ); ipr.drawText( tre ); } } ScriptHandler.callFunction( sh, ScriptHandler.AFTER_DRAW_AXIS_LABEL, axModel, la, getRunTimeContext( ).getScriptContext( ) ); getRunTimeContext( ).notifyStructureChange( IStructureDefinitionListener.AFTER_DRAW_AXIS_LABEL, la ); } cdt = cdtAxisValue.forward( iUnit, iStep * ( i + 1 ) ); // ALWAYS // W.R.T // START // VALUE } } la = (Label) EcoreUtil.copy( ax.getTitle( ) ); // TEMPORARILY USE // FOR AXIS TITLE if ( la.isVisible( ) && bRenderAxisTitle ) { ScriptHandler.callFunction( sh, ScriptHandler.BEFORE_DRAW_AXIS_TITLE, axModel, la, getRunTimeContext( ).getScriptContext( ) ); getRunTimeContext( ).notifyStructureChange( IStructureDefinitionListener.BEFORE_DRAW_AXIS_TITLE, la ); final String sRestoreValue = la.getCaption( ).getValue( ); la.getCaption( ) .setValue( rtc.externalizedMessage( sRestoreValue ) ); BoundingBox bb = null; try { bb = Methods.computeBox( xs, ax.getTitlePosition( ), la, 0, 0 ); } catch ( IllegalArgumentException uiex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, uiex ); } if ( ax.getTitle( ).isVisible( ) ) { if ( bRendering3D ) { Bounds cbo = getPlotBounds( ); tre.setBlockBounds( BoundsImpl.create( cbo.getLeft( ) + ( cbo.getWidth( ) / 3d - bb.getWidth( ) ) / 2d, cbo.getTop( ) + 30, bb.getWidth( ), bb.getHeight( ) ) ); tre.setLabel( la ); tre.setBlockAlignment( la.getCaption( ) .getFont( ) .getAlignment( ) ); tre.setAction( TextRenderEvent.RENDER_TEXT_IN_BLOCK ); ipr.drawText( tre ); tre.setBlockBounds( BoundsImpl.create( cbo.getLeft( ) + cbo.getWidth( ) - bb.getWidth( ), cbo.getTop( ) + 30 * 2, bb.getWidth( ), bb.getHeight( ) ) ); ipr.drawText( tre ); } else { final Bounds bo = BoundsImpl.create( ax.getTitleCoordinate( ), daEndPoints[1], bb.getWidth( ), daEndPoints[0] - daEndPoints[1] ); tre.setBlockBounds( bo ); tre.setLabel( la ); tre.setBlockAlignment( la.getCaption( ) .getFont( ) .getAlignment( ) ); tre.setAction( TextRenderEvent.RENDER_TEXT_IN_BLOCK ); if ( ax.getTitle( ).isVisible( ) ) { ipr.drawText( tre ); } } } la.getCaption( ).setValue( sRestoreValue ); ScriptHandler.callFunction( sh, ScriptHandler.AFTER_DRAW_AXIS_TITLE, axModel, la, getRunTimeContext( ).getScriptContext( ) ); getRunTimeContext( ).notifyStructureChange( IStructureDefinitionListener.AFTER_DRAW_AXIS_TITLE, la ); } la = (Label) EcoreUtil.copy( ax.getLabel( ) ); if ( iv != null && iv.getType( ) == IntersectionValue.MAX && iDimension == IConstants.TWO_5_D ) { trae.setTranslation( -dSeriesThickness, dSeriesThickness ); ipr.applyTransformation( trae ); } } else if ( iOrientation == IConstants.HORIZONTAL ) { int x; int x3d = 0; int z3d = 0; double dY = dLocation; double dX = 0; double dZ = 0; if ( bRendering3D ) { Location3D l3d = ax.getAxisCoordinate3D( ); dX = l3d.getX( ); dY = l3d.getY( ); dZ = l3d.getZ( ); } double dYTick1 = ( ( iMajorTickStyle & IConstants.TICK_ABOVE ) == IConstants.TICK_ABOVE ) ? ( bRendering3D ? dY + IConstants.TICK_SIZE : dY - IConstants.TICK_SIZE ) : dY; double dYTick2 = ( ( iMajorTickStyle & IConstants.TICK_BELOW ) == IConstants.TICK_BELOW ) ? ( bRendering3D ? dY - IConstants.TICK_SIZE : dY + IConstants.TICK_SIZE ) : dY; if ( iv != null && iv.getType( ) == IntersectionValue.MAX && iDimension == IConstants.TWO_5_D ) { trae.setTransform( TransformationEvent.TRANSLATE ); trae.setTranslation( dSeriesThickness, -dSeriesThickness ); ipr.applyTransformation( trae ); } if ( ( iWhatToDraw & IConstants.AXIS ) == IConstants.AXIS && lia.isVisible( ) ) { if ( bRenderBase3DAxis ) { final double dStart = daEndPoints3D[0]; final double dEnd = daEndPoints3D[1]; l3dre.setLineAttributes( lia ); l3dre.setStart3D( dStart, dY, dZ ); l3dre.setEnd3D( dEnd, dY, dZ ); dc.addLine( l3dre ); if ( isInteractivityEnabled( ) ) { Trigger tg; EList elTriggers = axModel.getTriggers( ); if ( !elTriggers.isEmpty( ) ) { final Polygon3DRenderEvent pre3d = (Polygon3DRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), Polygon3DRenderEvent.class ); Location3D[] loaHotspot = new Location3D[4]; loaHotspot[0] = Location3DImpl.create( dStart, dY - IConstants.LINE_EXPAND_DOUBLE_SIZE, dZ ); loaHotspot[1] = Location3DImpl.create( dStart, dY + IConstants.LINE_EXPAND_DOUBLE_SIZE, dZ ); loaHotspot[2] = Location3DImpl.create( dEnd, dY + IConstants.LINE_EXPAND_DOUBLE_SIZE, dZ ); loaHotspot[3] = Location3DImpl.create( dEnd, dY - IConstants.LINE_EXPAND_DOUBLE_SIZE, dZ ); pre3d.setPoints3D( loaHotspot ); pre3d.setDoubleSided( true ); if ( get3DEngine( ).processEvent( pre3d, boPlot.getLeft( ), boPlot.getTop( ) ) != null ) { final InteractionEvent iev = (InteractionEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), InteractionEvent.class ); for ( int t = 0; t < elTriggers.size( ); t++ ) { tg = (Trigger) EcoreUtil.copy( (Trigger) elTriggers.get( t ) ); processTrigger( tg, StructureSource.createAxis( axModel ) ); iev.addTrigger( tg ); } iev.setHotSpot( pre3d ); ipr.enableInteraction( iev ); } } } } else if ( bRenderAncillary3DAxis ) { final double dStart = daEndPoints3D[0]; final double dEnd = daEndPoints3D[1]; l3dre.setLineAttributes( lia ); l3dre.setStart3D( dX, dY, dStart ); l3dre.setEnd3D( dX, dY, dEnd ); dc.addLine( l3dre ); if ( isInteractivityEnabled( ) ) { Trigger tg; EList elTriggers = axModel.getTriggers( ); if ( !elTriggers.isEmpty( ) ) { final Polygon3DRenderEvent pre3d = (Polygon3DRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), Polygon3DRenderEvent.class ); Location3D[] loaHotspot = new Location3D[4]; loaHotspot[0] = Location3DImpl.create( dX, dY - IConstants.LINE_EXPAND_DOUBLE_SIZE, dStart ); loaHotspot[1] = Location3DImpl.create( dX, dY + IConstants.LINE_EXPAND_DOUBLE_SIZE, dStart ); loaHotspot[2] = Location3DImpl.create( dX, dY + IConstants.LINE_EXPAND_DOUBLE_SIZE, dEnd ); loaHotspot[3] = Location3DImpl.create( dX, dY - IConstants.LINE_EXPAND_DOUBLE_SIZE, dEnd ); pre3d.setPoints3D( loaHotspot ); pre3d.setDoubleSided( true ); if ( get3DEngine( ).processEvent( pre3d, boPlot.getLeft( ), boPlot.getTop( ) ) != null ) { final InteractionEvent iev = (InteractionEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), InteractionEvent.class ); for ( int t = 0; t < elTriggers.size( ); t++ ) { tg = (Trigger) EcoreUtil.copy( (Trigger) elTriggers.get( t ) ); processTrigger( tg, StructureSource.createAxis( axModel ) ); iev.addTrigger( tg ); } iev.setHotSpot( pre3d ); ipr.enableInteraction( iev ); } } } } else { final double dStart = daEndPoints[0] - insCA.getLeft( ), dEnd = daEndPoints[1] + insCA.getRight( ); if ( iv != null && iv.getType( ) == IntersectionValue.VALUE && iDimension == IConstants.TWO_5_D ) { // Zero plane. final Location[] loa = new Location[4]; loa[0] = LocationImpl.create( dStart, dY ); loa[1] = LocationImpl.create( dStart + dSeriesThickness, dY - dSeriesThickness ); loa[2] = LocationImpl.create( dEnd + dSeriesThickness, dY - dSeriesThickness ); loa[3] = LocationImpl.create( dEnd, dY ); final PolygonRenderEvent pre = (PolygonRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), PolygonRenderEvent.class ); pre.setPoints( loa ); pre.setBackground( ColorDefinitionImpl.create( 255, 255, 255, 127 ) ); pre.setOutline( lia ); ipr.fillPolygon( pre ); } lre.setLineAttributes( lia ); lre.getStart( ).set( dStart, dY ); lre.getEnd( ).set( dEnd, dY ); ipr.drawLine( lre ); if ( isInteractivityEnabled( ) ) { Trigger tg; EList elTriggers = axModel.getTriggers( ); if ( !elTriggers.isEmpty( ) ) { final InteractionEvent iev = (InteractionEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), InteractionEvent.class ); for ( int t = 0; t < elTriggers.size( ); t++ ) { tg = (Trigger) EcoreUtil.copy( (Trigger) elTriggers.get( t ) ); processTrigger( tg, StructureSource.createAxis( axModel ) ); iev.addTrigger( tg ); } Location[] loaHotspot = new Location[4]; loaHotspot[0] = LocationImpl.create( dStart, dY - IConstants.LINE_EXPAND_SIZE ); loaHotspot[1] = LocationImpl.create( dEnd, dY - IConstants.LINE_EXPAND_SIZE ); loaHotspot[2] = LocationImpl.create( dEnd, dY + IConstants.LINE_EXPAND_SIZE ); loaHotspot[3] = LocationImpl.create( dStart, dY + IConstants.LINE_EXPAND_SIZE ); final PolygonRenderEvent pre = (PolygonRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), PolygonRenderEvent.class ); pre.setPoints( loaHotspot ); iev.setHotSpot( pre ); ipr.enableInteraction( iev ); } } } } if ( ( sc.getType( ) & IConstants.TEXT ) == IConstants.TEXT || sc.isCategoryScale( ) ) { double dOffset = 0; double dUnitSize = sc.getUnitSize( ); DataSetIterator dsi = sc.getData( ); final int iDateTimeUnit = ( sc.getType( ) == IConstants.DATE_TIME ) ? CDateTime.computeUnit( dsi ) : IConstants.UNDEFINED; final ITextMetrics itmText = xs.getTextMetrics( la ); if ( dAngleInDegrees == 90 || dAngleInDegrees == 0 ) { dOffset = dUnitSize / 2; } double y = ( iLabelLocation == IConstants.ABOVE ) ? ( bRendering3D ? dYTick1 + 1 : dYTick1 - 1 ) : ( bRendering3D ? dYTick2 - 1 : dYTick2 + 1 ); dsi.reset( ); for ( int i = 0; i < da.length - 1; i++ ) { x = (int) da[i]; if ( bRendering3D ) { x3d = (int) da3D[i]; z3d = (int) da3D[i]; } if ( ( iWhatToDraw & IConstants.AXIS ) == IConstants.AXIS ) { double dYMinorTick1 = ( ( iMinorTickStyle & IConstants.TICK_ABOVE ) == IConstants.TICK_ABOVE ) ? ( bRendering3D ? dY + IConstants.TICK_SIZE : dY - IConstants.TICK_SIZE ) : dY; double dYMinorTick2 = ( ( iMinorTickStyle & IConstants.TICK_BELOW ) == IConstants.TICK_BELOW ) ? ( bRendering3D ? dY - IConstants.TICK_SIZE : dY + IConstants.TICK_SIZE ) : dY; if ( dYMinorTick1 != -dYMinorTick2 ) { // RENDER THE MINOR TICKS FIRST (For ALL but the // last Major tick) if ( i != da.length - 1 ) { if ( bRenderBase3DAxis ) { Line3DRenderEvent l3dreMinor = null; for ( int k = 0; k < daMinor.length - 1; k++ ) { l3dreMinor = (Line3DRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), Line3DRenderEvent.class ); l3dreMinor.setLineAttributes( liaMinorTick ); l3dreMinor.setStart3D( Location3DImpl.create( x3d + daMinor[k], dYMinorTick1, dZ ) ); l3dreMinor.setEnd3D( Location3DImpl.create( x3d + daMinor[k], dYMinorTick2, dZ ) ); dc.addLine( l3dreMinor ); } } else if ( bRenderAncillary3DAxis ) { Line3DRenderEvent l3dreMinor = null; for ( int k = 0; k < daMinor.length - 1; k++ ) { l3dreMinor = (Line3DRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), Line3DRenderEvent.class ); l3dreMinor.setLineAttributes( liaMinorTick ); l3dreMinor.setStart3D( Location3DImpl.create( dX, dYMinorTick1, z3d + daMinor[k] ) ); l3dreMinor.setEnd3D( Location3DImpl.create( dX, dYMinorTick2, z3d + daMinor[k] ) ); dc.addLine( l3dreMinor ); } } else { LineRenderEvent lreMinor = null; for ( int k = 0; k < daMinor.length - 1; k++ ) { lreMinor = (LineRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), LineRenderEvent.class ); lreMinor.setLineAttributes( liaMinorTick ); lreMinor.setStart( LocationImpl.create( x + daMinor[k], dYMinorTick1 ) ); lreMinor.setEnd( LocationImpl.create( x + daMinor[k], dYMinorTick2 ) ); ipr.drawLine( lreMinor ); } } } } if ( dYTick1 != dYTick2 ) { if ( bRenderBase3DAxis ) { l3dre.setLineAttributes( liaMajorTick ); l3dre.setStart3D( x3d, dYTick1, dZ ); l3dre.setEnd3D( x3d, dYTick2, dZ ); dc.addLine( l3dre ); } else if ( bRenderAncillary3DAxis ) { l3dre.setLineAttributes( liaMajorTick ); l3dre.setStart3D( dX, dYTick1, z3d ); l3dre.setEnd3D( dX, dYTick2, z3d ); dc.addLine( l3dre ); } else { lre.setLineAttributes( liaMajorTick ); lre.getStart( ).set( x, dYTick1 ); lre.getEnd( ).set( x, dYTick2 ); ipr.drawLine( lre ); } if ( iv != null && iDimension == IConstants.TWO_5_D && iv.getType( ) == IntersectionValue.VALUE ) { lre.getStart( ).set( x, dY ); lre.getEnd( ).set( x + dSeriesThickness, dY - dSeriesThickness ); ipr.drawLine( lre ); } } } if ( bRenderAxisLabels ) { la.getCaption( ) .setValue( sc.formatCategoryValue( sc.getType( ), dsi.next( ), // step to next value. iDateTimeUnit ) ); if ( sc.isTickLabelVisible( i ) ) { ScriptHandler.callFunction( sh, ScriptHandler.BEFORE_DRAW_AXIS_LABEL, axModel, la, getRunTimeContext( ).getScriptContext( ) ); getRunTimeContext( ).notifyStructureChange( IStructureDefinitionListener.BEFORE_DRAW_AXIS_LABEL, la ); itmText.reuse( la );// RECYCLED dOffset = dUnitSize / 2; double sy = y; if ( bAxisLabelStaggered && sc.isTickLabelStaggered( i ) ) { if ( iLabelLocation == IConstants.ABOVE ) { sy -= dStaggeredLabelOffset; } else { sy += dStaggeredLabelOffset; } } if ( ax.getLabel( ).isVisible( ) ) { if ( bRendering3D ) { if ( axisType == IConstants.BASE_AXIS ) { lo3d.set( x3d + dOffset, sy, dZEnd ); } else { lo3d.set( dXEnd, sy, z3d + dOffset ); } t3dre.setLocation3D( lo3d ); t3dre.setAction( TextRenderEvent.RENDER_TEXT_AT_LOCATION ); dc.addLabel( t3dre ); } else { lo.set( x + dOffset, sy ); tre.setAction( TextRenderEvent.RENDER_TEXT_AT_LOCATION ); ipr.drawText( tre ); } } ScriptHandler.callFunction( sh, ScriptHandler.AFTER_DRAW_AXIS_LABEL, axModel, la, getRunTimeContext( ).getScriptContext( ) ); getRunTimeContext( ).notifyStructureChange( IStructureDefinitionListener.AFTER_DRAW_AXIS_LABEL, la ); } } } // ONE LAST TICK x = (int) da[da.length - 1]; if ( ( iWhatToDraw & IConstants.AXIS ) == IConstants.AXIS ) { if ( dYTick1 != dYTick2 ) { if ( bRenderBase3DAxis ) { l3dre.setLineAttributes( liaMajorTick ); l3dre.setStart3D( x3d, dYTick1, dZ ); l3dre.setEnd3D( x3d, dYTick2, dZ ); dc.addLine( l3dre ); } else if ( bRenderAncillary3DAxis ) { l3dre.setLineAttributes( liaMajorTick ); l3dre.setStart3D( dX, dYTick1, z3d ); l3dre.setEnd3D( dX, dYTick2, z3d ); dc.addLine( l3dre ); } else { lre.setLineAttributes( liaMajorTick ); lre.getStart( ).set( x, dYTick1 ); lre.getEnd( ).set( x, dYTick2 ); ipr.drawLine( lre ); } if ( iv != null && iDimension == IConstants.TWO_5_D && iv.getType( ) == IntersectionValue.VALUE ) { lre.getStart( ).set( x, dY ); lre.getEnd( ).set( x + dSeriesThickness, dY - dSeriesThickness ); ipr.drawLine( lre ); } } } itmText.dispose( ); // DISPOSED } else if ( ( sc.getType( ) & IConstants.LINEAR ) == IConstants.LINEAR ) { double dAxisValue = Methods.asDouble( sc.getMinimum( ) ) .doubleValue( ); final double dAxisStep = Methods.asDouble( sc.getStep( ) ) .doubleValue( ); if ( fs == null ) { df = new DecimalFormat( sc.getNumericPattern( ) ); } dAxisValue = Methods.asDouble( sc.getMinimum( ) ).doubleValue( ); // RESET double y = ( iLabelLocation == IConstants.ABOVE ) ? ( bRendering3D ? dYTick1 + 1 : dYTick1 - 1 ) : ( bRendering3D ? dYTick2 - 1 : dYTick2 + 1 ); for ( int i = 0; i < da.length; i++ ) { x = (int) da[i]; if ( bRendering3D ) { x3d = (int) da3D[i]; z3d = (int) da3D[i]; } if ( ( iWhatToDraw & IConstants.AXIS ) == IConstants.AXIS ) { double dYMinorTick1 = ( ( iMinorTickStyle & IConstants.TICK_ABOVE ) == IConstants.TICK_ABOVE ) ? ( bRendering3D ? dY + IConstants.TICK_SIZE : dY - IConstants.TICK_SIZE ) : dY; double dYMinorTick2 = ( ( iMinorTickStyle & IConstants.TICK_BELOW ) == IConstants.TICK_BELOW ) ? ( bRendering3D ? dY - IConstants.TICK_SIZE : dY + IConstants.TICK_SIZE ) : dY; if ( dYMinorTick1 != -dYMinorTick2 ) { // RENDER THE MINOR TICKS FIRST (For ALL but the // last Major tick) if ( i != da.length - 1 ) { if ( bRenderBase3DAxis ) { Line3DRenderEvent l3dreMinor = null; for ( int k = 0; k < daMinor.length - 1; k++ ) { l3dreMinor = (Line3DRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), Line3DRenderEvent.class ); l3dreMinor.setLineAttributes( liaMinorTick ); l3dreMinor.setStart3D( Location3DImpl.create( x3d + daMinor[k], dYMinorTick1, dZ ) ); l3dreMinor.setEnd3D( Location3DImpl.create( x3d + daMinor[k], dYMinorTick2, dZ ) ); dc.addLine( l3dreMinor ); } } else if ( bRenderAncillary3DAxis ) { Line3DRenderEvent l3dreMinor = null; for ( int k = 0; k < daMinor.length - 1; k++ ) { l3dreMinor = (Line3DRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), Line3DRenderEvent.class ); l3dreMinor.setLineAttributes( liaMinorTick ); l3dreMinor.setStart3D( Location3DImpl.create( dX, dYMinorTick1, z3d + daMinor[k] ) ); l3dreMinor.setEnd3D( Location3DImpl.create( dX, dYMinorTick2, z3d + daMinor[k] ) ); dc.addLine( l3dreMinor ); } } else { LineRenderEvent lreMinor = null; for ( int k = 0; k < daMinor.length - 1; k++ ) { lreMinor = (LineRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), LineRenderEvent.class ); lreMinor.setLineAttributes( liaMinorTick ); lreMinor.setStart( LocationImpl.create( x + daMinor[k], dYMinorTick1 ) ); lreMinor.setEnd( LocationImpl.create( x + daMinor[k], dYMinorTick2 ) ); ipr.drawLine( lreMinor ); } } } } if ( dYTick1 != dYTick2 ) { if ( bRenderBase3DAxis ) { l3dre.setLineAttributes( liaMajorTick ); l3dre.setStart3D( x3d, dYTick1, dZ ); l3dre.setEnd3D( x3d, dYTick2, dZ ); dc.addLine( l3dre ); } else if ( bRenderAncillary3DAxis ) { l3dre.setLineAttributes( liaMajorTick ); l3dre.setStart3D( dX, dYTick1, z3d ); l3dre.setEnd3D( dX, dYTick2, z3d ); dc.addLine( l3dre ); } else { lre.setLineAttributes( liaMajorTick ); lre.getStart( ).set( x, dYTick1 ); lre.getEnd( ).set( x, dYTick2 ); ipr.drawLine( lre ); } if ( iv != null && iDimension == IConstants.TWO_5_D && iv.getType( ) == IntersectionValue.VALUE ) { lre.getStart( ).set( x, dY ); lre.getEnd( ).set( x + dSeriesThickness, dY - dSeriesThickness ); ipr.drawLine( lre ); } } } if ( bRenderAxisLabels && sc.isTickLabelVisible( i ) ) // OPTIMIZED: // ONLY // PROCESS // IF // AXES // LABELS ARE VISIBLE OR REQUESTED // FOR { nde.setValue( dAxisValue ); try { sText = ValueFormatter.format( nde, ax.getFormatSpecifier( ), ax.getRunTimeContext( ).getLocale( ), df ); } catch ( ChartException dfex ) { logger.log( dfex ); sText = IConstants.NULL_STRING; } ScriptHandler.callFunction( sh, ScriptHandler.BEFORE_DRAW_AXIS_LABEL, axModel, la, getRunTimeContext( ).getScriptContext( ) ); getRunTimeContext( ).notifyStructureChange( IStructureDefinitionListener.BEFORE_DRAW_AXIS_LABEL, la ); double sy = y; if ( bAxisLabelStaggered && sc.isTickLabelStaggered( i ) ) { if ( iLabelLocation == IConstants.ABOVE ) { sy -= dStaggeredLabelOffset; } else { sy += dStaggeredLabelOffset; } } if ( ax.getLabel( ).isVisible( ) ) { if ( bRendering3D ) { if ( axisType == IConstants.BASE_AXIS ) { lo3d.set( x3d, sy, dZEnd ); } else { lo3d.set( dXEnd, sy, z3d ); } la.getCaption( ).setValue( sText ); t3dre.setLocation3D( lo3d ); t3dre.setAction( TextRenderEvent.RENDER_TEXT_AT_LOCATION ); dc.addLabel( t3dre ); } else { lo.set( x, sy ); la.getCaption( ).setValue( sText ); tre.setAction( TextRenderEvent.RENDER_TEXT_AT_LOCATION ); ipr.drawText( tre ); } } ScriptHandler.callFunction( sh, ScriptHandler.AFTER_DRAW_AXIS_LABEL, axModel, la, getRunTimeContext( ).getScriptContext( ) ); getRunTimeContext( ).notifyStructureChange( IStructureDefinitionListener.AFTER_DRAW_AXIS_LABEL, la ); } dAxisValue += dAxisStep; } } else if ( ( sc.getType( ) & IConstants.LOGARITHMIC ) == IConstants.LOGARITHMIC ) { double dAxisValue = Methods.asDouble( sc.getMinimum( ) ) .doubleValue( ); final double dAxisStep = Methods.asDouble( sc.getStep( ) ) .doubleValue( ); dAxisValue = Methods.asDouble( sc.getMinimum( ) ).doubleValue( ); // RESET double y = ( iLabelLocation == IConstants.ABOVE ) ? ( bRendering3D ? dYTick1 + 1 : dYTick1 - 1 ) : ( bRendering3D ? dYTick2 - 1 : dYTick2 + 1 ); for ( int i = 0; i < da.length; i++ ) { x = (int) da[i]; if ( bRendering3D ) { x3d = (int) da3D[i]; z3d = (int) da3D[i]; } if ( ( iWhatToDraw & IConstants.AXIS ) == IConstants.AXIS ) { double dYMinorTick1 = ( ( iMinorTickStyle & IConstants.TICK_ABOVE ) == IConstants.TICK_ABOVE ) ? ( bRendering3D ? dY + IConstants.TICK_SIZE : dY - IConstants.TICK_SIZE ) : dY; double dYMinorTick2 = ( ( iMinorTickStyle & IConstants.TICK_BELOW ) == IConstants.TICK_BELOW ) ? ( bRendering3D ? dY - IConstants.TICK_SIZE : dY + IConstants.TICK_SIZE ) : dY; if ( dYMinorTick1 != -dYMinorTick2 ) { // RENDER THE MINOR TICKS FIRST (For ALL but the // last Major tick) if ( i != da.length - 1 ) { if ( bRenderBase3DAxis ) { Line3DRenderEvent l3dreMinor = null; for ( int k = 0; k < daMinor.length - 1; k++ ) { l3dreMinor = (Line3DRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), Line3DRenderEvent.class ); l3dreMinor.setLineAttributes( liaMinorTick ); l3dreMinor.setStart3D( Location3DImpl.create( x3d + daMinor[k], dYMinorTick1, dZ ) ); l3dreMinor.setEnd3D( Location3DImpl.create( x3d + daMinor[k], dYMinorTick2, dZ ) ); dc.addLine( l3dreMinor ); } } else if ( bRenderAncillary3DAxis ) { Line3DRenderEvent l3dreMinor = null; for ( int k = 0; k < daMinor.length - 1; k++ ) { l3dreMinor = (Line3DRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), Line3DRenderEvent.class ); l3dreMinor.setLineAttributes( liaMinorTick ); l3dreMinor.setStart3D( Location3DImpl.create( dX, dYMinorTick1, z3d + daMinor[k] ) ); l3dreMinor.setEnd3D( Location3DImpl.create( dX, dYMinorTick2, z3d + daMinor[k] ) ); dc.addLine( l3dreMinor ); } } else { LineRenderEvent lreMinor = null; for ( int k = 0; k < daMinor.length - 1; k++ ) { lreMinor = (LineRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), LineRenderEvent.class ); lreMinor.setLineAttributes( liaMinorTick ); lreMinor.setStart( LocationImpl.create( x + daMinor[k], dYMinorTick1 ) ); lreMinor.setEnd( LocationImpl.create( x + daMinor[k], dYMinorTick2 ) ); ipr.drawLine( lreMinor ); } } } } if ( dYTick1 != dYTick2 ) { if ( bRenderBase3DAxis ) { l3dre.setLineAttributes( liaMajorTick ); l3dre.setStart3D( x3d, dYTick1, dZ ); l3dre.setEnd3D( x3d, dYTick2, dZ ); dc.addLine( l3dre ); } else if ( bRenderAncillary3DAxis ) { l3dre.setLineAttributes( liaMajorTick ); l3dre.setStart3D( dX, dYTick1, z3d ); l3dre.setEnd3D( dX, dYTick2, z3d ); dc.addLine( l3dre ); } else { lre.setLineAttributes( lia ); lre.getStart( ).set( x, dYTick1 ); lre.getEnd( ).set( x, dYTick2 ); ipr.drawLine( lre ); } if ( iv != null && iDimension == IConstants.TWO_5_D && iv.getType( ) == IntersectionValue.VALUE ) { lre.getStart( ).set( x, dY ); lre.getEnd( ).set( x + dSeriesThickness, dY - dSeriesThickness ); ipr.drawLine( lre ); } } } if ( bRenderAxisLabels && sc.isTickLabelVisible( i ) ) // OPTIMIZED: // ONLY // PROCESS // IF // AXES // LABELS ARE VISIBLE OR REQUESTED // FOR { if ( fs == null ) { df = new DecimalFormat( sc.getNumericPattern( dAxisValue ) ); } nde.setValue( dAxisValue ); try { sText = ValueFormatter.format( nde, ax.getFormatSpecifier( ), ax.getRunTimeContext( ).getLocale( ), df ); } catch ( ChartException dfex ) { logger.log( dfex ); sText = IConstants.NULL_STRING; } ScriptHandler.callFunction( sh, ScriptHandler.BEFORE_DRAW_AXIS_LABEL, axModel, la, getRunTimeContext( ).getScriptContext( ) ); getRunTimeContext( ).notifyStructureChange( IStructureDefinitionListener.BEFORE_DRAW_AXIS_LABEL, la ); double sy = y; if ( bAxisLabelStaggered && sc.isTickLabelStaggered( i ) ) { if ( iLabelLocation == IConstants.ABOVE ) { sy -= dStaggeredLabelOffset; } else { sy += dStaggeredLabelOffset; } } if ( ax.getLabel( ).isVisible( ) ) { if ( bRendering3D ) { if ( axisType == IConstants.BASE_AXIS ) { lo3d.set( x3d, sy, dZEnd ); } else { lo3d.set( dXEnd, sy, z3d ); } la.getCaption( ).setValue( sText ); t3dre.setLocation3D( lo3d ); t3dre.setAction( TextRenderEvent.RENDER_TEXT_AT_LOCATION ); dc.addLabel( t3dre ); } else { lo.set( x, sy ); la.getCaption( ).setValue( sText ); tre.setAction( TextRenderEvent.RENDER_TEXT_AT_LOCATION ); ipr.drawText( tre ); } } ScriptHandler.callFunction( sh, ScriptHandler.AFTER_DRAW_AXIS_LABEL, axModel, la, getRunTimeContext( ).getScriptContext( ) ); getRunTimeContext( ).notifyStructureChange( IStructureDefinitionListener.AFTER_DRAW_AXIS_LABEL, la ); } dAxisValue *= dAxisStep; } } else if ( ( sc.getType( ) & IConstants.DATE_TIME ) == IConstants.DATE_TIME ) { CDateTime cdt, cdtAxisValue = Methods.asDateTime( sc.getMinimum( ) ); final int iUnit = Methods.asInteger( sc.getUnit( ) ); final int iStep = Methods.asInteger( sc.getStep( ) ); SimpleDateFormat sdf = null; if ( fs == null ) { sdf = new SimpleDateFormat( CDateTime.getPreferredFormat( iUnit ) ); } cdt = cdtAxisValue; double y = ( iLabelLocation == IConstants.ABOVE ) ? ( bRendering3D ? dYTick1 + 1 : dYTick1 - 1 ) : ( bRendering3D ? dYTick2 - 1 : dYTick2 + 1 ); for ( int i = 0; i < da.length; i++ ) { x = (int) da[i]; if ( bRendering3D ) { x3d = (int) da3D[i]; z3d = (int) da3D[i]; } if ( ( iWhatToDraw & IConstants.AXIS ) == IConstants.AXIS ) { double dYMinorTick1 = ( ( iMinorTickStyle & IConstants.TICK_ABOVE ) == IConstants.TICK_ABOVE ) ? ( bRendering3D ? dY + IConstants.TICK_SIZE : dY - IConstants.TICK_SIZE ) : dY; double dYMinorTick2 = ( ( iMinorTickStyle & IConstants.TICK_BELOW ) == IConstants.TICK_BELOW ) ? ( bRendering3D ? dY - IConstants.TICK_SIZE : dY + IConstants.TICK_SIZE ) : dY; if ( dYMinorTick1 != -dYMinorTick2 ) { // RENDER THE MINOR TICKS FIRST (For ALL but the // last Major tick) if ( i != da.length - 1 ) { if ( bRenderBase3DAxis ) { Line3DRenderEvent l3dreMinor = null; for ( int k = 0; k < daMinor.length - 1; k++ ) { l3dreMinor = (Line3DRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), Line3DRenderEvent.class ); l3dreMinor.setLineAttributes( liaMinorTick ); l3dreMinor.setStart3D( Location3DImpl.create( x3d + daMinor[k], dYMinorTick1, dZ ) ); l3dreMinor.setEnd3D( Location3DImpl.create( x3d + daMinor[k], dYMinorTick2, dZ ) ); dc.addLine( l3dreMinor ); } } else if ( bRenderAncillary3DAxis ) { Line3DRenderEvent l3dreMinor = null; for ( int k = 0; k < daMinor.length - 1; k++ ) { l3dreMinor = (Line3DRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), Line3DRenderEvent.class ); l3dreMinor.setLineAttributes( liaMinorTick ); l3dreMinor.setStart3D( Location3DImpl.create( dX, dYMinorTick1, z3d + daMinor[k] ) ); l3dreMinor.setEnd3D( Location3DImpl.create( dX, dYMinorTick2, z3d + daMinor[k] ) ); dc.addLine( l3dreMinor ); } } else { LineRenderEvent lreMinor = null; for ( int k = 0; k < daMinor.length - 1; k++ ) { lreMinor = (LineRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createAxis( axModel ), LineRenderEvent.class ); lreMinor.setLineAttributes( liaMinorTick ); lreMinor.setStart( LocationImpl.create( x + daMinor[k], dYMinorTick1 ) ); lreMinor.setEnd( LocationImpl.create( x + daMinor[k], dYMinorTick2 ) ); ipr.drawLine( lreMinor ); } } } } if ( dYTick1 != dYTick2 ) { if ( bRenderBase3DAxis ) { l3dre.setLineAttributes( liaMajorTick ); l3dre.setStart3D( x3d, dYTick1, dZ ); l3dre.setEnd3D( x3d, dYTick2, dZ ); dc.addLine( l3dre ); } else if ( bRenderAncillary3DAxis ) { l3dre.setLineAttributes( liaMajorTick ); l3dre.setStart3D( dX, dYTick1, z3d ); l3dre.setEnd3D( dX, dYTick2, z3d ); dc.addLine( l3dre ); } else { lre.setLineAttributes( liaMajorTick ); lre.getStart( ).set( x, dYTick1 ); lre.getEnd( ).set( x, dYTick2 ); ipr.drawLine( lre ); } if ( iv != null && iDimension == IConstants.TWO_5_D && iv.getType( ) == IntersectionValue.VALUE ) { lre.getStart( ).set( x, dY ); lre.getEnd( ).set( x + dSeriesThickness, dY - dSeriesThickness ); ipr.drawLine( lre ); } } } if ( bRenderAxisLabels && sc.isTickLabelVisible( i ) ) // OPTIMIZED: // ONLY // PROCESS // IF // AXES // LABELS ARE VISIBLE OR REQUESTED // FOR { try { sText = ValueFormatter.format( cdt, ax.getFormatSpecifier( ), ax.getRunTimeContext( ).getLocale( ), sdf ); } catch ( ChartException dfex ) { logger.log( dfex ); sText = IConstants.NULL_STRING; } ScriptHandler.callFunction( sh, ScriptHandler.BEFORE_DRAW_AXIS_LABEL, axModel, la, getRunTimeContext( ).getScriptContext( ) ); getRunTimeContext( ).notifyStructureChange( IStructureDefinitionListener.BEFORE_DRAW_AXIS_LABEL, la ); double sy = y; if ( bAxisLabelStaggered && sc.isTickLabelStaggered( i ) ) { if ( iLabelLocation == IConstants.ABOVE ) { sy -= dStaggeredLabelOffset; } else { sy += dStaggeredLabelOffset; } } if ( ax.getLabel( ).isVisible( ) ) { if ( bRendering3D ) { if ( axisType == IConstants.BASE_AXIS ) { lo3d.set( x3d, sy, dZEnd ); } else { lo3d.set( dXEnd, sy, z3d ); } la.getCaption( ).setValue( sText ); t3dre.setLocation3D( lo3d ); t3dre.setAction( TextRenderEvent.RENDER_TEXT_AT_LOCATION ); dc.addLabel( t3dre ); } else { lo.set( x, sy ); la.getCaption( ).setValue( sText ); tre.setAction( TextRenderEvent.RENDER_TEXT_AT_LOCATION ); ipr.drawText( tre ); } } ScriptHandler.callFunction( sh, ScriptHandler.AFTER_DRAW_AXIS_LABEL, axModel, la, getRunTimeContext( ).getScriptContext( ) ); getRunTimeContext( ).notifyStructureChange( IStructureDefinitionListener.AFTER_DRAW_AXIS_LABEL, la ); } cdt = cdtAxisValue.forward( iUnit, iStep * ( i + 1 ) ); // ALWAYS // W.R.T // START // VALUE } } // RENDER THE AXIS TITLE la = (Label) EcoreUtil.copy( ax.getTitle( ) ); // TEMPORARILY USE // FOR AXIS TITLE if ( la.isVisible( ) && bRenderAxisTitle ) { ScriptHandler.callFunction( sh, ScriptHandler.BEFORE_DRAW_AXIS_TITLE, axModel, la, getRunTimeContext( ).getScriptContext( ) ); getRunTimeContext( ).notifyStructureChange( IStructureDefinitionListener.BEFORE_DRAW_AXIS_TITLE, la ); final String sRestoreValue = la.getCaption( ).getValue( ); la.getCaption( ) .setValue( rtc.externalizedMessage( sRestoreValue ) ); // EXTERNALIZE BoundingBox bb = null; try { bb = Methods.computeBox( xs, ax.getTitlePosition( ), la, 0, 0 ); } catch ( IllegalArgumentException uiex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, uiex ); } if ( ax.getTitle( ).isVisible( ) ) { if ( bRendering3D ) { Bounds cbo = getPlotBounds( ); if ( axisType == IConstants.BASE_AXIS ) { tre.setBlockBounds( BoundsImpl.create( cbo.getLeft( ) + ( cbo.getWidth( ) / 3d - bb.getWidth( ) ), cbo.getTop( ) + cbo.getHeight( ) - Math.min( bb.getHeight( ), bb.getWidth( ) ) - 30, bb.getWidth( ), bb.getHeight( ) ) ); } else { tre.setBlockBounds( BoundsImpl.create( cbo.getLeft( ) + cbo.getWidth( ) * 2 / 3d + ( cbo.getWidth( ) / 3d - bb.getWidth( ) ) / 2d, cbo.getTop( ) + cbo.getHeight( ) - Math.min( bb.getHeight( ), bb.getWidth( ) ) - 30 * 2, bb.getWidth( ), bb.getHeight( ) ) ); } tre.setLabel( la ); tre.setBlockAlignment( la.getCaption( ) .getFont( ) .getAlignment( ) ); tre.setAction( TextRenderEvent.RENDER_TEXT_IN_BLOCK ); ipr.drawText( tre ); } else { final Bounds bo = BoundsImpl.create( daEndPoints[0], ax.getTitleCoordinate( ), daEndPoints[1] - daEndPoints[0], bb.getHeight( ) ); tre.setBlockBounds( bo ); tre.setLabel( la ); tre.setBlockAlignment( la.getCaption( ) .getFont( ) .getAlignment( ) ); tre.setAction( TextRenderEvent.RENDER_TEXT_IN_BLOCK ); ipr.drawText( tre ); } } la.getCaption( ).setValue( sRestoreValue ); // RESTORE ScriptHandler.callFunction( sh, ScriptHandler.AFTER_DRAW_AXIS_TITLE, axModel, la, getRunTimeContext( ).getScriptContext( ) ); getRunTimeContext( ).notifyStructureChange( IStructureDefinitionListener.AFTER_DRAW_AXIS_TITLE, la ); } la = (Label) EcoreUtil.copy( ax.getLabel( ) ); // RESTORE BACK TO // AXIS LABEL if ( iv != null && iv.getType( ) == IntersectionValue.MAX && iDimension == IConstants.TWO_5_D ) { trae.setTranslation( -dSeriesThickness, dSeriesThickness ); ipr.applyTransformation( trae ); } } }
15160 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/15160/536b54a46b25aa99e427a2fbd8217e09108c905a/AxesRenderer.java/clean/chart/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/render/AxesRenderer.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 727, 918, 1743, 3442, 6558, 12, 467, 9840, 6747, 277, 683, 16, 15211, 886, 16, 1082, 202, 3335, 6558, 1740, 16, 509, 277, 23801, 774, 6493, 262, 1216, 14804, 503, 202, 95, 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, 727, 918, 1743, 3442, 6558, 12, 467, 9840, 6747, 277, 683, 16, 15211, 886, 16, 1082, 202, 3335, 6558, 1740, 16, 509, 277, 23801, 774, 6493, 262, 1216, 14804, 503, 202, 95, 202...
}
}
protected String checkValidType(String type, ASTNode node, String message) { String original = type; if (type != null) { if (classNode.getNameWithoutPackage().equals(type)) { return classNode.getName(); } for (int i = 0; i < 2; i++) { if (context.getCompileUnit().getClass(type) != null) { return type; } try { classLoader.loadClass(type); return type; } catch (Throwable e) { // fall through } // lets try our class loader try { getClass().getClassLoader().loadClass(type); return type; } catch (Throwable e) { // fall through } // lets try the system class loader try { Class.forName(type); return type; } catch (Throwable e) { // fall through } // lets try class in same package String packageName = classNode.getPackageName(); if (packageName == null || packageName.length() <= 0) { break; } type = packageName + "." + type; } } throw new NoSuchClassException(original, node, message); }
6462 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6462/fd3c17b5f60d402ba42a72a49ed71cf21d179fec/ClassGenerator.java/buggy/src/main/org/codehaus/groovy/classgen/ClassGenerator.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 4750, 514, 29969, 559, 12, 780, 618, 16, 9183, 907, 756, 16, 514, 883, 13, 288, 3639, 514, 2282, 273, 618, 31, 3639, 309, 261, 723, 480, 446, 13, 288, 5411, 309, 261, 1106, 907, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 4750, 514, 29969, 559, 12, 780, 618, 16, 9183, 907, 756, 16, 514, 883, 13, 288, 3639, 514, 2282, 273, 618, 31, 3639, 309, 261, 723, 480, 446, 13, 288, 5411, 309, 261, 1106, 907, 18, ...
wlAddStepnr.setText("Include stepnr in filename? ");
wlAddStepnr.setText(Messages.getString("XMLOutputDialog.AddStepNr.Label"));
public String open() { Shell parent = getParent(); Display display = parent.getDisplay(); shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN); props.setLook(shell); ModifyListener lsMod = new ModifyListener() { public void modifyText(ModifyEvent e) { input.setChanged(); } }; changed = input.hasChanged(); FormLayout formLayout = new FormLayout (); formLayout.marginWidth = Const.FORM_MARGIN; formLayout.marginHeight = Const.FORM_MARGIN; shell.setLayout(formLayout); shell.setText(Messages.getString("XMLOutputDialog.DialogTitle")); int middle = props.getMiddlePct(); int margin = Const.MARGIN; // Stepname line wlStepname=new Label(shell, SWT.RIGHT); wlStepname.setText(Messages.getString("System.Label.StepName")); props.setLook(wlStepname); fdlStepname=new FormData(); fdlStepname.left = new FormAttachment(0, 0); fdlStepname.top = new FormAttachment(0, margin); fdlStepname.right = new FormAttachment(middle, -margin); wlStepname.setLayoutData(fdlStepname); wStepname=new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER); wStepname.setText(stepname); props.setLook(wStepname); wStepname.addModifyListener(lsMod); fdStepname=new FormData(); fdStepname.left = new FormAttachment(middle, 0); fdStepname.top = new FormAttachment(0, margin); fdStepname.right= new FormAttachment(100, 0); wStepname.setLayoutData(fdStepname); wTabFolder = new CTabFolder(shell, SWT.BORDER); props.setLook(wTabFolder, Props.WIDGET_STYLE_TAB); ////////////////////////// // START OF FILE TAB/// /// wFileTab=new CTabItem(wTabFolder, SWT.NONE); wFileTab.setText(Messages.getString("XMLOutputDialog.FileTab.Tab")); Composite wFileComp = new Composite(wTabFolder, SWT.NONE); props.setLook(wFileComp); FormLayout fileLayout = new FormLayout(); fileLayout.marginWidth = 3; fileLayout.marginHeight = 3; wFileComp.setLayout(fileLayout); // Filename line wlFilename=new Label(wFileComp, SWT.RIGHT); wlFilename.setText(Messages.getString("XMLOutputDialog.Filename.Label")); props.setLook(wlFilename); fdlFilename=new FormData(); fdlFilename.left = new FormAttachment(0, 0); fdlFilename.top = new FormAttachment(0, margin); fdlFilename.right= new FormAttachment(middle, -margin); wlFilename.setLayoutData(fdlFilename); wbFilename=new Button(wFileComp, SWT.PUSH| SWT.CENTER); props.setLook(wbFilename); wbFilename.setText(Messages.getString("XMLOutputDialog.Browse.Button")); fdbFilename=new FormData(); fdbFilename.right= new FormAttachment(100, 0); fdbFilename.top = new FormAttachment(0, 0); wbFilename.setLayoutData(fdbFilename); wbcFilename=new Button(wFileComp, SWT.PUSH| SWT.CENTER); props.setLook(wbcFilename); wbcFilename.setText(Messages.getString("XMLOutputDialog.Variable.Button")); fdbcFilename=new FormData(); fdbcFilename.right= new FormAttachment(wbFilename, -margin); fdbcFilename.top = new FormAttachment(0, 0); wbcFilename.setLayoutData(fdbcFilename); wFilename=new Text(wFileComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER); props.setLook(wFilename); wFilename.addModifyListener(lsMod); fdFilename=new FormData(); fdFilename.left = new FormAttachment(middle, 0); fdFilename.top = new FormAttachment(0, margin); fdFilename.right= new FormAttachment(wbcFilename, -margin); wFilename.setLayoutData(fdFilename); // Whenever something changes, set the tooltip to the expanded version: wFilename.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { wFilename.setToolTipText(StringUtil.environmentSubstitute( wFilename.getText() ) ); } } ); // Extension line wlExtension=new Label(wFileComp, SWT.RIGHT); wlExtension.setText(Messages.getString("XMLOutputDialog.Extension.Label")); props.setLook(wlExtension); fdlExtension=new FormData(); fdlExtension.left = new FormAttachment(0, 0); fdlExtension.top = new FormAttachment(wFilename, margin); fdlExtension.right= new FormAttachment(middle, -margin); wlExtension.setLayoutData(fdlExtension); wExtension=new Text(wFileComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER); wExtension.setText(""); props.setLook(wExtension); wExtension.addModifyListener(lsMod); fdExtension=new FormData(); fdExtension.left = new FormAttachment(middle, 0); fdExtension.top = new FormAttachment(wFilename, margin); fdExtension.right= new FormAttachment(100, 0); wExtension.setLayoutData(fdExtension); // Create multi-part file? wlAddStepnr=new Label(wFileComp, SWT.RIGHT); wlAddStepnr.setText("Include stepnr in filename? "); props.setLook(wlAddStepnr); fdlAddStepnr=new FormData(); fdlAddStepnr.left = new FormAttachment(0, 0); fdlAddStepnr.top = new FormAttachment(wExtension, margin); fdlAddStepnr.right= new FormAttachment(middle, -margin); wlAddStepnr.setLayoutData(fdlAddStepnr); wAddStepnr=new Button(wFileComp, SWT.CHECK); props.setLook(wAddStepnr); fdAddStepnr=new FormData(); fdAddStepnr.left = new FormAttachment(middle, 0); fdAddStepnr.top = new FormAttachment(wExtension, margin); fdAddStepnr.right= new FormAttachment(100, 0); wAddStepnr.setLayoutData(fdAddStepnr); wAddStepnr.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { input.setChanged(); } } ); // Create multi-part file? wlAddDate=new Label(wFileComp, SWT.RIGHT); wlAddDate.setText(Messages.getString("XMLOutputDialog.AddDate.Label")); props.setLook(wlAddDate); fdlAddDate=new FormData(); fdlAddDate.left = new FormAttachment(0, 0); fdlAddDate.top = new FormAttachment(wAddStepnr, margin); fdlAddDate.right= new FormAttachment(middle, -margin); wlAddDate.setLayoutData(fdlAddDate); wAddDate=new Button(wFileComp, SWT.CHECK); props.setLook(wAddDate); fdAddDate=new FormData(); fdAddDate.left = new FormAttachment(middle, 0); fdAddDate.top = new FormAttachment(wAddStepnr, margin); fdAddDate.right= new FormAttachment(100, 0); wAddDate.setLayoutData(fdAddDate); wAddDate.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { input.setChanged(); } } ); // Create multi-part file? wlAddTime=new Label(wFileComp, SWT.RIGHT); wlAddTime.setText(Messages.getString("XMLOutputDialog.AddTime.Label")); props.setLook(wlAddTime); fdlAddTime=new FormData(); fdlAddTime.left = new FormAttachment(0, 0); fdlAddTime.top = new FormAttachment(wAddDate, margin); fdlAddTime.right= new FormAttachment(middle, -margin); wlAddTime.setLayoutData(fdlAddTime); wAddTime=new Button(wFileComp, SWT.CHECK); props.setLook(wAddTime); fdAddTime=new FormData(); fdAddTime.left = new FormAttachment(middle, 0); fdAddTime.top = new FormAttachment(wAddDate, margin); fdAddTime.right= new FormAttachment(100, 0); wAddTime.setLayoutData(fdAddTime); wAddTime.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { input.setChanged(); } } ); wbShowFiles=new Button(wFileComp, SWT.PUSH| SWT.CENTER); props.setLook(wbShowFiles); wbShowFiles.setText(Messages.getString("XMLOutputDialog.ShowFiles.Button")); fdbShowFiles=new FormData(); fdbShowFiles.left = new FormAttachment(middle, 0); fdbShowFiles.top = new FormAttachment(wAddTime, margin*2); wbShowFiles.setLayoutData(fdbShowFiles); wbShowFiles.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { XMLOutputMeta tfoi = new XMLOutputMeta(); getInfo(tfoi); String files[] = tfoi.getFiles(); if (files!=null && files.length>0) { EnterSelectionDialog esd = new EnterSelectionDialog(shell, props, files, Messages.getString("XMLOutputDialog.OutputFiles.DialogTitle"), Messages.getString("XMLOutputDialog.OutputFiles.DialogMessage")); esd.setViewOnly(); esd.open(); } else { MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage(Messages.getString("XMLOutputDialog.NoFilesFound.DialogMessage")); mb.setText(Messages.getString("System.Dialog.Error.Title")); mb.open(); } } } ); fdFileComp=new FormData(); fdFileComp.left = new FormAttachment(0, 0); fdFileComp.top = new FormAttachment(0, 0); fdFileComp.right = new FormAttachment(100, 0); fdFileComp.bottom= new FormAttachment(100, 0); wFileComp.setLayoutData(fdFileComp); wFileComp.layout(); wFileTab.setControl(wFileComp); ///////////////////////////////////////////////////////////// /// END OF FILE TAB ///////////////////////////////////////////////////////////// ////////////////////////// // START OF CONTENT TAB/// /// wContentTab=new CTabItem(wTabFolder, SWT.NONE); wContentTab.setText(Messages.getString("XMLOutputDialog.ContentTab.TabTitle")); FormLayout contentLayout = new FormLayout (); contentLayout.marginWidth = 3; contentLayout.marginHeight = 3; Composite wContentComp = new Composite(wTabFolder, SWT.NONE); props.setLook(wContentComp); wContentComp.setLayout(contentLayout); wlZipped=new Label(wContentComp, SWT.RIGHT); wlZipped.setText(Messages.getString("XMLOutputDialog.Zipped.Label")); props.setLook(wlZipped); fdlZipped=new FormData(); fdlZipped.left = new FormAttachment(0, 0); fdlZipped.top = new FormAttachment(0, 0); fdlZipped.right= new FormAttachment(middle, -margin); wlZipped.setLayoutData(fdlZipped); wZipped=new Button(wContentComp, SWT.CHECK ); props.setLook(wZipped); fdZipped=new FormData(); fdZipped.left = new FormAttachment(middle, 0); fdZipped.top = new FormAttachment(0, 0); fdZipped.right= new FormAttachment(100, 0); wZipped.setLayoutData(fdZipped); wZipped.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { input.setChanged(); } } ); wlEncoding=new Label(wContentComp, SWT.RIGHT); wlEncoding.setText(Messages.getString("XMLOutputDialog.Encoding.Label")); props.setLook(wlEncoding); fdlEncoding=new FormData(); fdlEncoding.left = new FormAttachment(0, 0); fdlEncoding.top = new FormAttachment(wZipped, margin); fdlEncoding.right= new FormAttachment(middle, -margin); wlEncoding.setLayoutData(fdlEncoding); wEncoding=new CCombo(wContentComp, SWT.BORDER | SWT.READ_ONLY); wEncoding.setEditable(true); props.setLook(wEncoding); wEncoding.addModifyListener(lsMod); fdEncoding=new FormData(); fdEncoding.left = new FormAttachment(middle, 0); fdEncoding.top = new FormAttachment(wZipped, margin); fdEncoding.right= new FormAttachment(100, 0); wEncoding.setLayoutData(fdEncoding); wEncoding.addFocusListener(new FocusListener() { public void focusLost(org.eclipse.swt.events.FocusEvent e) { } public void focusGained(org.eclipse.swt.events.FocusEvent e) { Cursor busy = new Cursor(shell.getDisplay(), SWT.CURSOR_WAIT); shell.setCursor(busy); setEncodings(); shell.setCursor(null); busy.dispose(); } } ); wlMainElement=new Label(wContentComp, SWT.RIGHT); wlMainElement.setText(Messages.getString("XMLOutputDialog.MainElement.Label")); props.setLook(wlMainElement); fdlMainElement=new FormData(); fdlMainElement.left = new FormAttachment(0, 0); fdlMainElement.top = new FormAttachment(wEncoding, margin); fdlMainElement.right= new FormAttachment(middle, -margin); wlMainElement.setLayoutData(fdlMainElement); wMainElement=new CCombo(wContentComp, SWT.BORDER | SWT.READ_ONLY); wMainElement.setEditable(true); props.setLook(wMainElement); wMainElement.addModifyListener(lsMod); fdMainElement=new FormData(); fdMainElement.left = new FormAttachment(middle, 0); fdMainElement.top = new FormAttachment(wEncoding, margin); fdMainElement.right= new FormAttachment(100, 0); wMainElement.setLayoutData(fdMainElement); wlRepeatElement=new Label(wContentComp, SWT.RIGHT); wlRepeatElement.setText(Messages.getString("XMLOutputDialog.RepeatElement.Label")); props.setLook(wlRepeatElement); fdlRepeatElement=new FormData(); fdlRepeatElement.left = new FormAttachment(0, 0); fdlRepeatElement.top = new FormAttachment(wMainElement, margin); fdlRepeatElement.right= new FormAttachment(middle, -margin); wlRepeatElement.setLayoutData(fdlRepeatElement); wRepeatElement=new CCombo(wContentComp, SWT.BORDER | SWT.READ_ONLY); wRepeatElement.setEditable(true); props.setLook(wRepeatElement); wRepeatElement.addModifyListener(lsMod); fdRepeatElement=new FormData(); fdRepeatElement.left = new FormAttachment(middle, 0); fdRepeatElement.top = new FormAttachment(wMainElement, margin); fdRepeatElement.right= new FormAttachment(100, 0); wRepeatElement.setLayoutData(fdRepeatElement); wlSplitEvery=new Label(wContentComp, SWT.RIGHT); wlSplitEvery.setText(Messages.getString("XMLOutputDialog.SplitEvery.Label")); props.setLook(wlSplitEvery); fdlSplitEvery=new FormData(); fdlSplitEvery.left = new FormAttachment(0, 0); fdlSplitEvery.top = new FormAttachment(wRepeatElement, margin); fdlSplitEvery.right= new FormAttachment(middle, -margin); wlSplitEvery.setLayoutData(fdlSplitEvery); wSplitEvery=new Text(wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER); props.setLook(wSplitEvery); wSplitEvery.addModifyListener(lsMod); fdSplitEvery=new FormData(); fdSplitEvery.left = new FormAttachment(middle, 0); fdSplitEvery.top = new FormAttachment(wRepeatElement, margin); fdSplitEvery.right= new FormAttachment(100, 0); wSplitEvery.setLayoutData(fdSplitEvery); fdContentComp = new FormData(); fdContentComp.left = new FormAttachment(0, 0); fdContentComp.top = new FormAttachment(0, 0); fdContentComp.right = new FormAttachment(100, 0); fdContentComp.bottom= new FormAttachment(100, 0); wContentComp.setLayoutData(fdContentComp); wContentComp.layout(); wContentTab.setControl(wContentComp); ///////////////////////////////////////////////////////////// /// END OF CONTENT TAB ///////////////////////////////////////////////////////////// // Fields tab... // wFieldsTab = new CTabItem(wTabFolder, SWT.NONE); wFieldsTab.setText(Messages.getString("XMLOutputDialog.FieldsTab.TabTitle")); FormLayout fieldsLayout = new FormLayout (); fieldsLayout.marginWidth = Const.FORM_MARGIN; fieldsLayout.marginHeight = Const.FORM_MARGIN; Composite wFieldsComp = new Composite(wTabFolder, SWT.NONE); wFieldsComp.setLayout(fieldsLayout); props.setLook(wFieldsComp); wGet=new Button(wFieldsComp, SWT.PUSH); wGet.setText(Messages.getString("XMLOutputDialog.SplitEvery.Label")); wGet.setToolTipText(Messages.getString("XMLOutputDialog.Get.Tooltip")); wMinWidth =new Button(wFieldsComp, SWT.PUSH); wMinWidth.setText(Messages.getString("XMLOutputDialog.Get.Button")); wMinWidth.setToolTipText(Messages.getString("XMLOutputDialog.Get.Tooltip")); setButtonPositions(new Button[] { wGet, wMinWidth}, margin, null); final int FieldsRows=input.getOutputFields().length; // Prepare a list of possible formats... String dats[] = Const.dateFormats; String nums[] = Const.numberFormats; int totsize = dats.length + nums.length; String formats[] = new String[totsize]; for (int x=0;x<dats.length;x++) formats[x] = dats[x]; for (int x=0;x<nums.length;x++) formats[dats.length+x] = nums[x]; ColumnInfo[] colinf=new ColumnInfo[] { new ColumnInfo(Messages.getString("XMLOutputDialog.Fieldname.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(Messages.getString("XMLOutputDialog.Fieldname.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(Messages.getString("XMLOutputDialog.Type.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, Value.getTypes() ), new ColumnInfo(Messages.getString("XMLOutputDialog.Format.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, formats), new ColumnInfo(Messages.getString("XMLOutputDialog.Length.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(Messages.getString("XMLOutputDialog.Precision.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(Messages.getString("XMLOutputDialog.Currency.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(Messages.getString("XMLOutputDialog.Decimal.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(Messages.getString("XMLOutputDialog.Group.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(Messages.getString("XMLOutputDialog.Null.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false) }; wFields=new TableView(wFieldsComp, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI, colinf, FieldsRows, lsMod, props ); fdFields=new FormData(); fdFields.left = new FormAttachment(0, 0); fdFields.top = new FormAttachment(0, 0); fdFields.right = new FormAttachment(100, 0); fdFields.bottom= new FormAttachment(wGet, -margin); wFields.setLayoutData(fdFields); fdFieldsComp=new FormData(); fdFieldsComp.left = new FormAttachment(0, 0); fdFieldsComp.top = new FormAttachment(0, 0); fdFieldsComp.right = new FormAttachment(100, 0); fdFieldsComp.bottom= new FormAttachment(100, 0); wFieldsComp.setLayoutData(fdFieldsComp); wFieldsComp.layout(); wFieldsTab.setControl(wFieldsComp); fdTabFolder = new FormData(); fdTabFolder.left = new FormAttachment(0, 0); fdTabFolder.top = new FormAttachment(wStepname, margin); fdTabFolder.right = new FormAttachment(100, 0); fdTabFolder.bottom= new FormAttachment(100, -50); wTabFolder.setLayoutData(fdTabFolder); wOK=new Button(shell, SWT.PUSH); wOK.setText(Messages.getString("System.Button.OK")); wCancel=new Button(shell, SWT.PUSH); wCancel.setText(Messages.getString("System.Button.Cancel")); setButtonPositions(new Button[] { wOK, wCancel }, margin, wTabFolder); // Add listeners lsOK = new Listener() { public void handleEvent(Event e) { ok(); } }; lsGet = new Listener() { public void handleEvent(Event e) { get(); } }; lsMinWidth = new Listener() { public void handleEvent(Event e) { setMinimalWidth(); } }; lsCancel = new Listener() { public void handleEvent(Event e) { cancel(); } }; wOK.addListener (SWT.Selection, lsOK ); wGet.addListener (SWT.Selection, lsGet ); wMinWidth.addListener (SWT.Selection, lsMinWidth ); wCancel.addListener(SWT.Selection, lsCancel); lsDef=new SelectionAdapter() { public void widgetDefaultSelected(SelectionEvent e) { ok(); } }; wStepname.addSelectionListener( lsDef ); wFilename.addSelectionListener( lsDef ); // Whenever something changes, set the tooltip to the expanded version: wFilename.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { wFilename.setToolTipText(StringUtil.environmentSubstitute( wFilename.getText() ) ); } } ); // Listen to the Variable... button wbcFilename.addSelectionListener(VariableButtonListenerFactory.getSelectionAdapter(shell, wFilename)); wbFilename.addSelectionListener ( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { FileDialog dialog = new FileDialog(shell, SWT.OPEN); dialog.setFilterExtensions(new String[] {"*.txt", "*.csv", "*"}); if (wFilename.getText()!=null) { dialog.setFileName(StringUtil.environmentSubstitute(wFilename.getText())); } dialog.setFilterNames(new String[] {Messages.getString("System.FileType.TextFiles"), Messages.getString("System.FileType.CSVFiles"), Messages.getString("System.FileType.AllFiles")}); if (dialog.open()!=null) { wFilename.setText(dialog.getFilterPath()+System.getProperty("file.separator")+dialog.getFileName()); } } } ); // Detect X or ALT-F4 or something that kills this window... shell.addShellListener( new ShellAdapter() { public void shellClosed(ShellEvent e) { cancel(); } } ); lsResize = new Listener() { public void handleEvent(Event event) { Point size = shell.getSize(); wFields.setSize(size.x-10, size.y-50); wFields.table.setSize(size.x-10, size.y-50); wFields.redraw(); } }; shell.addListener(SWT.Resize, lsResize); wTabFolder.setSelection(0); // Set the shell size, based upon previous time... setSize(); getData(); input.setChanged(changed); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } return stepname; }
9547 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/9547/9d3aa441da44abfb2d91da39aaa660320864d21c/XMLOutputDialog.java/buggy/src/be/ibridge/kettle/trans/step/xmloutput/XMLOutputDialog.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 514, 1696, 1435, 202, 95, 3639, 19433, 982, 273, 5089, 5621, 202, 202, 4236, 2562, 273, 982, 18, 588, 4236, 5621, 3639, 5972, 273, 394, 19433, 12, 2938, 16, 348, 8588, 18, 256...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1696, 1435, 202, 95, 3639, 19433, 982, 273, 5089, 5621, 202, 202, 4236, 2562, 273, 982, 18, 588, 4236, 5621, 3639, 5972, 273, 394, 19433, 12, 2938, 16, 348, 8588, 18, 256...
AnalysisCache(IClassPath classPath) {
AnalysisCache(IClassPath classPath, IErrorLogger errorLogger) {
AnalysisCache(IClassPath classPath) { this.classPath = classPath; this.classAnalysisEngineMap = new MapCache<Class<?>, IClassAnalysisEngine>(CACHE_SIZE); this.methodAnalysisEngineMap = new MapCache<Class<?>, IMethodAnalysisEngine>(CACHE_SIZE); this.databaseFactoryMap = new MapCache<Class<?>, IDatabaseFactory<?>>(CACHE_SIZE); this.classAnalysisMap = new MapCache<ClassDescriptor, Map<Class<?>,Object>>(CACHE_SIZE); this.methodAnalysisMap = new MapCache<MethodDescriptor, Map<Class<?>,Object>>(CACHE_SIZE); this.databaseMap = new MapCache<Class<?>, Object>(CACHE_SIZE); }
10715 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/10715/06112609d287b53fe4d5574a21d0c7fe159f1d45/AnalysisCache.java/buggy/findbugs/src/java/edu/umd/cs/findbugs/classfile/impl/AnalysisCache.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 9418, 1649, 12, 45, 22158, 22503, 13, 288, 202, 202, 2211, 18, 1106, 743, 273, 22503, 31, 202, 202, 2211, 18, 1106, 9418, 4410, 863, 273, 394, 1635, 1649, 32, 797, 12880, 20401, 46...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9418, 1649, 12, 45, 22158, 22503, 13, 288, 202, 202, 2211, 18, 1106, 743, 273, 22503, 31, 202, 202, 2211, 18, 1106, 9418, 4410, 863, 273, 394, 1635, 1649, 32, 797, 12880, 20401, 46...
serializer.setCurrentMode(getSerializationMode());
serializer.setCompatibilityMode(getSerializationMode());
private ObjectSerializer makeIdentityListSerializer() { // CASTOR: Change to returning an XStreamSerializer CXSerializer serializer = new CXSerializer(theDaemon, MAPPING_FILE_NAME, IdentityListBean.class); serializer.setCurrentMode(getSerializationMode()); return serializer; }
8150 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8150/0bfa66892be6b78b88f5c17e2d801d00f577e2ec/IdentityManagerImpl.java/buggy/src/org/lockss/protocol/IdentityManagerImpl.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 3238, 1033, 6306, 1221, 4334, 682, 6306, 1435, 288, 565, 368, 6425, 882, 916, 30, 7576, 358, 5785, 392, 1139, 1228, 6306, 565, 385, 60, 6306, 6340, 273, 1377, 394, 385, 60, 6306, 12, 57...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1033, 6306, 1221, 4334, 682, 6306, 1435, 288, 565, 368, 6425, 882, 916, 30, 7576, 358, 5785, 392, 1139, 1228, 6306, 565, 385, 60, 6306, 6340, 273, 1377, 394, 385, 60, 6306, 12, 57...
public CmsLoginMessage(String message, boolean loginForbidden) {
public CmsLoginMessage() {
public CmsLoginMessage(String message, boolean loginForbidden) { this(DEFAULT_TIME_START, DEFAULT_TIME_END, message, loginForbidden); }
51784 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51784/0abaf9e2cd7b40be6257fbe506683783295516ca/CmsLoginMessage.java/buggy/src/org/opencms/db/CmsLoginMessage.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 2149, 5358, 1079, 1435, 288, 3639, 333, 12, 5280, 67, 4684, 67, 7570, 16, 3331, 67, 4684, 67, 4415, 16, 883, 16, 3925, 16553, 1769, 565, 289, 2, 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, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 2149, 5358, 1079, 1435, 288, 3639, 333, 12, 5280, 67, 4684, 67, 7570, 16, 3331, 67, 4684, 67, 4415, 16, 883, 16, 3925, 16553, 1769, 565, 289, 2, -100, -100, -100, -100, -100, -100...
type = fix(type, clasz, clone, map); if (self.isSubType(type)) return self; Type[] parents = new Type[]{type, self};
if (self.isSameAs(type)) return clone.type(); Type[] parents = {fix(type, clasz, clone, map), clone.type()};
public Type getTypeFor(Symbol symbol) { Symbol clasz = ClassSymbol.this; Symbol clone = symbol.owner(); Type.Map map = Type.getSubst(clasz.typeParams(), clone.typeParams()); Type type = clasz.typeOfThis(); Type self = clone.type(); switch (type) { case CompoundType(Type[] parents1, Scope members): assert members.isEmpty(): Debug.show(clasz, type); int length = parents1.length; Type[] parents2 = new Type[parents1.length]; for (int i = 0; i < parents2.length; i++) { parents2[i] = fix(parents1[i], clasz, clone, map); if (i != parents2.length - 1) assert !self.isSubType(parents2[i]): Debug.show(clasz, clone, type, ""+i, parents2[i]); } if (!self.isSubType(parents2[parents2.length - 1])) parents2 = Type.cloneArray(parents2, 1); parents2[parents2.length - 1] = self; return Type.compoundTypeWithOwner(clone, parents2, members); default: type = fix(type, clasz, clone, map); if (self.isSubType(type)) return self; Type[] parents = new Type[]{type, self}; return Type.compoundTypeWithOwner(clone, parents, new Scope()); } }
9617 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/9617/e2d63e26b256ceb64e8057ae7d3bf4fcbbf711c7/Symbol.java/clean/sources/scalac/symtab/Symbol.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 540, 1071, 1412, 3130, 1290, 12, 5335, 3273, 13, 288, 5411, 8565, 23268, 94, 273, 1659, 5335, 18, 2211, 31, 5411, 8565, 3236, 273, 3273, 18, 8443, 5621, 5411, 1412, 18, 863, 852, 273, 7734, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1412, 3130, 1290, 12, 5335, 3273, 13, 288, 5411, 8565, 23268, 94, 273, 1659, 5335, 18, 2211, 31, 5411, 8565, 3236, 273, 3273, 18, 8443, 5621, 5411, 1412, 18, 863, 852, 273, 7734, ...
while ((e != null) && e.hasMoreElements()) { a.add(Context.toObject(e.nextElement(), core.global));
for (int i=start; i<start+length; i++) { INode n = node.getSubnodeAt(i); if (n != null) { a.add(Context.toObject(n, core.global)); }
public Scriptable jsFunction_list() { checkNode(); Enumeration e = node.getSubnodes(); ArrayList a = new ArrayList(); while ((e != null) && e.hasMoreElements()) { a.add(Context.toObject(e.nextElement(), core.global)); } return Context.getCurrentContext().newArray(core.global, a.toArray()); }
3798 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/3798/f2938295ec3b63a212e1852d3f871a9a607acee0/HopObject.java/clean/src/helma/scripting/rhino/HopObject.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 22780, 3828, 2083, 67, 1098, 1435, 288, 3639, 866, 907, 5621, 3639, 13864, 425, 273, 756, 18, 588, 1676, 4690, 5621, 3639, 2407, 279, 273, 394, 2407, 5621, 3639, 1323, 14015, 73, 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, 22780, 3828, 2083, 67, 1098, 1435, 288, 3639, 866, 907, 5621, 3639, 13864, 425, 273, 756, 18, 588, 1676, 4690, 5621, 3639, 2407, 279, 273, 394, 2407, 5621, 3639, 1323, 14015, 73, 48...
int defaultPort = 1024 + (node.portNumber-1024+1000) % (65536 - 1024); testnetConfig.register("port", defaultPort, 2, true, "Testnet port", "Testnet port number (-1 = listenPort+1000)", new TestnetPortNumberCallback(node));
testnetConfig.register("port", node.portNumber+1000, 2, true, "Testnet port", "Testnet port number (-1 = listenPort+1000)", new TestnetPortNumberCallback());
public static TestnetHandler maybeCreate(Node node, Config config) throws NodeInitException { SubConfig testnetConfig = new SubConfig("node.testnet", config); testnetConfig.register("enabled", false, 1, false, "Enable testnet mode? (DANGEROUS)", "Whether to enable testnet mode (DANGEROUS!). Testnet mode eliminates your anonymity in exchange for greatly assisting the developers in debugging the node.", new TestnetEnabledCallback(node)); boolean enabled = testnetConfig.getBoolean("enabled"); if(enabled) { // Get the testnet port // Default to node port plus 1000 int defaultPort = 1024 + (node.portNumber-1024+1000) % (65536 - 1024); testnetConfig.register("port", defaultPort, 2, true, "Testnet port", "Testnet port number (-1 = listenPort+1000)", new TestnetPortNumberCallback(node)); testnetConfig.finishedInitialization(); int port = testnetConfig.getInt("port"); if(port == -1) port = defaultPort; return new TestnetHandler(node, port); } else return null; }
52909 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52909/cd2c50b0a122e8c38957a9efa116906548232899/TestnetHandler.java/clean/src/freenet/node/TestnetHandler.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 760, 7766, 2758, 1503, 6944, 1684, 12, 907, 756, 16, 1903, 642, 13, 1216, 2029, 2570, 503, 288, 3639, 2592, 809, 1842, 2758, 809, 273, 394, 2592, 809, 2932, 2159, 18, 3813, 27...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 760, 7766, 2758, 1503, 6944, 1684, 12, 907, 756, 16, 1903, 642, 13, 1216, 2029, 2570, 503, 288, 3639, 2592, 809, 1842, 2758, 809, 273, 394, 2592, 809, 2932, 2159, 18, 3813, 27...
} else { return bigNorm(getRuntime(), getValue().pow((int) other.getLongValue()));
public RubyNumeric op_pow(IRubyObject num) { RubyNumeric other = numericValue(num); if (other instanceof RubyFloat) { return RubyFloat.newFloat(getRuntime(), getDoubleValue()).op_pow(other); } else { return bigNorm(getRuntime(), getValue().pow((int) other.getLongValue())); } }
46258 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46258/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyBignum.java/buggy/src/org/jruby/RubyBignum.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 19817, 9902, 1061, 67, 23509, 12, 7937, 10340, 921, 818, 13, 288, 3639, 19817, 9902, 1308, 273, 6389, 620, 12, 2107, 1769, 3639, 309, 261, 3011, 1276, 19817, 4723, 13, 288, 5411, 32...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 19817, 9902, 1061, 67, 23509, 12, 7937, 10340, 921, 818, 13, 288, 3639, 19817, 9902, 1308, 273, 6389, 620, 12, 2107, 1769, 3639, 309, 261, 3011, 1276, 19817, 4723, 13, 288, 5411, 32...
int offset = VM_Entrypoints.longDivideMethod.getOffset(); genParameterRegisterLoad(4); asm.emitCALL_RegDisp(JTOC, offset); asm.emitPUSH_Reg(T0); asm.emitPUSH_Reg(T1);
asm.emitMOV_Reg_RegDisp(T0, SP, 0); asm.emitOR_Reg_RegDisp(T0, SP, 4); VM_ForwardReference fr1 = asm.forwardJcc(asm.NE); asm.emitINT_Imm(VM_Runtime.TRAP_DIVIDE_BY_ZERO + RVM_TRAP_BASE); fr1.resolve(asm); int numNonVols = NONVOLATILE_GPRS.length; for (int i = 0; i<numNonVols; i++) { asm.emitPUSH_Reg(NONVOLATILE_GPRS[i]); } asm.emitPUSH_RegDisp(SP, numNonVols*WORDSIZE+4); asm.emitPUSH_RegDisp(SP, numNonVols*WORDSIZE+4); asm.emitPUSH_RegDisp(SP, numNonVols*WORDSIZE+20); asm.emitPUSH_RegDisp(SP, numNonVols*WORDSIZE+20); asm.emitMOV_Reg_RegDisp(S0, JTOC, VM_Entrypoints.the_boot_recordField.getOffset()); asm.emitCALL_RegDisp(S0, VM_Entrypoints.sysLongDivideIPField.getOffset()); asm.emitADD_Reg_Imm(SP, 4*WORDSIZE); for (int i = numNonVols-1; i >=0; i--) { asm.emitPOP_Reg(NONVOLATILE_GPRS[i]); } asm.emitADD_Reg_Imm(SP, 4*WORDSIZE); asm.emitPUSH_Reg(T1); asm.emitPUSH_Reg(T0);
private final VM_MachineCode genCode (int compiledMethodId, VM_Method method, boolean shouldPrint) { if (options.PRINT_METHOD) printMethodMessage(method); /* initialization */ { // TODO!! check register ranges TODO!! this.method = method; klass = method.getDeclaringClass(); bytecodes = method.getBytecodes(); bytecodeLength = bytecodes.length; bytecodeMap = new int [bytecodeLength]; if (klass.isBridgeFromNative()) // JNIFunctions need space for bigger prolog & epilog asm = new VM_Assembler(bytecodeLength+10,shouldPrint); else asm = new VM_Assembler(bytecodeLength,shouldPrint); parameterWords = method.getParameterWords(); parameterWords += (method.isStatic() ? 0 : 1); // add 1 for this pointer } VM_Assembler asm = this.asm; // premature optimization if (klass.isBridgeFromNative()) { // replace the normal prologue with a special prolog VM_JNICompiler.generateGlueCodeForJNIMethod (asm, method, compiledMethodId); // set some constants for the code generation of the rest of the method // firstLocalOffset is shifted down because more registers are saved firstLocalOffset = STACKFRAME_BODY_OFFSET - (VM_JNICompiler.SAVED_GPRS_FOR_JNI<<LG_WORDSIZE) ; } else { genPrologue(compiledMethodId); } for (bi=0; bi<bytecodeLength;) { bytecodeMap[bi] = asm.getMachineCodeIndex(); asm.resolveForwardReferences(bi); biStart = bi; int code = fetch1ByteUnsigned(); switch (code) { case 0x00: /* nop */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "nop"); break; } case 0x01: /* aconst_null */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "aconst_null "); asm.emitPUSH_Imm(0); break; } case 0x02: /* iconst_m1 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "iconst_m1 "); asm.emitPUSH_Imm(-1); break; } case 0x03: /* iconst_0 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "iconst_0 "); asm.emitPUSH_Imm(0); break; } case 0x04: /* iconst_1 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "iconst_1 "); asm.emitPUSH_Imm(1); break; } case 0x05: /* iconst_2 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "iconst_2 "); asm.emitPUSH_Imm(2); break; } case 0x06: /* iconst_3 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "iconst_3 "); asm.emitPUSH_Imm(3); break; } case 0x07: /* iconst_4 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "iconst_4 "); asm.emitPUSH_Imm(4); break; } case 0x08: /* iconst_5 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "iconst_5 "); asm.emitPUSH_Imm(5); break; } case 0x09: /* lconst_0 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "lconst_0 "); // floating-point 0 is long 0 asm.emitPUSH_Imm(0); asm.emitPUSH_Imm(0); break; } case 0x0a: /* lconst_1 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "lconst_1 "); asm.emitPUSH_Imm(0); // high part asm.emitPUSH_Imm(1); // low part break; } case 0x0b: /* fconst_0 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "fconst_0"); asm.emitPUSH_Imm(0); break; } case 0x0c: /* fconst_1 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "fconst_1"); asm.emitPUSH_Imm(0x3f800000); break; } case 0x0d: /* fconst_2 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "fconst_2"); asm.emitPUSH_Imm(0x40000000); break; } case 0x0e: /* dconst_0 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "dconst_0"); asm.emitPUSH_Imm(0x00000000); asm.emitPUSH_Imm(0x00000000); break; } case 0x0f: /* dconst_1 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "dconst_1"); asm.emitPUSH_Imm(0x3ff00000); asm.emitPUSH_Imm(0x00000000); break; } case 0x10: /* bipush */ { int val = fetch1ByteSigned(); if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "bipush " + VM_Lister.decimal(val)); asm.emitPUSH_Imm(val); break; } case 0x11: /* sipush */ { int val = fetch2BytesSigned(); if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "sipush " + VM_Lister.decimal(val)); asm.emitPUSH_Imm(val); break; } case 0x12: /* ldc */ { int index = fetch1ByteUnsigned(); int offset = klass.getLiteralOffset(index); if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "ldc " + VM_Lister.decimal(index)); asm.emitPUSH_RegDisp(JTOC, offset); break; } case 0x13: /* ldc_w */ { int index = fetch2BytesUnsigned(); if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "ldc_w " + VM_Lister.decimal(index)); int offset = klass.getLiteralOffset(index); asm.emitPUSH_RegDisp(JTOC, offset); break; } case 0x14: /* ldc2_w */ { int index = fetch2BytesUnsigned(); if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "ldc2_w " + VM_Lister.decimal(index)); int offset = klass.getLiteralOffset(index); asm.emitPUSH_RegDisp(JTOC, offset+4); // high part of the long asm.emitPUSH_RegDisp(JTOC, offset); // low part of the long break; } case 0x15: /* iload */ { int index = fetch1ByteUnsigned(); if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "iload " + VM_Lister.decimal(index)); int offset = localOffset(index); asm.emitPUSH_RegDisp(ESP,offset); break; } case 0x16: /* lload */ { int index = fetch1ByteUnsigned(); if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "lload " + VM_Lister.decimal(index)); int offset = localOffset(index); asm.emitPUSH_RegDisp(ESP, offset); // high part asm.emitPUSH_RegDisp(ESP, offset); // low part (ESP has moved by 4!!) break; } case 0x17: /* fload */ { int index = fetch1ByteUnsigned(); if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "fload " + VM_Lister.decimal(index)); int offset = localOffset(index); asm.emitPUSH_RegDisp (ESP, offset); break; } case 0x18: /* dload */ { int index = fetch1ByteUnsigned(); if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "dload " + VM_Lister.decimal(index)); int offset = localOffset(index); asm.emitPUSH_RegDisp(ESP, offset); // high part asm.emitPUSH_RegDisp(ESP, offset); // low part (ESP has moved by 4!!) break; } case 0x19: /* aload */ { int index = fetch1ByteUnsigned(); if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "aload " + VM_Lister.decimal(index)); int offset = localOffset(index); asm.emitPUSH_RegDisp(ESP, offset); break; } case 0x1a: /* iload_0 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "iload_0"); int offset = localOffset(0); asm.emitPUSH_RegDisp (ESP, offset); break; } case 0x1b: /* iload_1 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "iload_1"); int offset = localOffset(1); asm.emitPUSH_RegDisp (ESP, offset); break; } case 0x1c: /* iload_2 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "iload_2"); int offset = localOffset(2); asm.emitPUSH_RegDisp (ESP, offset); break; } case 0x1d: /* iload_3 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "iload_3"); int offset = localOffset(3); asm.emitPUSH_RegDisp (ESP, offset); break; } case 0x1e: /* lload_0 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "lload_0"); int offset = localOffset(0); asm.emitPUSH_RegDisp(ESP, offset); // high part asm.emitPUSH_RegDisp(ESP, offset); // low part (ESP has moved by 4!!) break; } case 0x1f: /* lload_1 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "lload_1"); int offset = localOffset(1); asm.emitPUSH_RegDisp(ESP, offset); // high part asm.emitPUSH_RegDisp(ESP, offset); // low part (ESP has moved by 4!!) break; } case 0x20: /* lload_2 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "lload_2"); int offset = localOffset(2); asm.emitPUSH_RegDisp(ESP, offset); // high part asm.emitPUSH_RegDisp(ESP, offset); // low part (ESP has moved by 4!!) break; } case 0x21: /* lload_3 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "lload_3"); int offset = localOffset(3); asm.emitPUSH_RegDisp(ESP, offset); // high part asm.emitPUSH_RegDisp(ESP, offset); // low part (ESP has moved by 4!!) break; } case 0x22: /* fload_0 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "fload_0"); int offset = localOffset(0); asm.emitPUSH_RegDisp (ESP, offset); break; } case 0x23: /* fload_1 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "fload_1"); int offset = localOffset(1); asm.emitPUSH_RegDisp (ESP, offset); break; } case 0x24: /* fload_2 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "fload_2"); int offset = localOffset(2); asm.emitPUSH_RegDisp (ESP, offset); break; } case 0x25: /* fload_3 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "fload_3"); int offset = localOffset(3); asm.emitPUSH_RegDisp (ESP, offset); break; } case 0x26: /* dload_0 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "dload_0"); int offset = localOffset(0); asm.emitPUSH_RegDisp(ESP, offset); // high part asm.emitPUSH_RegDisp(ESP, offset); // low part (ESP has moved by 4!!) break; } case 0x27: /* dload_1 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "dload_1"); int offset = localOffset(1); asm.emitPUSH_RegDisp(ESP, offset); // high part asm.emitPUSH_RegDisp(ESP, offset); // low part (ESP has moved by 4!!) break; } case 0x28: /* dload_2 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "dload_2"); int offset = localOffset(2); asm.emitPUSH_RegDisp(ESP, offset); // high part asm.emitPUSH_RegDisp(ESP, offset); // low part (ESP has moved by 4!!) break; } case 0x29: /* dload_3 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "dload_3"); int offset = localOffset(3); asm.emitPUSH_RegDisp(ESP, offset); // high part asm.emitPUSH_RegDisp(ESP, offset); // low part (ESP has moved by 4!!) break; } case 0x2a: /* aload_0 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "aload_0"); int offset = localOffset(0); asm.emitPUSH_RegDisp(ESP, offset); break; } case 0x2b: /* aload_1 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "aload_1"); int offset = localOffset(1); asm.emitPUSH_RegDisp(ESP, offset); break; } case 0x2c: /* aload_2 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "aload_2"); int offset = localOffset(2); asm.emitPUSH_RegDisp(ESP, offset); break; } case 0x2d: /* aload_3 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "aload_3"); int offset = localOffset(3); asm.emitPUSH_RegDisp(ESP, offset); break; } case 0x2e: /* iaload */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "iaload"); asm.emitMOV_Reg_RegDisp(T0, SP, 0); // T0 is array index asm.emitMOV_Reg_RegDisp(S0, SP, 4); // S0 is the array ref genBoundsCheck(asm, T0, S0); // T0 is index, S0 is address of array asm.emitADD_Reg_Imm(SP, WORDSIZE*2); // complete popping the 2 args asm.emitPUSH_RegIdx(S0, T0, asm.WORD, 0); // push desired int array element break; } case 0x2f: /* laload */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "laload"); asm.emitMOV_Reg_RegDisp(T0, SP, 0); // T0 is array index asm.emitMOV_Reg_RegDisp(S0, SP, 4); // S0 is the array ref genBoundsCheck(asm, T0, S0); // T0 is index, S0 is address of array asm.emitADD_Reg_Imm(SP, WORDSIZE*2); // complete popping the 2 args asm.emitPUSH_RegIdx(S0, T0, asm.LONG, WORDSIZE); // load high part of desired long array element asm.emitPUSH_RegIdx(S0, T0, asm.LONG, 0); // load low part of desired long array element break; } case 0x30: /* faload */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "faload"); asm.emitMOV_Reg_RegDisp(T0, SP, 0); // T0 is array index asm.emitMOV_Reg_RegDisp(S0, SP, 4); // S0 is the array ref genBoundsCheck(asm, T0, S0); // T0 is index, S0 is address of array asm.emitADD_Reg_Imm(SP, WORDSIZE*2); // complete popping the 2 args asm.emitPUSH_RegIdx(S0, T0, asm.WORD, 0); // push desired float array element break; } case 0x31: /* daload */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "daload"); asm.emitMOV_Reg_RegDisp(T0, SP, 0); // T0 is array index asm.emitMOV_Reg_RegDisp(S0, SP, 4); // S0 is the array ref genBoundsCheck(asm, T0, S0); // T0 is index, S0 is address of array asm.emitADD_Reg_Imm(SP, WORDSIZE*2); // complete popping the 2 args asm.emitPUSH_RegIdx(S0, T0, asm.LONG, WORDSIZE); // load high part of double asm.emitPUSH_RegIdx(S0, T0, asm.LONG, 0); // load low part of double break; } case 0x32: /* aaload */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "aaload"); asm.emitMOV_Reg_RegDisp(T0, SP, 0); // T0 is array index asm.emitMOV_Reg_RegDisp(S0, SP, 4); // S0 is the array ref genBoundsCheck(asm, T0, S0); // T0 is index, S0 is address of array asm.emitADD_Reg_Imm(SP, WORDSIZE*2); // complete popping the 2 args asm.emitPUSH_RegIdx(S0, T0, asm.WORD, 0); // push desired object array element break; } case 0x33: /* baload */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "baload"); asm.emitMOV_Reg_RegDisp(T0, SP, 0); // T0 is array index asm.emitMOV_Reg_RegDisp(S0, SP, 4); // S0 is the array ref genBoundsCheck(asm, T0, S0); // T0 is index, S0 is address of array asm.emitADD_Reg_Imm(SP, WORDSIZE*2); // complete popping the 2 args asm.emitMOVSX_Reg_RegIdx_Byte(T1, S0, T0, asm.BYTE, 0); // load byte and sign extend to a 32 bit word asm.emitPUSH_Reg(T1); // push sign extended byte onto stack break; } case 0x34: /* caload */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "caload"); asm.emitMOV_Reg_RegDisp(T0, SP, 0); // T0 is array index asm.emitMOV_Reg_RegDisp(S0, SP, 4); // S0 is the array ref genBoundsCheck(asm, T0, S0); // T0 is index, S0 is address of array asm.emitADD_Reg_Imm(SP, WORDSIZE*2); // complete popping the 2 args asm.emitMOVZX_Reg_RegIdx_Word(T1, S0, T0, asm.SHORT, 0); // load halfword without sign extend to a 32 bit word asm.emitPUSH_Reg(T1); // push char onto stack break; } case 0x35: /* saload */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "saload"); asm.emitMOV_Reg_RegDisp(T0, SP, 0); // T0 is array index asm.emitMOV_Reg_RegDisp(S0, SP, 4); // S0 is the array ref genBoundsCheck(asm, T0, S0); // T0 is index, S0 is address of array asm.emitADD_Reg_Imm(SP, WORDSIZE*2); // complete popping the 2 args asm.emitMOVSX_Reg_RegIdx_Word(T1, S0, T0, asm.SHORT, 0); // load halfword sign extend to a 32 bit word asm.emitPUSH_Reg(T1); // push sign extended short onto stack break; } case 0x36: /* istore */ { int index = fetch1ByteUnsigned(); if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "istore " + VM_Lister.decimal(index)); int offset = localOffset(index) - 4; // pop computes EA after ESP has moved by 4! asm.emitPOP_RegDisp (ESP, offset); break; } case 0x37: /* lstore */ { int index = fetch1ByteUnsigned(); if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "lstore " + VM_Lister.decimal(index)); int offset = localOffset(index+1) - 4; // pop computes EA after ESP has moved by 4! asm.emitPOP_RegDisp(ESP, offset); // high part asm.emitPOP_RegDisp(ESP, offset); // low part (ESP has moved by 4!!) break; } case 0x38: /* fstore */ { int index = fetch1ByteUnsigned(); if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "fstore " + VM_Lister.decimal(index)); int offset = localOffset(index) - 4; // pop computes EA after ESP has moved by 4! asm.emitPOP_RegDisp (ESP, offset); break; } case 0x39: /* dstore */ { int index = fetch1ByteUnsigned(); if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "dstore " + VM_Lister.decimal(index)); int offset = localOffset(index+1) - 4; // pop computes EA after ESP has moved by 4! asm.emitPOP_RegDisp(ESP, offset); // high part asm.emitPOP_RegDisp(ESP, offset); // low part (ESP has moved by 4!!) break; } case 0x3a: /* astore */ { int index = fetch1ByteUnsigned(); if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "astore " + VM_Lister.decimal(index)); int offset = localOffset(index) - 4; // pop computes EA after ESP has moved by 4! asm.emitPOP_RegDisp (ESP, offset); break; } case 0x3b: /* istore_0 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "istore_0"); int offset = localOffset(0) - 4; asm.emitPOP_RegDisp (ESP, offset); // pop computes EA after ESP has moved by 4! break; } case 0x3c: /* istore_1 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "istore_1"); int offset = localOffset(1) -4; // pop computes EA after ESP has moved by 4! asm.emitPOP_RegDisp (ESP, offset); break; } case 0x3d: /* istore_2 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "istore_2"); int offset = localOffset(2) - 4; // pop computes EA after ESP has moved by 4! asm.emitPOP_RegDisp (ESP, offset); break; } case 0x3e: /* istore_3 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "istore_3"); int offset = localOffset(3) - 4; // pop computes EA after ESP has moved by 4! asm.emitPOP_RegDisp (ESP, offset); break; } case 0x3f: /* lstore_0 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "lstore_0"); int offset = localOffset(1) - 4; // pop computes EA after ESP has moved by 4! asm.emitPOP_RegDisp(ESP, offset); // high part asm.emitPOP_RegDisp(ESP, offset); // low part (ESP has moved by 4!!) break; } case 0x40: /* lstore_1 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "lstore_1"); int offset = localOffset(2) - 4; // pop computes EA after ESP has moved by 4! asm.emitPOP_RegDisp(ESP, offset); // high part asm.emitPOP_RegDisp(ESP, offset); // low part (ESP has moved by 4!!) break; } case 0x41: /* lstore_2 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "lstore_2"); int offset = localOffset(3) - 4; // pop computes EA after ESP has moved by 4! asm.emitPOP_RegDisp(ESP, offset); // high part asm.emitPOP_RegDisp(ESP, offset); // low part (ESP has moved by 4!!) break; } case 0x42: /* lstore_3 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "lstore_3"); int offset = localOffset(4) - 4; // pop computes EA after ESP has moved by 4! asm.emitPOP_RegDisp(ESP, offset); // high part asm.emitPOP_RegDisp(ESP, offset); // low part (ESP has moved by 4!!) break; } case 0x43: /* fstore_0 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "fstore_0"); int offset = localOffset(0) - 4; // pop computes EA after ESP has moved by 4! asm.emitPOP_RegDisp (ESP, offset); break; } case 0x44: /* fstore_1 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "fstore_1"); int offset = localOffset(1) - 4; // pop computes EA after ESP has moved by 4! asm.emitPOP_RegDisp (ESP, offset); break; } case 0x45: /* fstore_2 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "fstore_2"); int offset = localOffset(2) - 4; // pop computes EA after ESP has moved by 4! asm.emitPOP_RegDisp (ESP, offset); break; } case 0x46: /* fstore_3 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "fstore_3"); int offset = localOffset(3) - 4; // pop computes EA after ESP has moved by 4! asm.emitPOP_RegDisp (ESP, offset); break; } case 0x47: /* dstore_0 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "dstore_0"); int offset = localOffset(1) - 4; // pop computes EA after ESP has moved by 4! asm.emitPOP_RegDisp(ESP, offset); // high part asm.emitPOP_RegDisp(ESP, offset); // low part (ESP has moved by 4!!) break; } case 0x48: /* dstore_1 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "dstore_1"); int offset = localOffset(2) - 4; // pop computes EA after ESP has moved by 4! asm.emitPOP_RegDisp(ESP, offset); // high part asm.emitPOP_RegDisp(ESP, offset); // low part (ESP has moved by 4!!) break; } case 0x49: /* dstore_2 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "dstore_2"); int offset = localOffset(3) - 4; // pop computes EA after ESP has moved by 4! asm.emitPOP_RegDisp(ESP, offset); // high part asm.emitPOP_RegDisp(ESP, offset); // low part (ESP has moved by 4!!) break; } case 0x4a: /* dstore_3 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "dstore_3"); int offset = localOffset(4) - 4; // pop computes EA after ESP has moved by 4! asm.emitPOP_RegDisp(ESP, offset); // high part asm.emitPOP_RegDisp(ESP, offset); // low part (ESP has moved by 4!!) break; } case 0x4b: /* astore_0 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "astore_0"); int offset = localOffset(0) - 4; // pop computes EA after ESP has moved by 4! asm.emitPOP_RegDisp (ESP, offset); break; } case 0x4c: /* astore_1 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "astore_1"); int offset = localOffset(1) - 4; // pop computes EA after ESP has moved by 4! asm.emitPOP_RegDisp (ESP, offset); break; } case 0x4d: /* astore_2 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "astore_2"); int offset = localOffset(2) - 4; // pop computes EA after ESP has moved by 4! asm.emitPOP_RegDisp (ESP, offset); break; } case 0x4e: /* astore_3 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "astore_3"); int offset = localOffset(3) - 4; // pop computes EA after ESP has moved by 4! asm.emitPOP_RegDisp (ESP, offset); break; } case 0x4f: /* iastore */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "iastore"); asm.emitMOV_Reg_RegDisp(T0, SP, 4); // T0 is array index asm.emitMOV_Reg_RegDisp(S0, SP, 8); // S0 is the array ref genBoundsCheck(asm, T0, S0); // T0 is index, S0 is address of array asm.emitMOV_Reg_RegDisp(T1, SP, 0); // T1 is the int value asm.emitMOV_RegIdx_Reg(S0, T0, asm.WORD, 0, T1); // [S0 + T0<<2] <- T1 asm.emitADD_Reg_Imm(SP, WORDSIZE*3); // complete popping the 3 args break; } case 0x50: /* lastore */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "lastore"); asm.emitMOV_Reg_RegDisp(T0, SP, 8); // T0 is the array index asm.emitMOV_Reg_RegDisp(S0, SP, 12); // S0 is the array ref genBoundsCheck(asm, T0, S0); // T0 is index, S0 is address of array asm.emitPOP_Reg(T1); // low part of long value asm.emitMOV_RegIdx_Reg(S0, T0, asm.LONG, 0, T1); // [S0 + T0<<3 + 0] <- T1 store low part into array i.e. asm.emitPOP_Reg(T1); // high part of long value asm.emitMOV_RegIdx_Reg(S0, T0, asm.LONG, WORDSIZE, T1); // [S0 + T0<<3 + 4] <- T1 store high part into array i.e. asm.emitADD_Reg_Imm(SP, WORDSIZE*2); // remove index and ref from the stack break; } case 0x51: /* fastore */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "fastore"); asm.emitMOV_Reg_RegDisp(T0, SP, 4); // T0 is array index asm.emitMOV_Reg_RegDisp(S0, SP, 8); // S0 is the array ref genBoundsCheck(asm, T0, S0); // T0 is index, S0 is address of array asm.emitMOV_Reg_RegDisp(T1, SP, 0); // T1 is the float value asm.emitMOV_RegIdx_Reg(S0, T0, asm.WORD, 0, T1); // [S0 + T0<<2] <- T1 asm.emitADD_Reg_Imm(SP, WORDSIZE*3); // complete popping the 3 args break; } case 0x52: /* dastore */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "dastore"); asm.emitMOV_Reg_RegDisp(T0, SP, 8); // T0 is the array index asm.emitMOV_Reg_RegDisp(S0, SP, 12); // S0 is the array ref genBoundsCheck(asm, T0, S0); // T0 is index, S0 is address of array asm.emitPOP_Reg(T1); // low part of double value asm.emitMOV_RegIdx_Reg(S0, T0, asm.LONG, 0, T1); // [S0 + T0<<3 + 0] <- T1 store low part into array i.e. asm.emitPOP_Reg(T1); // high part of double value asm.emitMOV_RegIdx_Reg(S0, T0, asm.LONG, WORDSIZE, T1); // [S0 + T0<<3 + 4] <- T1 store high part into array i.e. asm.emitADD_Reg_Imm(SP, WORDSIZE*2); // remove index and ref from the stack break; } case 0x53: /* aastore */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "aastore"); asm.emitPUSH_RegDisp(SP, 2<<LG_WORDSIZE); // duplicate array ref asm.emitPUSH_RegDisp(SP, 1<<LG_WORDSIZE); // duplicate object value genParameterRegisterLoad(2); // pass 2 parameter asm.emitCALL_RegDisp(JTOC, VM_Entrypoints.checkstoreMethod.getOffset()); // checkstore(array ref, value) if (VM_Collector.NEEDS_WRITE_BARRIER) VM_Barriers.compileArrayStoreBarrier(asm); asm.emitMOV_Reg_RegDisp(T0, SP, 4); // T0 is array index asm.emitMOV_Reg_RegDisp(S0, SP, 8); // S0 is the array ref genBoundsCheck(asm, T0, S0); // T0 is index, S0 is address of array asm.emitMOV_Reg_RegDisp(T1, SP, 0); // T1 is the object value asm.emitMOV_RegIdx_Reg(S0, T0, asm.WORD, 0, T1); // [S0 + T0<<2] <- T1 asm.emitADD_Reg_Imm(SP, WORDSIZE*3); // complete popping the 3 args break; } case 0x54: /* bastore */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "bastore"); asm.emitMOV_Reg_RegDisp(T0, SP, 4); // T0 is array index asm.emitMOV_Reg_RegDisp(S0, SP, 8); // S0 is the array ref genBoundsCheck(asm, T0, S0); // T0 is index, S0 is address of array asm.emitMOV_Reg_RegDisp(T1, SP, 0); // T1 is the byte value asm.emitMOV_RegIdx_Reg_Byte(S0, T0, asm.BYTE, 0, T1); // [S0 + T0<<2] <- T1 asm.emitADD_Reg_Imm(SP, WORDSIZE*3); // complete popping the 3 args break; } case 0x55: /* castore */ { asm.emitMOV_Reg_RegDisp(T0, SP, 4); // T0 is array index asm.emitMOV_Reg_RegDisp(S0, SP, 8); // S0 is the array ref genBoundsCheck(asm, T0, S0); // T0 is index, S0 is address of array asm.emitMOV_Reg_RegDisp(T1, SP, 0); // T1 is the char value asm.emitMOV_RegIdx_Reg_Word(S0, T0, asm.SHORT, 0, T1);// store halfword element into array i.e. [S0 +T0] <- T1 (halfword) asm.emitADD_Reg_Imm(SP, WORDSIZE*3); // complete popping the 3 args break; } case 0x56: /* sastore */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "sastore"); asm.emitMOV_Reg_RegDisp(T0, SP, 4); // T0 is array index asm.emitMOV_Reg_RegDisp(S0, SP, 8); // S0 is the array ref genBoundsCheck(asm, T0, S0); // T0 is index, S0 is address of array asm.emitMOV_Reg_RegDisp(T1, SP, 0); // T1 is the short value asm.emitMOV_RegIdx_Reg_Word(S0, T0, asm.SHORT, 0, T1);// store halfword element into array i.e. [S0 +T0] <- T1 (halfword) asm.emitADD_Reg_Imm(SP, WORDSIZE*3); // complete popping the 3 args break; } case 0x57: /* pop */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "pop"); asm.emitPOP_Reg(T0); break; } case 0x58: /* pop2 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "pop2"); asm.emitPOP_Reg(T0); asm.emitPOP_Reg(T0); break; } case 0x59: /* dup */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "dup"); asm.emitMOV_Reg_RegInd (T0, SP); asm.emitPUSH_Reg(T0); break; } case 0x5a: /* dup_x1 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "dup_x1"); asm.emitPOP_Reg(T0); asm.emitPOP_Reg(S0); asm.emitPUSH_Reg(T0); asm.emitPUSH_Reg(S0); asm.emitPUSH_Reg(T0); break; } case 0x5b: /* dup_x2 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "dup_x2"); asm.emitPOP_Reg(T0); asm.emitPOP_Reg(S0); asm.emitPOP_Reg(T1); asm.emitPUSH_Reg(T0); asm.emitPUSH_Reg(T1); asm.emitPUSH_Reg(S0); asm.emitPUSH_Reg(T0); break; } case 0x5c: /* dup2 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "dup2"); asm.emitMOV_Reg_RegDisp (T0, SP, 4); asm.emitMOV_Reg_RegInd (S0, SP); asm.emitPUSH_Reg(T0); asm.emitPUSH_Reg(S0); break; } case 0x5d: /* dup2_x1 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "dup2_x1"); asm.emitPOP_Reg(T0); asm.emitPOP_Reg(S0); asm.emitPOP_Reg(T1); asm.emitPUSH_Reg(S0); asm.emitPUSH_Reg(T0); asm.emitPUSH_Reg(T1); asm.emitPUSH_Reg(S0); asm.emitPUSH_Reg(T0); break; } case 0x5e: /* dup2_x2 */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "dup2_x2"); asm.emitPOP_Reg(T0); asm.emitPOP_Reg(S0); asm.emitPOP_Reg(T1); asm.emitPOP_Reg(JTOC); // JTOC is scratch register asm.emitPUSH_Reg(S0); asm.emitPUSH_Reg(T0); asm.emitPUSH_Reg(JTOC); asm.emitPUSH_Reg(T1); asm.emitPUSH_Reg(S0); asm.emitPUSH_Reg(T0); // restore JTOC register VM_ProcessorLocalState.emitMoveFieldToReg(asm, JTOC, VM_Entrypoints.jtocField.getOffset()); break; } case 0x5f: /* swap */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "swap"); asm.emitPOP_Reg(T0); asm.emitPOP_Reg(S0); asm.emitPUSH_Reg(T0); asm.emitPUSH_Reg(S0); break; } case 0x60: /* iadd */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "iadd"); asm.emitPOP_Reg(T0); asm.emitADD_RegInd_Reg(SP, T0); break; } case 0x61: /* ladd */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "ladd"); asm.emitPOP_Reg(T0); // the low half of one long asm.emitPOP_Reg(S0); // the high half asm.emitADD_RegInd_Reg(SP, T0); // add low halves asm.emitADC_RegDisp_Reg(SP, WORDSIZE, S0); // add high halves with carry break; } case 0x62: /* fadd */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "fadd"); asm.emitFLD_Reg_RegInd (FP0, SP); // FPU reg. stack <- value2 asm.emitFADD_Reg_RegDisp(FP0, SP, WORDSIZE); // FPU reg. stack += value1 asm.emitPOP_Reg (T0); // discard asm.emitFSTP_RegInd_Reg(SP, FP0); // POP FPU reg. stack onto stack break; } case 0x63: /* dadd */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "dadd"); asm.emitFLD_Reg_RegInd_Quad (FP0, SP); // FPU reg. stack <- value2 asm.emitFADD_Reg_RegDisp_Quad(FP0, SP, 8); // FPU reg. stack += value1 asm.emitADD_Reg_Imm(SP, 2*WORDSIZE); // shrink the stack asm.emitFSTP_RegInd_Reg_Quad(SP, FP0); // POP FPU reg. stack onto stack break; } case 0x64: /* isub */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "isub"); asm.emitPOP_Reg(T0); asm.emitSUB_RegInd_Reg(SP, T0); break; } case 0x65: /* lsub */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "lsub"); asm.emitPOP_Reg(T0); // the low half of one long asm.emitPOP_Reg(S0); // the high half asm.emitSUB_RegInd_Reg(SP, T0); // subtract low halves asm.emitSBB_RegDisp_Reg(SP, WORDSIZE, S0); // subtract high halves with borrow break; } case 0x66: /* fsub */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "fsub"); asm.emitFLD_Reg_RegDisp (FP0, SP, WORDSIZE); // FPU reg. stack <- value1 asm.emitFSUB_Reg_RegDisp(FP0, SP, 0); // FPU reg. stack -= value2 asm.emitPOP_Reg (T0); // discard asm.emitFSTP_RegInd_Reg(SP, FP0); // POP FPU reg. stack onto stack break; } case 0x67: /* dsub */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "dsub"); asm.emitFLD_Reg_RegDisp_Quad (FP0, SP, 8); // FPU reg. stack <- value1 asm.emitFSUB_Reg_RegDisp_Quad(FP0, SP, 0); // FPU reg. stack -= value2 asm.emitADD_Reg_Imm (SP, 2*WORDSIZE); // shrink the stack asm.emitFSTP_RegInd_Reg_Quad(SP, FP0); // POP FPU reg. stack onto stack break; } case 0x68: /* imul */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "imul"); asm.emitPOP_Reg (T0); asm.emitIMUL2_Reg_RegInd(T0, SP); asm.emitMOV_RegInd_Reg (SP, T0); break; } case 0x69: /* lmul */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "lmul"); // 0: JTOC is used as scratch registers (see 14) // 1: load value1.low temp0, i.e., save value1.low // 2: eax <- temp0 eax is value1.low // 3: edx:eax <- eax * value2.low (product of the two low halves) // 4: store eax which is result.low into place --> value1.low is destroyed // 5: temp1 <- edx which is the carry of the product of the low halves // aex and edx now free of results // 6: aex <- temp0 which is still value1.low // 7: pop into aex aex <- value2.low --> value2.low is sort of destroyed // 8: edx:eax <- eax * value1.hi (value2.low * value1.hi) // 9: temp1 += aex // 10: pop into eax; eax <- value2.hi -> value2.hi is sort of destroyed // 11: edx:eax <- eax * temp0 (value2.hi * value1.low) // 12: temp1 += eax temp1 is now result.hi // 13: store result.hi // 14: restore JTOC if (VM.VerifyAssertions) VM.assert(S0 != EAX); if (VM.VerifyAssertions) VM.assert(S0 != EDX); asm.emitMOV_Reg_RegDisp (JTOC, SP, 8); // step 1: JTOC is temp0 asm.emitMOV_Reg_Reg (EAX, JTOC); // step 2 asm.emitMUL_Reg_RegInd(EAX, SP); // step 3 asm.emitMOV_RegDisp_Reg (SP, 8, EAX); // step 4 asm.emitMOV_Reg_Reg (S0, EDX); // step 5: S0 is temp1 asm.emitMOV_Reg_Reg (EAX, JTOC); // step 6 asm.emitPOP_Reg (EAX); // step 7: SP changed! asm.emitIMUL1_Reg_RegDisp(EAX, SP, 8);// step 8 asm.emitADD_Reg_Reg (S0, EAX); // step 9 asm.emitPOP_Reg (EAX); // step 10: SP changed! asm.emitIMUL1_Reg_Reg(EAX, JTOC); // step 11 asm.emitADD_Reg_Reg (S0, EAX); // step 12 asm.emitMOV_RegDisp_Reg (SP, 4, S0); // step 13 // restore JTOC register VM_ProcessorLocalState.emitMoveFieldToReg(asm, JTOC, VM_Entrypoints.jtocField.getOffset()); break; } case 0x6a: /* fmul */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "fmul"); asm.emitFLD_Reg_RegInd (FP0, SP); // FPU reg. stack <- value2 asm.emitFMUL_Reg_RegDisp(FP0, SP, WORDSIZE); // FPU reg. stack *= value1 asm.emitPOP_Reg (T0); // discard asm.emitFSTP_RegInd_Reg(SP, FP0); // POP FPU reg. stack onto stack break; } case 0x6b: /* dmul */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "dmul"); asm.emitFLD_Reg_RegInd_Quad (FP0, SP); // FPU reg. stack <- value2 asm.emitFMUL_Reg_RegDisp_Quad(FP0, SP, 8); // FPU reg. stack *= value1 asm.emitADD_Reg_Imm (SP, 2*WORDSIZE); // shrink the stack asm.emitFSTP_RegInd_Reg_Quad(SP, FP0); // POP FPU reg. stack onto stack break; } case 0x6c: /* idiv */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "idiv"); asm.emitMOV_Reg_RegDisp(ECX, SP, 0); // ECX is divisor; NOTE: can't use symbolic registers because of intel hardware requirements asm.emitMOV_Reg_RegDisp(EAX, SP, 4); // EAX is dividend asm.emitCDQ (); // sign extend EAX into EDX asm.emitIDIV_Reg_Reg(EAX, ECX); // compute EAX/ECX - Quotient in EAX, remainder in EDX asm.emitADD_Reg_Imm(SP, WORDSIZE*2); // complete popping the 2 values asm.emitPUSH_Reg(EAX); // push result break; } case 0x6d: /* ldiv */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "ldiv"); int offset = VM_Entrypoints.longDivideMethod.getOffset(); genParameterRegisterLoad(4); // pass 4 parameter words (2 longs) asm.emitCALL_RegDisp(JTOC, offset); asm.emitPUSH_Reg(T0); // high half asm.emitPUSH_Reg(T1); // low half break; } case 0x6e: /* fdiv */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "fdiv"); asm.emitFLD_Reg_RegDisp (FP0, SP, WORDSIZE); // FPU reg. stack <- value1 asm.emitFDIV_Reg_RegDisp(FP0, SP, 0); // FPU reg. stack /= value2 asm.emitPOP_Reg (T0); // discard asm.emitFSTP_RegInd_Reg(SP, FP0); // POP FPU reg. stack onto stack break; } case 0x6f: /* ddiv */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "ddiv"); asm.emitFLD_Reg_RegDisp_Quad (FP0, SP, 8); // FPU reg. stack <- value1 asm.emitFDIV_Reg_RegInd_Quad(FP0, SP); // FPU reg. stack /= value2 asm.emitADD_Reg_Imm (SP, 2*WORDSIZE); // shrink the stack asm.emitFSTP_RegInd_Reg_Quad(SP, FP0); // POP FPU reg. stack onto stack break; } case 0x70: /* irem */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "irem"); asm.emitMOV_Reg_RegDisp(ECX, SP, 0); // ECX is divisor; NOTE: can't use symbolic registers because of intel hardware requirements asm.emitMOV_Reg_RegDisp(EAX, SP, 4); // EAX is dividend asm.emitCDQ (); // sign extend EAX into EDX asm.emitIDIV_Reg_Reg(EAX, ECX); // compute EAX/ECX - Quotient in EAX, remainder in EDX asm.emitADD_Reg_Imm(SP, WORDSIZE*2); // complete popping the 2 values asm.emitPUSH_Reg(EDX); // push remainder break; } case 0x71: /* lrem */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "lrem"); int offset = VM_Entrypoints.longRemainderMethod.getOffset(); genParameterRegisterLoad(4); // pass 4 parameter words (2 longs) asm.emitCALL_RegDisp(JTOC, offset); asm.emitPUSH_Reg(T0); // high half asm.emitPUSH_Reg(T1); // low half break; } case 0x72: /* frem */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "frem"); asm.emitFLD_Reg_RegInd (FP0, SP); // FPU reg. stack <- value2, or a asm.emitFLD_Reg_RegDisp (FP0, SP, WORDSIZE); // FPU reg. stack <- value1, or b asm.emitFPREM (); // FPU reg. stack <- a%b asm.emitFSTP_RegDisp_Reg(SP, WORDSIZE, FP0); // POP FPU reg. stack (results) onto java stack asm.emitFSTP_RegInd_Reg(SP, FP0); // POP FPU reg. stack onto java stack asm.emitPOP_Reg (T0); // shrink the stack (T0 discarded) break; } case 0x73: /* drem */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "drem"); asm.emitFLD_Reg_RegInd_Quad (FP0, SP); // FPU reg. stack <- value2, or a asm.emitFLD_Reg_RegDisp_Quad (FP0, SP, 2*WORDSIZE); // FPU reg. stack <- value1, or b asm.emitFPREM (); // FPU reg. stack <- a%b asm.emitFSTP_RegDisp_Reg_Quad(SP, 2*WORDSIZE, FP0); // POP FPU reg. stack (result) onto java stack asm.emitFSTP_RegInd_Reg_Quad(SP, FP0); // POP FPU reg. stack onto java stack asm.emitADD_Reg_Imm (SP, 2*WORDSIZE); // shrink the stack break; } case 0x74: /* ineg */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "ineg"); asm.emitNEG_RegInd(SP); // [SP] <- -[SP] break; } case 0x75: /* lneg */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "lneg"); asm.emitNEG_RegDisp(SP, 4); // [SP+4] <- -[SP+4] or high <- -high asm.emitNEG_RegInd(SP); // [SP] <- -[SP] or low <- -low asm.emitSBB_RegDisp_Imm(SP, 4, 0); // [SP+4] += borrow or high += borrow break; } case 0x76: /* fneg */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "fneg"); asm.emitFLD_Reg_RegInd (FP0, SP); // FPU reg. stack <- value1 asm.emitFCHS (); // change sign to stop of FPU stack asm.emitFSTP_RegInd_Reg(SP, FP0); // POP FPU reg. stack onto stack break; } case 0x77: /* dneg */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "dneg"); asm.emitFLD_Reg_RegInd_Quad (FP0, SP); // FPU reg. stack <- value1 asm.emitFCHS (); // change sign to stop of FPU stack asm.emitFSTP_RegInd_Reg_Quad(SP, FP0); // POP FPU reg. stack onto stack break; } case 0x78: /* ishl */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "ishl"); if (VM.VerifyAssertions) VM.assert(ECX != T0); asm.emitPOP_Reg(ECX); asm.emitSHL_RegInd_Reg(SP, ECX); // shift T0 left ECX times; ECX low order 5 bits break; } case 0x79: /* lshl */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "lshl"); // l >> n if (VM.VerifyAssertions) VM.assert (ECX != T0); // ECX is constrained to be the shift count if (VM.VerifyAssertions) VM.assert (ECX != T1); if (VM.VerifyAssertions) VM.assert (ECX != JTOC); // 1: pop shift amount into JTOC (JTOC must be restored at the end) // 2: pop low half into T0 // 3: pop high half into T1 // 4: ECX <- JTOC, copy the shift count // 5: JTOC <- JTOC & 32 --> if 0 then shift amount is less than 32 // 6: branch to step 12 if results is zero // the result is not zero --> the shift amount is greater than 32 // 7: ECX <- ECX XOR JTOC --> ECX is orginal shift amount minus 32 // 8: T1 <- T0, or replace the high half with the low half. This accounts for the 32 bit shift // 9: shift T1 left by ECX bits // 10: T0 <- 0 // 11: branch to step 14 // 12: shift left double from T0 into T1 by ECX bits. T0 is unaltered // 13: shift left T0, the low half, also by ECX bits // 14: push high half from T1 // 15: push the low half from T0 // 16: restore the JTOC asm.emitPOP_Reg (JTOC); // original shift amount 6 bits asm.emitPOP_Reg (T0); // pop low half asm.emitPOP_Reg (T1); // pop high half asm.emitMOV_Reg_Reg (ECX, JTOC); asm.emitAND_Reg_Imm (JTOC, 32); VM_ForwardReference fr1 = asm.forwardJcc(asm.EQ); asm.emitXOR_Reg_Reg (ECX, JTOC); asm.emitMOV_Reg_Reg (T1, T0); // low replaces high asm.emitSHL_Reg_Reg (T1, ECX); asm.emitXOR_Reg_Reg (T0, T0); VM_ForwardReference fr2 = asm.forwardJMP(); fr1.resolve(asm); asm.emitSHLD_Reg_Reg_Reg(T1, T0, ECX); // shift high half (step 12) asm.emitSHL_Reg_Reg (T0, ECX); // shift low half fr2.resolve(asm); asm.emitPUSH_Reg(T1); // push high half (step 14) asm.emitPUSH_Reg(T0); // push low half // restore JTOC VM_ProcessorLocalState.emitMoveFieldToReg(asm, JTOC, VM_Entrypoints.jtocField.getOffset()); break; } case 0x7a: /* ishr */ { // unit test by IArith if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "ishr"); if (VM.VerifyAssertions) VM.assert (ECX != T0); asm.emitPOP_Reg (ECX); asm.emitSAR_RegInd_Reg (SP, ECX); // shift T0 right ECX times; ECX low order 5 bits break; } case 0x7b: /* lshr */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "lshr"); if (VM.VerifyAssertions) VM.assert (ECX != T0); // ECX is constrained to be the shift count if (VM.VerifyAssertions) VM.assert (ECX != T1); if (VM.VerifyAssertions) VM.assert (ECX != JTOC); // 1: pop shift amount into JTOC (JTOC must be restored at the end) // 2: pop low half into T0 // 3: pop high half into T1 // 4: ECX <- JTOC, copy the shift count // 5: JTOC <- JTOC & 32 --> if 0 then shift amount is less than 32 // 6: branch to step 13 if results is zero // the result is not zero --> the shift amount is greater than 32 // 7: ECX <- ECX XOR JTOC --> ECX is orginal shift amount minus 32 // 8: T0 <- T1, or replace the low half with the high half. This accounts for the 32 bit shift // 9: shift T0 right arithmetic by ECX bits // 10: ECX <- 31 // 11: shift T1 right arithmetic by ECX=31 bits, thus exending the sigh // 12: branch to step 15 // 13: shift right double from T1 into T0 by ECX bits. T1 is unaltered // 14: shift right arithmetic T1, the high half, also by ECX bits // 15: push high half from T1 // 16: push the low half from T0 // 17: restore JTOC asm.emitPOP_Reg (JTOC); // original shift amount 6 bits asm.emitPOP_Reg (T0); // pop low half asm.emitPOP_Reg (T1); // pop high asm.emitMOV_Reg_Reg (ECX, JTOC); asm.emitAND_Reg_Imm (JTOC, 32); VM_ForwardReference fr1 = asm.forwardJcc(asm.EQ); asm.emitXOR_Reg_Reg (ECX, JTOC); asm.emitMOV_Reg_Reg (T0, T1); // replace low with high asm.emitSAR_Reg_Reg (T0, ECX); // and shift it asm.emitMOV_Reg_Imm (ECX, 31); asm.emitSAR_Reg_Reg (T1, ECX); // set high half VM_ForwardReference fr2 = asm.forwardJMP(); fr1.resolve(asm); asm.emitSHRD_Reg_Reg_Reg(T0, T1, ECX); // shift low half (step 13) asm.emitSAR_Reg_Reg (T1, ECX); // shift high half fr2.resolve(asm); asm.emitPUSH_Reg(T1); // push high half (step 15) asm.emitPUSH_Reg(T0); // push low half // restore JTOC VM_ProcessorLocalState.emitMoveFieldToReg(asm, JTOC, VM_Entrypoints.jtocField.getOffset()); break; } case 0x7c: /* iushr */ { // unit test by IArith if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "iushr"); if (VM.VerifyAssertions) VM.assert (ECX != T0); asm.emitPOP_Reg (ECX); asm.emitSHR_RegInd_Reg(SP, ECX); // shift T0 right ECX times; ECX low order 5 bits break; } case 0x7d: /* lushr */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "lushr"); if (VM.VerifyAssertions) VM.assert (ECX != T0); // ECX is constrained to be the shift count if (VM.VerifyAssertions) VM.assert (ECX != T1); if (VM.VerifyAssertions) VM.assert (ECX != JTOC); // 1: pop shift amount into JTOC (JTOC must be restored at the end) // 2: pop low half into T0 // 3: ECX <- JTOC, copy the shift count // 4: JTOC <- JTOC & 32 --> if 0 then shift amount is less than 32 // 5: branch to step 11 if results is zero // the result is not zero --> the shift amount is greater than 32 // 6: ECX <- ECX XOR JTOC --> ECX is orginal shift amount minus 32 // 7: pop high half into T0 replace the low half with the high // half. This accounts for the 32 bit shift // 8: shift T0 right logical by ECX bits // 9: T1 <- 0 T1 is the high half // 10: branch to step 14 // 11: pop high half into T1 // 12: shift right double from T1 into T0 by ECX bits. T1 is unaltered // 13: shift right logical T1, the high half, also by ECX bits // 14: push high half from T1 // 15: push the low half from T0 // 16: restore JTOC asm.emitPOP_Reg(JTOC); // original shift amount 6 bits asm.emitPOP_Reg(T0); // pop low half asm.emitMOV_Reg_Reg(ECX, JTOC); asm.emitAND_Reg_Imm(JTOC, 32); VM_ForwardReference fr1 = asm.forwardJcc(asm.EQ); asm.emitXOR_Reg_Reg (ECX, JTOC); asm.emitPOP_Reg (T0); // replace low with high asm.emitSHR_Reg_Reg (T0, ECX); // and shift it (count - 32) asm.emitXOR_Reg_Reg (T1, T1); // high <- 0 VM_ForwardReference fr2 = asm.forwardJMP(); fr1.resolve(asm); asm.emitPOP_Reg (T1); // high half (step 11) asm.emitSHRD_Reg_Reg_Reg(T0, T1, ECX); // shift low half asm.emitSHR_Reg_Reg (T1, ECX); // shift high half fr2.resolve(asm); asm.emitPUSH_Reg(T1); // push high half (step 14) asm.emitPUSH_Reg(T0); // push low half // restore JTOC VM_ProcessorLocalState.emitMoveFieldToReg(asm, JTOC, VM_Entrypoints.jtocField.getOffset()); break; } case 0x7e: /* iand */ { // unit test by IArith if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "iand"); asm.emitPOP_Reg(T0); asm.emitAND_RegInd_Reg(SP, T0); break; } case 0x7f: /* land */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "land"); asm.emitPOP_Reg(T0); // low asm.emitPOP_Reg(S0); // high asm.emitAND_RegInd_Reg(SP, T0); asm.emitAND_RegDisp_Reg(SP, 4, S0); break; } case 0x80: /* ior */ { // unit test by IArith if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "ior"); asm.emitPOP_Reg(T0); asm.emitOR_RegInd_Reg (SP, T0); break; } case 0x81: /* lor */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "lor"); asm.emitPOP_Reg(T0); // low asm.emitPOP_Reg(S0); // high asm.emitOR_RegInd_Reg(SP, T0); asm.emitOR_RegDisp_Reg(SP, 4, S0); break; } case 0x82: /* ixor */ { // unit test by IArith if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "ixor"); asm.emitPOP_Reg(T0); asm.emitXOR_RegInd_Reg(SP, T0); break; } case 0x83: /* lxor */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "lxor"); asm.emitPOP_Reg(T0); // low asm.emitPOP_Reg(S0); // high asm.emitXOR_RegInd_Reg(SP, T0); asm.emitXOR_RegDisp_Reg(SP, 4, S0); break; } case 0x84: /* iinc */ { int index = fetch1ByteUnsigned(); int val = fetch1ByteSigned(); if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "iinc " + VM_Lister.decimal(index) + " " + VM_Lister.decimal(val)); int offset = localOffset(index); asm.emitADD_RegDisp_Imm(ESP, offset, val); break; } case 0x85: /* i2l */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "i2l"); asm.emitPOP_Reg (EAX); asm.emitCDQ (); asm.emitPUSH_Reg(EDX); asm.emitPUSH_Reg(EAX); break; } case 0x86: /* i2f */ { // unit test by FArith if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "i2f"); asm.emitFILD_Reg_RegInd(FP0, SP); asm.emitFSTP_RegInd_Reg(SP, FP0); break; } case 0x87: /* i2d */ { // unit test by DArith if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "i2d"); asm.emitFILD_Reg_RegInd(FP0, SP); asm.emitPUSH_Reg(T0); // grow the stack asm.emitFSTP_RegInd_Reg_Quad(SP, FP0); break; } case 0x88: /* l2i */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "l2i"); asm.emitPOP_Reg (T0); // low half of the long asm.emitPOP_Reg (S0); // high half of the long asm.emitPUSH_Reg(T0); break; } case 0x89: /* l2f */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "l2f"); asm.emitFILD_Reg_RegInd_Quad(FP0, SP); asm.emitADD_Reg_Imm(SP, WORDSIZE); // shrink the stack asm.emitFSTP_RegInd_Reg(SP, FP0); break; } case 0x8a: /* l2d */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "l2d"); asm.emitFILD_Reg_RegInd_Quad(FP0, SP); asm.emitFSTP_RegInd_Reg_Quad(SP, FP0); break; } case 0x8b: /* f2i */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "f2i"); // convert to double asm.emitFLD_Reg_RegInd(FP0, SP); asm.emitSUB_Reg_Imm(SP, WORDSIZE); // grow the stack asm.emitFSTP_RegInd_Reg_Quad(SP, FP0); // and convert to int int offset = VM_Entrypoints.doubleToIntMethod.getOffset(); genParameterRegisterLoad(); // pass 1 parameter asm.emitCALL_RegDisp(JTOC, offset); asm.emitPUSH_Reg(T0); break; } case 0x8c: /* f2l */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "f2l"); // convert to double asm.emitFLD_Reg_RegInd(FP0, SP); asm.emitSUB_Reg_Imm(SP, WORDSIZE); // grow the stack asm.emitFSTP_RegInd_Reg_Quad(SP, FP0); // and convert to long int offset = VM_Entrypoints.doubleToLongMethod.getOffset(); genParameterRegisterLoad(); // pass 1 parameter asm.emitCALL_RegDisp(JTOC, offset); asm.emitPUSH_Reg(T0); // high half asm.emitPUSH_Reg(T1); // low half break; } case 0x8d: /* f2d */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "f2d"); asm.emitFLD_Reg_RegInd(FP0, SP); asm.emitSUB_Reg_Imm(SP, WORDSIZE); // grow the stack asm.emitFSTP_RegInd_Reg_Quad(SP, FP0); break; } case 0x8e: /* d2i */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "d2i"); int offset = VM_Entrypoints.doubleToIntMethod.getOffset(); genParameterRegisterLoad(); // pass 1 parameter asm.emitCALL_RegDisp(JTOC, offset); asm.emitPUSH_Reg(T0); break; } case 0x8f: /* d2l */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "d2l"); int offset = VM_Entrypoints.doubleToLongMethod.getOffset(); genParameterRegisterLoad(); // pass 1 parameter asm.emitCALL_RegDisp(JTOC, offset); asm.emitPUSH_Reg(T0); // high half asm.emitPUSH_Reg(T1); // low half break; } case 0x90: /* d2f */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "d2f"); asm.emitFLD_Reg_RegInd_Quad(FP0, SP); asm.emitADD_Reg_Imm(SP, WORDSIZE); // shrink the stack asm.emitFSTP_RegInd_Reg(SP, FP0); break; } case 0x91: /* i2b */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "i2b"); // asm.emitMOVSXb(T0, SP, 0); // load byte off top of the stack sign extended // asm.emitMOV (SP, 0, T0); // store result back on the top of the stack asm.emitPOP_Reg (T0); asm.emitMOVSX_Reg_Reg_Byte(T0, T0); asm.emitPUSH_Reg (T0); break; } case 0x92: /* i2c */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "i2c"); // asm.emitMOVZXh(T0, SP, 0); // load char off top of the stack sign extended // asm.emitMOV (SP, 0, T0); // store result back on the top of the stack asm.emitPOP_Reg (T0); asm.emitMOVZX_Reg_Reg_Word(T0, T0); asm.emitPUSH_Reg (T0); break; } case 0x93: /* i2s */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "i2s"); // asm.emitMOVSXh(T0, SP, 0); // load short off top of the stack sign extended // asm.emitMOV (SP, 0, T0); // store result back on the top of the stack asm.emitPOP_Reg (T0); asm.emitMOVSX_Reg_Reg_Word(T0, T0); asm.emitPUSH_Reg (T0); break; } case 0x94: /* lcmp */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "lcmp"); // a ? b asm.emitPOP_Reg(T0); // the low half of value2 asm.emitPOP_Reg(S0); // the high half of value2 asm.emitPOP_Reg(T1); // the low half of value1 asm.emitSUB_Reg_Reg(T1, T0); // subtract the low half of value2 from // low half of value1, result into T1 asm.emitPOP_Reg(T0); // the high half of value 1 // pop does not alter the carry register asm.emitSBB_Reg_Reg(T0, S0); // subtract the high half of value2 plus // borrow from the high half of value 1, // result in T0 asm.emitMOV_Reg_Imm(S0, -1); // load -1 into S0 VM_ForwardReference fr1 = asm.forwardJcc(asm.LT); // result negative --> branch to end asm.emitMOV_Reg_Imm(S0, 0); // load 0 into S0 asm.emitOR_Reg_Reg(T0, T1); // result 0 VM_ForwardReference fr2 = asm.forwardJcc(asm.EQ); // result 0 --> branch to end asm.emitMOV_Reg_Imm(S0, 1); // load 1 into S0 fr1.resolve(asm); fr2.resolve(asm); asm.emitPUSH_Reg(S0); // push result on stack break; } case 0x95: /* fcmpl !!- */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "fcmpl"); VM_ForwardReference fr1,fr2,fr3; asm.emitFLD_Reg_RegDisp(FP0, SP, WORDSIZE); // copy value1 into FPU asm.emitFLD_Reg_RegInd(FP0, SP); // copy value2 into FPU asm.emitADD_Reg_Imm(SP, 2*WORDSIZE); // popping the stack if (VM.VerifyAssertions) VM.assert(S0 != EAX); // eax is used by FNSTSW asm.emitXOR_Reg_Reg(S0, S0); // S0 <- 0 asm.emitFUCOMPP(); // compare and pop FPU *2 asm.emitFNSTSW(); // move FPU flags into (E)AX asm.emitSAHF(); // store AH into flags fr1 = asm.forwardJcc(asm.EQ); // branch if ZF set (eq. or unord.) // ZF not set -> neither equal nor unordered asm.emitMOV_Reg_Imm(S0, 1); // load 1 into S0 fr2 = asm.forwardJcc(asm.LLT); // branch if CF set (val2 < val1) asm.emitMOV_Reg_Imm(S0, -1); // load -1 into S0 fr1.resolve(asm); // ZF set (equal or unordered) fr3 = asm.forwardJcc(asm.LGE); // branch if CF not set (not unordered) asm.emitMOV_Reg_Imm(S0, -1); // load -1 into S0 fr3.resolve(asm); fr2.resolve(asm); asm.emitPUSH_Reg(S0); // push result on stack break; } case 0x96: /* fcmpg !!- */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "fcmpg"); VM_ForwardReference fr1,fr2,fr3; asm.emitFLD_Reg_RegDisp(FP0, SP, WORDSIZE); // copy value1 into FPU asm.emitFLD_Reg_RegInd(FP0, SP); // copy value2 into FPU asm.emitADD_Reg_Imm(SP, 2*WORDSIZE); // popping the stack if (VM.VerifyAssertions) VM.assert(S0 != EAX); // eax is used by FNSTSW asm.emitXOR_Reg_Reg(S0, S0); // S0 <- 0 asm.emitFUCOMPP(); // compare and pop FPU *2 asm.emitFNSTSW(); // move FPU flags into (E)AX asm.emitSAHF(); // store AH into flags fr1 = asm.forwardJcc(asm.EQ); // branch if ZF set (eq. or unord.) // ZF not set -> neither equal nor unordered asm.emitMOV_Reg_Imm(S0, 1); // load 1 into S0 fr2 = asm.forwardJcc(asm.LLT); // branch if CF set (val2 < val1) asm.emitMOV_Reg_Imm(S0, -1); // load -1 into S0 fr1.resolve(asm); // ZF set (equal or unordered) fr3 = asm.forwardJcc(asm.LGE); // branch if CF not set (not unordered) asm.emitMOV_Reg_Imm(S0, 1); // load 1 into S0 fr3.resolve(asm); fr2.resolve(asm); asm.emitPUSH_Reg(S0); // push result on stack break; } case 0x97: /* dcmpl !!- */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "dcmpl"); VM_ForwardReference fr1,fr2,fr3; asm.emitFLD_Reg_RegDisp_Quad(FP0, SP, WORDSIZE*2); // copy value1 into FPU asm.emitFLD_Reg_RegInd_Quad(FP0, SP); // copy value2 into FPU asm.emitADD_Reg_Imm(SP, 4*WORDSIZE); // popping the stack if (VM.VerifyAssertions) VM.assert(S0 != EAX); // eax is used by FNSTSW asm.emitXOR_Reg_Reg(S0, S0); // S0 <- 0 asm.emitFUCOMPP(); // compare and pop FPU *2 asm.emitFNSTSW(); // move FPU flags into (E)AX asm.emitSAHF(); // store AH into flags fr1 = asm.forwardJcc(asm.EQ); // branch if ZF set (eq. or unord.) // ZF not set -> neither equal nor unordered asm.emitMOV_Reg_Imm(S0, 1); // load 1 into S0 fr2 = asm.forwardJcc(asm.LLT); // branch if CF set (val2 < val1) asm.emitMOV_Reg_Imm(S0, -1); // load -1 into S0 fr1.resolve(asm); // ZF set (equal or unordered) fr3 = asm.forwardJcc(asm.LGE); // branch if CF not set (not unordered) asm.emitMOV_Reg_Imm(S0, -1); // load -1 into S0 fr3.resolve(asm); fr2.resolve(asm); asm.emitPUSH_Reg(S0); // push result on stack break; } case 0x98: /* dcmpg !!- */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "dcmpg"); VM_ForwardReference fr1,fr2,fr3; asm.emitFLD_Reg_RegDisp_Quad(FP0, SP, WORDSIZE*2); // copy value1 into FPU asm.emitFLD_Reg_RegInd_Quad(FP0, SP); // copy value2 into FPU asm.emitADD_Reg_Imm(SP, 4*WORDSIZE); // popping the stack if (VM.VerifyAssertions) VM.assert(S0 != EAX); // eax is used by FNSTSW asm.emitXOR_Reg_Reg(S0, S0); // S0 <- 0 asm.emitFUCOMPP(); // compare and pop FPU *2 asm.emitFNSTSW(); // move FPU flags into (E)AX asm.emitSAHF(); // store AH into flags fr1 = asm.forwardJcc(asm.EQ); // branch if ZF set (eq. or unord.) // ZF not set -> neither equal nor unordered asm.emitMOV_Reg_Imm(S0, 1); // load 1 into S0 fr2 = asm.forwardJcc(asm.LLT); // branch if CF set (val2 < val1) asm.emitMOV_Reg_Imm(S0, -1); // load -1 into S0 fr1.resolve(asm); // ZF set (equal or unordered) fr3 = asm.forwardJcc(asm.LGE); // branch if CF not set (not unordered) asm.emitMOV_Reg_Imm(S0, 1); // load 1 into S0 fr3.resolve(asm); fr2.resolve(asm); asm.emitPUSH_Reg(S0); // push result on stack break; } case 0x99: /* ifeq */ { int offset = fetch2BytesSigned(); int bTarget = biStart + offset; int mTarget = bytecodeMap[bTarget]; if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "ifeq " + VM_Lister.decimal(offset) + " [" + VM_Lister.decimal(bTarget) + "] "); if (offset < 0) genThreadSwitchTest(VM_Thread.BACKEDGE); asm.emitPOP_Reg(T0); asm.emitCMP_Reg_Imm(T0, 0); asm.emitJCC_Cond_ImmOrLabel(asm.EQ, mTarget, bTarget); break; } case 0x9a: /* ifne */ { int offset = fetch2BytesSigned(); int bTarget = biStart + offset; int mTarget = bytecodeMap[bTarget]; if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "ifne " + VM_Lister.decimal(offset) + " [" + VM_Lister.decimal(bTarget) + "] "); if (offset < 0) genThreadSwitchTest(VM_Thread.BACKEDGE); asm.emitPOP_Reg(T0); asm.emitCMP_Reg_Imm(T0, 0); asm.emitJCC_Cond_ImmOrLabel(asm.NE, mTarget, bTarget); break; } case 0x9b: /* iflt */ { int offset = fetch2BytesSigned(); int bTarget = biStart + offset; int mTarget = bytecodeMap[bTarget]; if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "iflt " + VM_Lister.decimal(offset) + " [" + VM_Lister.decimal(bTarget) + "] "); if (offset < 0) genThreadSwitchTest(VM_Thread.BACKEDGE); asm.emitPOP_Reg(T0); asm.emitCMP_Reg_Imm(T0, 0); asm.emitJCC_Cond_ImmOrLabel(asm.LT, mTarget, bTarget); break; } case 0x9c: /* ifge */ { int offset = fetch2BytesSigned(); int bTarget = biStart + offset; int mTarget = bytecodeMap[bTarget]; if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "ifge " + VM_Lister.decimal(offset) + " [" + VM_Lister.decimal(bTarget) + "] "); if (offset < 0) genThreadSwitchTest(VM_Thread.BACKEDGE); asm.emitPOP_Reg(T0); asm.emitCMP_Reg_Imm(T0, 0); asm.emitJCC_Cond_ImmOrLabel(asm.GE, mTarget, bTarget); break; } case 0x9d: /* ifgt */ { int offset = fetch2BytesSigned(); int bTarget = biStart + offset; int mTarget = bytecodeMap[bTarget]; if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "ifgt " + VM_Lister.decimal(offset) + " [" + VM_Lister.decimal(bTarget) + "] "); if (offset < 0) genThreadSwitchTest(VM_Thread.BACKEDGE); asm.emitPOP_Reg(T0); asm.emitCMP_Reg_Imm(T0, 0); asm.emitJCC_Cond_ImmOrLabel(asm.GT, mTarget, bTarget); break; } case 0x9e: /* ifle */ { int offset = fetch2BytesSigned(); int bTarget = biStart + offset; int mTarget = bytecodeMap[bTarget]; if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "ifle " + VM_Lister.decimal(offset) + " [" + VM_Lister.decimal(bTarget) + "] "); if (offset < 0) genThreadSwitchTest(VM_Thread.BACKEDGE); asm.emitPOP_Reg(T0); asm.emitCMP_Reg_Imm(T0, 0); asm.emitJCC_Cond_ImmOrLabel(asm.LE, mTarget, bTarget); break; } case 0x9f: /* if_icmpeq */ { int offset = fetch2BytesSigned(); int bTarget = biStart + offset; int mTarget = bytecodeMap[bTarget]; if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "if_icmpeq " + VM_Lister.decimal(offset) + " [" + VM_Lister.decimal(bTarget) + "] "); if (offset < 0) genThreadSwitchTest(VM_Thread.BACKEDGE); asm.emitPOP_Reg(S0); asm.emitPOP_Reg(T0); asm.emitCMP_Reg_Reg(T0, S0); asm.emitJCC_Cond_ImmOrLabel(asm.EQ, mTarget, bTarget); break; } case 0xa0: /* if_icmpne */ { int offset = fetch2BytesSigned(); int bTarget = biStart + offset; int mTarget = bytecodeMap[bTarget]; if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "if_icmpne " + VM_Lister.decimal(offset) + " [" + VM_Lister.decimal(bTarget) + "] "); if (offset < 0) genThreadSwitchTest(VM_Thread.BACKEDGE); asm.emitPOP_Reg(S0); asm.emitPOP_Reg(T0); asm.emitCMP_Reg_Reg(T0, S0); asm.emitJCC_Cond_ImmOrLabel(asm.NE, mTarget, bTarget); break; } case 0xa1: /* if_icmplt */ { // maria backward brach test is TESTED int offset = fetch2BytesSigned(); int bTarget = biStart + offset; int mTarget = bytecodeMap[bTarget]; if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "if_icmplt " + VM_Lister.decimal(offset) + " [" + VM_Lister.decimal(bTarget) + "] "); if (offset < 0) genThreadSwitchTest(VM_Thread.BACKEDGE); asm.emitPOP_Reg(S0); asm.emitPOP_Reg(T0); asm.emitCMP_Reg_Reg(T0, S0); asm.emitJCC_Cond_ImmOrLabel(asm.LT, mTarget, bTarget); break; } case 0xa2: /* if_icmpge */ { int offset = fetch2BytesSigned(); int bTarget = biStart + offset; int mTarget = bytecodeMap[bTarget]; if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "if_icmpge " + VM_Lister.decimal(offset) + " [" + VM_Lister.decimal(bTarget) + "] "); if (offset < 0) genThreadSwitchTest(VM_Thread.BACKEDGE); asm.emitPOP_Reg(S0); asm.emitPOP_Reg(T0); asm.emitCMP_Reg_Reg(T0, S0); asm.emitJCC_Cond_ImmOrLabel(asm.GE, mTarget, bTarget); break; } case 0xa3: /* if_icmpgt */ { int offset = fetch2BytesSigned(); int bTarget = biStart + offset; int mTarget = bytecodeMap[bTarget]; if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "if_icmpgt " + VM_Lister.decimal(offset) + " [" + VM_Lister.decimal(bTarget) + "] "); if (offset < 0) genThreadSwitchTest(VM_Thread.BACKEDGE); asm.emitPOP_Reg(S0); asm.emitPOP_Reg(T0); asm.emitCMP_Reg_Reg(T0, S0); asm.emitJCC_Cond_ImmOrLabel(asm.GT, mTarget, bTarget); break; } case 0xa4: /* if_icmple */ { int offset = fetch2BytesSigned(); int bTarget = biStart + offset; int mTarget = bytecodeMap[bTarget]; if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "if_icmple " + VM_Lister.decimal(offset) + " [" + VM_Lister.decimal(bTarget) + "] "); if (offset < 0) genThreadSwitchTest(VM_Thread.BACKEDGE); asm.emitPOP_Reg(S0); asm.emitPOP_Reg(T0); asm.emitCMP_Reg_Reg(T0, S0); asm.emitJCC_Cond_ImmOrLabel(asm.LE, mTarget, bTarget); break; } case 0xa5: /* if_acmpeq */ { int offset = fetch2BytesSigned(); int bTarget = biStart + offset; int mTarget = bytecodeMap[bTarget]; if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "if_acmpeq " + VM_Lister.decimal(offset) + " [" + VM_Lister.decimal(bTarget) + "] "); if (offset < 0) genThreadSwitchTest(VM_Thread.BACKEDGE); asm.emitPOP_Reg(S0); asm.emitPOP_Reg(T0); asm.emitCMP_Reg_Reg(T0, S0); asm.emitJCC_Cond_ImmOrLabel(asm.EQ, mTarget, bTarget); break; } case 0xa6: /* if_acmpne */ { int offset = fetch2BytesSigned(); int bTarget = biStart + offset; int mTarget = bytecodeMap[bTarget]; if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "if_acmpne " + VM_Lister.decimal(offset) + " [" + VM_Lister.decimal(bTarget) + "] "); if (offset < 0) genThreadSwitchTest(VM_Thread.BACKEDGE); asm.emitPOP_Reg(S0); asm.emitPOP_Reg(T0); asm.emitCMP_Reg_Reg(T0, S0); asm.emitJCC_Cond_ImmOrLabel(asm.NE, mTarget, bTarget); break; } case 0xa7: /* goto */ { // unit test by IBack int offset = fetch2BytesSigned(); int bTarget = biStart + offset; // bi has been bumped by 3 already int mTarget = bytecodeMap[bTarget]; if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "goto " + VM_Lister.decimal(offset) + " [" + VM_Lister.decimal(bTarget) + "] "); if (offset < 0) genThreadSwitchTest(VM_Thread.BACKEDGE); asm.emitJMP_ImmOrLabel(mTarget, bTarget); break; } case 0xa8: /* jsr */ { int offset = fetch2BytesSigned(); int bTarget = biStart + offset; int mTarget = bytecodeMap[bTarget]; if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "jsr " + VM_Lister.decimal(offset) + " [" + VM_Lister.decimal(bTarget) + "] (" + VM_Lister.decimal(mTarget)); asm.emitCALL_ImmOrLabel(mTarget, bTarget); break; } case 0xa9: /* ret */ { int index = fetch1ByteUnsigned(); if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "ret " + VM_Lister.decimal(index)); int offset = localOffset(index); asm.emitJMP_RegDisp(ESP, offset); break; } case 0xaa: /* tableswitch */ { // unit test by Table bi = (bi+3) & -4; // eat padding int defaultval = fetch4BytesSigned(); int bTarget = biStart + defaultval; int mTarget = bytecodeMap[bTarget]; int low = fetch4BytesSigned(); int high = fetch4BytesSigned(); if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "tableswitch [" + VM_Lister.decimal(low) + "--" + VM_Lister.decimal(high) + "] " + VM_Lister.decimal(defaultval)); int n = high-low+1; // n = number of normal cases (0..n-1) asm.emitPOP_Reg (T0); // T0 is index of desired case asm.emitSUB_Reg_Imm(T0, low); // relativize T0 asm.emitCMP_Reg_Imm(T0, n); // 0 <= relative index < n asm.emitJCC_Cond_ImmOrLabel (asm.LGE, mTarget, bTarget); // if not, goto default case asm.emitCALL_Imm(asm.getMachineCodeIndex() + 5 + (n<<LG_WORDSIZE) ); // jump around table, pushing address of 0th delta for (int i=0; i<n; i++) { // create table of deltas int offset = fetch4BytesSigned(); bTarget = biStart + offset; mTarget = bytecodeMap[bTarget]; // delta i: difference between address of case i and of delta 0 asm.emitOFFSET_Imm_ImmOrLabel(i, mTarget, bTarget ); } asm.emitPOP_Reg (S0); // S0 = address of 0th delta asm.emitADD_Reg_RegIdx (S0, S0, T0, asm.WORD, 0); // S0 += [S0 + T0<<2] asm.emitPUSH_Reg(S0); // push computed case address asm.emitRET (); // goto case break; } case 0xab: /* lookupswitch */ { // unit test by Lookup bi = (bi+3) & -4; // eat padding int defaultval = fetch4BytesSigned(); int npairs = fetch4BytesSigned(); if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "lookupswitch [<" + VM_Lister.decimal(npairs) + ">]" + VM_Lister.decimal(defaultval)); asm.emitPOP_Reg(T0); for (int i=0; i<npairs; i++) { int match = fetch4BytesSigned(); asm.emitCMP_Reg_Imm(T0, match); int offset = fetch4BytesSigned(); int bTarget = biStart + offset; int mTarget = bytecodeMap[bTarget]; asm.emitJCC_Cond_ImmOrLabel(asm.EQ, mTarget, bTarget); } int bTarget = biStart + defaultval; int mTarget = bytecodeMap[bTarget]; asm.emitJMP_ImmOrLabel(mTarget, bTarget); // TODO replace linear search loop with binary search break; } case 0xac: /* ireturn */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "ireturn"); if (VM.UseEpilogueYieldPoints) genThreadSwitchTest(VM_Thread.EPILOGUE); if (method.isSynchronized()) genMonitorExit(); asm.emitPOP_Reg(T0); genEpilogue(4); break; } case 0xad: /* lreturn */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "lreturn"); if (VM.UseEpilogueYieldPoints) genThreadSwitchTest(VM_Thread.EPILOGUE); if (method.isSynchronized()) genMonitorExit(); asm.emitPOP_Reg(T1); // low half asm.emitPOP_Reg(T0); // high half genEpilogue(8); break; } case 0xae: /* freturn */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "freturn"); if (VM.UseEpilogueYieldPoints) genThreadSwitchTest(VM_Thread.EPILOGUE); if (method.isSynchronized()) genMonitorExit(); asm.emitFLD_Reg_RegInd(FP0, SP); asm.emitADD_Reg_Imm(SP, WORDSIZE); // pop the stack genEpilogue(4); break; } case 0xaf: /* dreturn */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "dreturn"); if (VM.UseEpilogueYieldPoints) genThreadSwitchTest(VM_Thread.EPILOGUE); if (method.isSynchronized()) genMonitorExit(); asm.emitFLD_Reg_RegInd_Quad(FP0, SP); asm.emitADD_Reg_Imm(SP, WORDSIZE<<1); // pop the stack genEpilogue(8); break; } case 0xb0: /* areturn */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "areturn"); if (VM.UseEpilogueYieldPoints) genThreadSwitchTest(VM_Thread.EPILOGUE); if (method.isSynchronized()) genMonitorExit(); asm.emitPOP_Reg(T0); genEpilogue(4); break; } case 0xb1: /* return */ { if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "return"); if (VM.UseEpilogueYieldPoints) genThreadSwitchTest(VM_Thread.EPILOGUE); if (method.isSynchronized()) genMonitorExit(); genEpilogue(0); break; } case 0xb2: /* getstatic */ { int constantPoolIndex = fetch2BytesUnsigned(); VM_Field fieldRef = klass.getFieldRef(constantPoolIndex); if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "getstatic " + VM_Lister.decimal(constantPoolIndex) + " (" + fieldRef + ")"); boolean classPreresolved = false; VM_Class fieldRefClass = fieldRef.getDeclaringClass(); if (fieldRef.needsDynamicLink(method) && VM.BuildForPrematureClassResolution) { try { fieldRefClass.load(); fieldRefClass.resolve(); classPreresolved = true; } catch (Exception e) { // report the exception at runtime VM.sysWrite("WARNING: during compilation of " + method + " premature resolution of " + fieldRefClass + " provoked the following exception: " + e); // TODO!! remove this warning message } } if (VM.BuildForPrematureClassResolution && !fieldRefClass.isInitialized() && !(fieldRefClass == klass) && !(fieldRefClass.isInBootImage() && VM.writingBootImage) ) { // TODO!! rearrange the following code to backpatch after the first call asm.emitMOV_Reg_Imm (T0, fieldRefClass.getDictionaryId()); asm.emitPUSH_Reg (T0); asm.emitCALL_RegDisp(JTOC, VM_Entrypoints.initializeClassIfNecessaryMethod.getOffset()); classPreresolved = true; } if (fieldRef.needsDynamicLink(method) && !classPreresolved) { if (VM.VerifyAssertions && VM.BuildForStrongVolatileSemantics) // Either VM.BuildForPrematureClassResolution was not set or the class was not found (these cases are not yet handled) VM.assert(VM.NOT_REACHED); // TODO!! handle this case by emitting code that assumes the field is volatile emitDynamicLinkingSequence(T0, fieldRef); if (fieldRef.getSize() == 4) { // field is one word asm.emitPUSH_RegIdx (JTOC, T0, asm.BYTE, 0); // get static field } else { // field is two words (double or long) if (VM.VerifyAssertions) VM.assert(fieldRef.getSize() == 8); // TODO!! use 8-byte move if possible asm.emitPUSH_RegIdx (JTOC, T0, asm.BYTE, WORDSIZE); // get high part asm.emitPUSH_RegIdx (JTOC, T0, asm.BYTE, 0); // get low part } } else { fieldRef = fieldRef.resolve(); int fieldOffset = fieldRef.getOffset(); if (fieldRef.getSize() == 4) { // field is one word asm.emitPUSH_RegDisp(JTOC, fieldOffset); } else { // field is two words (double or long) if (VM.VerifyAssertions) VM.assert(fieldRef.getSize() == 8); if (fieldRef.isVolatile() && VM.BuildForStrongVolatileSemantics) { asm.emitMOV_Reg_RegDisp (T0, JTOC, VM_Entrypoints.doublewordVolatileMutexField.getOffset()); asm.emitPUSH_Reg (T0); asm.emitMOV_Reg_RegDisp (S0, T0, OBJECT_TIB_OFFSET); asm.emitCALL_RegDisp (S0, VM_Entrypoints.processorLockMethod.getOffset()); } // TODO!! use 8-byte move if possible asm.emitPUSH_RegDisp(JTOC, fieldOffset+WORDSIZE); // get high part asm.emitPUSH_RegDisp(JTOC, fieldOffset); // get low part if (fieldRef.isVolatile() && VM.BuildForStrongVolatileSemantics) { asm.emitMOV_Reg_RegDisp (T0, JTOC, VM_Entrypoints.doublewordVolatileMutexField.getOffset()); asm.emitPUSH_Reg (T0); asm.emitMOV_Reg_RegDisp (S0, T0, OBJECT_TIB_OFFSET); asm.emitCALL_RegDisp (S0, VM_Entrypoints.processorUnlockMethod.getOffset()); } } } break; } case 0xb3: /* putstatic */ { int constantPoolIndex = fetch2BytesUnsigned(); int fieldId = klass.getFieldRefId(constantPoolIndex); VM_Field fieldRef = VM_FieldDictionary.getValue(fieldId); if (VM_Assembler.TRACE) asm.noteBytecode(biStart, "putstatic " + VM_Lister.decimal(constantPoolIndex) + " (" + fieldRef + ")"); if (VM_Collector.NEEDS_WRITE_BARRIER && !fieldRef.getType().isPrimitiveType()) { if (fieldRef.needsDynamicLink(method)) VM_Barriers.compileUnresolvedPutstaticBarrier(asm, fieldId); else VM_Barriers.compilePutstaticBarrier(asm, fieldRef.getOffset()); } boolean classPreresolved = false; VM_Class fieldRefClass = fieldRef.getDeclaringClass(); if (fieldRef.needsDynamicLink(method) && VM.BuildForPrematureClassResolution) { try { fieldRefClass.load(); fieldRefClass.resolve(); classPreresolved = true; } catch (Exception e) { // report the exception at runtime VM.sysWrite("WARNING: during compilation of " + method + " premature resolution of " + fieldRefClass + " provoked the following exception: " + e); // TODO!! remove this warning message } } if (VM.BuildForPrematureClassResolution && !fieldRefClass.isInitialized() && !(fieldRefClass == klass) && !(fieldRefClass.isInBootImage() && VM.writingBootImage) ) { // TODO!! rearrange the following code to backpatch after the first call asm.emitMOV_Reg_Imm (T0, fieldRefClass.getDictionaryId()); asm.emitPUSH_Reg (T0); asm.emitCALL_RegDisp(JTOC, VM_Entrypoints.initializeClassIfNecessaryMethod.getOffset()); classPreresolved = true; } if (fieldRef.needsDynamicLink(method) && !classPreresolved) { if (VM.VerifyAssertions && VM.BuildForStrongVolatileSemantics) // Either VM.BuildForPrematureClassResolution was not set or the class was not found (these cases are not yet handled) VM.assert(VM.NOT_REACHED); // TODO!! handle this case by emitting code that assumes the field is volatile emitDynamicLinkingSequence(T0, fieldRef); if (fieldRef.getSize() == 4) { // field is one word asm.emitPOP_RegIdx(JTOC, T0, asm.BYTE, 0); } else { // field is two words (double or long) if (VM.VerifyAssertions) VM.assert(fieldRef.getSize() == 8); // TODO!! use 8-byte move if possible asm.emitPOP_RegIdx(JTOC, T0, asm.BYTE, 0); // store low part asm.emitPOP_RegIdx(JTOC, T0, asm.BYTE, WORDSIZE); // store high part } } else { fieldRef = fieldRef.resolve(); int fieldOffset = fieldRef.getOffset(); if (fieldRef.getSize() == 4) { // field is one word asm.emitPOP_RegDisp(JTOC, fieldOffset); } else { // field is two words (double or long) if (VM.VerifyAssertions) VM.assert(fieldRef.getSize() == 8); if (fieldRef.isVolatile() && VM.BuildForStrongVolatileSemantics) { asm.emitMOV_Reg_RegDisp (T0, JTOC, VM_Entrypoints.doublewordVolatileMutexField.getOffset()); asm.emitPUSH_Reg (T0); asm.emitMOV_Reg_RegDisp (S0, T0, OBJECT_TIB_OFFSET); asm.emitCALL_RegDisp (S0, VM_Entrypoints.processorLockMethod.getOffset()); } // TODO!! use 8-byte move if possible asm.emitPOP_RegDisp(JTOC, fieldOffset); // store low part asm.emitPOP_RegDisp(JTOC, fieldOffset+WORDSIZE); // store high part if (fieldRef.isVolatile() && VM.BuildForStrongVolatileSemantics) { asm.emitMOV_Reg_RegDisp (T0, JTOC, VM_Entrypoints.doublewordVolatileMutexField.getOffset()); asm.emitPUSH_Reg (T0); asm.emitMOV_Reg_RegDisp (S0, T0, OBJECT_TIB_OFFSET); asm.emitCALL_RegDisp (S0, VM_Entrypoints.processorUnlockMethod.getOffset()); } } } break; }
49871 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49871/b10305d4dc3bedd5e012418bdf9536501412ec77/VM_Compiler.java/clean/rvm/src/vm/arch/intel/compilers/baseline/VM_Compiler.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 3238, 727, 8251, 67, 6981, 1085, 3157, 1085, 261, 474, 7743, 30793, 16, 8251, 67, 1305, 707, 16, 1250, 1410, 5108, 13, 288, 565, 309, 261, 2116, 18, 19350, 67, 5327, 13, 1172, 1305, 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, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 3238, 727, 8251, 67, 6981, 1085, 3157, 1085, 261, 474, 7743, 30793, 16, 8251, 67, 1305, 707, 16, 1250, 1410, 5108, 13, 288, 565, 309, 261, 2116, 18, 19350, 67, 5327, 13, 1172, 1305, 107...
if (_cur.isContainer())
if (_cur.isElem())
public int getAttributeCount ( ) { int n = 0; if (_cur.isContainer()) { Cur ca = _cur.tempCur(); if (ca.toFirstAttr()) { do { if (ca.isNormalAttr()) n++; } while ( ca.toNextSibling() ); } ca.release(); } else if (_cur.isNormalAttr()) n++; else throw new IllegalStateException(); return n; }
3520 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/3520/0348e161e0d123181c6f12c1786a8041f483033c/Jsr173.java/buggy/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/Jsr173.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 540, 1071, 509, 4061, 1380, 261, 262, 3639, 288, 5411, 509, 290, 273, 374, 31, 13491, 309, 261, 67, 1397, 18, 291, 7498, 10756, 5411, 288, 7734, 7251, 3474, 273, 389, 1397, 18, 5814, 2408, 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, 540, 1071, 509, 4061, 1380, 261, 262, 3639, 288, 5411, 509, 290, 273, 374, 31, 13491, 309, 261, 67, 1397, 18, 291, 7498, 10756, 5411, 288, 7734, 7251, 3474, 273, 389, 1397, 18, 5814, 2408, 5...
public static int adjustForTab( Context c, LineBox prev_line, int remaining_width ) { if(prev_line.width == 0) { prev_line.width = remaining_width; } else { Uu.p("warning. possible error. line already has width: " + prev_line); }
public static int adjustForTab(Context c, LineBox prev_line, int remaining_width) { if (prev_line.width == 0) { prev_line.width = remaining_width; } else { Uu.p("warning. possible error. line already has width: " + prev_line); }
public static int adjustForTab( Context c, LineBox prev_line, int remaining_width ) { if(prev_line.width == 0) { prev_line.width = remaining_width; } else { Uu.p("warning. possible error. line already has width: " + prev_line); } BlockFormattingContext bfc = c.getBlockFormattingContext(); remaining_width -= bfc.getLeftFloatDistance( prev_line ); remaining_width -= bfc.getRightFloatDistance( prev_line ); //Uu.p("adjusting the line by: " + remaining_width); return remaining_width; }
53937 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53937/bde92034552ad767004ee99ea3102b82d884d477/FloatUtil.java/clean/src/java/org/xhtmlrenderer/layout/inline/FloatUtil.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 760, 509, 5765, 1290, 5661, 12, 1772, 276, 16, 5377, 3514, 2807, 67, 1369, 16, 509, 4463, 67, 2819, 262, 288, 202, 202, 430, 12, 10001, 67, 1369, 18, 2819, 422, 374, 13, 288, 10...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 509, 5765, 1290, 5661, 12, 1772, 276, 16, 5377, 3514, 2807, 67, 1369, 16, 509, 4463, 67, 2819, 262, 288, 202, 202, 430, 12, 10001, 67, 1369, 18, 2819, 422, 374, 13, 288, 10...
public TA_RetCode CDLLADDERBOTTOM( int startIdx, int endIdx, double inOpen[], double inHigh[], double inLow[], double inClose[], MInteger outBegIdx, MInteger outNbElement, int outInteger[] ){ double ShadowVeryShortPeriodTotal; int i, outIdx, ShadowVeryShortTrailingIdx, 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 = CDLLADDERBOTTOM_Lookback (); if( startIdx < lookbackTotal ) startIdx = lookbackTotal; if( startIdx > endIdx ) { outBegIdx.value = 0 ; outNbElement.value = 0 ; return TA_RetCode. TA_SUCCESS; } ShadowVeryShortPeriodTotal = 0; ShadowVeryShortTrailingIdx = startIdx - (this.candleSettings[TA_CandleSettingType.TA_ShadowVeryShort.ordinal()].avgPeriod) ; i = ShadowVeryShortTrailingIdx; while( i < startIdx ) { ShadowVeryShortPeriodTotal += ( (this.candleSettings[TA_CandleSettingType.TA_ShadowVeryShort.ordinal()].rangeType) == TA_RangeType. TA_RangeType_RealBody ? ( Math.abs ( inClose[i-1] - inOpen[i-1] ) ) : ( (this.candleSettings[TA_CandleSettingType.TA_ShadowVeryShort.ordinal()].rangeType) == TA_RangeType. TA_RangeType_HighLow ? ( inHigh[i-1] - inLow[i-1] ) : ( (this.candleSettings[TA_CandleSettingType.TA_ShadowVeryShort.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 ) ) ) ; i++; } i = startIdx; outIdx = 0; do { if( ( inClose[i-4] >= inOpen[i-4] ? 1 : -1 ) == -1 && ( inClose[i-3] >= inOpen[i-3] ? 1 : -1 ) == -1 && ( inClose[i-2] >= inOpen[i-2] ? 1 : -1 ) == -1 && inOpen[i-4] > inOpen[i-3] && inOpen[i-3] > inOpen[i-2] && inClose[i-4] > inClose[i-3] && inClose[i-3] > inClose[i-2] && ( inClose[i-1] >= inOpen[i-1] ? 1 : -1 ) == -1 && ( inHigh[i-1] - ( inClose[i-1] >= inOpen[i-1] ? inClose[i-1] : inOpen[i-1] ) ) > ( (this.candleSettings[TA_CandleSettingType.TA_ShadowVeryShort.ordinal()].factor) * ( (this.candleSettings[TA_CandleSettingType.TA_ShadowVeryShort.ordinal()].avgPeriod) != 0.0? ShadowVeryShortPeriodTotal / (this.candleSettings[TA_CandleSettingType.TA_ShadowVeryShort.ordinal()].avgPeriod) : ( (this.candleSettings[TA_CandleSettingType.TA_ShadowVeryShort.ordinal()].rangeType) == TA_RangeType. TA_RangeType_RealBody ? ( Math.abs ( inClose[i-1] - inOpen[i-1] ) ) : ( (this.candleSettings[TA_CandleSettingType.TA_ShadowVeryShort.ordinal()].rangeType) == TA_RangeType. TA_RangeType_HighLow ? ( inHigh[i-1] - inLow[i-1] ) : ( (this.candleSettings[TA_CandleSettingType.TA_ShadowVeryShort.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_ShadowVeryShort.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? 2.0 : 1.0 ) ) && ( inClose[i] >= inOpen[i] ? 1 : -1 ) == 1 && inOpen[i] > inOpen[i-1] && inClose[i] > inHigh[i-1] ) outInteger[outIdx++] = 100; else outInteger[outIdx++] = 0; ShadowVeryShortPeriodTotal += ( (this.candleSettings[TA_CandleSettingType.TA_ShadowVeryShort.ordinal()].rangeType) == TA_RangeType. TA_RangeType_RealBody ? ( Math.abs ( inClose[i-1] - inOpen[i-1] ) ) : ( (this.candleSettings[TA_CandleSettingType.TA_ShadowVeryShort.ordinal()].rangeType) == TA_RangeType. TA_RangeType_HighLow ? ( inHigh[i-1] - inLow[i-1] ) : ( (this.candleSettings[TA_CandleSettingType.TA_ShadowVeryShort.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_ShadowVeryShort.ordinal()].rangeType) == TA_RangeType. TA_RangeType_RealBody ? ( Math.abs ( inClose[ShadowVeryShortTrailingIdx-1] - inOpen[ShadowVeryShortTrailingIdx-1] ) ) : ( (this.candleSettings[TA_CandleSettingType.TA_ShadowVeryShort.ordinal()].rangeType) == TA_RangeType. TA_RangeType_HighLow ? ( inHigh[ShadowVeryShortTrailingIdx-1] - inLow[ShadowVeryShortTrailingIdx-1] ) : ( (this.candleSettings[TA_CandleSettingType.TA_ShadowVeryShort.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? ( inHigh[ShadowVeryShortTrailingIdx-1] - ( inClose[ShadowVeryShortTrailingIdx-1] >= inOpen[ShadowVeryShortTrailingIdx-1] ? inClose[ShadowVeryShortTrailingIdx-1] : inOpen[ShadowVeryShortTrailingIdx-1] ) ) + ( ( inClose[ShadowVeryShortTrailingIdx-1] >= inOpen[ShadowVeryShortTrailingIdx-1] ? inOpen[ShadowVeryShortTrailingIdx-1] : inClose[ShadowVeryShortTrailingIdx-1] ) - inLow[ShadowVeryShortTrailingIdx-1] ) : 0 ) ) ) ; i++; ShadowVeryShortTrailingIdx++; } while( i <= endIdx ); outNbElement.value = outIdx; outBegIdx.value = startIdx; return TA_RetCode. TA_SUCCESS;}
51465 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51465/1a230e9b7099cbd2b7e9eb1294130ca009bfedf4/Core.java/buggy/trunk/ta-lib/java/src/TA/Lib/Core.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 1071, 399, 37, 67, 7055, 1085, 21508, 4503, 1880, 4179, 28891, 12, 509, 27108, 16, 509, 679, 4223, 16, 1645, 316, 3678, 63, 6487, 1645, 316, 8573, 63, 6487, 1645, 316, 10520, 63, 6487, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1071, 399, 37, 67, 7055, 1085, 21508, 4503, 1880, 4179, 28891, 12, 509, 27108, 16, 509, 679, 4223, 16, 1645, 316, 3678, 63, 6487, 1645, 316, 8573, 63, 6487, 1645, 316, 10520, 63, 6487, ...
}
}
private void addFetchDbObjectListener() { availableDbObjectsTree.addListener(SWT.Expand, new Listener(){ /* * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event) */ public void handleEvent( final Event event ) { TreeItem item = (TreeItem)event.item; BusyIndicator.showWhile( item.getDisplay( ), new Runnable( ) { /* * @see java.lang.Runnable#run() */ public void run( ) { showTable( event ); } } ); } /** * @param event */ private void showTable(Event event) { TreeItem item = (TreeItem)event.item; if (item == null) return; if( item == rootNode ) return; if ( isSchemaNode( item ) ) { populateTableList( item.getText( ), item ); return; }//TODO String tableName = Utility.getTreeItemsName( item ); String catalogName = metaDataProvider.getCatalog(); String schemaName = null; String schemaSeparator = "."; if (metaDataProvider.isSchemaSupported()) { // remove the schema name from the fully qualified name int index = -1; if ((index = tableName.lastIndexOf(schemaSeparator)) != -1) { schemaName = tableName.substring(0, index); tableName = tableName.substring( index + 1); } } if ( item.getData( ) instanceof DbObject ) { DbObject obj = (DbObject) item.getData( ); if ( obj.getType( ) == DbObject.TABLE_TYPE || obj.getType( ) == DbObject.VIEW_TYPE ) { ArrayList columnList = metaDataProvider.getColumns( catalogName, schemaName, tableName, null ); TreeItem[] items = item.getItems( ); if ( items != null ) { for ( int i = 0; i < items.length; i++ ) { items[i].dispose( ); } } Utility.createTreeItems( item, columnList, SWT.NONE, columnImage ); } else if ( obj.getType( ) == DbObject.PROCEDURE_TYPE ) { ArrayList procedureList = metaDataProvider.getAllProcedure( catalogName, schemaName, getTailoredSearchText( searchTxt.getText() ) ); TreeItem[] items = item.getItems( ); if ( items != null ) { for ( int i = 0; i < items.length; i++ ) { items[i].dispose( ); } } Utility.createTreeItems( item, procedureList, SWT.NONE, columnImage ); //expand procedure TreeItem } } else if ( item.getData( ) instanceof Procedure ) { Procedure obj = (Procedure) item.getData( ); { ArrayList columnList = metaDataProvider.getProcedureColumns( obj.getCatalog( ), schemaName, tableName, getTailoredSearchText(null) ); TreeItem[] items = item.getItems( ); if ( items != null ) { for ( int i = 0; i < items.length; i++ ) { items[i].dispose( ); } } Utility.createTreeItems( item, columnList, SWT.NONE, columnImage ); } } } }); }
46013 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46013/8887f296b0d9adc032ae9020f3349938893f43a3/SQLDataSetEditorPage.java/clean/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/editors/SQLDataSetEditorPage.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1152, 918, 527, 5005, 4331, 921, 2223, 1435, 202, 95, 9506, 202, 5699, 4331, 4710, 2471, 18, 1289, 2223, 12, 55, 8588, 18, 12271, 16, 394, 10652, 1435, 95, 25083, 202, 20308, 9506, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5005, 4331, 921, 2223, 1435, 202, 95, 9506, 202, 5699, 4331, 4710, 2471, 18, 1289, 2223, 12, 55, 8588, 18, 12271, 16, 394, 10652, 1435, 95, 25083, 202, 20308, 9506, ...
reportGenericSchemaError("element " + name + " cannot also have a ref attribute");
reportGenericSchemaError("src-element.2.1: element " + nameStr + " cannot also have a ref attribute");
private QName traverseElementDecl(Element elementDecl) throws Exception { // General Attribute Checking int scope = isTopLevel(elementDecl)? GeneralAttrCheck.ELE_CONTEXT_GLOBAL: GeneralAttrCheck.ELE_CONTEXT_LOCAL; Hashtable attrValues = fGeneralAttrCheck.checkAttributes(elementDecl, scope); int contentSpecType = -1; int contentSpecNodeIndex = -1; int typeNameIndex = -1; int scopeDefined = -2; //signal a error if -2 gets gets through //cause scope can never be -2. DatatypeValidator dv = null; String name = elementDecl.getAttribute(SchemaSymbols.ATT_NAME); if ( DEBUGGING ) System.out.println("traversing element decl : " + name ); String ref = elementDecl.getAttribute(SchemaSymbols.ATT_REF); String type = elementDecl.getAttribute(SchemaSymbols.ATT_TYPE); String minOccurs = elementDecl.getAttribute(SchemaSymbols.ATT_MINOCCURS); String maxOccurs = elementDecl.getAttribute(SchemaSymbols.ATT_MAXOCCURS); String dflt = elementDecl.getAttribute(SchemaSymbols.ATT_DEFAULT); String fixed = elementDecl.getAttribute(SchemaSymbols.ATT_FIXED); if(!(dflt.equals("") || fixed.equals(""))) // REVISIT: localize reportGenericSchemaError("an element cannot have both \"fixed\" and \"default\" present at the same time"); String substitutionGroup = elementDecl.getAttribute(SchemaSymbols.ATT_SUBSTITUTIONGROUP); // form attribute String isQName = elementDecl.getAttribute(SchemaSymbols.ATT_FORM); String fromAnotherSchema = null; if (isTopLevel(elementDecl)) { if(name.equals("")) // REVISIT: localize reportGenericSchemaError("globally-declared element must have a name"); else if (!ref.equals("")) // REVISIT: localize reportGenericSchemaError("globally-declared element " + name + " cannot have a ref attribute"); int nameIndex = fStringPool.addSymbol(name); int eltKey = fSchemaGrammar.getElementDeclIndex(fTargetNSURI, nameIndex,TOP_LEVEL_SCOPE); if (eltKey > -1 ) { return new QName(-1,nameIndex,nameIndex,fTargetNSURI); } } // parse out 'block', 'final', 'nillable', 'abstract' String blockSetStr = null; Attr blockAttr = elementDecl.getAttributeNode( SchemaSymbols.ATT_BLOCK ); if (blockAttr != null) blockSetStr = blockAttr.getValue(); int blockSet = parseBlockSet(blockSetStr); if( (blockSetStr != null) && !blockSetStr.equals("") && (!blockSetStr.equals(SchemaSymbols.ATTVAL_POUNDALL) && (((blockSet & SchemaSymbols.RESTRICTION) == 0) && (((blockSet & SchemaSymbols.EXTENSION) == 0) && ((blockSet & SchemaSymbols.SUBSTITUTION) == 0))))) reportGenericSchemaError("The values of the 'block' attribute of an element must be either #all or a list of 'substitution', 'restriction' and 'extension'; " + blockSetStr + " was found"); String finalSetStr = null; Attr finalAttr = elementDecl.getAttributeNode( SchemaSymbols.ATT_FINAL ); if (finalAttr != null) finalSetStr = finalAttr.getValue(); int finalSet = parseFinalSet(finalSetStr); if( (finalSetStr != null) && !finalSetStr.equals("") && (!finalSetStr.equals(SchemaSymbols.ATTVAL_POUNDALL) && (((finalSet & SchemaSymbols.RESTRICTION) == 0) && ((finalSet & SchemaSymbols.EXTENSION) == 0)))) reportGenericSchemaError("The values of the 'final' attribute of an element must be either #all or a list of 'restriction' and 'extension'; " + finalSetStr + " was found"); boolean isNillable = elementDecl.getAttribute (SchemaSymbols.ATT_NILLABLE).equals(SchemaSymbols.ATTVAL_TRUE)? true:false; boolean isAbstract = elementDecl.getAttribute (SchemaSymbols.ATT_ABSTRACT).equals(SchemaSymbols.ATTVAL_TRUE)? true:false; int elementMiscFlags = 0; if (isNillable) { elementMiscFlags += SchemaSymbols.NILLABLE; } if (isAbstract) { elementMiscFlags += SchemaSymbols.ABSTRACT; } // make the property of the element's value being fixed also appear in elementMiscFlags if(!fixed.equals("")) elementMiscFlags += SchemaSymbols.FIXED; //if this is a reference to a global element if (!ref.equals("")) { //REVISIT top level check for ref if (!type.equals("") || (elementMiscFlags > 0) || (finalSetStr != null && finalSet > 0) || (blockSetStr != null && blockSet > 0) || !dflt.equals("") || !fixed.equals("")) reportSchemaError(SchemaMessageProvider.BadAttWithRef, null); if (!name.equals("")) // REVISIT: Localize reportGenericSchemaError("element " + name + " cannot also have a ref attribute"); Element child = XUtil.getFirstChildElement(elementDecl); if(child != null && child.getLocalName().equals(SchemaSymbols.ELT_ANNOTATION)) { if (XUtil.getNextSiblingElement(child) != null) reportSchemaError(SchemaMessageProvider.NoContentForRef, null); else traverseAnnotationDecl(child); } else if (child != null) reportSchemaError(SchemaMessageProvider.NoContentForRef, null); String prefix = ""; String localpart = ref; int colonptr = ref.indexOf(":"); if ( colonptr > 0) { prefix = ref.substring(0,colonptr); localpart = ref.substring(colonptr+1); } int localpartIndex = fStringPool.addSymbol(localpart); String uriString = resolvePrefixToURI(prefix); QName eltName = new QName(prefix != null ? fStringPool.addSymbol(prefix) : -1, localpartIndex, fStringPool.addSymbol(ref), uriString != null ? fStringPool.addSymbol(uriString) : StringPool.EMPTY_STRING); //if from another schema, just return the element QName if (! uriString.equals(fTargetNSURIString) ) { return eltName; } int elementIndex = fSchemaGrammar.getElementDeclIndex(eltName, TOP_LEVEL_SCOPE); //if not found, traverse the top level element that if referenced if (elementIndex == -1 ) { Element targetElement = getTopLevelComponentByName(SchemaSymbols.ELT_ELEMENT,localpart); if (targetElement == null ) { // REVISIT: Localize reportGenericSchemaError("Element " + localpart + " not found in the Schema"); //REVISIT, for now, the QName anyway return eltName; //return new QName(-1,fStringPool.addSymbol(localpart), -1, fStringPool.addSymbol(uriString)); } else { // do nothing here, other wise would cause infinite loop for // <element name="recur"><complexType><element ref="recur"> ... //eltName= traverseElementDecl(targetElement); } } return eltName; } else if (name.equals("")) // REVISIT: Localize reportGenericSchemaError("a local element must have a name or a ref attribute present"); // Handle the substitutionGroup Element substitutionGroupElementDecl = null; int substitutionGroupElementDeclIndex = -1; boolean noErrorSoFar = true; String substitutionGroupUri = null; String substitutionGroupLocalpart = null; String substitutionGroupFullName = null; ComplexTypeInfo substitutionGroupEltTypeInfo = null; DatatypeValidator substitutionGroupEltDV = null; if ( substitutionGroup.length() > 0 ) { if(!ref.equals("")) // REVISIT: Localize reportGenericSchemaError("a local element cannot have a substitutionGroup"); substitutionGroupUri = resolvePrefixToURI(getPrefix(substitutionGroup)); substitutionGroupLocalpart = getLocalPart(substitutionGroup); substitutionGroupFullName = substitutionGroupUri+","+substitutionGroupLocalpart; if ( !substitutionGroupUri.equals(fTargetNSURIString) ) { substitutionGroupEltTypeInfo = getElementDeclTypeInfoFromNS(substitutionGroupUri, substitutionGroupLocalpart); if (substitutionGroupEltTypeInfo == null) { substitutionGroupEltDV = getElementDeclTypeValidatorFromNS(substitutionGroupUri, substitutionGroupLocalpart); if (substitutionGroupEltDV == null) { //TO DO: report error here; noErrorSoFar = false; reportGenericSchemaError("Could not find type for element '" +substitutionGroupLocalpart + "' in schema '" + substitutionGroupUri+"'"); } } } else { substitutionGroupElementDecl = getTopLevelComponentByName(SchemaSymbols.ELT_ELEMENT, substitutionGroupLocalpart); if (substitutionGroupElementDecl == null) { substitutionGroupElementDeclIndex = fSchemaGrammar.getElementDeclIndex(fTargetNSURI, getLocalPartIndex(substitutionGroup),TOP_LEVEL_SCOPE); if ( substitutionGroupElementDeclIndex == -1) { noErrorSoFar = false; // REVISIT: Localize reportGenericSchemaError("unable to locate substitutionGroup affiliation element " +substitutionGroup +" in element declaration " +name); } } else { substitutionGroupElementDeclIndex = fSchemaGrammar.getElementDeclIndex(fTargetNSURI, getLocalPartIndex(substitutionGroup),TOP_LEVEL_SCOPE); if ( substitutionGroupElementDeclIndex == -1) { traverseElementDecl(substitutionGroupElementDecl); substitutionGroupElementDeclIndex = fSchemaGrammar.getElementDeclIndex(fTargetNSURI, getLocalPartIndex(substitutionGroup),TOP_LEVEL_SCOPE); } } if (substitutionGroupElementDeclIndex != -1) { substitutionGroupEltTypeInfo = fSchemaGrammar.getElementComplexTypeInfo( substitutionGroupElementDeclIndex ); if (substitutionGroupEltTypeInfo == null) { fSchemaGrammar.getElementDecl(substitutionGroupElementDeclIndex, fTempElementDecl); substitutionGroupEltDV = fTempElementDecl.datatypeValidator; if (substitutionGroupEltDV == null) { //TO DO: report error here; noErrorSoFar = false; reportGenericSchemaError("Could not find type for element '" +substitutionGroupLocalpart + "' in schema '" + substitutionGroupUri+"'"); } } } } } // // resolving the type for this element right here // ComplexTypeInfo typeInfo = null; // element has a single child element, either a datatype or a type, null if primitive Element child = XUtil.getFirstChildElement(elementDecl); if(child != null && child.getLocalName().equals(SchemaSymbols.ELT_ANNOTATION)) { traverseAnnotationDecl(child); child = XUtil.getNextSiblingElement(child); } if(child != null && child.getLocalName().equals(SchemaSymbols.ELT_ANNOTATION)) // REVISIT: Localize reportGenericSchemaError("element declarations can contain at most one annotation Element Information Item"); boolean haveAnonType = false; // Handle Anonymous type if there is one if (child != null) { String childName = child.getLocalName(); if (childName.equals(SchemaSymbols.ELT_COMPLEXTYPE)) { if (child.getAttribute(SchemaSymbols.ATT_NAME).length() > 0) { noErrorSoFar = false; // REVISIT: Localize reportGenericSchemaError("anonymous complexType in element '" + name +"' has a name attribute"); } else { // Determine what the type name will be String anonTypeName = genAnonTypeName(child); if (fCurrentTypeNameStack.search((Object)anonTypeName) > - 1) { // A recursing element using an anonymous type int uriInd = StringPool.EMPTY_STRING; if ( isQName.equals(SchemaSymbols.ATTVAL_QUALIFIED)|| fElementDefaultQualified) { uriInd = fTargetNSURI; } int nameIndex = fStringPool.addSymbol(name); QName tempQName = new QName(fCurrentScope, nameIndex, nameIndex, uriInd); fElementRecurseComplex.put(tempQName, anonTypeName); return new QName(-1, nameIndex, nameIndex, uriInd); } else { typeNameIndex = traverseComplexTypeDecl(child); if (typeNameIndex != -1 ) { typeInfo = (ComplexTypeInfo) fComplexTypeRegistry.get(fStringPool.toString(typeNameIndex)); } else { noErrorSoFar = false; // REVISIT: Localize reportGenericSchemaError("traverse complexType error in element '" + name +"'"); } } } haveAnonType = true; child = XUtil.getNextSiblingElement(child); } else if (childName.equals(SchemaSymbols.ELT_SIMPLETYPE)) { if (child.getAttribute(SchemaSymbols.ATT_NAME).length() > 0) { noErrorSoFar = false; // REVISIT: Localize reportGenericSchemaError("anonymous simpleType in element '" + name +"' has a name attribute"); } else typeNameIndex = traverseSimpleTypeDecl(child); if (typeNameIndex != -1) { dv = fDatatypeRegistry.getDatatypeValidator(fStringPool.toString(typeNameIndex)); } else { noErrorSoFar = false; // REVISIT: Localize reportGenericSchemaError("traverse simpleType error in element '" + name +"'"); } contentSpecType = XMLElementDecl.TYPE_SIMPLE; haveAnonType = true; child = XUtil.getNextSiblingElement(child); } else if (type.equals("")) { // "ur-typed" leaf contentSpecType = XMLElementDecl.TYPE_ANY; //REVISIT: is this right? //contentSpecType = fStringPool.addSymbol("UR_TYPE"); // set occurrence count contentSpecNodeIndex = -1; } // see if there's something here; it had better be key, keyref or unique. if (child != null) childName = child.getLocalName(); while ((child != null) && ((childName.equals(SchemaSymbols.ELT_KEY)) || (childName.equals(SchemaSymbols.ELT_KEYREF)) || (childName.equals(SchemaSymbols.ELT_UNIQUE)))) { child = XUtil.getNextSiblingElement(child); if (child != null) { childName = child.getLocalName(); } } if (child != null) { // REVISIT: Localize noErrorSoFar = false; reportGenericSchemaError("the content of an element information item must match (annotation?, (simpleType | complexType)?, (unique | key | keyref)*)"); } } // handle type="" here if (haveAnonType && (type.length()>0)) { noErrorSoFar = false; // REVISIT: Localize reportGenericSchemaError( "Element '"+ name + "' have both a type attribute and a annoymous type child" ); } // type specified as an attribute and no child is type decl. else if (!type.equals("")) { String prefix = ""; String localpart = type; int colonptr = type.indexOf(":"); if ( colonptr > 0) { prefix = type.substring(0,colonptr); localpart = type.substring(colonptr+1); } String typeURI = resolvePrefixToURI(prefix); // check if the type is from the same Schema if ( !typeURI.equals(fTargetNSURIString) && !typeURI.equals(SchemaSymbols.URI_SCHEMAFORSCHEMA) && typeURI.length() != 0) { // REVISIT, only needed because of resolvePrifixToURI. fromAnotherSchema = typeURI; typeInfo = getTypeInfoFromNS(typeURI, localpart); if (typeInfo == null) { dv = getTypeValidatorFromNS(typeURI, localpart); if (dv == null) { //TO DO: report error here; noErrorSoFar = false; reportGenericSchemaError("Could not find type " +localpart + " in schema " + typeURI); } } } else { typeInfo = (ComplexTypeInfo) fComplexTypeRegistry.get(typeURI+","+localpart); if (typeInfo == null) { dv = getDatatypeValidator(typeURI, localpart); if (dv == null ) if (typeURI.equals(SchemaSymbols.URI_SCHEMAFORSCHEMA) && !fTargetNSURIString.equals(SchemaSymbols.URI_SCHEMAFORSCHEMA)) { noErrorSoFar = false; // REVISIT: Localize reportGenericSchemaError("type not found : " + typeURI+":"+localpart); } else { Element topleveltype = getTopLevelComponentByName(SchemaSymbols.ELT_COMPLEXTYPE,localpart); if (topleveltype != null) { if (fCurrentTypeNameStack.search((Object)localpart) > - 1) { //then we found a recursive element using complexType. // REVISIT: this will be broken when recursing happens between 2 schemas int uriInd = StringPool.EMPTY_STRING; if ( isQName.equals(SchemaSymbols.ATTVAL_QUALIFIED)|| fElementDefaultQualified) { uriInd = fTargetNSURI; } int nameIndex = fStringPool.addSymbol(name); QName tempQName = new QName(fCurrentScope, nameIndex, nameIndex, uriInd); fElementRecurseComplex.put(tempQName, localpart); return new QName(-1, nameIndex, nameIndex, uriInd); } else { typeNameIndex = traverseComplexTypeDecl( topleveltype ); typeInfo = (ComplexTypeInfo) fComplexTypeRegistry.get(fStringPool.toString(typeNameIndex)); } } else { topleveltype = getTopLevelComponentByName(SchemaSymbols.ELT_SIMPLETYPE, localpart); if (topleveltype != null) { typeNameIndex = traverseSimpleTypeDecl( topleveltype ); dv = getDatatypeValidator(typeURI, localpart); } else { noErrorSoFar = false; // REVISIT: Localize reportGenericSchemaError("type not found : " + typeURI+":"+localpart); } } } } } } // now we need to make sure that our substitution (if any) // is valid, now that we have all the requisite type-related info. if(substitutionGroup.length() > 0) { checkSubstitutionGroupOK(elementDecl, substitutionGroupElementDecl, noErrorSoFar, substitutionGroupElementDeclIndex, typeInfo, substitutionGroupEltTypeInfo, dv, substitutionGroupEltDV); } // this element is ur-type, check its substitutionGroup affiliation. // if there is substitutionGroup affiliation and not type definition found for this element, // then grab substitutionGroup affiliation's type and give it to this element if ( noErrorSoFar && typeInfo == null && dv == null ) { typeInfo = substitutionGroupEltTypeInfo; dv = substitutionGroupEltDV; } if (typeInfo == null && dv==null) { if (noErrorSoFar) { // Actually this Element's type definition is ur-type; contentSpecType = XMLElementDecl.TYPE_ANY; // REVISIT, need to wait till we have wildcards implementation. // ADD attribute wildcards here } else { noErrorSoFar = false; // REVISIT: Localize reportGenericSchemaError ("untyped element : " + name ); } } // if element belongs to a compelx type if (typeInfo!=null) { contentSpecNodeIndex = typeInfo.contentSpecHandle; contentSpecType = typeInfo.contentType; scopeDefined = typeInfo.scopeDefined; dv = typeInfo.datatypeValidator; } // if element belongs to a simple type if (dv!=null) { contentSpecType = XMLElementDecl.TYPE_SIMPLE; if (typeInfo == null) { fromAnotherSchema = null; // not to switch schema in this case } } // Now we can handle validation etc. of default and fixed attributes, // since we finally have all the type information. if(!fixed.equals("")) dflt = fixed; if(!dflt.equals("")) { if(dv == null) { // in this case validate according to xs:string new StringDatatypeValidator().validate(dflt, null); } else { dv.validate(dflt, null); } if(typeInfo != null && (typeInfo.contentType != XMLElementDecl.TYPE_MIXED_SIMPLE && typeInfo.contentType != XMLElementDecl.TYPE_MIXED_COMPLEX && typeInfo.contentType != XMLElementDecl.TYPE_SIMPLE)) { // REVISIT: Localize reportGenericSchemaError ("element " + name + " has a fixed or default value and must have a mixed or simple content model"); } } // // Create element decl // int elementNameIndex = fStringPool.addSymbol(name); int localpartIndex = elementNameIndex; int uriIndex = StringPool.EMPTY_STRING; int enclosingScope = fCurrentScope; //refer to 4.3.2 in "XML Schema Part 1: Structures" if ( isTopLevel(elementDecl)) { uriIndex = fTargetNSURI; enclosingScope = TOP_LEVEL_SCOPE; } else if ( !isQName.equals(SchemaSymbols.ATTVAL_UNQUALIFIED) && (( isQName.equals(SchemaSymbols.ATTVAL_QUALIFIED)|| fElementDefaultQualified ))) { uriIndex = fTargetNSURI; } //There can never be two elements with the same name and different type in the same scope. int existSuchElementIndex = fSchemaGrammar.getElementDeclIndex(uriIndex, localpartIndex, enclosingScope); if ( existSuchElementIndex > -1) { fSchemaGrammar.getElementDecl(existSuchElementIndex, fTempElementDecl); DatatypeValidator edv = fTempElementDecl.datatypeValidator; ComplexTypeInfo eTypeInfo = fSchemaGrammar.getElementComplexTypeInfo(existSuchElementIndex); if ( ((eTypeInfo != null)&&(eTypeInfo!=typeInfo)) || ((edv != null)&&(edv != dv)) ) { noErrorSoFar = false; // REVISIT: Localize reportGenericSchemaError("duplicate element decl in the same scope : " + fStringPool.toString(localpartIndex)); } } QName eltQName = new QName(-1,localpartIndex,elementNameIndex,uriIndex); // add element decl to pool int attrListHead = -1 ; // copy up attribute decls from type object if (typeInfo != null) { attrListHead = typeInfo.attlistHead; } int elementIndex = fSchemaGrammar.addElementDecl(eltQName, enclosingScope, scopeDefined, contentSpecType, contentSpecNodeIndex, attrListHead, dv); if ( DEBUGGING ) { /***/ System.out.println("########elementIndex:"+elementIndex+" ("+fStringPool.toString(eltQName.uri)+"," + fStringPool.toString(eltQName.localpart) + ")"+ " eltType:"+type+" contentSpecType:"+contentSpecType+ " SpecNodeIndex:"+ contentSpecNodeIndex +" enclosingScope: " +enclosingScope + " scopeDefined: " +scopeDefined+"\n"); /***/ } fSchemaGrammar.setElementComplexTypeInfo(elementIndex, typeInfo); // REVISIT: should we report error if typeInfo was null? // mark element if its type belongs to different Schema. fSchemaGrammar.setElementFromAnotherSchemaURI(elementIndex, fromAnotherSchema); // set BlockSet, FinalSet, Nillable and Abstract for this element decl fSchemaGrammar.setElementDeclBlockSet(elementIndex, blockSet); fSchemaGrammar.setElementDeclFinalSet(elementIndex, finalSet); fSchemaGrammar.setElementDeclMiscFlags(elementIndex, elementMiscFlags); fSchemaGrammar.setElementDefault(elementIndex, dflt); // setSubstitutionGroupElementFullName fSchemaGrammar.setElementDeclSubstitutionGroupElementFullName(elementIndex, substitutionGroupFullName); // // key/keyref/unique processing // Element ic = XUtil.getFirstChildElementNS(elementDecl, IDENTITY_CONSTRAINTS); if (ic != null) { Integer elementIndexObj = new Integer(elementIndex); Vector identityConstraints = (Vector)fIdentityConstraints.get(elementIndexObj); if (identityConstraints == null) { identityConstraints = new Vector(); fIdentityConstraints.put(elementIndexObj, identityConstraints); } while (ic != null) { if (DEBUG_IC_DATATYPES) { System.out.println("<ICD>: adding ic for later traversal: "+ic); } identityConstraints.addElement(ic); ic = XUtil.getNextSiblingElementNS(ic, IDENTITY_CONSTRAINTS); } } return eltQName; }// end of method traverseElementDecl(Element)
46079 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46079/db50512047bd38712dbc3a9d35ed787e6f2582f4/TraverseSchema.java/clean/src/org/apache/xerces/validators/schema/TraverseSchema.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 16723, 10080, 1046, 3456, 12, 1046, 930, 3456, 13, 1216, 1185, 288, 3639, 368, 9544, 3601, 24471, 3639, 509, 2146, 273, 353, 27046, 12, 2956, 3456, 9945, 10792, 9544, 3843, 1564, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 16723, 10080, 1046, 3456, 12, 1046, 930, 3456, 13, 1216, 1185, 288, 3639, 368, 9544, 3601, 24471, 3639, 509, 2146, 273, 353, 27046, 12, 2956, 3456, 9945, 10792, 9544, 3843, 1564, 18, ...
currTestDataPath = TEST_DATA_PATH + File.separatorChar + testDataPath;
currTestDataPath = AjdeTests.testDataPath(testDataPath);
protected void setUp(String testDataPath) throws Exception { currTestDataPath = TEST_DATA_PATH + File.separatorChar + testDataPath; // AMC - added this next line as a temporary workaround for // listener leakage in AsmManager induced by the Ajde test suite. AsmManager.getDefault().removeAllListeners(); ideManager.init(currTestDataPath); super.setUp(); assertTrue(NullIdeManager.getIdeManager().isInitialized()); Ajde.getDefault().getBuildManager().addListener(testerBuildListener); }
53148 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53148/07b62e63fa19324107da924c64bcecc2603dd1cf/AjdeTestCase.java/buggy/ajde/testsrc/org/aspectj/ajde/AjdeTestCase.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1117, 918, 24292, 12, 780, 1842, 751, 743, 13, 1216, 1185, 288, 202, 202, 17016, 4709, 751, 743, 273, 22130, 67, 4883, 67, 4211, 397, 1387, 18, 11287, 2156, 397, 1842, 751, 743, 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, 225, 202, 1117, 918, 24292, 12, 780, 1842, 751, 743, 13, 1216, 1185, 288, 202, 202, 17016, 4709, 751, 743, 273, 22130, 67, 4883, 67, 4211, 397, 1387, 18, 11287, 2156, 397, 1842, 751, 743, 31...
public void createControl(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(1, false)); new Label(composite, SWT.NONE).setText("Task: " + task.getDescription()); new Label(composite, SWT.NONE).setText("Repository: " + repository.getUrl()); new Label(composite, SWT.NONE).setText("Select context below:"); final Table contextTable = new Table(composite, SWT.FULL_SELECTION | SWT.BORDER); contextTable.setHeaderVisible(true); contextTable.setLinesVisible(true); contextTable.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { if (contextTable.getSelectionIndex() > -1) { selectedContextAttachment = (RepositoryAttachment) contextTable.getItem(contextTable.getSelectionIndex()) .getData(); getWizard().getContainer().updateButtons(); } } }); AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector( repository.getKind()); Set<RepositoryAttachment> contextAttachments = connector.getContextAttachments(repository, task); TableColumn[] columns = new TableColumn[3]; columns[0] = new TableColumn(contextTable, SWT.LEFT); columns[0].setText(COLUMN_DATE); columns[1] = new TableColumn(contextTable, SWT.LEFT); columns[1].setText(COLUMN_AUTHOR); columns[2] = new TableColumn(contextTable, SWT.CENTER); columns[2].setText(COLUMN_COMMENT); for (RepositoryAttachment attachment : contextAttachments) { TableItem item = new TableItem(contextTable, SWT.NONE); item.setText(0, attachment.getDateCreated()); item.setText(1, attachment.getCreator()); item.setText(2, attachment.getDescription()); item.setData(attachment); } for (int i = 0, n = columns.length; i < n; i++) { columns[i].pack(); } contextTable.setLayoutData(new GridData(GridData.FILL_BOTH)); setControl(composite); }
51151 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51151/3f33a89683820a198642d1fcceae5fd787efe4f1/ContextRetrieveWizardPage.java/buggy/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/ContextRetrieveWizardPage.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 918, 752, 3367, 12, 9400, 982, 13, 288, 202, 202, 9400, 9635, 273, 394, 14728, 12, 2938, 16, 348, 8588, 18, 9826, 1769, 202, 202, 27676, 18, 542, 3744, 12, 2704, 7145, 3744, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 752, 3367, 12, 9400, 982, 13, 288, 202, 202, 9400, 9635, 273, 394, 14728, 12, 2938, 16, 348, 8588, 18, 9826, 1769, 202, 202, 27676, 18, 542, 3744, 12, 2704, 7145, 3744, ...
if (jj_3R_265()) jj_scanpos = xsp;
if (jj_3R_266()) jj_scanpos = xsp;
final private boolean jj_3R_234() { Token xsp; xsp = jj_scanpos; if (jj_3R_263()) jj_scanpos = xsp; if (jj_3R_79()) return true; if (jj_3R_264()) return true; xsp = jj_scanpos; if (jj_3R_265()) jj_scanpos = xsp; xsp = jj_scanpos; if (jj_3R_266()) { jj_scanpos = xsp; if (jj_scan_token(80)) return true; } return false; }
45569 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45569/ac9207dcb7a8bbf54f85da7f1bdae7d7162b86b3/JavaParser.java/buggy/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, 17959, 1435, 288, 565, 3155, 619, 1752, 31, 565, 619, 1752, 273, 10684, 67, 9871, 917, 31, 565, 309, 261, 78, 78, 67, 23, 54, 67, 22, 4449, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 727, 3238, 1250, 10684, 67, 23, 54, 67, 17959, 1435, 288, 565, 3155, 619, 1752, 31, 565, 619, 1752, 273, 10684, 67, 9871, 917, 31, 565, 309, 261, 78, 78, 67, 23, 54, 67, 22, 4449, 1...
org.wings.plaf.Utils.optAttribute(device, "focus", component.getName());
Utils.optAttribute(device, "focus", component.getName());
public void writeContent(final Device device, final SComponent _c) throws IOException { final SAnchor component = (SAnchor) _c; device.print("<a href=\""); device.print(component.getURL()); device.print("\""); Utils.printCSSInlinePreferredSize(device, component.getPreferredSize()); if (component.isFocusOwner()) org.wings.plaf.Utils.optAttribute(device, "focus", component.getName()); org.wings.plaf.Utils.optAttribute(device, "target", component.getTarget()); org.wings.plaf.Utils.optAttribute(device, "name", component.getName()); org.wings.plaf.Utils.optAttribute(device, "tabindex", component.getFocusTraversalIndex()); Utils.writeEvents(device, component); device.print(">"); Utils.renderContainer(device, component); device.print("</a>"); }
3911 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/3911/a13e1e051952689f51f8e2bee7381d6e03645ee4/AnchorCG.java/buggy/wings2/src/java/org/wings/plaf/css/AnchorCG.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1045, 1350, 12, 6385, 6077, 2346, 16, 11794, 727, 348, 1841, 389, 71, 13, 5411, 1216, 1860, 288, 3639, 727, 348, 11605, 1794, 273, 261, 55, 11605, 13, 389, 71, 31, 3639, 2346...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1350, 12, 6385, 6077, 2346, 16, 11794, 727, 348, 1841, 389, 71, 13, 5411, 1216, 1860, 288, 3639, 727, 348, 11605, 1794, 273, 261, 55, 11605, 13, 389, 71, 31, 3639, 2346...
handleAdvancedButtonSelect(); }
handleAdvancedButtonSelect(); }
public void widgetSelected(SelectionEvent e) { handleAdvancedButtonSelect(); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6acf364392177fabaa2905c86fa45a3dac0a3db3/WizardNewFileCreationPage.java/buggy/bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/dialogs/WizardNewFileCreationPage.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1171, 1071, 918, 3604, 7416, 12, 6233, 1133, 425, 13, 288, 10792, 1640, 23618, 3616, 3391, 5621, 7734, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1171, 1071, 918, 3604, 7416, 12, 6233, 1133, 425, 13, 288, 10792, 1640, 23618, 3616, 3391, 5621, 7734, 289, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
getRuntime().printError(((RaiseException)exception).getActException());
getRuntime().printError(((RaiseException) exception).getActException());
public void printException(Exception exception) { if (exception instanceof RaiseException) { getRuntime().printError(((RaiseException)exception).getActException()); } else if (exception instanceof ThrowJump) { getRuntime().printError(((ThrowJump)exception).getNameError()); } else if (exception instanceof BreakJump) { getRuntime().getErrorStream().println("break without block."); } else if (exception instanceof ReturnException) { getRuntime().getErrorStream().println("return without block."); } }
45298 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45298/4e4bb40b2eb2d38881d15ca8ef7cda4c34323793/Ruby.java/clean/org/jruby/Ruby.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1172, 503, 12, 503, 1520, 13, 288, 3639, 309, 261, 4064, 1276, 20539, 503, 13, 288, 5411, 18814, 7675, 1188, 668, 12443, 12, 30570, 503, 13, 1520, 2934, 588, 2459, 503, 10663, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1172, 503, 12, 503, 1520, 13, 288, 3639, 309, 261, 4064, 1276, 20539, 503, 13, 288, 5411, 18814, 7675, 1188, 668, 12443, 12, 30570, 503, 13, 1520, 2934, 588, 2459, 503, 10663, ...
RubyNumeric other = numericValue(num); if (other instanceof RubyFloat) { return RubyFloat.newFloat(getRuby(), getDoubleValue()).op_div(other); } else if (other instanceof RubyBignum) { return RubyBignum.newBignum(getRuby(), getLongValue()).op_div(other); } else { return newFixnum(getRuby(), getLongValue() / other.getLongValue()); } }
RubyNumeric other = numericValue(num); if (other instanceof RubyFloat) { return RubyFloat.newFloat(getRuby(), getDoubleValue()).op_div(other); } else if (other instanceof RubyBignum) { return RubyBignum.newBignum(getRuby(), getLongValue()).op_div(other); } else { return newFixnum(getRuby(), getLongValue() / other.getLongValue()); } }
public RubyNumeric op_div(RubyObject num) { RubyNumeric other = numericValue(num); if (other instanceof RubyFloat) { return RubyFloat.newFloat(getRuby(), getDoubleValue()).op_div(other); } else if (other instanceof RubyBignum) { return RubyBignum.newBignum(getRuby(), getLongValue()).op_div(other); } else { return newFixnum(getRuby(), getLongValue() / other.getLongValue()); } }
47273 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47273/1cc89bd397c0f049e6fa3045916fd6d9a3cdada8/RubyFixnum.java/buggy/org/jruby/RubyFixnum.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 19817, 9902, 1061, 67, 2892, 12, 54, 10340, 921, 818, 13, 288, 3639, 19817, 9902, 1308, 273, 6389, 620, 12, 2107, 1769, 3639, 309, 261, 3011, 1276, 19817, 4723, 13, 288, 5411, 327, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 19817, 9902, 1061, 67, 2892, 12, 54, 10340, 921, 818, 13, 288, 3639, 19817, 9902, 1308, 273, 6389, 620, 12, 2107, 1769, 3639, 309, 261, 3011, 1276, 19817, 4723, 13, 288, 5411, 327, ...
matchTypePos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH];
matchTypePos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
protected boolean AbbreviatedNodeTestStep(boolean isLeadingSlashPermitted) throws javax.xml.transform.TransformerException { int opPos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH]; int axesType; // The next blocks guarantee that a MATCH_XXX will be added. int matchTypePos = -1; if (tokenIs('@')) { axesType = OpCodes.MATCH_ATTRIBUTE; appendOp(2, axesType); nextToken(); } else if (this.lookahead("::", 1)) { if (tokenIs("attribute")) { axesType = OpCodes.MATCH_ATTRIBUTE; appendOp(2, axesType); } else if (tokenIs("child")) { matchTypePos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH]; axesType = OpCodes.MATCH_IMMEDIATE_ANCESTOR; appendOp(2, axesType); } else { axesType = -1; this.error(XPATHErrorResources.ER_AXES_NOT_ALLOWED, new Object[]{ this.m_token }); } nextToken(); nextToken(); } else if (tokenIs('/')) { if (!isLeadingSlashPermitted) { // "A step was expected in the pattern, but '/' was encountered." error(XPATHErrorResources.ER_EXPECTED_STEP_PATTERN, null); } axesType = OpCodes.MATCH_ANY_ANCESTOR; appendOp(2, axesType); nextToken(); } else { matchTypePos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH]; axesType = OpCodes.MATCH_IMMEDIATE_ANCESTOR; appendOp(2, axesType); } // Make room for telling how long the step is without the predicate m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] += 1; NodeTest(axesType); // Tell how long the step is without the predicate m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH + 1] = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos; while (tokenIs('[')) { Predicate(); } boolean trailingSlashConsumed; // For "a//b", where "a" is current step, we need to mark operation of // current step as "MATCH_ANY_ANCESTOR". Then we'll consume the first // slash and subsequent step will be treated as a MATCH_IMMEDIATE_ANCESTOR // (unless it too is followed by '//'.) // // %REVIEW% Following is what happens today, but I'm not sure that's // %REVIEW% correct behaviour. Perhaps no valid case could be constructed // %REVIEW% where it would matter? // // If current step is on the attribute axis (e.g., "@x//b"), we won't // change the current step, and let following step be marked as // MATCH_ANY_ANCESTOR on next call instead. if ((matchTypePos > -1) && tokenIs('/') && lookahead('/', 1)) { m_ops.m_opMap[matchTypePos] = OpCodes.MATCH_ANY_ANCESTOR; nextToken(); trailingSlashConsumed = true; } else { trailingSlashConsumed = false; } // Tell how long the entire step is. m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH] = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos; return trailingSlashConsumed; }
2723 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2723/f136f83081069756bcd71950054569f3ad4d2ce5/XPathParser.java/buggy/src/org/apache/xpath/compiler/XPathParser.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 4750, 1250, 9771, 9854, 907, 4709, 4160, 12, 6494, 353, 19112, 11033, 31465, 13, 5411, 1216, 6863, 18, 2902, 18, 6547, 18, 8319, 503, 225, 288, 565, 509, 1061, 1616, 273, 312, 67, 4473, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 4750, 1250, 9771, 9854, 907, 4709, 4160, 12, 6494, 353, 19112, 11033, 31465, 13, 5411, 1216, 6863, 18, 2902, 18, 6547, 18, 8319, 503, 225, 288, 565, 509, 1061, 1616, 273, 312, 67, 4473, ...
public org.quickfix.field.Text getText() throws FieldNotFound { org.quickfix.field.Text value = new org.quickfix.field.Text();
public quickfix.field.Text getText() throws FieldNotFound { quickfix.field.Text value = new quickfix.field.Text();
public org.quickfix.field.Text getText() throws FieldNotFound { org.quickfix.field.Text value = new org.quickfix.field.Text(); getField(value); return value; }
8803 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8803/fecc27f98261270772ff182a1d4dfd94b5daa73d/ExecutionReport.java/clean/src/java/src/quickfix/fix40/ExecutionReport.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 2358, 18, 19525, 904, 18, 1518, 18, 1528, 6701, 1435, 1216, 2286, 2768, 225, 288, 2358, 18, 19525, 904, 18, 1518, 18, 1528, 460, 273, 394, 2358, 18, 19525, 904, 18, 1518, 18, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 2358, 18, 19525, 904, 18, 1518, 18, 1528, 6701, 1435, 1216, 2286, 2768, 225, 288, 2358, 18, 19525, 904, 18, 1518, 18, 1528, 460, 273, 394, 2358, 18, 19525, 904, 18, 1518, 18, 1528...
if (validateDV == DV_STRING)
if (validateDV == DV_STRING) {
protected XSSimpleTypeDecl(XSSimpleTypeDecl base, String name, short validateDV) { fBase = base; fTypeName = name; fTargetNamespace = URI_SCHEMAFORSCHEMA; fVariety = VARIETY_ATOMIC; //fPrimitiveDV = validateDV; //if (validateDV == DV_ID || validateDV == DV_IDREF || validateDV == DV_ENTITY) // fPrimitiveDV = DV_STRING; fValidateDV = validateDV; fFacetsDefined = FACET_WHITESPACE; if (validateDV == DV_STRING) fWhiteSpace = WS_PRESERVE; else fWhiteSpace = WS_COLLAPSE; }
6373 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6373/16ed7852384aa6366d7ceee5eb51e15601693770/XSSimpleTypeDecl.java/buggy/src/org/apache/xerces/impl/v2/new_datatypes/XSSimpleTypeDecl.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 4750, 1139, 1260, 2052, 559, 3456, 12, 60, 1260, 2052, 559, 3456, 1026, 16, 514, 508, 16, 3025, 1954, 30199, 13, 288, 3639, 284, 2171, 273, 1026, 31, 3639, 284, 7947, 273, 508, 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, 4750, 1139, 1260, 2052, 559, 3456, 12, 60, 1260, 2052, 559, 3456, 1026, 16, 514, 508, 16, 3025, 1954, 30199, 13, 288, 3639, 284, 2171, 273, 1026, 31, 3639, 284, 7947, 273, 508, 31, 3639...
case Event.GET_MSG_DIGEST: long[] highest_seqnos=(long[])evt.getArg(); Digest digest=naker.computeMessageDigest(highest_seqnos); passUp(new Event(Event.GET_MSG_DIGEST_OK, digest)); return;
return;
public void down(Event evt) { Message msg; if(Trace.debug) Trace.debug("NAKACK.down()", "queued_msgs has " + queued_msgs.size() + " messages " + "\n\nnaker:\n" + naker.dumpContents() + "\n\nout_of_bander: " + out_of_bander.dumpContents() + "\n-----------------------------\n"); switch(evt.getType()) { case Event.MSG: msg=(Message)evt.getArg(); if(msg.getDest() != null && !msg.getDest().isMulticastAddress()) break; // unicast address: not null and not mcast, pass down unchanged if(send_next_msg_out_of_band) { out_of_bander.send(msg); send_next_msg_out_of_band=false; } else if(send_next_msg_acking) { naker.setAcks(true); // require acks when sending a msg naker.send(msg); naker.setAcks(false); // don't require acks when sending a msg send_next_msg_acking=false; } else naker.send(msg); return; // don't pass down the stack, naker does this for us ! case Event.GET_MSG_DIGEST: long[] highest_seqnos=(long[])evt.getArg(); Digest digest=naker.computeMessageDigest(highest_seqnos); passUp(new Event(Event.GET_MSG_DIGEST_OK, digest)); return; case Event.GET_MSGS: List lower_seqnos=naker.getMessagesInRange((long[][])evt.getArg()); passUp(new Event(Event.GET_MSGS_OK, lower_seqnos)); return; case Event.REBROADCAST_MSGS: rebroadcastMsgs((Vector) evt.getArg()); break; case Event.TMP_VIEW: Vector mbrs=((View)evt.getArg()).getMembers(); members=mbrs != null ? (Vector)mbrs.clone(): new Vector(); break; case Event.VIEW_CHANGE: synchronized (this) { view=((View) ((View) evt.getArg()).clone()); vid=view.getVid(); members=(Vector)view.getMembers().clone(); naker.reset(); out_of_bander.reset(); is_server=true; // check vids from now on // deliver messages received previously for this view if(queued_msgs.size() > 0) deliverQueuedMessages(); } break; case Event.BECOME_SERVER: is_server=true; break; case Event.SWITCH_NAK: naker.setAcks(false); // don't require acks when sending a msg return; // don't pass down any further case Event.SWITCH_NAK_ACK: send_next_msg_acking=true; return; // don't pass down any further case Event.SWITCH_OUT_OF_BAND: send_next_msg_out_of_band=true; return; case Event.GET_MSGS_RECEIVED: // return the highest seqnos delivered (=consumed by the application) long[] h=naker.getHighestSeqnosDelivered(); passUp(new Event(Event.GET_MSGS_RECEIVED_OK, h)); break; } passDown(evt); }
47927 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47927/75359f4186603c5a949e15ffab51fb811f04ed8e/NAKACK.java/buggy/src/org/jgroups/protocols/NAKACK.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 2588, 12, 1133, 6324, 13, 288, 202, 1079, 1234, 31, 202, 430, 12, 3448, 18, 4148, 13, 202, 565, 2677, 18, 4148, 2932, 11277, 47, 3649, 18, 2378, 1435, 3113, 315, 19499, 67, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 2588, 12, 1133, 6324, 13, 288, 202, 1079, 1234, 31, 202, 430, 12, 3448, 18, 4148, 13, 202, 565, 2677, 18, 4148, 2932, 11277, 47, 3649, 18, 2378, 1435, 3113, 315, 19499, 67, ...
private ObjectStreamField[] getSerialPersistentFields(Class clazz) throws NoSuchFieldException, IllegalAccessException { ObjectStreamField[] fieldsArray = null; ObjectStreamField[] o; // Use getDeclaredField rather than getField for the same reason // as above in getDefinedSUID. Field f = clazz.getDeclaredField("serialPersistentFields"); f.setAccessible(true); int modifiers = f.getModifiers(); if (!(Modifier.isStatic(modifiers) && Modifier.isFinal(modifiers) && Modifier.isPrivate(modifiers))) return null; o = (ObjectStreamField[]) f.get(null); if (o == null) return null; fieldsArray = new ObjectStreamField[ o.length ]; System.arraycopy(o, 0, fieldsArray, 0, o.length); return fieldsArray; }
45163 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45163/126d7770c7bb5b9c74598afb0864a336d457fd92/ObjectStreamClass.java/buggy/libjava/java/io/ObjectStreamClass.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 3238, 1033, 1228, 974, 8526, 336, 6342, 11906, 2314, 12, 797, 4003, 13, 377, 1216, 5823, 28846, 16, 11900, 225, 288, 565, 1033, 1228, 974, 8526, 1466, 1076, 273, 446, 31, 565, 1033, 1228,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 3238, 1033, 1228, 974, 8526, 336, 6342, 11906, 2314, 12, 797, 4003, 13, 377, 1216, 5823, 28846, 16, 11900, 225, 288, 565, 1033, 1228, 974, 8526, 1466, 1076, 273, 446, 31, 565, 1033, 1228,...
private InputStream resolve(String url)
static InputStream resolve(String url)
private InputStream resolve(String url) throws IOException { try { return new URL(url).openStream(); } catch (MalformedURLException e) { return null; } }
47947 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47947/ec80a4d83ee8b04d65215d92efe22fd108cf1d23/XMLParser.java/buggy/gnu/xml/stream/XMLParser.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 760, 5037, 2245, 12, 780, 880, 13, 565, 1216, 1860, 225, 288, 565, 775, 1377, 288, 3639, 327, 394, 1976, 12, 718, 2934, 3190, 1228, 5621, 1377, 289, 565, 1044, 261, 18695, 20160, 425, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 760, 5037, 2245, 12, 780, 880, 13, 565, 1216, 1860, 225, 288, 565, 775, 1377, 288, 3639, 327, 394, 1976, 12, 718, 2934, 3190, 1228, 5621, 1377, 289, 565, 1044, 261, 18695, 20160, 425, 1...
MNamespace ns = (MNamespace)handle; if (ns instanceof MPackage) return true; return false;
return true;
public boolean isValidNamespace(Object handle) { if (!ModelFacade.isANamespace(handle)) { cat.error("No namespace as argument"); cat.error(handle); throw new IllegalArgumentException( "The argument " + handle + "is not a namespace."); } MNamespace ns = (MNamespace)handle; if (ns instanceof MPackage) return true; return false; }
7166 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7166/d5cbce0bdbb219cb89b05407c2c3a0195079296c/ActionClassDiagram.java/clean/src_new/org/argouml/uml/ui/ActionClassDiagram.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 1250, 4908, 3402, 12, 921, 1640, 13, 288, 3639, 309, 16051, 1488, 12467, 18, 291, 1258, 753, 909, 12, 4110, 3719, 288, 5411, 6573, 18, 1636, 2932, 2279, 1981, 487, 1237, 8863, 5411,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4908, 3402, 12, 921, 1640, 13, 288, 3639, 309, 16051, 1488, 12467, 18, 291, 1258, 753, 909, 12, 4110, 3719, 288, 5411, 6573, 18, 1636, 2932, 2279, 1981, 487, 1237, 8863, 5411,...
if ((col = token.indexOf(':')) != -1) { prefix = token.substring(0,col); } else { prefix = Constants.EMPTYSTRING; }
if (col != -1) { namespace = lookupNamespace(token.substring(0,col)); if (namespace != null) { elements.append(namespace+":"+ token.substring(col+1,token.length())); } else { elements.append(token); } } else { elements.append(token); }
public void parseContents(Parser parser) { // Determine if this is an xsl:strip- or preserve-space element _action = _qname.getLocalPart().endsWith("strip-space") ? STRIP_SPACE : PRESERVE_SPACE; // Determine the import precedence _importPrecedence = parser.getCurrentImportPrecedence(); // Get the list of elements to strip/preserve _elementList = getAttribute("elements"); if (_elementList == null || _elementList.length() == 0) { reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "elements"); return; } final SymbolTable stable = parser.getSymbolTable(); StringTokenizer list = new StringTokenizer(_elementList); StringBuffer elements = new StringBuffer(Constants.EMPTYSTRING); while (list.hasMoreElements()) { String token = list.nextToken(); String prefix; String namespace; int col; if ((col = token.indexOf(':')) != -1) { prefix = token.substring(0,col); } else { prefix = Constants.EMPTYSTRING; } namespace = lookupNamespace(prefix); if (namespace != null) elements.append(namespace+":"+ token.substring(col+1,token.length())); else elements.append(token); if (list.hasMoreElements()) elements.append(" "); } _elementList = elements.toString(); }
46591 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46591/787c5fac4d810a9fb25c601e2fc27df9de2893d0/Whitespace.java/clean/src/org/apache/xalan/xsltc/compiler/Whitespace.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1109, 6323, 12, 2678, 2082, 13, 288, 202, 759, 10229, 309, 333, 353, 392, 20791, 30, 6406, 17, 578, 9420, 17, 2981, 930, 202, 67, 1128, 273, 389, 85, 529, 18, 588, 2042, 19...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1109, 6323, 12, 2678, 2082, 13, 288, 202, 759, 10229, 309, 333, 353, 392, 20791, 30, 6406, 17, 578, 9420, 17, 2981, 930, 202, 67, 1128, 273, 389, 85, 529, 18, 588, 2042, 19...
IPojoPluginConfiguration.getLogger().log(Level.INFO, "Local Variable : " + "_manager" + " index = " + 1 + " desc = " + "Lorg/apache/felix/ipojo/ComponentManager;");
IPojoPluginConfiguration.getLogger().log(Level.INFO, "Local Variable : " + "_manager" + " index = " + 1 + " desc = " + "Lorg/apache/felix/ipojo/ComponentManagerImpl;");
public void visitLocalVariable(String name, String desc, String signature, Label start, Label end, int index) { if(index == 0) { mv.visitLocalVariable(name, desc, signature, start, end, index); mv.visitLocalVariable("_manager", "Lorg/apache/felix/ipojo/ComponentManager;", null, start, end, 1); IPojoPluginConfiguration.getLogger().log(Level.INFO, "Local Variable : " + name + " index = " + index + " desc = " + desc); IPojoPluginConfiguration.getLogger().log(Level.INFO, "Local Variable : " + "_manager" + " index = " + 1 + " desc = " + "Lorg/apache/felix/ipojo/ComponentManager;"); } mv.visitLocalVariable(name, desc, signature, start, end, index+1); IPojoPluginConfiguration.getLogger().log(Level.INFO, "Local Variable : " + name + " index = " + index + " desc = " + desc); }
45948 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45948/ade5d36d9bda6dfac49dec23cf83e543691726ab/ConstructorCodeAdapter.java/clean/ipojo.plugin/src/main/java/org/apache/felix/ipojo/manipulation/ConstructorCodeAdapter.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 3757, 2042, 3092, 12, 780, 508, 16, 514, 3044, 16, 514, 3372, 16, 5287, 787, 16, 5287, 679, 16, 509, 770, 13, 288, 377, 202, 430, 12, 1615, 422, 374, 13, 288, 377, 202, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 3757, 2042, 3092, 12, 780, 508, 16, 514, 3044, 16, 514, 3372, 16, 5287, 787, 16, 5287, 679, 16, 509, 770, 13, 288, 377, 202, 430, 12, 1615, 422, 374, 13, 288, 377, 202, 2...
String className = publication.getClass().getName(); Integer lastPoint = className.lastIndexOf("."); String type = className.substring(lastPoint + 1);
String type = publication.getClass().getSimpleName();
private String getPublicationTypeString(ResultPublication publication) { String className = publication.getClass().getName(); Integer lastPoint = className.lastIndexOf("."); String type = className.substring(lastPoint + 1); if (type.equals("BookPart")) { //add bookPart type type = type + "." + ((BookPart) publication).getBookPartType().toString(); } return type; }
2645 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2645/dd56a2e5849915f5cc2645b54879e4e0fc052637/ResultPublicationsManagementDispatchAction.java/buggy/src/net/sourceforge/fenixedu/presentationTier/Action/research/result/publication/ResultPublicationsManagementDispatchAction.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 514, 17426, 367, 559, 780, 12, 1253, 4782, 367, 20574, 13, 288, 3639, 514, 2658, 273, 20574, 18, 588, 797, 7675, 17994, 5621, 3639, 2144, 1142, 2148, 273, 2658, 18, 2722, 31985, 293...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 514, 17426, 367, 559, 780, 12, 1253, 4782, 367, 20574, 13, 288, 3639, 514, 2658, 273, 20574, 18, 588, 797, 7675, 17994, 5621, 3639, 2144, 1142, 2148, 273, 2658, 18, 2722, 31985, 293...
public void set(org.quickfix.field.LegSymbol value)
public void set(quickfix.field.LegSymbol value)
public void set(org.quickfix.field.LegSymbol value) { setField(value); }
8803 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8803/fecc27f98261270772ff182a1d4dfd94b5daa73d/SecurityDefinitionRequest.java/buggy/src/java/src/quickfix/fix43/SecurityDefinitionRequest.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 918, 444, 12, 19525, 904, 18, 1518, 18, 8329, 5335, 460, 13, 225, 288, 16331, 12, 1132, 1769, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 918, 444, 12, 19525, 904, 18, 1518, 18, 8329, 5335, 460, 13, 225, 288, 16331, 12, 1132, 1769, 289, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
ASTVariable variable = new ASTVariable( newSymbol, abstractDeclaration, initializerClause, bitfieldExpression, startingOffset, nameOffset, references, constructorExpression );
ASTVariable variable = new ASTVariable( newSymbol, abstractDeclaration, initializerClause, bitfieldExpression, startingOffset, nameOffset, references, constructorExpression, previouslyDeclared );
public IASTVariable createVariable( IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset, IASTExpression constructorExpression) throws ASTSemanticException { List references = new ArrayList(); ISymbol newSymbol = cloneSimpleTypeSymbol(name, abstractDeclaration, references); setVariableTypeInfoBits( isAuto, abstractDeclaration, isMutable, isExtern, isRegister, isStatic, newSymbol); setPointerOperators( newSymbol, abstractDeclaration.getPointerOperators(), abstractDeclaration.getArrayModifiers() ); try { scopeToSymbol(scope).addSymbol( newSymbol ); } catch (ParserSymbolTableException e) { // TODO Auto-generated catch block } ASTVariable variable = new ASTVariable( newSymbol, abstractDeclaration, initializerClause, bitfieldExpression, startingOffset, nameOffset, references, constructorExpression ); try { attachSymbolExtension(newSymbol, variable ); } catch (ExtensionException e) { throw new ASTSemanticException(); } return variable; }
54911 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54911/ef856ea3e1e1acd7ffeac317801a531de0a75737/CompleteParseASTFactory.java/clean/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 467, 9053, 3092, 752, 3092, 12, 3639, 467, 9053, 3876, 2146, 16, 3639, 514, 508, 16, 3639, 1250, 27079, 16, 3639, 467, 9053, 14729, 7044, 12562, 7044, 16, 3639, 467, 9053, 2300, 283...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9053, 3092, 752, 3092, 12, 3639, 467, 9053, 3876, 2146, 16, 3639, 514, 508, 16, 3639, 1250, 27079, 16, 3639, 467, 9053, 14729, 7044, 12562, 7044, 16, 3639, 467, 9053, 2300, 283...
int c = -1; if (_istream == null) return c; try { c = _istream.read(); } catch(IOException e) {
int c = -1; if (_istream == null) return c; try { c = _istream.read(); } catch(IOException e) {
public int read() { int c = -1; if (_istream == null) return c; try { c = _istream.read(); } catch(IOException e) { } return c; }
5134 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5134/41422245404c0fad8a30437d75fc29381b02be42/ByteReader.java/buggy/components/gnutella-core/src/main/java/com/limegroup/gnutella/ByteReader.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 509, 855, 1435, 288, 202, 474, 276, 273, 300, 21, 31, 202, 202, 430, 261, 67, 376, 793, 422, 446, 13, 202, 565, 327, 276, 31, 202, 202, 698, 288, 202, 565, 276, 273, 225, 389,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 509, 855, 1435, 288, 202, 474, 276, 273, 300, 21, 31, 202, 202, 430, 261, 67, 376, 793, 422, 446, 13, 202, 565, 327, 276, 31, 202, 202, 698, 288, 202, 565, 276, 273, 225, 389,...
return getAttribute("iname");
return getAttribute("iname");
public String getIName() { return getAttribute("iname"); }
6373 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6373/bf94d6634ab3635fdb8210105d9c1c839d13e555/WMLSelectElementImpl.java/clean/src/org/apache/wml/dom/WMLSelectElementImpl.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 514, 8974, 461, 1435, 288, 202, 2463, 4061, 2932, 267, 339, 8863, 565, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 514, 8974, 461, 1435, 288, 202, 2463, 4061, 2932, 267, 339, 8863, 565, 289, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
public AstObject makeAst( Source xsrc, String prefix ) throws IOException { Node node;
public AstObject makeAst( Element el, String prefix ) throws IOException { ChannelWriter chan = new ChannelWriter( prefix ); chan.writeElement( el );
public AstObject makeAst( Source xsrc, String prefix ) throws IOException { Node node; try { node = new SourceReader().getDOM( xsrc ); } catch ( TransformerException e ) { throw (IOException) new IOException( "Error transforming XML source: " + e.getMessage() ) .initCause( e ); } Element el; if ( node instanceof Document ) { el = ((Document) node).getDocumentElement(); } else if ( node instanceof Element ) { el = (Element) node; } else { throw new IOException( "Source does not represent an Element or Document" ); } return makeAst( el, prefix ); }
48494 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/48494/69af040df751f6249865bd5c44cf05d9ac3268ca/XAstReader.java/buggy/jniast/src/main/uk/ac/starlink/ast/xml/XAstReader.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 16614, 921, 1221, 21385, 12, 4998, 619, 4816, 16, 514, 1633, 262, 1216, 1860, 288, 3639, 2029, 756, 31, 3639, 775, 288, 5411, 756, 273, 394, 4998, 2514, 7675, 588, 8168, 12, 619, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 16614, 921, 1221, 21385, 12, 4998, 619, 4816, 16, 514, 1633, 262, 1216, 1860, 288, 3639, 2029, 756, 31, 3639, 775, 288, 5411, 756, 273, 394, 4998, 2514, 7675, 588, 8168, 12, 619, ...
protected void dropTable(String tablename) throws SQLException { String sobName = "sysobjects"; if (tablename.startsWith("#"))
protected void dropTable(String tablename) throws SQLException { String sobName = "sysobjects"; if (tablename.startsWith("#")) {
protected void dropTable(String tablename) throws SQLException { String sobName = "sysobjects"; if (tablename.startsWith("#")) sobName = "tempdb.dbo.sysobjects"; Statement stmt = con.createStatement(); stmt.executeUpdate( "if exists (select * from " + sobName + " where name like '" + tablename + "%' and type = 'U') " + " drop table " + tablename); stmt.close(); }
2029 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2029/d48066e24a9a4b4edf35b9545de98ba05acafd4d/DatabaseTestCase.java/buggy/src/test/net/sourceforge/jtds/test/DatabaseTestCase.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1117, 918, 3640, 1388, 12, 780, 19096, 13, 1216, 6483, 202, 95, 1850, 514, 272, 947, 461, 273, 315, 9499, 6911, 14432, 1850, 309, 261, 7032, 14724, 18, 17514, 1190, 2932, 17133, 3719...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3640, 1388, 12, 780, 19096, 13, 1216, 6483, 202, 95, 1850, 514, 272, 947, 461, 273, 315, 9499, 6911, 14432, 1850, 309, 261, 7032, 14724, 18, 17514, 1190, 2932, 17133, 3719...
ctx.statManager().createRateStat("router.activePeers", "How many peers we are actively talking with", "Throttle", new long[] { 5*60*1000, 60*60*1000 }); ctx.statManager().createRateStat("router.activeSendPeers", "How many peers have sent messages to this minute", "Throttle", new long[] { 5*60*1000, 60*60*1000 });
ctx.statManager().createRateStat("router.activePeers", "How many peers we are actively talking with", "Throttle", new long[] { 60*1000, 5*60*1000, 60*60*1000 }); ctx.statManager().createRateStat("router.activeSendPeers", "How many peers have sent messages to this minute", "Throttle", new long[] { 60*1000, 5*60*1000, 60*60*1000 });
public CoalesceStatsJob(RouterContext ctx) { super(ctx); ctx.statManager().createRateStat("bw.receiveBps", "How fast we receive data (in KBps)", "Bandwidth", new long[] { 60*1000, 5*60*1000, 60*60*1000 }); ctx.statManager().createRateStat("bw.sendBps", "How fast we send data (in KBps)", "Bandwidth", new long[] { 60*1000, 5*60*1000, 60*60*1000 }); ctx.statManager().createRateStat("bw.sendRate", "Low level bandwidth send rate, averaged every minute", "Bandwidth", new long[] { 60*1000l, 5*60*1000l, 10*60*1000l, 60*60*1000l }); ctx.statManager().createRateStat("bw.recvRate", "Low level bandwidth receive rate, averaged every minute", "Bandwidth", new long[] { 60*1000l, 5*60*1000l, 10*60*1000l, 60*60*1000l }); ctx.statManager().createRateStat("router.activePeers", "How many peers we are actively talking with", "Throttle", new long[] { 5*60*1000, 60*60*1000 }); ctx.statManager().createRateStat("router.activeSendPeers", "How many peers have sent messages to this minute", "Throttle", new long[] { 5*60*1000, 60*60*1000 }); ctx.statManager().createRateStat("router.highCapacityPeers", "How many high capacity peers we know", "Throttle", new long[] { 5*60*1000, 60*60*1000 }); ctx.statManager().createRateStat("router.fastPeers", "How many fast peers we know", "Throttle", new long[] { 5*60*1000, 60*60*1000 }); }
27493 /local/tlutelli/issta_data/temp/all_java2context/java/2006_temp/2006/27493/65dc803fb73068777de39ad4e780c9be6ee1a16b/Router.java/clean/router/java/src/net/i2p/router/Router.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 7695, 24827, 4195, 2278, 12, 8259, 1042, 1103, 13, 288, 540, 2240, 12, 5900, 1769, 540, 1103, 18, 5642, 1318, 7675, 2640, 4727, 5000, 2932, 70, 91, 18, 18149, 38, 1121, 3113, 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, 377, 1071, 7695, 24827, 4195, 2278, 12, 8259, 1042, 1103, 13, 288, 540, 2240, 12, 5900, 1769, 540, 1103, 18, 5642, 1318, 7675, 2640, 4727, 5000, 2932, 70, 91, 18, 18149, 38, 1121, 3113, 315, ...
private void pushCast(ForExpression forExpression, IProxyBeanType type) throws IllegalStateException {
private void pushCast(ForExpression forExpression, IProxyBeanType type) throws IllegalStateException, IllegalArgumentException {
private void pushCast(ForExpression forExpression, IProxyBeanType type) throws IllegalStateException { try { checkForExpression(forExpression); push(type); push(InternalExpressionTypes.CAST_EXPRESSION); pushForExpression(PROCESS_EXPRESSION); pushForExpression(ForExpression.CAST_EXPRESSION); // The next expression must be for the cast expression. processExpression(); } catch (RuntimeException e) { markInvalid(); throw e; } }
8196 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8196/d40f79967a360552542dd5928938c24345a23d88/Expression.java/buggy/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/Expression.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1152, 918, 1817, 9735, 12, 1290, 2300, 364, 2300, 16, 467, 3886, 3381, 559, 618, 13, 1216, 5477, 288, 202, 202, 698, 288, 1082, 202, 1893, 1290, 2300, 12, 1884, 2300, 1769, 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, 225, 202, 1152, 918, 1817, 9735, 12, 1290, 2300, 364, 2300, 16, 467, 3886, 3381, 559, 618, 13, 1216, 5477, 288, 202, 202, 698, 288, 1082, 202, 1893, 1290, 2300, 12, 1884, 2300, 1769, 1082, 2...
peer.register(this.localP2pService); this.acqGroup.add(peer);
if (!peer.equals(this.localP2pService)) { peer.register(this.localP2pService); this.acqGroup.add(peer); }
private void connectingPeer() { for (int index = 0; index < this.peers.size(); index++) { String peerUrl = urlAdderP2PNodeName((String) this.peers.get(index)); try { Node distNode = NodeFactory.getNode(peerUrl); P2PService peer = (P2PService) distNode.getActiveObjects(P2PService.class.getName())[0]; // Send a message to the remote peer to record me peer.register(this.localP2pService); // Add the peer in my group of acquaintances this.acqGroup.add(peer); } catch (Exception e) { logger.debug("The peer at " + peerUrl + " couldn't be contacted", e); } } }
58694 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/58694/7bb4dc1110d8924b68a4c89e0fc33bd16a9e5a03/P2PFirstContact.java/clean/src/org/objectweb/proactive/p2p/service/P2PFirstContact.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 918, 14244, 6813, 1435, 288, 3639, 364, 261, 474, 770, 273, 374, 31, 770, 411, 333, 18, 30502, 18, 1467, 5621, 770, 27245, 288, 5411, 514, 4261, 1489, 273, 880, 986, 264, 52, 22, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 14244, 6813, 1435, 288, 3639, 364, 261, 474, 770, 273, 374, 31, 770, 411, 333, 18, 30502, 18, 1467, 5621, 770, 27245, 288, 5411, 514, 4261, 1489, 273, 880, 986, 264, 52, 22, ...
int fixId = NO_RES;
int fixId = PDEMarkerFactory.NO_RESOLUTION;
private void validateIncludes(IBuildEntry includes, ArrayList sourceIncludes) { if (includes == null) return; String[] tokens = includes.getTokens(); for (int i = 0; i < tokens.length; i++) { String token = tokens[i].trim(); if (token.indexOf("*") != -1) //$NON-NLS-1$ // skip entries with wildcards continue; if (token.equals(".")) //$NON-NLS-1$ // skip . since we know it exists continue; int varStart = token.indexOf("${"); //$NON-NLS-1$ if (varStart != -1 && varStart < token.indexOf("}")) //$NON-NLS-1$ // skip '${x}' variables continue; IResource member = fProject.findMember(token); String message = null; int fixId = NO_RES; if (member == null) { if (sourceIncludes.contains(PROPERTY_SOURCE_PREFIX + token)) continue; if (token.endsWith("/")) //$NON-NLS-1$ message = NLS.bind(PDECoreMessages.BuildErrorReporter_missingFolder, token); else message = NLS.bind(PDECoreMessages.BuildErrorReporter_missingFile, token); fixId = PDEMarkerFactory.B_REMOVAL; } else if (token.endsWith("/") && !(member instanceof IFolder)) { //$NON-NLS-1$ message = NLS.bind(PDECoreMessages.BuildErrorReporter_entiresMustRefDirs, token); fixId = PDEMarkerFactory.B_REMOVE_SLASH_FILE_ENTRY; } else if (!token.endsWith("/") && !(member instanceof IFile)) { //$NON-NLS-1$ message = NLS.bind(PDECoreMessages.BuildErrorReporter_dirsMustEndSlash, token); fixId = PDEMarkerFactory.B_APPEND_SLASH_FOLDER_ENTRY; } if (message != null) prepareError(includes.getName(), token, message, fixId); } }
8783 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8783/4fd02c79db415ececbd7efac8f41f52ff0ceaec1/BuildErrorReporter.java/clean/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/BuildErrorReporter.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1152, 918, 1954, 16815, 12, 45, 3116, 1622, 6104, 16, 2407, 1084, 16815, 13, 288, 202, 202, 430, 261, 18499, 422, 446, 13, 1082, 202, 2463, 31, 202, 202, 780, 8526, 2430, 273, 6104...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1954, 16815, 12, 45, 3116, 1622, 6104, 16, 2407, 1084, 16815, 13, 288, 202, 202, 430, 261, 18499, 422, 446, 13, 1082, 202, 2463, 31, 202, 202, 780, 8526, 2430, 273, 6104...
public void set(org.quickfix.field.PartyID value)
public void set(quickfix.field.PartyID value)
public void set(org.quickfix.field.PartyID value) { setField(value); }
5926 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5926/fecc27f98261270772ff182a1d4dfd94b5daa73d/CrossOrderCancelRequest.java/clean/src/java/src/quickfix/fix43/CrossOrderCancelRequest.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 918, 444, 12, 19525, 904, 18, 1518, 18, 17619, 734, 460, 13, 225, 288, 16331, 12, 1132, 1769, 289, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 918, 444, 12, 19525, 904, 18, 1518, 18, 17619, 734, 460, 13, 225, 288, 16331, 12, 1132, 1769, 289, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
value = new AutoloadSyntax(name, filename.toString());
value = new AutoloadSyntax(name, filename.toString(), tr.getGlobalEnvironment());
public static boolean process(Object names, Object type, Object filename, java.util.Vector forms, ScopeExp defs, Translator tr) { if (names instanceof Pair) { Pair p = (Pair) names; return (process(p.car, type, filename, forms, defs, tr) && process(p.cdr, type, filename, forms, defs, tr)); } if (names == LList.Empty) return true; String fn; int len; /* if (names == "*" && filename instanceof String && (len = (fn = (String) filename).length()) > 2 && fn.charAt(0) == '<' && fn.charAt(len-1) == '>') { fn = fn.substring(1, len-1); try { Class fclass = Class.forName(fn); Object instance = require.find(ctype, env); ...; } catch (ClassNotFoundException ex) { tr.syntaxError("class <"+fn+"> not found"); return false; } } */ if (names instanceof String) { String name = (String) names; Declaration decl = defs.getDefine(name, 'w', tr); Object value; if (filename instanceof String && (len = (fn = (String) filename).length()) > 2 && fn.charAt(0) == '<' && fn.charAt(len-1) == '>') filename = fn.substring(1, len-1); if (type == "<syntax>" || type == "<macro>") value = new AutoloadSyntax(name, filename.toString()); else if (type == "<procedure>" || type == "<interactive>" || type == null) value = new AutoloadProcedure(name, filename.toString()); else { tr.syntaxError("unknown autoload type: " + type); return false; } Expression ex = new QuoteExp(value); decl.setFlag(Declaration.IS_CONSTANT); decl.noteValue(ex); return true; } return false; }
36952 /local/tlutelli/issta_data/temp/all_java3context/java/2006_temp/2006/36952/3144cbe9205778d3ac450c7c9765bc15291f58a3/define_autoload.java/clean/kawa/standard/define_autoload.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 760, 1250, 1207, 12, 921, 1257, 16, 1033, 618, 16, 1033, 1544, 16, 9506, 4202, 2252, 18, 1367, 18, 5018, 10138, 16, 9506, 4202, 5468, 2966, 17588, 16, 18669, 433, 13, 225, 288, 56...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 760, 1250, 1207, 12, 921, 1257, 16, 1033, 618, 16, 1033, 1544, 16, 9506, 4202, 2252, 18, 1367, 18, 5018, 10138, 16, 9506, 4202, 5468, 2966, 17588, 16, 18669, 433, 13, 225, 288, 56...
parseExpression(context);
parseExpression(context, targetNamespace);
public XPath(String xpath, StringPool stringPool, NamespacesScope context) throws XPathException { fExpression = xpath; fStringPool = stringPool; parseExpression(context); } // <init>(String,StringPool,NamespacesScope)
1831 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1831/0622c6defe56e9e4c66eb469c351d4ff12fbc046/XPath.java/buggy/src/org/apache/xerces/validators/schema/identity/XPath.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 10172, 12, 780, 6748, 16, 514, 2864, 533, 2864, 16, 5276, 4996, 3876, 819, 13, 540, 1216, 10172, 503, 288, 3639, 284, 2300, 273, 6748, 31, 3639, 284, 780, 2864, 273, 533, 2864, 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, 10172, 12, 780, 6748, 16, 514, 2864, 533, 2864, 16, 5276, 4996, 3876, 819, 13, 540, 1216, 10172, 503, 288, 3639, 284, 2300, 273, 6748, 31, 3639, 284, 780, 2864, 273, 533, 2864, 31...
throws ParseException, IOException { Expression left = parseMulExpr(lexer);
throws ParseException, IOException { Expression left = parseMulExpr(lexer);
private Expression parseAddExpr( Lexer lexer ) throws ParseException, IOException { Expression left = parseMulExpr(lexer); for (; ;) { Token token = lexer.nextToken(); switch (token.getType()) { case Token.ADD: left = factory.newAddition(left, parseAddExpr(lexer)); break; case Token.SUBTRACT: left = factory.newSubtraction(left, parseAddExpr(lexer)); break; default: lexer.pushBack(token); return left; } } }
2796 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2796/a917aff361c58c31c5dce12a5e8052df6803dbe1/InfixParser.java/buggy/jmock/examples/calculator/src/org/jmock/examples/calculator/InfixParser.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 1152, 5371, 1109, 986, 4742, 12, 14234, 8512, 262, 202, 3639, 1216, 10616, 16, 1860, 288, 202, 202, 2300, 2002, 273, 1109, 27860, 4742, 12, 31731, 1769, 202, 202, 1884, 261, 31, 274,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5371, 1109, 986, 4742, 12, 14234, 8512, 262, 202, 3639, 1216, 10616, 16, 1860, 288, 202, 202, 2300, 2002, 273, 1109, 27860, 4742, 12, 31731, 1769, 202, 202, 1884, 261, 31, 274,...
public void testPublish() throws CruiseControlException { MockSchedule sched = new MockSchedule(); project.setSchedule(sched); MockPublisher publisher = new MockPublisher(); Publisher exceptionThrower = new MockPublisher() { public void publish(Element log) throws CruiseControlException { throw new CruiseControlException("exception"); } }; List publishers = new ArrayList(); publishers.add(publisher); publishers.add(exceptionThrower); publishers.add(publisher); project.setPublishers(publishers); project.setName("projectName"); project.setLabel("label"); //Element element = project.getProjectPropertiesElement(new Date()); project.publish(); assertEquals(2, publisher.getPublishCount()); }
55334 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55334/65a4f612834e8d4d4b579436a6741b7e62b0f8c4/ProjectTest.java/buggy/main/test/net/sourceforge/cruisecontrol/ProjectTest.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1842, 6024, 1435, 1216, 385, 8653, 784, 3367, 503, 288, 3639, 7867, 6061, 23964, 273, 394, 7867, 6061, 5621, 3639, 1984, 18, 542, 6061, 12, 87, 2049, 1769, 3639, 7867, 15960, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 918, 1842, 6024, 1435, 1216, 385, 8653, 784, 3367, 503, 288, 3639, 7867, 6061, 23964, 273, 394, 7867, 6061, 5621, 3639, 1984, 18, 542, 6061, 12, 87, 2049, 1769, 3639, 7867, 15960, 1...
}
}
private void endLogEntry() throws SAXException { checkLastElement(LOGENTRY); lastElement = LOG; for (int i = 0; i < currentFilenames.size(); i++) { RevisionData revisionData = (RevisionData) currentRevisions.get(i); revisionData.setComment(currentRevisionData.getComment()); revisionData.setDate(currentRevisionData.getDate()); revisionData.setLoginName(currentRevisionData.getLoginName()); String currentFilename = currentFilenames.get(i).toString(); boolean isBinary = repositoryFileManager.isBinary(currentFilename); builder.buildFile(currentFilename, isBinary, revisionData.isDeletion(), new HashMap()); builder.buildRevision(revisionData); } }
49097 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49097/a86451bd4356e2e928fa1390c95b028131541159/SvnXmlLogFileHandler.java/buggy/src/net/sf/statcvs/input/SvnXmlLogFileHandler.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 918, 679, 25548, 1435, 1216, 14366, 288, 3639, 866, 3024, 1046, 12, 4842, 19083, 1769, 3639, 1142, 1046, 273, 2018, 31, 3639, 364, 261, 474, 277, 273, 374, 31, 277, 411, 783, 25579,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 679, 25548, 1435, 1216, 14366, 288, 3639, 866, 3024, 1046, 12, 4842, 19083, 1769, 3639, 1142, 1046, 273, 2018, 31, 3639, 364, 261, 474, 277, 273, 374, 31, 277, 411, 783, 25579,...
IChemModel model = (IChemModel) jchemPaintModel.getChemModel().clone();
IChemModel model = null; try { model = (IChemModel) jchemPaintModel.getChemModel().clone(); } catch (CloneNotSupportedException exception) { logger.error("Clone of IChemModel failed: ", exception.getMessage()); logger.debug(exception); return null; }
public Image takeSnapshot() { Image snapImage = null; try { logger.info("Making snapshot... "); Renderer2D r2d = new Renderer2D(jchemPaintModel.getRendererModel()); r2d.setRenderer2DModel(jchemPaintModel.getRendererModel()); IChemModel model = (IChemModel) jchemPaintModel.getChemModel().clone(); IAtomContainer ac = SetOfMoleculesManipulator.getAllInOneContainer(model.getSetOfMolecules()); Dimension dim = GeometryTools.get2DDimension(ac); GeometryTools.translateAllPositive(ac,jchemPaintModel.getRendererModel().getRenderingCoordinates()); snapImage = createImage((int)dim.getWidth()+20, (int)dim.getHeight()+20); Graphics2D snapGraphics = (Graphics2D) snapImage.getGraphics(); snapGraphics.setBackground(Color.WHITE); snapGraphics.clearRect(0,0,(int)dim.getWidth()+20, (int)dim.getHeight()+20); r2d.useScreenSize=false; r2d.paintMolecule(ac, (Graphics2D) snapGraphics,false,true); r2d.useScreenSize=true; logger.info("created..."); logger.debug("painting succeeded."); } catch (NullPointerException e) { snapImage = null; } return snapImage; }
45167 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45167/2b55a607674535cd8492e3539d8f3dce16fc3b92/JChemPaintEditorPanel.java/clean/src/org/openscience/cdk/applications/jchempaint/JChemPaintEditorPanel.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 202, 482, 3421, 4862, 4568, 1435, 202, 95, 202, 202, 2040, 10915, 2040, 273, 446, 31, 202, 202, 698, 202, 202, 95, 1082, 202, 4901, 18, 1376, 2932, 49, 6159, 4439, 2777, 315, 1769, 5411...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3421, 4862, 4568, 1435, 202, 95, 202, 202, 2040, 10915, 2040, 273, 446, 31, 202, 202, 698, 202, 202, 95, 1082, 202, 4901, 18, 1376, 2932, 49, 6159, 4439, 2777, 315, 1769, 5411...
public Call[] getCalls(QName portName) throws ServiceException { if (portName == null) throw new ServiceException("Portname cannot be null"); SEIFactory factory = (SEIFactory) portToImplementationMap.get(portName.getLocalPart()); if( factory == null ) throw new ServiceException("No port for portname: " + portName); OperationInfo[] operationInfos = factory.getOperationInfos(); javax.xml.rpc.Call[] array = new javax.xml.rpc.Call[operationInfos.length]; for (int i = 0; i < operationInfos.length; i++) { OperationInfo operation = operationInfos[i]; array[i] = delegate.createCall(factory.getPortQName(), operation.getOperationName()); } return array; }
12474 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12474/90530c10cd7f4fb72cf8640c4ded62bd7246d536/ServiceImpl.java/clean/modules/axis/src/java/org/apache/geronimo/axis/client/ServiceImpl.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 3049, 8526, 336, 10125, 12, 13688, 1756, 461, 13, 1216, 16489, 288, 7734, 309, 261, 655, 461, 422, 446, 13, 5411, 604, 394, 16489, 2932, 2617, 529, 2780, 506, 446, 8863, 7734, 3174,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3049, 8526, 336, 10125, 12, 13688, 1756, 461, 13, 1216, 16489, 288, 7734, 309, 261, 655, 461, 422, 446, 13, 5411, 604, 394, 16489, 2932, 2617, 529, 2780, 506, 446, 8863, 7734, 3174,...
arg.setValue(arguments[argNr]);
arg.setValue(saved[argNr]);
public Row getUsedArguments(String[] arguments) { Row args = new Row(); // Always at least return an empty row, not null! for (int i = 0; i < nrSteps(); i++) { StepMetaInterface smi = getStep(i).getStepMetaInterface(); Row row = smi.getUsedArguments(); // Get the command line arguments that this step uses. if (row != null) { for (int x = 0; x < row.size(); x++) { Value value = row.getValue(x); String argname = value.getName(); if (args.searchValueIndex(argname) < 0) args.addValue(value); } } } // OK, so perhaps, we can use the arguments from a previous execution? String[] saved = Props.isInitialized() ? Props.getInstance().getLastArguments() : null; // Set the default values on it... // Also change the name to "Argument 1" .. "Argument 10" if (arguments != null) { for (int i = 0; i < args.size(); i++) { Value arg = args.getValue(i); int argNr = Const.toInt(arg.getName(), -1); if (argNr >= 0 && argNr < arguments.length) { arg.setValue(arguments[argNr]); } if (arg.isNull() || arg.getString() == null) // try the saved option... { if (argNr >= 0 && argNr < saved.length && saved[argNr] != null) { arg.setValue(saved[argNr]); } } arg.setName("Argument " + arg.getName()); //$NON-NLS-1$ } } return args; }
58146 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/58146/6e4b56644b6d8f51a5665ceee69777a679de202a/TransMeta.java/clean/kettle/src/be/ibridge/kettle/trans/TransMeta.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 6556, 336, 6668, 4628, 12, 780, 8526, 1775, 13, 565, 288, 3639, 6556, 833, 273, 394, 6556, 5621, 368, 14178, 622, 4520, 327, 392, 1008, 1027, 16, 486, 446, 5, 3639, 364, 261, 474,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 1071, 6556, 336, 6668, 4628, 12, 780, 8526, 1775, 13, 565, 288, 3639, 6556, 833, 273, 394, 6556, 5621, 368, 14178, 622, 4520, 327, 392, 1008, 1027, 16, 486, 446, 5, 3639, 364, 261, 474,...
if (testValue.getKey() == JOB && value.getKey() == AO)
if (key == AO && testValue.getKey() == JOB) /* Migration */
private boolean isValid(BasicMonitoredObject value, Set constraints) { Iterator iter = constraints.iterator(); while (iter.hasNext()) { BasicMonitoredObject testValue = (BasicMonitoredObject) iter.next(); if (testValue.getKey() == JOB && value.getKey() == AO) continue; MonitoredObjectSet test = getValues(value, testValue.getKey(), null); if (!test.contains(testValue)) { return false; } } return true; }
23362 /local/tlutelli/issta_data/temp/all_java2context/java/2006_temp/2006/23362/5501b6f7458bbbfb3fb6e17971df559c9ec40c93/DataAssociation.java/clean/src/org/objectweb/proactive/ic2d/gui/jobmonitor/data/DataAssociation.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 3238, 1250, 4908, 12, 8252, 11415, 20425, 921, 460, 16, 1000, 6237, 13, 288, 3639, 4498, 1400, 273, 6237, 18, 9838, 5621, 3639, 1323, 261, 2165, 18, 5332, 2134, 10756, 288, 5411, 7651, 11...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4908, 12, 8252, 11415, 20425, 921, 460, 16, 1000, 6237, 13, 288, 3639, 4498, 1400, 273, 6237, 18, 9838, 5621, 3639, 1323, 261, 2165, 18, 5332, 2134, 10756, 288, 5411, 7651, 11...
public String getNodeName(){return _objectName.getKeyProperty("node");}
public String getNodeName() { return _objectName.getKeyProperty("node"); }
public String getNodeName(){return _objectName.getKeyProperty("node");}
12474 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12474/a2608ecf073f21457f97954cda18ce59a88fe2c6/Tier.java/clean/modules/clustering/src/java/org/apache/geronimo/clustering/Tier.java
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 514, 21812, 1435, 95, 2463, 389, 1612, 461, 18, 588, 653, 1396, 2932, 2159, 8863, 97, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 282, 1071, 514, 21812, 1435, 95, 2463, 389, 1612, 461, 18, 588, 653, 1396, 2932, 2159, 8863, 97, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...