rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
new IFile[] { testFile1, testFile2, testFile3 },
new IFile[] { emptyTestFile, testFileWithContent, testLinkedFile },
public void testUpdateMultipleMarkerUndoRedo() throws ExecutionException, CoreException { String[] types = new String[] { IMarker.BOOKMARK, IMarker.TASK, CUSTOM_TYPE }; Map[] attrs = new Map[] { getInitialMarkerAttributes(), getInitialMarkerAttributes(), getInitialMarkerAttributes() }; CreateMarkersOperation op = new CreateMarkersOperation(types, attrs, new IFile[] { testFile1, testFile2, testFile3 }, "Create Multiple Markers Same Type Test"); execute(op); UpdateMarkersOperation updateOp = new UpdateMarkersOperation(op .getMarkers(), getUpdatedMarkerAttributes(), "Update Multiple Markers", false); execute(updateOp); validateCreatedMarkers(3, updateOp.getMarkers(), new Map[] { getUpdatedMarkerAttributes(), getUpdatedMarkerAttributes(), getUpdatedMarkerAttributes() }, types); undo(); validateCreatedMarkers(3, updateOp.getMarkers(), attrs, types); redo(); validateCreatedMarkers(3, updateOp.getMarkers(), new Map[] { getUpdatedMarkerAttributes(), getUpdatedMarkerAttributes(), getUpdatedMarkerAttributes() }, types); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3de75189b6b769855f0fc9efca2440b7173c759e/WorkspaceOperationsTests.java/buggy/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/operations/WorkspaceOperationsTests.java
IMarker.BOOKMARK, getInitialMarkerAttributes(), testFile1, "Create Marker Test");
IMarker.BOOKMARK, getInitialMarkerAttributes(), testFileWithContent, "Create Marker Test");
public void testUpdateSingleMarkerUndoRedo() throws ExecutionException, CoreException { CreateMarkersOperation op = new CreateMarkersOperation( IMarker.BOOKMARK, getInitialMarkerAttributes(), testFile1, "Create Marker Test"); execute(op); UpdateMarkersOperation updateOp = new UpdateMarkersOperation(op .getMarkers()[0], getUpdatedMarkerAttributes(), "Update Single Marker", false); execute(updateOp); validateCreatedMarkers(1, updateOp.getMarkers(), new Map[] { getUpdatedMarkerAttributes() }, new String[] { IMarker.BOOKMARK }); undo(); validateCreatedMarkers(1, updateOp.getMarkers(), new Map[] { getInitialMarkerAttributes() }, new String[] { IMarker.BOOKMARK }); redo(); validateCreatedMarkers(1, updateOp.getMarkers(), new Map[] { getUpdatedMarkerAttributes() }, new String[] { IMarker.BOOKMARK }); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3de75189b6b769855f0fc9efca2440b7173c759e/WorkspaceOperationsTests.java/buggy/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/operations/WorkspaceOperationsTests.java
assertTrue("Undo should be OK status", history.undo(context, getMonitor(), null).equals(Status.OK_STATUS));
IStatus status = history.undo(context, getMonitor(), null); assertTrue("Undo should be OK status", status.isOK());
private void undo() throws ExecutionException { assertTrue("Operation can be undone", history.canUndo(context)); assertTrue("Undo should be OK status", history.undo(context, getMonitor(), null).equals(Status.OK_STATUS)); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3de75189b6b769855f0fc9efca2440b7173c759e/WorkspaceOperationsTests.java/buggy/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/operations/WorkspaceOperationsTests.java
try { sacSelectorList = CSOM_PARSER.parseSelectors(new org.w3c.css.sac.InputSource(new java.io.StringReader(sacRule.getSelectorText()))); } catch (java.io.IOException ex) { throw new XRRuntimeException("Could not pull SAC Selectors from SAC CSSStyleRule.", ex); }
sacSelectorList = ((CSSStyleRuleImpl) sacRule).getSelectorList(); /* sacSelectorList = CSOM_PARSER.parseSelectors(new org.w3c.css.sac.InputSource(new java.io.StringReader(sacRule.getSelectorText()))); */
private void pullSelectorsFromDOMRule(org.w3c.dom.css.CSSStyleRule sacRule) { try { // note, we parse the selector for this instance, not the one from the CSS Style, which // might still be multi-part; selector for TODO is always single (no commas) sacSelectorList = CSOM_PARSER.parseSelectors(new org.w3c.css.sac.InputSource(new java.io.StringReader(sacRule.getSelectorText()))); } catch (java.io.IOException ex) { throw new XRRuntimeException("Could not pull SAC Selectors from SAC CSSStyleRule.", ex); } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/c96efe21dd32b0a4f0420c8495d49144792cbc9d/Ruleset.java/buggy/src/java/org/xhtmlrenderer/css/sheet/Ruleset.java
String fingerprint = null; if (elementStyling == null) { StringBuffer sb = new StringBuffer(); for (java.util.Iterator i = getMatchedRulesets(matchedSelectors); i.hasNext();) { sb.append(i.next().hashCode()); sb.append(":");
java.util.List propList = new java.util.LinkedList(); for (java.util.Iterator i = getMatchedRulesets(matchedSelectors); i.hasNext();) { org.xhtmlrenderer.css.sheet.Ruleset rs = (org.xhtmlrenderer.css.sheet.Ruleset) i.next(); for (java.util.Iterator j = rs.getPropertyDeclarations(); j.hasNext();) { propList.add((org.xhtmlrenderer.css.sheet.PropertyDeclaration) j.next());
CascadedStyle createCascadedStyle(org.w3c.dom.Element e, List matchedSelectors) { CascadedStyle cs = null; org.xhtmlrenderer.css.sheet.Ruleset elementStyling = getElementStyle(e); String fingerprint = null; if (elementStyling == null) {//try to re-use a CascadedStyle StringBuffer sb = new StringBuffer(); for (java.util.Iterator i = getMatchedRulesets(matchedSelectors); i.hasNext();) { sb.append(i.next().hashCode()); sb.append(":"); } fingerprint = sb.toString(); if (_csCache == null) { _csCache = new java.util.HashMap(); } cs = (CascadedStyle) _csCache.get(fingerprint); } if (cs == null) { java.util.List propList = new java.util.LinkedList(); for (java.util.Iterator i = getMatchedRulesets(matchedSelectors); i.hasNext();) { org.xhtmlrenderer.css.sheet.Ruleset rs = (org.xhtmlrenderer.css.sheet.Ruleset) i.next(); for (java.util.Iterator j = rs.getPropertyDeclarations(); j.hasNext();) { propList.add((org.xhtmlrenderer.css.sheet.PropertyDeclaration) j.next()); } } if (elementStyling != null) { for (java.util.Iterator j = elementStyling.getPropertyDeclarations(); j.hasNext();) { propList.add((org.xhtmlrenderer.css.sheet.PropertyDeclaration) j.next()); } } if (propList.size() == 0) cs = CascadedStyle.emptyCascadedStyle; else cs = new CascadedStyle(propList.iterator()); if (elementStyling == null) { _csCache.put(fingerprint, cs); } } return cs; }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/3b0c5b292a89ef497d36c49cc4a65213722313ac/Matcher.java/clean/src/java/org/xhtmlrenderer/css/newmatch/Matcher.java
fingerprint = sb.toString(); if (_csCache == null) { _csCache = new java.util.HashMap();
} if (elementStyling != null) { for (java.util.Iterator j = elementStyling.getPropertyDeclarations(); j.hasNext();) { propList.add((org.xhtmlrenderer.css.sheet.PropertyDeclaration) j.next());
CascadedStyle createCascadedStyle(org.w3c.dom.Element e, List matchedSelectors) { CascadedStyle cs = null; org.xhtmlrenderer.css.sheet.Ruleset elementStyling = getElementStyle(e); String fingerprint = null; if (elementStyling == null) {//try to re-use a CascadedStyle StringBuffer sb = new StringBuffer(); for (java.util.Iterator i = getMatchedRulesets(matchedSelectors); i.hasNext();) { sb.append(i.next().hashCode()); sb.append(":"); } fingerprint = sb.toString(); if (_csCache == null) { _csCache = new java.util.HashMap(); } cs = (CascadedStyle) _csCache.get(fingerprint); } if (cs == null) { java.util.List propList = new java.util.LinkedList(); for (java.util.Iterator i = getMatchedRulesets(matchedSelectors); i.hasNext();) { org.xhtmlrenderer.css.sheet.Ruleset rs = (org.xhtmlrenderer.css.sheet.Ruleset) i.next(); for (java.util.Iterator j = rs.getPropertyDeclarations(); j.hasNext();) { propList.add((org.xhtmlrenderer.css.sheet.PropertyDeclaration) j.next()); } } if (elementStyling != null) { for (java.util.Iterator j = elementStyling.getPropertyDeclarations(); j.hasNext();) { propList.add((org.xhtmlrenderer.css.sheet.PropertyDeclaration) j.next()); } } if (propList.size() == 0) cs = CascadedStyle.emptyCascadedStyle; else cs = new CascadedStyle(propList.iterator()); if (elementStyling == null) { _csCache.put(fingerprint, cs); } } return cs; }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/3b0c5b292a89ef497d36c49cc4a65213722313ac/Matcher.java/clean/src/java/org/xhtmlrenderer/css/newmatch/Matcher.java
cs = (CascadedStyle) _csCache.get(fingerprint);
CascadedStyle createCascadedStyle(org.w3c.dom.Element e, List matchedSelectors) { CascadedStyle cs = null; org.xhtmlrenderer.css.sheet.Ruleset elementStyling = getElementStyle(e); String fingerprint = null; if (elementStyling == null) {//try to re-use a CascadedStyle StringBuffer sb = new StringBuffer(); for (java.util.Iterator i = getMatchedRulesets(matchedSelectors); i.hasNext();) { sb.append(i.next().hashCode()); sb.append(":"); } fingerprint = sb.toString(); if (_csCache == null) { _csCache = new java.util.HashMap(); } cs = (CascadedStyle) _csCache.get(fingerprint); } if (cs == null) { java.util.List propList = new java.util.LinkedList(); for (java.util.Iterator i = getMatchedRulesets(matchedSelectors); i.hasNext();) { org.xhtmlrenderer.css.sheet.Ruleset rs = (org.xhtmlrenderer.css.sheet.Ruleset) i.next(); for (java.util.Iterator j = rs.getPropertyDeclarations(); j.hasNext();) { propList.add((org.xhtmlrenderer.css.sheet.PropertyDeclaration) j.next()); } } if (elementStyling != null) { for (java.util.Iterator j = elementStyling.getPropertyDeclarations(); j.hasNext();) { propList.add((org.xhtmlrenderer.css.sheet.PropertyDeclaration) j.next()); } } if (propList.size() == 0) cs = CascadedStyle.emptyCascadedStyle; else cs = new CascadedStyle(propList.iterator()); if (elementStyling == null) { _csCache.put(fingerprint, cs); } } return cs; }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/3b0c5b292a89ef497d36c49cc4a65213722313ac/Matcher.java/clean/src/java/org/xhtmlrenderer/css/newmatch/Matcher.java
if (cs == null) { java.util.List propList = new java.util.LinkedList(); for (java.util.Iterator i = getMatchedRulesets(matchedSelectors); i.hasNext();) { org.xhtmlrenderer.css.sheet.Ruleset rs = (org.xhtmlrenderer.css.sheet.Ruleset) i.next(); for (java.util.Iterator j = rs.getPropertyDeclarations(); j.hasNext();) { propList.add((org.xhtmlrenderer.css.sheet.PropertyDeclaration) j.next()); } } if (elementStyling != null) { for (java.util.Iterator j = elementStyling.getPropertyDeclarations(); j.hasNext();) { propList.add((org.xhtmlrenderer.css.sheet.PropertyDeclaration) j.next()); } } if (propList.size() == 0) cs = CascadedStyle.emptyCascadedStyle; else cs = new CascadedStyle(propList.iterator()); if (elementStyling == null) {
if (propList.size() == 0) cs = CascadedStyle.emptyCascadedStyle; else { cs = new CascadedStyle(propList.iterator()); String fingerprint = cs.getFingerprint(); CascadedStyle internal = (CascadedStyle) _csCache.get(fingerprint); if (internal != null) { cs = internal; } else {
CascadedStyle createCascadedStyle(org.w3c.dom.Element e, List matchedSelectors) { CascadedStyle cs = null; org.xhtmlrenderer.css.sheet.Ruleset elementStyling = getElementStyle(e); String fingerprint = null; if (elementStyling == null) {//try to re-use a CascadedStyle StringBuffer sb = new StringBuffer(); for (java.util.Iterator i = getMatchedRulesets(matchedSelectors); i.hasNext();) { sb.append(i.next().hashCode()); sb.append(":"); } fingerprint = sb.toString(); if (_csCache == null) { _csCache = new java.util.HashMap(); } cs = (CascadedStyle) _csCache.get(fingerprint); } if (cs == null) { java.util.List propList = new java.util.LinkedList(); for (java.util.Iterator i = getMatchedRulesets(matchedSelectors); i.hasNext();) { org.xhtmlrenderer.css.sheet.Ruleset rs = (org.xhtmlrenderer.css.sheet.Ruleset) i.next(); for (java.util.Iterator j = rs.getPropertyDeclarations(); j.hasNext();) { propList.add((org.xhtmlrenderer.css.sheet.PropertyDeclaration) j.next()); } } if (elementStyling != null) { for (java.util.Iterator j = elementStyling.getPropertyDeclarations(); j.hasNext();) { propList.add((org.xhtmlrenderer.css.sheet.PropertyDeclaration) j.next()); } } if (propList.size() == 0) cs = CascadedStyle.emptyCascadedStyle; else cs = new CascadedStyle(propList.iterator()); if (elementStyling == null) { _csCache.put(fingerprint, cs); } } return cs; }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/3b0c5b292a89ef497d36c49cc4a65213722313ac/Matcher.java/clean/src/java/org/xhtmlrenderer/css/newmatch/Matcher.java
CascadedStyle createCascadedStyle(org.w3c.dom.Element e, List matchedSelectors) { CascadedStyle cs = null; org.xhtmlrenderer.css.sheet.Ruleset elementStyling = getElementStyle(e); String fingerprint = null; if (elementStyling == null) {//try to re-use a CascadedStyle StringBuffer sb = new StringBuffer(); for (java.util.Iterator i = getMatchedRulesets(matchedSelectors); i.hasNext();) { sb.append(i.next().hashCode()); sb.append(":"); } fingerprint = sb.toString(); if (_csCache == null) { _csCache = new java.util.HashMap(); } cs = (CascadedStyle) _csCache.get(fingerprint); } if (cs == null) { java.util.List propList = new java.util.LinkedList(); for (java.util.Iterator i = getMatchedRulesets(matchedSelectors); i.hasNext();) { org.xhtmlrenderer.css.sheet.Ruleset rs = (org.xhtmlrenderer.css.sheet.Ruleset) i.next(); for (java.util.Iterator j = rs.getPropertyDeclarations(); j.hasNext();) { propList.add((org.xhtmlrenderer.css.sheet.PropertyDeclaration) j.next()); } } if (elementStyling != null) { for (java.util.Iterator j = elementStyling.getPropertyDeclarations(); j.hasNext();) { propList.add((org.xhtmlrenderer.css.sheet.PropertyDeclaration) j.next()); } } if (propList.size() == 0) cs = CascadedStyle.emptyCascadedStyle; else cs = new CascadedStyle(propList.iterator()); if (elementStyling == null) { _csCache.put(fingerprint, cs); } } return cs; }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/3b0c5b292a89ef497d36c49cc4a65213722313ac/Matcher.java/clean/src/java/org/xhtmlrenderer/css/newmatch/Matcher.java
String fingerprint = null; StringBuffer sb = new StringBuffer();
CascadedStyle cs = null; java.util.List propList = new java.util.LinkedList();
private void resolvePseudoElements(org.w3c.dom.Element e, HashMap pseudoSelectors) { java.util.Iterator si = pseudoSelectors.entrySet().iterator(); if (!si.hasNext()) { return; } java.util.Map pelm = new java.util.HashMap(); while (si.hasNext()) { java.util.Map.Entry me = (java.util.Map.Entry) si.next(); String fingerprint = null; //try to re-use a CascadedStyle StringBuffer sb = new StringBuffer(); for (java.util.Iterator i = getSelectedRulesets((java.util.List) me.getValue()); i.hasNext();) { sb.append(i.next().hashCode()); sb.append(":"); } fingerprint = sb.toString(); if (_csCache == null) { _csCache = new java.util.HashMap(); } CascadedStyle cs = (CascadedStyle) _csCache.get(fingerprint); if (cs == null) { java.util.List propList = new java.util.LinkedList(); for (java.util.Iterator i = getSelectedRulesets((java.util.List) me.getValue()); i.hasNext();) { org.xhtmlrenderer.css.sheet.Ruleset rs = (org.xhtmlrenderer.css.sheet.Ruleset) i.next(); for (java.util.Iterator j = rs.getPropertyDeclarations(); j.hasNext();) { propList.add((org.xhtmlrenderer.css.sheet.PropertyDeclaration) j.next()); } } if (propList.size() == 0) cs = CascadedStyle.emptyCascadedStyle; else cs = new CascadedStyle(propList.iterator()); _csCache.put(fingerprint, cs); } pelm.put(me.getKey(), cs); } _peMap.put(e, pelm); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/3b0c5b292a89ef497d36c49cc4a65213722313ac/Matcher.java/clean/src/java/org/xhtmlrenderer/css/newmatch/Matcher.java
sb.append(i.next().hashCode()); sb.append(":");
org.xhtmlrenderer.css.sheet.Ruleset rs = (org.xhtmlrenderer.css.sheet.Ruleset) i.next(); for (java.util.Iterator j = rs.getPropertyDeclarations(); j.hasNext();) { propList.add((org.xhtmlrenderer.css.sheet.PropertyDeclaration) j.next()); }
private void resolvePseudoElements(org.w3c.dom.Element e, HashMap pseudoSelectors) { java.util.Iterator si = pseudoSelectors.entrySet().iterator(); if (!si.hasNext()) { return; } java.util.Map pelm = new java.util.HashMap(); while (si.hasNext()) { java.util.Map.Entry me = (java.util.Map.Entry) si.next(); String fingerprint = null; //try to re-use a CascadedStyle StringBuffer sb = new StringBuffer(); for (java.util.Iterator i = getSelectedRulesets((java.util.List) me.getValue()); i.hasNext();) { sb.append(i.next().hashCode()); sb.append(":"); } fingerprint = sb.toString(); if (_csCache == null) { _csCache = new java.util.HashMap(); } CascadedStyle cs = (CascadedStyle) _csCache.get(fingerprint); if (cs == null) { java.util.List propList = new java.util.LinkedList(); for (java.util.Iterator i = getSelectedRulesets((java.util.List) me.getValue()); i.hasNext();) { org.xhtmlrenderer.css.sheet.Ruleset rs = (org.xhtmlrenderer.css.sheet.Ruleset) i.next(); for (java.util.Iterator j = rs.getPropertyDeclarations(); j.hasNext();) { propList.add((org.xhtmlrenderer.css.sheet.PropertyDeclaration) j.next()); } } if (propList.size() == 0) cs = CascadedStyle.emptyCascadedStyle; else cs = new CascadedStyle(propList.iterator()); _csCache.put(fingerprint, cs); } pelm.put(me.getKey(), cs); } _peMap.put(e, pelm); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/3b0c5b292a89ef497d36c49cc4a65213722313ac/Matcher.java/clean/src/java/org/xhtmlrenderer/css/newmatch/Matcher.java
fingerprint = sb.toString(); if (_csCache == null) { _csCache = new java.util.HashMap(); } CascadedStyle cs = (CascadedStyle) _csCache.get(fingerprint); if (cs == null) { java.util.List propList = new java.util.LinkedList(); for (java.util.Iterator i = getSelectedRulesets((java.util.List) me.getValue()); i.hasNext();) { org.xhtmlrenderer.css.sheet.Ruleset rs = (org.xhtmlrenderer.css.sheet.Ruleset) i.next(); for (java.util.Iterator j = rs.getPropertyDeclarations(); j.hasNext();) { propList.add((org.xhtmlrenderer.css.sheet.PropertyDeclaration) j.next()); }
if (propList.size() == 0) cs = CascadedStyle.emptyCascadedStyle; else { cs = new CascadedStyle(propList.iterator()); String fingerprint = cs.getFingerprint(); CascadedStyle internal = (CascadedStyle) _csCache.get(fingerprint); if (internal != null) { cs = internal; } else { _csCache.put(fingerprint, cs);
private void resolvePseudoElements(org.w3c.dom.Element e, HashMap pseudoSelectors) { java.util.Iterator si = pseudoSelectors.entrySet().iterator(); if (!si.hasNext()) { return; } java.util.Map pelm = new java.util.HashMap(); while (si.hasNext()) { java.util.Map.Entry me = (java.util.Map.Entry) si.next(); String fingerprint = null; //try to re-use a CascadedStyle StringBuffer sb = new StringBuffer(); for (java.util.Iterator i = getSelectedRulesets((java.util.List) me.getValue()); i.hasNext();) { sb.append(i.next().hashCode()); sb.append(":"); } fingerprint = sb.toString(); if (_csCache == null) { _csCache = new java.util.HashMap(); } CascadedStyle cs = (CascadedStyle) _csCache.get(fingerprint); if (cs == null) { java.util.List propList = new java.util.LinkedList(); for (java.util.Iterator i = getSelectedRulesets((java.util.List) me.getValue()); i.hasNext();) { org.xhtmlrenderer.css.sheet.Ruleset rs = (org.xhtmlrenderer.css.sheet.Ruleset) i.next(); for (java.util.Iterator j = rs.getPropertyDeclarations(); j.hasNext();) { propList.add((org.xhtmlrenderer.css.sheet.PropertyDeclaration) j.next()); } } if (propList.size() == 0) cs = CascadedStyle.emptyCascadedStyle; else cs = new CascadedStyle(propList.iterator()); _csCache.put(fingerprint, cs); } pelm.put(me.getKey(), cs); } _peMap.put(e, pelm); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/3b0c5b292a89ef497d36c49cc4a65213722313ac/Matcher.java/clean/src/java/org/xhtmlrenderer/css/newmatch/Matcher.java
if (propList.size() == 0) cs = CascadedStyle.emptyCascadedStyle; else cs = new CascadedStyle(propList.iterator()); _csCache.put(fingerprint, cs);
private void resolvePseudoElements(org.w3c.dom.Element e, HashMap pseudoSelectors) { java.util.Iterator si = pseudoSelectors.entrySet().iterator(); if (!si.hasNext()) { return; } java.util.Map pelm = new java.util.HashMap(); while (si.hasNext()) { java.util.Map.Entry me = (java.util.Map.Entry) si.next(); String fingerprint = null; //try to re-use a CascadedStyle StringBuffer sb = new StringBuffer(); for (java.util.Iterator i = getSelectedRulesets((java.util.List) me.getValue()); i.hasNext();) { sb.append(i.next().hashCode()); sb.append(":"); } fingerprint = sb.toString(); if (_csCache == null) { _csCache = new java.util.HashMap(); } CascadedStyle cs = (CascadedStyle) _csCache.get(fingerprint); if (cs == null) { java.util.List propList = new java.util.LinkedList(); for (java.util.Iterator i = getSelectedRulesets((java.util.List) me.getValue()); i.hasNext();) { org.xhtmlrenderer.css.sheet.Ruleset rs = (org.xhtmlrenderer.css.sheet.Ruleset) i.next(); for (java.util.Iterator j = rs.getPropertyDeclarations(); j.hasNext();) { propList.add((org.xhtmlrenderer.css.sheet.PropertyDeclaration) j.next()); } } if (propList.size() == 0) cs = CascadedStyle.emptyCascadedStyle; else cs = new CascadedStyle(propList.iterator()); _csCache.put(fingerprint, cs); } pelm.put(me.getKey(), cs); } _peMap.put(e, pelm); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/3b0c5b292a89ef497d36c49cc4a65213722313ac/Matcher.java/clean/src/java/org/xhtmlrenderer/css/newmatch/Matcher.java
Relative.translateRelative(ctx);
Relative.translateRelative(ctx, true);
public static void paintRelative(Context ctx, Box block, boolean restyle) { Relative.translateRelative(ctx); paintNormal(ctx, block, restyle); Relative.untranslateRelative(ctx); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/01fe5f6295fdbc46194c11fca8c5668798faefcb/BoxRendering.java/buggy/src/java/org/xhtmlrenderer/render/BoxRendering.java
Relative.untranslateRelative(ctx);
Relative.untranslateRelative(ctx, true);
public static void paintRelative(Context ctx, Box block, boolean restyle) { Relative.translateRelative(ctx); paintNormal(ctx, block, restyle); Relative.untranslateRelative(ctx); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/01fe5f6295fdbc46194c11fca8c5668798faefcb/BoxRendering.java/buggy/src/java/org/xhtmlrenderer/render/BoxRendering.java
super(runtime, runtime.getClasses().getClassClass(), null, null, "Object");
super(runtime, null /*Would be Class if it existed yet */, null, null, "Object");
public ObjectMetaClass(Ruby runtime) { super(runtime, runtime.getClasses().getClassClass(), null, null, "Object"); this.builtinClass = RubyObject.class; initializeClass(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ca6b16e996ea9af83ce593594b9c69b9364a9924/ObjectMetaClass.java/clean/src/org/jruby/runtime/builtin/meta/ObjectMetaClass.java
User cUser = UserDirectoryService.getCurrentUser();
private void sendSiteRequest(SessionState state, String request, int requestListSize, List requestFields) { boolean sendEmailToRequestee = false; StringBuffer buf = new StringBuffer(); // get the request email from configuration String requestEmail = ServerConfigurationService.getString("setup.request", null); if (requestEmail == null) { M_log.warn(this + " - no 'setup.request' in configuration"); } else { String noEmailInIdAccountName = ServerConfigurationService.getString("noEmailInIdAccountName", ""); SiteInfo siteInfo = (SiteInfo)state.getAttribute(STATE_SITE_INFO); Site site = getStateSite(state); String id = site.getId(); String title = site.getTitle(); Time time = TimeService.newTime(); String local_time = time.toStringLocalTime(); String local_date = time.toStringLocalDate(); Term term = null; boolean termExist = false; if (state.getAttribute(STATE_TERM_SELECTED) != null) { termExist = true; term = (Term) state.getAttribute(STATE_TERM_SELECTED); } String productionSiteName = ServerConfigurationService.getServerName(); String from = NULL_STRING; String to = NULL_STRING; String headerTo = NULL_STRING; String replyTo = NULL_STRING; String message_subject = NULL_STRING; String content = NULL_STRING; String sessionUserName = UserDirectoryService.getCurrentUser().getDisplayName(); String sessionUserId = StringUtil.trimToZero(SessionManager.getCurrentSessionUserId()); String additional = NULL_STRING; if (request.equals("new")) { additional = siteInfo.getAdditional(); } else { additional = (String)state.getAttribute(FORM_ADDITIONAL); } boolean isFutureTerm = false; if (state.getAttribute(STATE_FUTURE_TERM_SELECTED) != null && ((Boolean) state.getAttribute(STATE_FUTURE_TERM_SELECTED)).booleanValue()) { isFutureTerm = true; } // message subject if (termExist) { message_subject = rb.getString("java.sitereqfrom")+" " + sessionUserName + " " + rb.getString("java.for") + " " + term.getId(); } else { message_subject = rb.getString("java.official")+" " + sessionUserName; } // there is no offical instructor for future term sites String requestId = (String) state.getAttribute(STATE_SITE_QUEST_UNIQNAME); if (!isFutureTerm) { //To site quest account - the instructor of record's if (requestId != null) { try { User instructor = UserDirectoryService.getUser(requestId); from = requestEmail; to = instructor.getEmail(); headerTo = instructor.getEmail(); replyTo = requestEmail; buf.append(rb.getString("java.hello")+" \n\n"); buf.append(rb.getString("java.receiv")+" " + sessionUserName + ", "); buf.append(rb.getString("java.who")+"\n"); if (termExist) { buf.append(term.getTerm() + " " + term.getYear() + "\n"); } // what are the required fields shown in the UI List requiredFields = CourseManagementService.getCourseIdRequiredFields(); for (int i = 0; i < requestListSize; i++) { List requiredFieldList = (List) requestFields.get(i); for (int j = 0; j < requiredFieldList.size(); j++) { String requiredField = (String) requiredFields.get(j); buf.append(requiredField +"\t" + requiredFieldList.get(j) + "\n"); } } buf.append("\n\n"+rb.getString("java.according")+" " + sessionUserName + " "+rb.getString("java.record")); buf.append(" " + rb.getString("java.canyou")+" " + sessionUserName + " "+ rb.getString("java.assoc")+"\n\n"); buf.append(rb.getString("java.respond")+" " + sessionUserName + rb.getString("java.appoint")+"\n\n"); buf.append(rb.getString("java.thanks")+"\n"); buf.append(productionSiteName + " "+rb.getString("java.support")); content = buf.toString(); // send the email EmailService.send(from, to, message_subject, content, headerTo, replyTo, null); // email has been sent successfully sendEmailToRequestee = true; } catch (UserNotDefinedException ee) { } // try } } //To Support from = UserDirectoryService.getCurrentUser().getEmail(); to = requestEmail; headerTo = requestEmail; replyTo = UserDirectoryService.getCurrentUser().getEmail(); buf.setLength(0); buf.append(rb.getString("java.to")+"\t\t" + productionSiteName + " "+rb.getString("java.supp")+"\n"); buf.append("\n"+rb.getString("java.from")+"\t" + sessionUserName + "\n"); if (request.equals("new")) { buf.append(rb.getString("java.subj")+"\t"+rb.getString("java.sitereq")+"\n"); } else { buf.append(rb.getString("java.subj")+"\t"+rb.getString("java.sitechreq")+"\n"); } buf.append(rb.getString("java.date")+"\t" + local_date + " " + local_time + "\n\n"); if (request.equals("new")) { buf.append(rb.getString("java.approval") + " " + productionSiteName + " "+rb.getString("java.coursesite")+" "); } else { buf.append(rb.getString("java.approval2")+" " + productionSiteName + " "+rb.getString("java.coursesite")+" "); } if (termExist) { buf.append(term.getTerm() + " " + term.getYear()); } if (requestListSize >1) { buf.append(" "+rb.getString("java.forthese")+" " + requestListSize + " "+rb.getString("java.sections")+"\n\n"); } else { buf.append(" "+rb.getString("java.forthis")+"\n\n"); } //what are the required fields shown in the UI List requiredFields = CourseManagementService.getCourseIdRequiredFields(); for (int i = 0; i < requestListSize; i++) { List requiredFieldList = (List) requestFields.get(i); for (int j = 0; j < requiredFieldList.size(); j++) { String requiredField = (String) requiredFields.get(j); buf.append(requiredField +"\t" + requiredFieldList.get(j) + "\n"); } } buf.append(rb.getString("java.name")+"\t" + sessionUserName + " (" + noEmailInIdAccountName + " " + sessionUserName + ")\n"); buf.append(rb.getString("java.email")+"\t" + replyTo + "\n\n"); buf.append(rb.getString("java.sitetitle")+"\t" + title + "\n"); buf.append(rb.getString("java.siteid")+"\t" + id + "\n"); buf.append(rb.getString("java.siteinstr")+"\n" + additional + "\n\n"); if (!isFutureTerm) { if (sendEmailToRequestee) { buf.append(rb.getString("java.authoriz")+" " + requestId + " "+rb.getString("java.asreq")); } else { buf.append(rb.getString("java.thesiteemail")+" " + requestId + " "+rb.getString("java.asreq")); } } content = buf.toString(); EmailService.send(from, to, message_subject, content, headerTo, replyTo, null); //To the Instructor User curUser = UserDirectoryService.getCurrentUser(); from = requestEmail; to = curUser.getEmail(); headerTo = to; replyTo = to; buf.setLength(0); buf.append(rb.getString("java.isbeing")+" "); buf.append(rb.getString("java.meantime")+"\n\n"); buf.append(rb.getString("java.copy")+"\n\n"); buf.append(content); buf.append("\n"+rb.getString("java.wish")+" " + requestEmail); content = buf.toString(); EmailService.send(from, to, message_subject, content, headerTo, replyTo, null); state.setAttribute(REQUEST_SENT, new Boolean(true)); } // if } // sendSiteRequest
54846 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54846/c056181efb440533c058b7fd915da25fb81424b9/SiteAction.java/buggy/site-manage-tool/tool/src/java/org/sakaiproject/site/tool/SiteAction.java
String sessionUserName = UserDirectoryService.getCurrentUser().getDisplayName(); String sessionUserId = StringUtil.trimToZero(SessionManager.getCurrentSessionUserId());
String sessionUserName = cUser.getDisplayName();
private void sendSiteRequest(SessionState state, String request, int requestListSize, List requestFields) { boolean sendEmailToRequestee = false; StringBuffer buf = new StringBuffer(); // get the request email from configuration String requestEmail = ServerConfigurationService.getString("setup.request", null); if (requestEmail == null) { M_log.warn(this + " - no 'setup.request' in configuration"); } else { String noEmailInIdAccountName = ServerConfigurationService.getString("noEmailInIdAccountName", ""); SiteInfo siteInfo = (SiteInfo)state.getAttribute(STATE_SITE_INFO); Site site = getStateSite(state); String id = site.getId(); String title = site.getTitle(); Time time = TimeService.newTime(); String local_time = time.toStringLocalTime(); String local_date = time.toStringLocalDate(); Term term = null; boolean termExist = false; if (state.getAttribute(STATE_TERM_SELECTED) != null) { termExist = true; term = (Term) state.getAttribute(STATE_TERM_SELECTED); } String productionSiteName = ServerConfigurationService.getServerName(); String from = NULL_STRING; String to = NULL_STRING; String headerTo = NULL_STRING; String replyTo = NULL_STRING; String message_subject = NULL_STRING; String content = NULL_STRING; String sessionUserName = UserDirectoryService.getCurrentUser().getDisplayName(); String sessionUserId = StringUtil.trimToZero(SessionManager.getCurrentSessionUserId()); String additional = NULL_STRING; if (request.equals("new")) { additional = siteInfo.getAdditional(); } else { additional = (String)state.getAttribute(FORM_ADDITIONAL); } boolean isFutureTerm = false; if (state.getAttribute(STATE_FUTURE_TERM_SELECTED) != null && ((Boolean) state.getAttribute(STATE_FUTURE_TERM_SELECTED)).booleanValue()) { isFutureTerm = true; } // message subject if (termExist) { message_subject = rb.getString("java.sitereqfrom")+" " + sessionUserName + " " + rb.getString("java.for") + " " + term.getId(); } else { message_subject = rb.getString("java.official")+" " + sessionUserName; } // there is no offical instructor for future term sites String requestId = (String) state.getAttribute(STATE_SITE_QUEST_UNIQNAME); if (!isFutureTerm) { //To site quest account - the instructor of record's if (requestId != null) { try { User instructor = UserDirectoryService.getUser(requestId); from = requestEmail; to = instructor.getEmail(); headerTo = instructor.getEmail(); replyTo = requestEmail; buf.append(rb.getString("java.hello")+" \n\n"); buf.append(rb.getString("java.receiv")+" " + sessionUserName + ", "); buf.append(rb.getString("java.who")+"\n"); if (termExist) { buf.append(term.getTerm() + " " + term.getYear() + "\n"); } // what are the required fields shown in the UI List requiredFields = CourseManagementService.getCourseIdRequiredFields(); for (int i = 0; i < requestListSize; i++) { List requiredFieldList = (List) requestFields.get(i); for (int j = 0; j < requiredFieldList.size(); j++) { String requiredField = (String) requiredFields.get(j); buf.append(requiredField +"\t" + requiredFieldList.get(j) + "\n"); } } buf.append("\n\n"+rb.getString("java.according")+" " + sessionUserName + " "+rb.getString("java.record")); buf.append(" " + rb.getString("java.canyou")+" " + sessionUserName + " "+ rb.getString("java.assoc")+"\n\n"); buf.append(rb.getString("java.respond")+" " + sessionUserName + rb.getString("java.appoint")+"\n\n"); buf.append(rb.getString("java.thanks")+"\n"); buf.append(productionSiteName + " "+rb.getString("java.support")); content = buf.toString(); // send the email EmailService.send(from, to, message_subject, content, headerTo, replyTo, null); // email has been sent successfully sendEmailToRequestee = true; } catch (UserNotDefinedException ee) { } // try } } //To Support from = UserDirectoryService.getCurrentUser().getEmail(); to = requestEmail; headerTo = requestEmail; replyTo = UserDirectoryService.getCurrentUser().getEmail(); buf.setLength(0); buf.append(rb.getString("java.to")+"\t\t" + productionSiteName + " "+rb.getString("java.supp")+"\n"); buf.append("\n"+rb.getString("java.from")+"\t" + sessionUserName + "\n"); if (request.equals("new")) { buf.append(rb.getString("java.subj")+"\t"+rb.getString("java.sitereq")+"\n"); } else { buf.append(rb.getString("java.subj")+"\t"+rb.getString("java.sitechreq")+"\n"); } buf.append(rb.getString("java.date")+"\t" + local_date + " " + local_time + "\n\n"); if (request.equals("new")) { buf.append(rb.getString("java.approval") + " " + productionSiteName + " "+rb.getString("java.coursesite")+" "); } else { buf.append(rb.getString("java.approval2")+" " + productionSiteName + " "+rb.getString("java.coursesite")+" "); } if (termExist) { buf.append(term.getTerm() + " " + term.getYear()); } if (requestListSize >1) { buf.append(" "+rb.getString("java.forthese")+" " + requestListSize + " "+rb.getString("java.sections")+"\n\n"); } else { buf.append(" "+rb.getString("java.forthis")+"\n\n"); } //what are the required fields shown in the UI List requiredFields = CourseManagementService.getCourseIdRequiredFields(); for (int i = 0; i < requestListSize; i++) { List requiredFieldList = (List) requestFields.get(i); for (int j = 0; j < requiredFieldList.size(); j++) { String requiredField = (String) requiredFields.get(j); buf.append(requiredField +"\t" + requiredFieldList.get(j) + "\n"); } } buf.append(rb.getString("java.name")+"\t" + sessionUserName + " (" + noEmailInIdAccountName + " " + sessionUserName + ")\n"); buf.append(rb.getString("java.email")+"\t" + replyTo + "\n\n"); buf.append(rb.getString("java.sitetitle")+"\t" + title + "\n"); buf.append(rb.getString("java.siteid")+"\t" + id + "\n"); buf.append(rb.getString("java.siteinstr")+"\n" + additional + "\n\n"); if (!isFutureTerm) { if (sendEmailToRequestee) { buf.append(rb.getString("java.authoriz")+" " + requestId + " "+rb.getString("java.asreq")); } else { buf.append(rb.getString("java.thesiteemail")+" " + requestId + " "+rb.getString("java.asreq")); } } content = buf.toString(); EmailService.send(from, to, message_subject, content, headerTo, replyTo, null); //To the Instructor User curUser = UserDirectoryService.getCurrentUser(); from = requestEmail; to = curUser.getEmail(); headerTo = to; replyTo = to; buf.setLength(0); buf.append(rb.getString("java.isbeing")+" "); buf.append(rb.getString("java.meantime")+"\n\n"); buf.append(rb.getString("java.copy")+"\n\n"); buf.append(content); buf.append("\n"+rb.getString("java.wish")+" " + requestEmail); content = buf.toString(); EmailService.send(from, to, message_subject, content, headerTo, replyTo, null); state.setAttribute(REQUEST_SENT, new Boolean(true)); } // if } // sendSiteRequest
54846 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54846/c056181efb440533c058b7fd915da25fb81424b9/SiteAction.java/buggy/site-manage-tool/tool/src/java/org/sakaiproject/site/tool/SiteAction.java
from = UserDirectoryService.getCurrentUser().getEmail();
from = cUser.getEmail();
private void sendSiteRequest(SessionState state, String request, int requestListSize, List requestFields) { boolean sendEmailToRequestee = false; StringBuffer buf = new StringBuffer(); // get the request email from configuration String requestEmail = ServerConfigurationService.getString("setup.request", null); if (requestEmail == null) { M_log.warn(this + " - no 'setup.request' in configuration"); } else { String noEmailInIdAccountName = ServerConfigurationService.getString("noEmailInIdAccountName", ""); SiteInfo siteInfo = (SiteInfo)state.getAttribute(STATE_SITE_INFO); Site site = getStateSite(state); String id = site.getId(); String title = site.getTitle(); Time time = TimeService.newTime(); String local_time = time.toStringLocalTime(); String local_date = time.toStringLocalDate(); Term term = null; boolean termExist = false; if (state.getAttribute(STATE_TERM_SELECTED) != null) { termExist = true; term = (Term) state.getAttribute(STATE_TERM_SELECTED); } String productionSiteName = ServerConfigurationService.getServerName(); String from = NULL_STRING; String to = NULL_STRING; String headerTo = NULL_STRING; String replyTo = NULL_STRING; String message_subject = NULL_STRING; String content = NULL_STRING; String sessionUserName = UserDirectoryService.getCurrentUser().getDisplayName(); String sessionUserId = StringUtil.trimToZero(SessionManager.getCurrentSessionUserId()); String additional = NULL_STRING; if (request.equals("new")) { additional = siteInfo.getAdditional(); } else { additional = (String)state.getAttribute(FORM_ADDITIONAL); } boolean isFutureTerm = false; if (state.getAttribute(STATE_FUTURE_TERM_SELECTED) != null && ((Boolean) state.getAttribute(STATE_FUTURE_TERM_SELECTED)).booleanValue()) { isFutureTerm = true; } // message subject if (termExist) { message_subject = rb.getString("java.sitereqfrom")+" " + sessionUserName + " " + rb.getString("java.for") + " " + term.getId(); } else { message_subject = rb.getString("java.official")+" " + sessionUserName; } // there is no offical instructor for future term sites String requestId = (String) state.getAttribute(STATE_SITE_QUEST_UNIQNAME); if (!isFutureTerm) { //To site quest account - the instructor of record's if (requestId != null) { try { User instructor = UserDirectoryService.getUser(requestId); from = requestEmail; to = instructor.getEmail(); headerTo = instructor.getEmail(); replyTo = requestEmail; buf.append(rb.getString("java.hello")+" \n\n"); buf.append(rb.getString("java.receiv")+" " + sessionUserName + ", "); buf.append(rb.getString("java.who")+"\n"); if (termExist) { buf.append(term.getTerm() + " " + term.getYear() + "\n"); } // what are the required fields shown in the UI List requiredFields = CourseManagementService.getCourseIdRequiredFields(); for (int i = 0; i < requestListSize; i++) { List requiredFieldList = (List) requestFields.get(i); for (int j = 0; j < requiredFieldList.size(); j++) { String requiredField = (String) requiredFields.get(j); buf.append(requiredField +"\t" + requiredFieldList.get(j) + "\n"); } } buf.append("\n\n"+rb.getString("java.according")+" " + sessionUserName + " "+rb.getString("java.record")); buf.append(" " + rb.getString("java.canyou")+" " + sessionUserName + " "+ rb.getString("java.assoc")+"\n\n"); buf.append(rb.getString("java.respond")+" " + sessionUserName + rb.getString("java.appoint")+"\n\n"); buf.append(rb.getString("java.thanks")+"\n"); buf.append(productionSiteName + " "+rb.getString("java.support")); content = buf.toString(); // send the email EmailService.send(from, to, message_subject, content, headerTo, replyTo, null); // email has been sent successfully sendEmailToRequestee = true; } catch (UserNotDefinedException ee) { } // try } } //To Support from = UserDirectoryService.getCurrentUser().getEmail(); to = requestEmail; headerTo = requestEmail; replyTo = UserDirectoryService.getCurrentUser().getEmail(); buf.setLength(0); buf.append(rb.getString("java.to")+"\t\t" + productionSiteName + " "+rb.getString("java.supp")+"\n"); buf.append("\n"+rb.getString("java.from")+"\t" + sessionUserName + "\n"); if (request.equals("new")) { buf.append(rb.getString("java.subj")+"\t"+rb.getString("java.sitereq")+"\n"); } else { buf.append(rb.getString("java.subj")+"\t"+rb.getString("java.sitechreq")+"\n"); } buf.append(rb.getString("java.date")+"\t" + local_date + " " + local_time + "\n\n"); if (request.equals("new")) { buf.append(rb.getString("java.approval") + " " + productionSiteName + " "+rb.getString("java.coursesite")+" "); } else { buf.append(rb.getString("java.approval2")+" " + productionSiteName + " "+rb.getString("java.coursesite")+" "); } if (termExist) { buf.append(term.getTerm() + " " + term.getYear()); } if (requestListSize >1) { buf.append(" "+rb.getString("java.forthese")+" " + requestListSize + " "+rb.getString("java.sections")+"\n\n"); } else { buf.append(" "+rb.getString("java.forthis")+"\n\n"); } //what are the required fields shown in the UI List requiredFields = CourseManagementService.getCourseIdRequiredFields(); for (int i = 0; i < requestListSize; i++) { List requiredFieldList = (List) requestFields.get(i); for (int j = 0; j < requiredFieldList.size(); j++) { String requiredField = (String) requiredFields.get(j); buf.append(requiredField +"\t" + requiredFieldList.get(j) + "\n"); } } buf.append(rb.getString("java.name")+"\t" + sessionUserName + " (" + noEmailInIdAccountName + " " + sessionUserName + ")\n"); buf.append(rb.getString("java.email")+"\t" + replyTo + "\n\n"); buf.append(rb.getString("java.sitetitle")+"\t" + title + "\n"); buf.append(rb.getString("java.siteid")+"\t" + id + "\n"); buf.append(rb.getString("java.siteinstr")+"\n" + additional + "\n\n"); if (!isFutureTerm) { if (sendEmailToRequestee) { buf.append(rb.getString("java.authoriz")+" " + requestId + " "+rb.getString("java.asreq")); } else { buf.append(rb.getString("java.thesiteemail")+" " + requestId + " "+rb.getString("java.asreq")); } } content = buf.toString(); EmailService.send(from, to, message_subject, content, headerTo, replyTo, null); //To the Instructor User curUser = UserDirectoryService.getCurrentUser(); from = requestEmail; to = curUser.getEmail(); headerTo = to; replyTo = to; buf.setLength(0); buf.append(rb.getString("java.isbeing")+" "); buf.append(rb.getString("java.meantime")+"\n\n"); buf.append(rb.getString("java.copy")+"\n\n"); buf.append(content); buf.append("\n"+rb.getString("java.wish")+" " + requestEmail); content = buf.toString(); EmailService.send(from, to, message_subject, content, headerTo, replyTo, null); state.setAttribute(REQUEST_SENT, new Boolean(true)); } // if } // sendSiteRequest
54846 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54846/c056181efb440533c058b7fd915da25fb81424b9/SiteAction.java/buggy/site-manage-tool/tool/src/java/org/sakaiproject/site/tool/SiteAction.java
replyTo = UserDirectoryService.getCurrentUser().getEmail();
replyTo = cUser.getEmail();
private void sendSiteRequest(SessionState state, String request, int requestListSize, List requestFields) { boolean sendEmailToRequestee = false; StringBuffer buf = new StringBuffer(); // get the request email from configuration String requestEmail = ServerConfigurationService.getString("setup.request", null); if (requestEmail == null) { M_log.warn(this + " - no 'setup.request' in configuration"); } else { String noEmailInIdAccountName = ServerConfigurationService.getString("noEmailInIdAccountName", ""); SiteInfo siteInfo = (SiteInfo)state.getAttribute(STATE_SITE_INFO); Site site = getStateSite(state); String id = site.getId(); String title = site.getTitle(); Time time = TimeService.newTime(); String local_time = time.toStringLocalTime(); String local_date = time.toStringLocalDate(); Term term = null; boolean termExist = false; if (state.getAttribute(STATE_TERM_SELECTED) != null) { termExist = true; term = (Term) state.getAttribute(STATE_TERM_SELECTED); } String productionSiteName = ServerConfigurationService.getServerName(); String from = NULL_STRING; String to = NULL_STRING; String headerTo = NULL_STRING; String replyTo = NULL_STRING; String message_subject = NULL_STRING; String content = NULL_STRING; String sessionUserName = UserDirectoryService.getCurrentUser().getDisplayName(); String sessionUserId = StringUtil.trimToZero(SessionManager.getCurrentSessionUserId()); String additional = NULL_STRING; if (request.equals("new")) { additional = siteInfo.getAdditional(); } else { additional = (String)state.getAttribute(FORM_ADDITIONAL); } boolean isFutureTerm = false; if (state.getAttribute(STATE_FUTURE_TERM_SELECTED) != null && ((Boolean) state.getAttribute(STATE_FUTURE_TERM_SELECTED)).booleanValue()) { isFutureTerm = true; } // message subject if (termExist) { message_subject = rb.getString("java.sitereqfrom")+" " + sessionUserName + " " + rb.getString("java.for") + " " + term.getId(); } else { message_subject = rb.getString("java.official")+" " + sessionUserName; } // there is no offical instructor for future term sites String requestId = (String) state.getAttribute(STATE_SITE_QUEST_UNIQNAME); if (!isFutureTerm) { //To site quest account - the instructor of record's if (requestId != null) { try { User instructor = UserDirectoryService.getUser(requestId); from = requestEmail; to = instructor.getEmail(); headerTo = instructor.getEmail(); replyTo = requestEmail; buf.append(rb.getString("java.hello")+" \n\n"); buf.append(rb.getString("java.receiv")+" " + sessionUserName + ", "); buf.append(rb.getString("java.who")+"\n"); if (termExist) { buf.append(term.getTerm() + " " + term.getYear() + "\n"); } // what are the required fields shown in the UI List requiredFields = CourseManagementService.getCourseIdRequiredFields(); for (int i = 0; i < requestListSize; i++) { List requiredFieldList = (List) requestFields.get(i); for (int j = 0; j < requiredFieldList.size(); j++) { String requiredField = (String) requiredFields.get(j); buf.append(requiredField +"\t" + requiredFieldList.get(j) + "\n"); } } buf.append("\n\n"+rb.getString("java.according")+" " + sessionUserName + " "+rb.getString("java.record")); buf.append(" " + rb.getString("java.canyou")+" " + sessionUserName + " "+ rb.getString("java.assoc")+"\n\n"); buf.append(rb.getString("java.respond")+" " + sessionUserName + rb.getString("java.appoint")+"\n\n"); buf.append(rb.getString("java.thanks")+"\n"); buf.append(productionSiteName + " "+rb.getString("java.support")); content = buf.toString(); // send the email EmailService.send(from, to, message_subject, content, headerTo, replyTo, null); // email has been sent successfully sendEmailToRequestee = true; } catch (UserNotDefinedException ee) { } // try } } //To Support from = UserDirectoryService.getCurrentUser().getEmail(); to = requestEmail; headerTo = requestEmail; replyTo = UserDirectoryService.getCurrentUser().getEmail(); buf.setLength(0); buf.append(rb.getString("java.to")+"\t\t" + productionSiteName + " "+rb.getString("java.supp")+"\n"); buf.append("\n"+rb.getString("java.from")+"\t" + sessionUserName + "\n"); if (request.equals("new")) { buf.append(rb.getString("java.subj")+"\t"+rb.getString("java.sitereq")+"\n"); } else { buf.append(rb.getString("java.subj")+"\t"+rb.getString("java.sitechreq")+"\n"); } buf.append(rb.getString("java.date")+"\t" + local_date + " " + local_time + "\n\n"); if (request.equals("new")) { buf.append(rb.getString("java.approval") + " " + productionSiteName + " "+rb.getString("java.coursesite")+" "); } else { buf.append(rb.getString("java.approval2")+" " + productionSiteName + " "+rb.getString("java.coursesite")+" "); } if (termExist) { buf.append(term.getTerm() + " " + term.getYear()); } if (requestListSize >1) { buf.append(" "+rb.getString("java.forthese")+" " + requestListSize + " "+rb.getString("java.sections")+"\n\n"); } else { buf.append(" "+rb.getString("java.forthis")+"\n\n"); } //what are the required fields shown in the UI List requiredFields = CourseManagementService.getCourseIdRequiredFields(); for (int i = 0; i < requestListSize; i++) { List requiredFieldList = (List) requestFields.get(i); for (int j = 0; j < requiredFieldList.size(); j++) { String requiredField = (String) requiredFields.get(j); buf.append(requiredField +"\t" + requiredFieldList.get(j) + "\n"); } } buf.append(rb.getString("java.name")+"\t" + sessionUserName + " (" + noEmailInIdAccountName + " " + sessionUserName + ")\n"); buf.append(rb.getString("java.email")+"\t" + replyTo + "\n\n"); buf.append(rb.getString("java.sitetitle")+"\t" + title + "\n"); buf.append(rb.getString("java.siteid")+"\t" + id + "\n"); buf.append(rb.getString("java.siteinstr")+"\n" + additional + "\n\n"); if (!isFutureTerm) { if (sendEmailToRequestee) { buf.append(rb.getString("java.authoriz")+" " + requestId + " "+rb.getString("java.asreq")); } else { buf.append(rb.getString("java.thesiteemail")+" " + requestId + " "+rb.getString("java.asreq")); } } content = buf.toString(); EmailService.send(from, to, message_subject, content, headerTo, replyTo, null); //To the Instructor User curUser = UserDirectoryService.getCurrentUser(); from = requestEmail; to = curUser.getEmail(); headerTo = to; replyTo = to; buf.setLength(0); buf.append(rb.getString("java.isbeing")+" "); buf.append(rb.getString("java.meantime")+"\n\n"); buf.append(rb.getString("java.copy")+"\n\n"); buf.append(content); buf.append("\n"+rb.getString("java.wish")+" " + requestEmail); content = buf.toString(); EmailService.send(from, to, message_subject, content, headerTo, replyTo, null); state.setAttribute(REQUEST_SENT, new Boolean(true)); } // if } // sendSiteRequest
54846 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54846/c056181efb440533c058b7fd915da25fb81424b9/SiteAction.java/buggy/site-manage-tool/tool/src/java/org/sakaiproject/site/tool/SiteAction.java
buf.append(rb.getString("java.name")+"\t" + sessionUserName + " (" + noEmailInIdAccountName + " " + sessionUserName + ")\n");
buf.append(rb.getString("java.name")+"\t" + sessionUserName + " (" + noEmailInIdAccountName + " " + cUser.getEid() + ")\n");
private void sendSiteRequest(SessionState state, String request, int requestListSize, List requestFields) { boolean sendEmailToRequestee = false; StringBuffer buf = new StringBuffer(); // get the request email from configuration String requestEmail = ServerConfigurationService.getString("setup.request", null); if (requestEmail == null) { M_log.warn(this + " - no 'setup.request' in configuration"); } else { String noEmailInIdAccountName = ServerConfigurationService.getString("noEmailInIdAccountName", ""); SiteInfo siteInfo = (SiteInfo)state.getAttribute(STATE_SITE_INFO); Site site = getStateSite(state); String id = site.getId(); String title = site.getTitle(); Time time = TimeService.newTime(); String local_time = time.toStringLocalTime(); String local_date = time.toStringLocalDate(); Term term = null; boolean termExist = false; if (state.getAttribute(STATE_TERM_SELECTED) != null) { termExist = true; term = (Term) state.getAttribute(STATE_TERM_SELECTED); } String productionSiteName = ServerConfigurationService.getServerName(); String from = NULL_STRING; String to = NULL_STRING; String headerTo = NULL_STRING; String replyTo = NULL_STRING; String message_subject = NULL_STRING; String content = NULL_STRING; String sessionUserName = UserDirectoryService.getCurrentUser().getDisplayName(); String sessionUserId = StringUtil.trimToZero(SessionManager.getCurrentSessionUserId()); String additional = NULL_STRING; if (request.equals("new")) { additional = siteInfo.getAdditional(); } else { additional = (String)state.getAttribute(FORM_ADDITIONAL); } boolean isFutureTerm = false; if (state.getAttribute(STATE_FUTURE_TERM_SELECTED) != null && ((Boolean) state.getAttribute(STATE_FUTURE_TERM_SELECTED)).booleanValue()) { isFutureTerm = true; } // message subject if (termExist) { message_subject = rb.getString("java.sitereqfrom")+" " + sessionUserName + " " + rb.getString("java.for") + " " + term.getId(); } else { message_subject = rb.getString("java.official")+" " + sessionUserName; } // there is no offical instructor for future term sites String requestId = (String) state.getAttribute(STATE_SITE_QUEST_UNIQNAME); if (!isFutureTerm) { //To site quest account - the instructor of record's if (requestId != null) { try { User instructor = UserDirectoryService.getUser(requestId); from = requestEmail; to = instructor.getEmail(); headerTo = instructor.getEmail(); replyTo = requestEmail; buf.append(rb.getString("java.hello")+" \n\n"); buf.append(rb.getString("java.receiv")+" " + sessionUserName + ", "); buf.append(rb.getString("java.who")+"\n"); if (termExist) { buf.append(term.getTerm() + " " + term.getYear() + "\n"); } // what are the required fields shown in the UI List requiredFields = CourseManagementService.getCourseIdRequiredFields(); for (int i = 0; i < requestListSize; i++) { List requiredFieldList = (List) requestFields.get(i); for (int j = 0; j < requiredFieldList.size(); j++) { String requiredField = (String) requiredFields.get(j); buf.append(requiredField +"\t" + requiredFieldList.get(j) + "\n"); } } buf.append("\n\n"+rb.getString("java.according")+" " + sessionUserName + " "+rb.getString("java.record")); buf.append(" " + rb.getString("java.canyou")+" " + sessionUserName + " "+ rb.getString("java.assoc")+"\n\n"); buf.append(rb.getString("java.respond")+" " + sessionUserName + rb.getString("java.appoint")+"\n\n"); buf.append(rb.getString("java.thanks")+"\n"); buf.append(productionSiteName + " "+rb.getString("java.support")); content = buf.toString(); // send the email EmailService.send(from, to, message_subject, content, headerTo, replyTo, null); // email has been sent successfully sendEmailToRequestee = true; } catch (UserNotDefinedException ee) { } // try } } //To Support from = UserDirectoryService.getCurrentUser().getEmail(); to = requestEmail; headerTo = requestEmail; replyTo = UserDirectoryService.getCurrentUser().getEmail(); buf.setLength(0); buf.append(rb.getString("java.to")+"\t\t" + productionSiteName + " "+rb.getString("java.supp")+"\n"); buf.append("\n"+rb.getString("java.from")+"\t" + sessionUserName + "\n"); if (request.equals("new")) { buf.append(rb.getString("java.subj")+"\t"+rb.getString("java.sitereq")+"\n"); } else { buf.append(rb.getString("java.subj")+"\t"+rb.getString("java.sitechreq")+"\n"); } buf.append(rb.getString("java.date")+"\t" + local_date + " " + local_time + "\n\n"); if (request.equals("new")) { buf.append(rb.getString("java.approval") + " " + productionSiteName + " "+rb.getString("java.coursesite")+" "); } else { buf.append(rb.getString("java.approval2")+" " + productionSiteName + " "+rb.getString("java.coursesite")+" "); } if (termExist) { buf.append(term.getTerm() + " " + term.getYear()); } if (requestListSize >1) { buf.append(" "+rb.getString("java.forthese")+" " + requestListSize + " "+rb.getString("java.sections")+"\n\n"); } else { buf.append(" "+rb.getString("java.forthis")+"\n\n"); } //what are the required fields shown in the UI List requiredFields = CourseManagementService.getCourseIdRequiredFields(); for (int i = 0; i < requestListSize; i++) { List requiredFieldList = (List) requestFields.get(i); for (int j = 0; j < requiredFieldList.size(); j++) { String requiredField = (String) requiredFields.get(j); buf.append(requiredField +"\t" + requiredFieldList.get(j) + "\n"); } } buf.append(rb.getString("java.name")+"\t" + sessionUserName + " (" + noEmailInIdAccountName + " " + sessionUserName + ")\n"); buf.append(rb.getString("java.email")+"\t" + replyTo + "\n\n"); buf.append(rb.getString("java.sitetitle")+"\t" + title + "\n"); buf.append(rb.getString("java.siteid")+"\t" + id + "\n"); buf.append(rb.getString("java.siteinstr")+"\n" + additional + "\n\n"); if (!isFutureTerm) { if (sendEmailToRequestee) { buf.append(rb.getString("java.authoriz")+" " + requestId + " "+rb.getString("java.asreq")); } else { buf.append(rb.getString("java.thesiteemail")+" " + requestId + " "+rb.getString("java.asreq")); } } content = buf.toString(); EmailService.send(from, to, message_subject, content, headerTo, replyTo, null); //To the Instructor User curUser = UserDirectoryService.getCurrentUser(); from = requestEmail; to = curUser.getEmail(); headerTo = to; replyTo = to; buf.setLength(0); buf.append(rb.getString("java.isbeing")+" "); buf.append(rb.getString("java.meantime")+"\n\n"); buf.append(rb.getString("java.copy")+"\n\n"); buf.append(content); buf.append("\n"+rb.getString("java.wish")+" " + requestEmail); content = buf.toString(); EmailService.send(from, to, message_subject, content, headerTo, replyTo, null); state.setAttribute(REQUEST_SENT, new Boolean(true)); } // if } // sendSiteRequest
54846 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54846/c056181efb440533c058b7fd915da25fb81424b9/SiteAction.java/buggy/site-manage-tool/tool/src/java/org/sakaiproject/site/tool/SiteAction.java
User curUser = UserDirectoryService.getCurrentUser();
private void sendSiteRequest(SessionState state, String request, int requestListSize, List requestFields) { boolean sendEmailToRequestee = false; StringBuffer buf = new StringBuffer(); // get the request email from configuration String requestEmail = ServerConfigurationService.getString("setup.request", null); if (requestEmail == null) { M_log.warn(this + " - no 'setup.request' in configuration"); } else { String noEmailInIdAccountName = ServerConfigurationService.getString("noEmailInIdAccountName", ""); SiteInfo siteInfo = (SiteInfo)state.getAttribute(STATE_SITE_INFO); Site site = getStateSite(state); String id = site.getId(); String title = site.getTitle(); Time time = TimeService.newTime(); String local_time = time.toStringLocalTime(); String local_date = time.toStringLocalDate(); Term term = null; boolean termExist = false; if (state.getAttribute(STATE_TERM_SELECTED) != null) { termExist = true; term = (Term) state.getAttribute(STATE_TERM_SELECTED); } String productionSiteName = ServerConfigurationService.getServerName(); String from = NULL_STRING; String to = NULL_STRING; String headerTo = NULL_STRING; String replyTo = NULL_STRING; String message_subject = NULL_STRING; String content = NULL_STRING; String sessionUserName = UserDirectoryService.getCurrentUser().getDisplayName(); String sessionUserId = StringUtil.trimToZero(SessionManager.getCurrentSessionUserId()); String additional = NULL_STRING; if (request.equals("new")) { additional = siteInfo.getAdditional(); } else { additional = (String)state.getAttribute(FORM_ADDITIONAL); } boolean isFutureTerm = false; if (state.getAttribute(STATE_FUTURE_TERM_SELECTED) != null && ((Boolean) state.getAttribute(STATE_FUTURE_TERM_SELECTED)).booleanValue()) { isFutureTerm = true; } // message subject if (termExist) { message_subject = rb.getString("java.sitereqfrom")+" " + sessionUserName + " " + rb.getString("java.for") + " " + term.getId(); } else { message_subject = rb.getString("java.official")+" " + sessionUserName; } // there is no offical instructor for future term sites String requestId = (String) state.getAttribute(STATE_SITE_QUEST_UNIQNAME); if (!isFutureTerm) { //To site quest account - the instructor of record's if (requestId != null) { try { User instructor = UserDirectoryService.getUser(requestId); from = requestEmail; to = instructor.getEmail(); headerTo = instructor.getEmail(); replyTo = requestEmail; buf.append(rb.getString("java.hello")+" \n\n"); buf.append(rb.getString("java.receiv")+" " + sessionUserName + ", "); buf.append(rb.getString("java.who")+"\n"); if (termExist) { buf.append(term.getTerm() + " " + term.getYear() + "\n"); } // what are the required fields shown in the UI List requiredFields = CourseManagementService.getCourseIdRequiredFields(); for (int i = 0; i < requestListSize; i++) { List requiredFieldList = (List) requestFields.get(i); for (int j = 0; j < requiredFieldList.size(); j++) { String requiredField = (String) requiredFields.get(j); buf.append(requiredField +"\t" + requiredFieldList.get(j) + "\n"); } } buf.append("\n\n"+rb.getString("java.according")+" " + sessionUserName + " "+rb.getString("java.record")); buf.append(" " + rb.getString("java.canyou")+" " + sessionUserName + " "+ rb.getString("java.assoc")+"\n\n"); buf.append(rb.getString("java.respond")+" " + sessionUserName + rb.getString("java.appoint")+"\n\n"); buf.append(rb.getString("java.thanks")+"\n"); buf.append(productionSiteName + " "+rb.getString("java.support")); content = buf.toString(); // send the email EmailService.send(from, to, message_subject, content, headerTo, replyTo, null); // email has been sent successfully sendEmailToRequestee = true; } catch (UserNotDefinedException ee) { } // try } } //To Support from = UserDirectoryService.getCurrentUser().getEmail(); to = requestEmail; headerTo = requestEmail; replyTo = UserDirectoryService.getCurrentUser().getEmail(); buf.setLength(0); buf.append(rb.getString("java.to")+"\t\t" + productionSiteName + " "+rb.getString("java.supp")+"\n"); buf.append("\n"+rb.getString("java.from")+"\t" + sessionUserName + "\n"); if (request.equals("new")) { buf.append(rb.getString("java.subj")+"\t"+rb.getString("java.sitereq")+"\n"); } else { buf.append(rb.getString("java.subj")+"\t"+rb.getString("java.sitechreq")+"\n"); } buf.append(rb.getString("java.date")+"\t" + local_date + " " + local_time + "\n\n"); if (request.equals("new")) { buf.append(rb.getString("java.approval") + " " + productionSiteName + " "+rb.getString("java.coursesite")+" "); } else { buf.append(rb.getString("java.approval2")+" " + productionSiteName + " "+rb.getString("java.coursesite")+" "); } if (termExist) { buf.append(term.getTerm() + " " + term.getYear()); } if (requestListSize >1) { buf.append(" "+rb.getString("java.forthese")+" " + requestListSize + " "+rb.getString("java.sections")+"\n\n"); } else { buf.append(" "+rb.getString("java.forthis")+"\n\n"); } //what are the required fields shown in the UI List requiredFields = CourseManagementService.getCourseIdRequiredFields(); for (int i = 0; i < requestListSize; i++) { List requiredFieldList = (List) requestFields.get(i); for (int j = 0; j < requiredFieldList.size(); j++) { String requiredField = (String) requiredFields.get(j); buf.append(requiredField +"\t" + requiredFieldList.get(j) + "\n"); } } buf.append(rb.getString("java.name")+"\t" + sessionUserName + " (" + noEmailInIdAccountName + " " + sessionUserName + ")\n"); buf.append(rb.getString("java.email")+"\t" + replyTo + "\n\n"); buf.append(rb.getString("java.sitetitle")+"\t" + title + "\n"); buf.append(rb.getString("java.siteid")+"\t" + id + "\n"); buf.append(rb.getString("java.siteinstr")+"\n" + additional + "\n\n"); if (!isFutureTerm) { if (sendEmailToRequestee) { buf.append(rb.getString("java.authoriz")+" " + requestId + " "+rb.getString("java.asreq")); } else { buf.append(rb.getString("java.thesiteemail")+" " + requestId + " "+rb.getString("java.asreq")); } } content = buf.toString(); EmailService.send(from, to, message_subject, content, headerTo, replyTo, null); //To the Instructor User curUser = UserDirectoryService.getCurrentUser(); from = requestEmail; to = curUser.getEmail(); headerTo = to; replyTo = to; buf.setLength(0); buf.append(rb.getString("java.isbeing")+" "); buf.append(rb.getString("java.meantime")+"\n\n"); buf.append(rb.getString("java.copy")+"\n\n"); buf.append(content); buf.append("\n"+rb.getString("java.wish")+" " + requestEmail); content = buf.toString(); EmailService.send(from, to, message_subject, content, headerTo, replyTo, null); state.setAttribute(REQUEST_SENT, new Boolean(true)); } // if } // sendSiteRequest
54846 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54846/c056181efb440533c058b7fd915da25fb81424b9/SiteAction.java/buggy/site-manage-tool/tool/src/java/org/sakaiproject/site/tool/SiteAction.java
to = curUser.getEmail();
to = cUser.getEmail();
private void sendSiteRequest(SessionState state, String request, int requestListSize, List requestFields) { boolean sendEmailToRequestee = false; StringBuffer buf = new StringBuffer(); // get the request email from configuration String requestEmail = ServerConfigurationService.getString("setup.request", null); if (requestEmail == null) { M_log.warn(this + " - no 'setup.request' in configuration"); } else { String noEmailInIdAccountName = ServerConfigurationService.getString("noEmailInIdAccountName", ""); SiteInfo siteInfo = (SiteInfo)state.getAttribute(STATE_SITE_INFO); Site site = getStateSite(state); String id = site.getId(); String title = site.getTitle(); Time time = TimeService.newTime(); String local_time = time.toStringLocalTime(); String local_date = time.toStringLocalDate(); Term term = null; boolean termExist = false; if (state.getAttribute(STATE_TERM_SELECTED) != null) { termExist = true; term = (Term) state.getAttribute(STATE_TERM_SELECTED); } String productionSiteName = ServerConfigurationService.getServerName(); String from = NULL_STRING; String to = NULL_STRING; String headerTo = NULL_STRING; String replyTo = NULL_STRING; String message_subject = NULL_STRING; String content = NULL_STRING; String sessionUserName = UserDirectoryService.getCurrentUser().getDisplayName(); String sessionUserId = StringUtil.trimToZero(SessionManager.getCurrentSessionUserId()); String additional = NULL_STRING; if (request.equals("new")) { additional = siteInfo.getAdditional(); } else { additional = (String)state.getAttribute(FORM_ADDITIONAL); } boolean isFutureTerm = false; if (state.getAttribute(STATE_FUTURE_TERM_SELECTED) != null && ((Boolean) state.getAttribute(STATE_FUTURE_TERM_SELECTED)).booleanValue()) { isFutureTerm = true; } // message subject if (termExist) { message_subject = rb.getString("java.sitereqfrom")+" " + sessionUserName + " " + rb.getString("java.for") + " " + term.getId(); } else { message_subject = rb.getString("java.official")+" " + sessionUserName; } // there is no offical instructor for future term sites String requestId = (String) state.getAttribute(STATE_SITE_QUEST_UNIQNAME); if (!isFutureTerm) { //To site quest account - the instructor of record's if (requestId != null) { try { User instructor = UserDirectoryService.getUser(requestId); from = requestEmail; to = instructor.getEmail(); headerTo = instructor.getEmail(); replyTo = requestEmail; buf.append(rb.getString("java.hello")+" \n\n"); buf.append(rb.getString("java.receiv")+" " + sessionUserName + ", "); buf.append(rb.getString("java.who")+"\n"); if (termExist) { buf.append(term.getTerm() + " " + term.getYear() + "\n"); } // what are the required fields shown in the UI List requiredFields = CourseManagementService.getCourseIdRequiredFields(); for (int i = 0; i < requestListSize; i++) { List requiredFieldList = (List) requestFields.get(i); for (int j = 0; j < requiredFieldList.size(); j++) { String requiredField = (String) requiredFields.get(j); buf.append(requiredField +"\t" + requiredFieldList.get(j) + "\n"); } } buf.append("\n\n"+rb.getString("java.according")+" " + sessionUserName + " "+rb.getString("java.record")); buf.append(" " + rb.getString("java.canyou")+" " + sessionUserName + " "+ rb.getString("java.assoc")+"\n\n"); buf.append(rb.getString("java.respond")+" " + sessionUserName + rb.getString("java.appoint")+"\n\n"); buf.append(rb.getString("java.thanks")+"\n"); buf.append(productionSiteName + " "+rb.getString("java.support")); content = buf.toString(); // send the email EmailService.send(from, to, message_subject, content, headerTo, replyTo, null); // email has been sent successfully sendEmailToRequestee = true; } catch (UserNotDefinedException ee) { } // try } } //To Support from = UserDirectoryService.getCurrentUser().getEmail(); to = requestEmail; headerTo = requestEmail; replyTo = UserDirectoryService.getCurrentUser().getEmail(); buf.setLength(0); buf.append(rb.getString("java.to")+"\t\t" + productionSiteName + " "+rb.getString("java.supp")+"\n"); buf.append("\n"+rb.getString("java.from")+"\t" + sessionUserName + "\n"); if (request.equals("new")) { buf.append(rb.getString("java.subj")+"\t"+rb.getString("java.sitereq")+"\n"); } else { buf.append(rb.getString("java.subj")+"\t"+rb.getString("java.sitechreq")+"\n"); } buf.append(rb.getString("java.date")+"\t" + local_date + " " + local_time + "\n\n"); if (request.equals("new")) { buf.append(rb.getString("java.approval") + " " + productionSiteName + " "+rb.getString("java.coursesite")+" "); } else { buf.append(rb.getString("java.approval2")+" " + productionSiteName + " "+rb.getString("java.coursesite")+" "); } if (termExist) { buf.append(term.getTerm() + " " + term.getYear()); } if (requestListSize >1) { buf.append(" "+rb.getString("java.forthese")+" " + requestListSize + " "+rb.getString("java.sections")+"\n\n"); } else { buf.append(" "+rb.getString("java.forthis")+"\n\n"); } //what are the required fields shown in the UI List requiredFields = CourseManagementService.getCourseIdRequiredFields(); for (int i = 0; i < requestListSize; i++) { List requiredFieldList = (List) requestFields.get(i); for (int j = 0; j < requiredFieldList.size(); j++) { String requiredField = (String) requiredFields.get(j); buf.append(requiredField +"\t" + requiredFieldList.get(j) + "\n"); } } buf.append(rb.getString("java.name")+"\t" + sessionUserName + " (" + noEmailInIdAccountName + " " + sessionUserName + ")\n"); buf.append(rb.getString("java.email")+"\t" + replyTo + "\n\n"); buf.append(rb.getString("java.sitetitle")+"\t" + title + "\n"); buf.append(rb.getString("java.siteid")+"\t" + id + "\n"); buf.append(rb.getString("java.siteinstr")+"\n" + additional + "\n\n"); if (!isFutureTerm) { if (sendEmailToRequestee) { buf.append(rb.getString("java.authoriz")+" " + requestId + " "+rb.getString("java.asreq")); } else { buf.append(rb.getString("java.thesiteemail")+" " + requestId + " "+rb.getString("java.asreq")); } } content = buf.toString(); EmailService.send(from, to, message_subject, content, headerTo, replyTo, null); //To the Instructor User curUser = UserDirectoryService.getCurrentUser(); from = requestEmail; to = curUser.getEmail(); headerTo = to; replyTo = to; buf.setLength(0); buf.append(rb.getString("java.isbeing")+" "); buf.append(rb.getString("java.meantime")+"\n\n"); buf.append(rb.getString("java.copy")+"\n\n"); buf.append(content); buf.append("\n"+rb.getString("java.wish")+" " + requestEmail); content = buf.toString(); EmailService.send(from, to, message_subject, content, headerTo, replyTo, null); state.setAttribute(REQUEST_SENT, new Boolean(true)); } // if } // sendSiteRequest
54846 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54846/c056181efb440533c058b7fd915da25fb81424b9/SiteAction.java/buggy/site-manage-tool/tool/src/java/org/sakaiproject/site/tool/SiteAction.java
if ( node.getNodeName().equals( "a" ) ) {
if ( LayoutFactory.isLink(node)) {
public void mousePressed( MouseEvent evt ) { Box box = panel.findBox( evt.getX(), evt.getY() ); if ( box == null ) { return; } u.p( "pressed " + box ); if ( box.node != null ) { Node node = box.node; if ( node.getNodeType() == node.TEXT_NODE ) { node = node.getParentNode(); } if ( node.getNodeName().equals( "a" ) ) { u.p( "clicked on a link" ); box.clicked = true; box.color = new Color( 255, 255, 0 ); panel.repaint(); } } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/0c66b0065199584307997eaf70c9585a4d0964be/HTMLTest.java/clean/src/java/org/xhtmlrenderer/swing/HTMLTest.java
if ( node.getNodeName().equals( "a" ) ) {
if ( LayoutFactory.isLink(node) ) {
public void mouseReleased( MouseEvent evt ) { Box box = panel.findBox( evt.getX(), evt.getY() ); if ( box == null ) { return; } u.p( "pressed " + box ); if ( box.node != null ) { Node node = box.node; if ( node.getNodeType() == node.TEXT_NODE ) { node = node.getParentNode(); } if ( node.getNodeName().equals( "a" ) ) { u.p( "clicked on a link" ); box.clicked = true; box.color = new Color( 255, 0, 0 ); panel.repaint(); followLink( (Element)node ); } } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/0c66b0065199584307997eaf70c9585a4d0964be/HTMLTest.java/clean/src/java/org/xhtmlrenderer/swing/HTMLTest.java
}
}
public IStatus runInUIThread(IProgressMonitor monitor) { if(viewer != null) { try { if (viewer.getControl().isDisposed()) { return Status.OK_STATUS; } Display display = viewer.getControl().getDisplay(); if (!display.isDisposed() && viewer != null) { viewer.refresh(); } } catch (RuntimeException e) { NavigatorPlugin.logError(0, e.toString(), e); } } return Status.OK_STATUS; }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/760f9bf6c2e4d21502cb533a888c5fe64e58bdf8/StructuredViewerManager.java/buggy/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/StructuredViewerManager.java
viewer.refresh();
try { viewer.getControl().setRedraw(false); viewer.refresh(); } finally { viewer.getControl().setRedraw(true); }
public IStatus runInUIThread(IProgressMonitor monitor) { if(viewer != null) { try { if (viewer.getControl().isDisposed()) { return Status.OK_STATUS; } Display display = viewer.getControl().getDisplay(); if (!display.isDisposed() && viewer != null) { viewer.refresh(); } } catch (RuntimeException e) { NavigatorPlugin.logError(0, e.toString(), e); } } return Status.OK_STATUS; }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/760f9bf6c2e4d21502cb533a888c5fe64e58bdf8/StructuredViewerManager.java/buggy/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/StructuredViewerManager.java
getTable().setItemCount(10);
getTable().setItemCount(requiredCount);
public void notVisibleAdded(Object element, int index) { int requiredCount = index + 1; if(requiredCount > getTable().getItemCount()) getTable().setItemCount(10); Integer key = new Integer(index); virtualElements.put(key,element); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/64c2c3bf4e125339a37c122995e9f96aecaf6b87/TableViewer.java/buggy/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TableViewer.java
public Object getContent(Context c) {
public List getContent(Context c) {
public Object getContent(Context c) { return ContentUtil.getInlineContentList(_elem, c); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/bbe26e114cd1f823901a5ca3d63b5fccfdfedf81/FloatedBlockContent.java/clean/src/java/org/xhtmlrenderer/layout/content/FloatedBlockContent.java
RequestNodeList request = getController().getNodeManager() .createDefaultNodeListRequestMessage();
boolean thisHandshakeCompleted = true;
public boolean completeHandshake() { if (!isConnected()) { return false; } // Create request for nodelist. RequestNodeList request = getController().getNodeManager() .createDefaultNodeListRequestMessage(); synchronized (peerInitalizeLock) { if (!isConnected()) { log().warn("Disconnected while completing handshake"); return false; } // Send node informations now // Send joined folders to synchronize FolderList folderList = new FolderList(getController() .getFolderRepository().getJoinedFolderInfos(), peer .getRemoteMagicId()); peer.sendMessageAsynchron(folderList, null); // Send our transfer status peer.sendMessageAsynchron(getController().getTransferManager() .getStatus(), null); // Send request for nodelist. peer.sendMessageAsynchron(request, null); } // My messages sent, now wait for his folder list. waitForFolderList(); synchronized (peerInitalizeLock) { if (!isConnected()) { log().error("Disconnected while completing handshake"); return false; } if (!isInteresting()) { log().warn("Rejected, Node not interesting"); // Tell remote side try { peer.sendMessage(new Problem("You are boring", true, Problem.YOU_ARE_BORING)); } catch (ConnectionException e) { log().verbose(e); } handshaked = false; } } // Handshaked ? handshaked = isConnected(); if (handshaked) { // Reset things connectionRetries = 0; unableToConnect = false; // if (logEnabled) { log().info( "Connected (" + getController().getNodeManager().countConnectedNodes() + " total)"); // } // Supernode <-> Supernode communication on public networking if (getController().isPublicNetworking() && isSupernode() && getController().getMySelf().isSupernode()) { sendMessageAsynchron(RequestNetworkFolderList.COMPLETE_LIST, "Unable to request network folder list"); } // Inform nodemanger about it getController().getNodeManager().onlineStateChanged(this); if (getController().isVerbose()) { // Running in verbose mode, directly request node information sendMessageAsynchron(new RequestNodeInformation(), null); } } else { // Not handshaked, shutdown shutdown(); } return handshaked; }
51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/e38c204fd097c64b64a9f9d12bf0f5484eec0a6f/Member.java/clean/src/main/de/dal33t/powerfolder/Member.java
peer.sendMessageAsynchron(request, null);
public boolean completeHandshake() { if (!isConnected()) { return false; } // Create request for nodelist. RequestNodeList request = getController().getNodeManager() .createDefaultNodeListRequestMessage(); synchronized (peerInitalizeLock) { if (!isConnected()) { log().warn("Disconnected while completing handshake"); return false; } // Send node informations now // Send joined folders to synchronize FolderList folderList = new FolderList(getController() .getFolderRepository().getJoinedFolderInfos(), peer .getRemoteMagicId()); peer.sendMessageAsynchron(folderList, null); // Send our transfer status peer.sendMessageAsynchron(getController().getTransferManager() .getStatus(), null); // Send request for nodelist. peer.sendMessageAsynchron(request, null); } // My messages sent, now wait for his folder list. waitForFolderList(); synchronized (peerInitalizeLock) { if (!isConnected()) { log().error("Disconnected while completing handshake"); return false; } if (!isInteresting()) { log().warn("Rejected, Node not interesting"); // Tell remote side try { peer.sendMessage(new Problem("You are boring", true, Problem.YOU_ARE_BORING)); } catch (ConnectionException e) { log().verbose(e); } handshaked = false; } } // Handshaked ? handshaked = isConnected(); if (handshaked) { // Reset things connectionRetries = 0; unableToConnect = false; // if (logEnabled) { log().info( "Connected (" + getController().getNodeManager().countConnectedNodes() + " total)"); // } // Supernode <-> Supernode communication on public networking if (getController().isPublicNetworking() && isSupernode() && getController().getMySelf().isSupernode()) { sendMessageAsynchron(RequestNetworkFolderList.COMPLETE_LIST, "Unable to request network folder list"); } // Inform nodemanger about it getController().getNodeManager().onlineStateChanged(this); if (getController().isVerbose()) { // Running in verbose mode, directly request node information sendMessageAsynchron(new RequestNodeInformation(), null); } } else { // Not handshaked, shutdown shutdown(); } return handshaked; }
51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/e38c204fd097c64b64a9f9d12bf0f5484eec0a6f/Member.java/clean/src/main/de/dal33t/powerfolder/Member.java
handshaked = false;
thisHandshakeCompleted = false; } else { peer.sendMessageAsynchron(request, null);
public boolean completeHandshake() { if (!isConnected()) { return false; } // Create request for nodelist. RequestNodeList request = getController().getNodeManager() .createDefaultNodeListRequestMessage(); synchronized (peerInitalizeLock) { if (!isConnected()) { log().warn("Disconnected while completing handshake"); return false; } // Send node informations now // Send joined folders to synchronize FolderList folderList = new FolderList(getController() .getFolderRepository().getJoinedFolderInfos(), peer .getRemoteMagicId()); peer.sendMessageAsynchron(folderList, null); // Send our transfer status peer.sendMessageAsynchron(getController().getTransferManager() .getStatus(), null); // Send request for nodelist. peer.sendMessageAsynchron(request, null); } // My messages sent, now wait for his folder list. waitForFolderList(); synchronized (peerInitalizeLock) { if (!isConnected()) { log().error("Disconnected while completing handshake"); return false; } if (!isInteresting()) { log().warn("Rejected, Node not interesting"); // Tell remote side try { peer.sendMessage(new Problem("You are boring", true, Problem.YOU_ARE_BORING)); } catch (ConnectionException e) { log().verbose(e); } handshaked = false; } } // Handshaked ? handshaked = isConnected(); if (handshaked) { // Reset things connectionRetries = 0; unableToConnect = false; // if (logEnabled) { log().info( "Connected (" + getController().getNodeManager().countConnectedNodes() + " total)"); // } // Supernode <-> Supernode communication on public networking if (getController().isPublicNetworking() && isSupernode() && getController().getMySelf().isSupernode()) { sendMessageAsynchron(RequestNetworkFolderList.COMPLETE_LIST, "Unable to request network folder list"); } // Inform nodemanger about it getController().getNodeManager().onlineStateChanged(this); if (getController().isVerbose()) { // Running in verbose mode, directly request node information sendMessageAsynchron(new RequestNodeInformation(), null); } } else { // Not handshaked, shutdown shutdown(); } return handshaked; }
51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/e38c204fd097c64b64a9f9d12bf0f5484eec0a6f/Member.java/clean/src/main/de/dal33t/powerfolder/Member.java
handshaked = isConnected();
handshaked = thisHandshakeCompleted && isConnected();
public boolean completeHandshake() { if (!isConnected()) { return false; } // Create request for nodelist. RequestNodeList request = getController().getNodeManager() .createDefaultNodeListRequestMessage(); synchronized (peerInitalizeLock) { if (!isConnected()) { log().warn("Disconnected while completing handshake"); return false; } // Send node informations now // Send joined folders to synchronize FolderList folderList = new FolderList(getController() .getFolderRepository().getJoinedFolderInfos(), peer .getRemoteMagicId()); peer.sendMessageAsynchron(folderList, null); // Send our transfer status peer.sendMessageAsynchron(getController().getTransferManager() .getStatus(), null); // Send request for nodelist. peer.sendMessageAsynchron(request, null); } // My messages sent, now wait for his folder list. waitForFolderList(); synchronized (peerInitalizeLock) { if (!isConnected()) { log().error("Disconnected while completing handshake"); return false; } if (!isInteresting()) { log().warn("Rejected, Node not interesting"); // Tell remote side try { peer.sendMessage(new Problem("You are boring", true, Problem.YOU_ARE_BORING)); } catch (ConnectionException e) { log().verbose(e); } handshaked = false; } } // Handshaked ? handshaked = isConnected(); if (handshaked) { // Reset things connectionRetries = 0; unableToConnect = false; // if (logEnabled) { log().info( "Connected (" + getController().getNodeManager().countConnectedNodes() + " total)"); // } // Supernode <-> Supernode communication on public networking if (getController().isPublicNetworking() && isSupernode() && getController().getMySelf().isSupernode()) { sendMessageAsynchron(RequestNetworkFolderList.COMPLETE_LIST, "Unable to request network folder list"); } // Inform nodemanger about it getController().getNodeManager().onlineStateChanged(this); if (getController().isVerbose()) { // Running in verbose mode, directly request node information sendMessageAsynchron(new RequestNodeInformation(), null); } } else { // Not handshaked, shutdown shutdown(); } return handshaked; }
51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/e38c204fd097c64b64a9f9d12bf0f5484eec0a6f/Member.java/clean/src/main/de/dal33t/powerfolder/Member.java
if (block instanceof BlockBox && block.getStyle().isListItem() && ((BlockBox)block).getStructMetrics() == null) { StrutMetrics strutMetrics = InlineBoxing.createDefaultStrutMetrics(c, block); ((BlockBox)block).setStructMetrics(strutMetrics); }
private static Box layout(LayoutContext c, Box block, Content content, StyleSetListener listener) { //OK, first set up the current style. All depends on this... CascadedStyle pushed = content.getStyle(); if (pushed != null) { c.pushStyle(pushed); } Rectangle oe = c.getExtents(); block.setStyle(new Style(c.getCurrentStyle(), (float) oe.getWidth())); if (listener != null ) { listener.onStyleSet(block); } if (c.getCurrentStyle().isIdent(CSSName.BACKGROUND_ATTACHMENT, IdentValue.FIXED)) { c.getRootLayer().setFixedBackground(true); } if (content instanceof DomToplevelNode || block.getStyle().requiresLayer()) { c.pushLayer(block); } if (content instanceof DomToplevelNode || block.getStyle().establishesBFC()) { BlockFormattingContext bfc = new BlockFormattingContext(block, c); c.pushBFC(bfc); } // copy the extents c.setExtents(new Rectangle(oe)); VerticalMarginCollapser.collapseVerticalMargins(c, block, content, (float) oe.getWidth()); BorderPropertySet border = c.getCurrentStyle().getBorder(c); //note: percentages here refer to width of containing block RectPropertySet margin = block.getStyle().getMarginWidth(c); RectPropertySet padding = c.getCurrentStyle().getPaddingRect((float) oe.getWidth(), (float) oe.getWidth(), c); // CLEAN: cast to int block.leftPadding = (int) margin.left() + (int) border.left() + (int) padding.left(); block.rightPadding = (int) padding.right() + (int) border.right() + (int) margin.right(); block.contentWidth = (int) (c.getExtents().getWidth() - block.leftPadding - block.rightPadding); CalculatedStyle style = c.getCurrentStyle(); // calculate the width and height as much as possible if (!(block instanceof AnonymousBlockBox)) { int setHeight = -1;//means height is not set by css int setWidth = -1;//means width is not set by css if (!block.getStyle().isAutoWidth()) { setWidth = (int) style.getFloatPropertyProportionalWidth(CSSName.WIDTH, c.getExtents().width, c); block.contentWidth = setWidth; c.getExtents().width = block.getWidth(); } if (!block.getStyle().isAutoHeight()) { setHeight = (int) style.getFloatPropertyProportionalHeight(CSSName.HEIGHT, c.getExtents().height, c); // CLEAN: cast to int c.getExtents().height = (int) margin.top() + (int) border.top() + (int) padding.top() + setHeight + (int) padding.bottom() + (int) border.bottom() + (int) margin.bottom(); block.height = setHeight; } //check if replaced JComponent cc = c.getNamespaceHandler().getCustomComponent(content.getElement(), c.getUac(), setWidth, setHeight); if (cc != null) { Rectangle bounds = cc.getBounds(); //block.x = bounds.x; //block.y = bounds.y; block.contentWidth = bounds.width; block.height = bounds.height; block.component = cc; } } //block.x = c.getExtents().x; //block.y = c.getExtents().y; // save height incase fixed height int original_height = block.height; if (block.component == null) { block.height = 0; } // do children's layout boolean old_sub = c.isSubBlock(); c.setSubBlock(false); // CLEAN: cast to int int tx = (int) margin.left() + (int) border.left() + (int) padding.left(); int ty = (int) margin.top() + (int) border.top() + (int) padding.top(); block.tx = tx; block.ty = ty; c.translate(tx, ty); // CLEAN: cast to int c.shrinkExtents(tx + (int) margin.right() + (int) border.right() + (int) padding.right(), ty + (int) margin.bottom() + (int) border.bottom() + (int) padding.bottom()); if (block.component == null) layoutChildren(c, block, content);//when this is really an anonymous, InlineLayout.layoutChildren is called else { Point origin = c.getOriginOffset(); block.component.setLocation((int) origin.getX(), (int) origin.getY()); if (c.isInteractive()) { c.getCanvas().add(block.component); } block.setState(Box.DONE); } c.unshrinkExtents(); c.translate(-tx, -ty); c.setSubBlock(old_sub); // restore height incase fixed height if (!block.getStyle().isAutoHeight()) { // Uu.p("restoring original height"); block.height = original_height; } if (content instanceof DomToplevelNode || block.getStyle().establishesBFC()) { if (block.getStyle().isAutoHeight()) { int delta = c.getBlockFormattingContext().getFloatManager().getClearDelta( c, (int) margin.top() + (int) border.top() + (int) padding.top() + block.height); if (delta > 0) { block.height += delta ; } } c.popBFC(); } // calculate the total outer width //block.contentWidth = block.getWidth(); //block.width = margin.left + border.left + padding.left + block.contentWidth + padding.right + border.right + margin.right; // CLEAN: cast to int block.height = (int) margin.top() + (int) border.top() + (int) padding.top() + block.height + (int) padding.bottom() + (int) border.bottom() + (int) margin.bottom(); if (content instanceof DomToplevelNode || block.getStyle().requiresLayer()) { c.popLayer(); } //restore the extents c.setExtents(oe); if (block.getStyle().isFloated()) { c.getBlockFormattingContext().floatBox(c, (FloatedBlockBox) block); } if (block instanceof BlockBox && block.getStyle().isListItem() && ((BlockBox)block).getStructMetrics() == null) { StrutMetrics strutMetrics = InlineBoxing.createDefaultStrutMetrics(c, block); ((BlockBox)block).setStructMetrics(strutMetrics); } checkExceeds(block); //and now, back to previous style if (pushed != null) { c.popStyle(); } // Uu.p("BoxLayout: finished with block: " + block); return block; }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/62dda5920d7dd7f50a882f85976d3eabbd67550c/Boxing.java/clean/src/java/org/xhtmlrenderer/layout/Boxing.java
sash.setVisible(false);
if (sash != null) { sash.dispose(); sash = null; }
public void hideView() { if (currentPane == null) { return; } sash.setVisible(false); clientComposite.removeListener(SWT.Resize, resizeListener); // Get pane. // Hide the right side sash first hideFastViewSash(); Control ctrl = currentPane.getControl(); // Hide it completely. getPresentation().setVisible(false); site.dispose(); //currentPane.setFastViewSash(null); ctrl.setEnabled(false); // Remove focus support. currentPane = null; }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/bbdb70d58fe4644a33a534728ec66e2dba73436a/FastViewPane.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/FastViewPane.java
hideFastViewSash();
public void hideView() { if (currentPane == null) { return; } sash.setVisible(false); clientComposite.removeListener(SWT.Resize, resizeListener); // Get pane. // Hide the right side sash first hideFastViewSash(); Control ctrl = currentPane.getControl(); // Hide it completely. getPresentation().setVisible(false); site.dispose(); //currentPane.setFastViewSash(null); ctrl.setEnabled(false); // Remove focus support. currentPane = null; }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/bbdb70d58fe4644a33a534728ec66e2dba73436a/FastViewPane.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/FastViewPane.java
sash.moveSash();
final KeyListener listener = new KeyAdapter() { public void keyPressed(KeyEvent e) { if (e.character == SWT.ESC || e.character == '\r') { currentPane.setFocus(); } } }; sash.addFocusListener(new FocusAdapter() { public void focusGained(FocusEvent e) { sash.setBackground(sash.getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION)); sash.addKeyListener(listener); } public void focusLost(FocusEvent e) { sash.setBackground(null); sash.removeKeyListener(listener); } }); sash.setFocus();
public void moveSash() { sash.moveSash(); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/bbdb70d58fe4644a33a534728ec66e2dba73436a/FastViewPane.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/FastViewPane.java
sash = new HiddenSash(parent, Geometry.getSwtHorizontalOrVerticalConstant(horizontal));
sash = new Sash(parent, Geometry.getSwtHorizontalOrVerticalConstant(horizontal));
public void showView(Composite newClientComposite, ViewPane pane, int newSide, float sizeRatio) { side = newSide; if (currentPane != null) { hideView(); } currentPane = pane; clientComposite = newClientComposite; clientComposite.addListener(SWT.Resize, resizeListener); // Create the control first Control ctrl = pane.getControl(); if (ctrl == null) { pane.createControl(clientComposite); ctrl = pane.getControl(); } // Temporarily use the same appearance as docked views .. eventually, fastviews will // be independently pluggable. AbstractPresentationFactory factory = ((WorkbenchWindow) pane.getWorkbenchWindow()) .getWindowConfigurer().getPresentationFactory(); StackPresentation presentation = factory.createPresentation(newClientComposite, site, AbstractPresentationFactory.ROLE_DOCKED_VIEW, SWT.MIN | SWT.MAX, pane.getPage().getPerspective().getId(), pane.getID()); //StackPresentation presentation = new PartTabFolderPresentation(newClientComposite, site, SWT.MIN | SWT.MAX); site.setPresentation(presentation); site.setPresentationState(IStackPresentationSite.STATE_RESTORED); presentation.addPart(pane.getPresentablePart(), null); presentation.selectPart(pane.getPresentablePart()); presentation.setActive(true); presentation.setVisible(true); systemMenuContribution = new SystemMenuContribution(site, this); presentation.getSystemMenuManager().add(systemMenuContribution); // Show pane fast. ctrl.setEnabled(true); // Add focus support. Composite parent = ctrl.getParent(); pane.setVisible(true); pane.setFocus(); boolean horizontal = Geometry.isHorizontal(side); sash = new HiddenSash(parent, Geometry.getSwtHorizontalOrVerticalConstant(horizontal)); sash.addSelectionListener(selectionListener); Rectangle clientArea = newClientComposite.getClientArea(); getPresentation().getControl().moveAbove(null); currentPane.moveAbove(null); sash.moveAbove(null); setSize((int)(Geometry.getDimension(clientArea, !horizontal) * sizeRatio)); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/bbdb70d58fe4644a33a534728ec66e2dba73436a/FastViewPane.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/FastViewPane.java
Rectangle newBounds = Geometry.getExtrudedEdge(bounds, SASH_SIZE, oppositeSide);
Rectangle newBounds = Geometry.getExtrudedEdge(bounds, -SASH_SIZE, oppositeSide);
private void updateFastViewSashBounds() { Rectangle bounds = getBounds(); int oppositeSide = Geometry.getOppositeSide(side); Rectangle newBounds = Geometry.getExtrudedEdge(bounds, SASH_SIZE, oppositeSide); Rectangle oldBounds = sash.getBounds(); if (!newBounds.equals(oldBounds)) { sash.setBounds(newBounds); } }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/bbdb70d58fe4644a33a534728ec66e2dba73436a/FastViewPane.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/FastViewPane.java
TestHelper.waitMilliSeconds(500);
TestHelper.waitMilliSeconds(10000);
public void testAbortUpload() { assertEquals(0, bartModelListener.events.size()); // Create a 20 megs file TestHelper.createRandomFile(getFolderAtBart().getLocalBase(), 20000000); getFolderAtBart().forceScanOnNextMaintenance(); getFolderAtBart().maintain(); TestHelper.waitForCondition(2, new TestHelper.Condition() { public boolean reached() { return getContollerBart().getTransferManager() .getActiveUploads().length == 1; } }); TestHelper.waitMilliSeconds(100); assertEquals(1, bartModel.getRowCount()); // Upload requested + started assertEquals(2, bartModelListener.events.size()); // Abort Download download = getContollerLisa().getTransferManager() .getActiveDownloads()[0]; download.abort(); TestHelper.waitForCondition(50, new TestHelper.Condition() { public boolean reached() { return bartModel.getRowCount() == 0; } }); // Wait for EDT TestHelper.waitMilliSeconds(500); // no active upload assertEquals(0, bartModel.getRowCount()); // Check correct events from model assertEquals(3, bartModelListener.events.size()); // Upload requested assertTrue(bartModelListener.events.get(0).getType() == TableModelEvent.INSERT); // Upload started assertTrue(bartModelListener.events.get(1).getType() == TableModelEvent.UPDATE); // Upload aborted assertTrue(bartModelListener.events.get(2).getType() == TableModelEvent.DELETE); TestHelper.waitMilliSeconds(500); }
51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/a39885e159324158799c02c01a98ce16527ce37b/UploadsTableModelTest.java/clean/src/test/de/dal33t/powerfolder/test/ui/UploadsTableModelTest.java
if (!si.appliesToMedia(media)) return count;
boolean applies = si.appliesToMedia(media);
private int appendStylesheet(StylesheetInfo si, int count, java.util.TreeMap sorter, String media) { if (!si.appliesToMedia(media)) return count; Stylesheet ss = si.getStylesheet(); if (ss == null) { ss = _styleFactory.getStylesheet(si); si.setStylesheet(ss); } if (ss == null) return count;//couldn't load it for (java.util.Iterator rulesets = ss.getRulesets(); rulesets.hasNext();) { Object obj = rulesets.next(); if (obj instanceof StylesheetInfo) { count = appendStylesheet((StylesheetInfo) obj, count, sorter, media); } else { org.xhtmlrenderer.css.sheet.Ruleset r = (org.xhtmlrenderer.css.sheet.Ruleset) obj; //at this point all selectors in a ruleset must be placed on the descendant axis org.w3c.css.sac.SelectorList selector_list = r.getSelectorList(); for (int i = 0; i < selector_list.getLength(); i++) { org.w3c.css.sac.Selector selector = selector_list.item(i); Selector s = addSelector(count++, r, selector); sorter.put(s.getOrder(), s); } } } return count; }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/fe0a57c6a370f4f2a7a78f1c9a60657c159377cc/Matcher.java/clean/src/java/org/xhtmlrenderer/css/newmatch/Matcher.java
} else {
} else if (applies) {
private int appendStylesheet(StylesheetInfo si, int count, java.util.TreeMap sorter, String media) { if (!si.appliesToMedia(media)) return count; Stylesheet ss = si.getStylesheet(); if (ss == null) { ss = _styleFactory.getStylesheet(si); si.setStylesheet(ss); } if (ss == null) return count;//couldn't load it for (java.util.Iterator rulesets = ss.getRulesets(); rulesets.hasNext();) { Object obj = rulesets.next(); if (obj instanceof StylesheetInfo) { count = appendStylesheet((StylesheetInfo) obj, count, sorter, media); } else { org.xhtmlrenderer.css.sheet.Ruleset r = (org.xhtmlrenderer.css.sheet.Ruleset) obj; //at this point all selectors in a ruleset must be placed on the descendant axis org.w3c.css.sac.SelectorList selector_list = r.getSelectorList(); for (int i = 0; i < selector_list.getLength(); i++) { org.w3c.css.sac.Selector selector = selector_list.item(i); Selector s = addSelector(count++, r, selector); sorter.put(s.getOrder(), s); } } } return count; }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/fe0a57c6a370f4f2a7a78f1c9a60657c159377cc/Matcher.java/clean/src/java/org/xhtmlrenderer/css/newmatch/Matcher.java
Uu.p("resolved URI to: " + uri);
public ImageResource getImageResource(String uri) { ImageResource ir = null; uri = resolveURI(uri); ir = (ImageResource) imageCache.get(uri); //TODO: check that cached image is still valid if (ir == null) { InputStream is = getInputStream(uri); if (is != null) { try { Image img = ImageIO.read(is); img = GraphicsUtil.cleanImage(img); ir = new ImageResource(img); imageCache.put(uri, ir); } catch (IOException e) { XRLog.exception("Can't read image file; unexpected problem for URI '" + uri + "'", e); } } } if (ir == null) ir = new ImageResource(null); return ir; }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/b98ebeff38a46f03c84fd40760bf5cf6473cd7f4/NaiveUserAgent.java/clean/src/java/org/xhtmlrenderer/swing/NaiveUserAgent.java
return (scope_vmode & scope) != 0;
return (actMethodScope & scope) != 0;
private boolean isScope(int scope) { return (scope_vmode & scope) != 0; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/60d09f0d06e157ff7d9bb828d89273706e4e2798/RubyInterpreter.java/clean/org/jruby/interpreter/RubyInterpreter.java
static void paintInline(Context c, InlineBox ib, int lx, int ly, LineBox line, int blockLineHeight, LineMetrics blockLineMetrics, boolean restyle) {
static void paintInline(Context c, InlineBox ib, int lx, int ly, LineBox line, int blockLineHeight, LineMetrics blockLineMetrics, boolean restyle, LinkedList pushedStyles) {
static void paintInline(Context c, InlineBox ib, int lx, int ly, LineBox line, int blockLineHeight, LineMetrics blockLineMetrics, boolean restyle) { restyle = restyle || ib.restyle;//cascade it down ib.restyle = false;//reset if (ib.pushstyles != null) { for (Iterator i = ib.pushstyles.iterator(); i.hasNext();) { StylePush sp = (StylePush) i.next(); c.pushStyle(c.getCss().getCascadedStyle(sp.getElement(), restyle)); //Now we know that an inline element started here, handle borders and such? Relative.translateRelative(c); //TODO: push to current border-list (and paint left edge) //HACK: this might do for now - tobe 2004-12-27 paintPadding(c, line, ib); } } if (ib.floated) { paintFloat(c, ib, restyle); debugInlines(c, ib, lx, ly); } // Uu.p("paintInline: " + inline); else if (ib instanceof InlineBlockBox) { c.pushStyle(c.getCss().getCascadedStyle(ib.element, restyle)); c.translate(line.x, line.y + (line.getBaseline() - VerticalAlign.getBaselineOffset(c, line, ib, blockLineHeight, blockLineMetrics) - ib.height)); BoxRendering.paint(c, ib, true, restyle); c.translate(-line.x, -(line.y + (line.getBaseline() - VerticalAlign.getBaselineOffset(c, line, ib, blockLineHeight, blockLineMetrics) - ib.height))); debugInlines(c, ib, lx, ly); c.popStyle(); } else { InlineTextBox inline = (InlineTextBox) ib; c.updateSelection(inline); // calculate the Xx and y relative to the baseline of the line (ly) and the // left edge of the line (lx) int iy = ly - VerticalAlign.getBaselineOffset(c, line, inline, blockLineHeight, blockLineMetrics); int ix = lx + inline.x;//TODO: find the right way to work this out // account for padding // Uu.p("adjusted inline by: " + inline.totalLeftPadding()); // Uu.p("inline = " + inline); // Uu.p("padding = " + inline.padding); paintSelection(c, inline, lx, ly); // JMM: new adjustments to move the text to account for horizontal insets int padding_xoff = inline.totalLeftPadding(c.getCurrentStyle()); c.translate(padding_xoff,0); paintText(c, lx, ly, ix, iy, inline); c.translate(-padding_xoff,0); debugInlines(c, inline, lx, ly); } if (ib.popstyles != null) { for (Iterator i = ib.popstyles.iterator(); i.hasNext();) { StylePop sp = (StylePop) i.next(); //TODO: paint right edge and pop current border-list Relative.untranslateRelative(c); c.popStyle(); } } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/8f81e5fe9f6f8593d3c596d30a3f100cb87dbf27/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
c.pushStyle(c.getCss().getCascadedStyle(sp.getElement(), restyle));
CascadedStyle style = c.getCss().getCascadedStyle(sp.getElement(), restyle); c.pushStyle(style); if (pushedStyles != null) pushedStyles.addLast(style);
static void paintInline(Context c, InlineBox ib, int lx, int ly, LineBox line, int blockLineHeight, LineMetrics blockLineMetrics, boolean restyle) { restyle = restyle || ib.restyle;//cascade it down ib.restyle = false;//reset if (ib.pushstyles != null) { for (Iterator i = ib.pushstyles.iterator(); i.hasNext();) { StylePush sp = (StylePush) i.next(); c.pushStyle(c.getCss().getCascadedStyle(sp.getElement(), restyle)); //Now we know that an inline element started here, handle borders and such? Relative.translateRelative(c); //TODO: push to current border-list (and paint left edge) //HACK: this might do for now - tobe 2004-12-27 paintPadding(c, line, ib); } } if (ib.floated) { paintFloat(c, ib, restyle); debugInlines(c, ib, lx, ly); } // Uu.p("paintInline: " + inline); else if (ib instanceof InlineBlockBox) { c.pushStyle(c.getCss().getCascadedStyle(ib.element, restyle)); c.translate(line.x, line.y + (line.getBaseline() - VerticalAlign.getBaselineOffset(c, line, ib, blockLineHeight, blockLineMetrics) - ib.height)); BoxRendering.paint(c, ib, true, restyle); c.translate(-line.x, -(line.y + (line.getBaseline() - VerticalAlign.getBaselineOffset(c, line, ib, blockLineHeight, blockLineMetrics) - ib.height))); debugInlines(c, ib, lx, ly); c.popStyle(); } else { InlineTextBox inline = (InlineTextBox) ib; c.updateSelection(inline); // calculate the Xx and y relative to the baseline of the line (ly) and the // left edge of the line (lx) int iy = ly - VerticalAlign.getBaselineOffset(c, line, inline, blockLineHeight, blockLineMetrics); int ix = lx + inline.x;//TODO: find the right way to work this out // account for padding // Uu.p("adjusted inline by: " + inline.totalLeftPadding()); // Uu.p("inline = " + inline); // Uu.p("padding = " + inline.padding); paintSelection(c, inline, lx, ly); // JMM: new adjustments to move the text to account for horizontal insets int padding_xoff = inline.totalLeftPadding(c.getCurrentStyle()); c.translate(padding_xoff,0); paintText(c, lx, ly, ix, iy, inline); c.translate(-padding_xoff,0); debugInlines(c, inline, lx, ly); } if (ib.popstyles != null) { for (Iterator i = ib.popstyles.iterator(); i.hasNext();) { StylePop sp = (StylePop) i.next(); //TODO: paint right edge and pop current border-list Relative.untranslateRelative(c); c.popStyle(); } } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/8f81e5fe9f6f8593d3c596d30a3f100cb87dbf27/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
paintPadding(c, line, ib);
int padWidth = ib.totalLeftPadding(c.getCurrentStyle()); paintLeftPadding(c, line, ib, padX, padWidth); padX += padWidth;
static void paintInline(Context c, InlineBox ib, int lx, int ly, LineBox line, int blockLineHeight, LineMetrics blockLineMetrics, boolean restyle) { restyle = restyle || ib.restyle;//cascade it down ib.restyle = false;//reset if (ib.pushstyles != null) { for (Iterator i = ib.pushstyles.iterator(); i.hasNext();) { StylePush sp = (StylePush) i.next(); c.pushStyle(c.getCss().getCascadedStyle(sp.getElement(), restyle)); //Now we know that an inline element started here, handle borders and such? Relative.translateRelative(c); //TODO: push to current border-list (and paint left edge) //HACK: this might do for now - tobe 2004-12-27 paintPadding(c, line, ib); } } if (ib.floated) { paintFloat(c, ib, restyle); debugInlines(c, ib, lx, ly); } // Uu.p("paintInline: " + inline); else if (ib instanceof InlineBlockBox) { c.pushStyle(c.getCss().getCascadedStyle(ib.element, restyle)); c.translate(line.x, line.y + (line.getBaseline() - VerticalAlign.getBaselineOffset(c, line, ib, blockLineHeight, blockLineMetrics) - ib.height)); BoxRendering.paint(c, ib, true, restyle); c.translate(-line.x, -(line.y + (line.getBaseline() - VerticalAlign.getBaselineOffset(c, line, ib, blockLineHeight, blockLineMetrics) - ib.height))); debugInlines(c, ib, lx, ly); c.popStyle(); } else { InlineTextBox inline = (InlineTextBox) ib; c.updateSelection(inline); // calculate the Xx and y relative to the baseline of the line (ly) and the // left edge of the line (lx) int iy = ly - VerticalAlign.getBaselineOffset(c, line, inline, blockLineHeight, blockLineMetrics); int ix = lx + inline.x;//TODO: find the right way to work this out // account for padding // Uu.p("adjusted inline by: " + inline.totalLeftPadding()); // Uu.p("inline = " + inline); // Uu.p("padding = " + inline.padding); paintSelection(c, inline, lx, ly); // JMM: new adjustments to move the text to account for horizontal insets int padding_xoff = inline.totalLeftPadding(c.getCurrentStyle()); c.translate(padding_xoff,0); paintText(c, lx, ly, ix, iy, inline); c.translate(-padding_xoff,0); debugInlines(c, inline, lx, ly); } if (ib.popstyles != null) { for (Iterator i = ib.popstyles.iterator(); i.hasNext();) { StylePop sp = (StylePop) i.next(); //TODO: paint right edge and pop current border-list Relative.untranslateRelative(c); c.popStyle(); } } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/8f81e5fe9f6f8593d3c596d30a3f100cb87dbf27/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
int padding_xoff = inline.totalLeftPadding(c.getCurrentStyle()); c.translate(padding_xoff,0);
static void paintInline(Context c, InlineBox ib, int lx, int ly, LineBox line, int blockLineHeight, LineMetrics blockLineMetrics, boolean restyle) { restyle = restyle || ib.restyle;//cascade it down ib.restyle = false;//reset if (ib.pushstyles != null) { for (Iterator i = ib.pushstyles.iterator(); i.hasNext();) { StylePush sp = (StylePush) i.next(); c.pushStyle(c.getCss().getCascadedStyle(sp.getElement(), restyle)); //Now we know that an inline element started here, handle borders and such? Relative.translateRelative(c); //TODO: push to current border-list (and paint left edge) //HACK: this might do for now - tobe 2004-12-27 paintPadding(c, line, ib); } } if (ib.floated) { paintFloat(c, ib, restyle); debugInlines(c, ib, lx, ly); } // Uu.p("paintInline: " + inline); else if (ib instanceof InlineBlockBox) { c.pushStyle(c.getCss().getCascadedStyle(ib.element, restyle)); c.translate(line.x, line.y + (line.getBaseline() - VerticalAlign.getBaselineOffset(c, line, ib, blockLineHeight, blockLineMetrics) - ib.height)); BoxRendering.paint(c, ib, true, restyle); c.translate(-line.x, -(line.y + (line.getBaseline() - VerticalAlign.getBaselineOffset(c, line, ib, blockLineHeight, blockLineMetrics) - ib.height))); debugInlines(c, ib, lx, ly); c.popStyle(); } else { InlineTextBox inline = (InlineTextBox) ib; c.updateSelection(inline); // calculate the Xx and y relative to the baseline of the line (ly) and the // left edge of the line (lx) int iy = ly - VerticalAlign.getBaselineOffset(c, line, inline, blockLineHeight, blockLineMetrics); int ix = lx + inline.x;//TODO: find the right way to work this out // account for padding // Uu.p("adjusted inline by: " + inline.totalLeftPadding()); // Uu.p("inline = " + inline); // Uu.p("padding = " + inline.padding); paintSelection(c, inline, lx, ly); // JMM: new adjustments to move the text to account for horizontal insets int padding_xoff = inline.totalLeftPadding(c.getCurrentStyle()); c.translate(padding_xoff,0); paintText(c, lx, ly, ix, iy, inline); c.translate(-padding_xoff,0); debugInlines(c, inline, lx, ly); } if (ib.popstyles != null) { for (Iterator i = ib.popstyles.iterator(); i.hasNext();) { StylePop sp = (StylePop) i.next(); //TODO: paint right edge and pop current border-list Relative.untranslateRelative(c); c.popStyle(); } } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/8f81e5fe9f6f8593d3c596d30a3f100cb87dbf27/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
c.translate(-padding_xoff,0);
c.translate(-padX, 0);
static void paintInline(Context c, InlineBox ib, int lx, int ly, LineBox line, int blockLineHeight, LineMetrics blockLineMetrics, boolean restyle) { restyle = restyle || ib.restyle;//cascade it down ib.restyle = false;//reset if (ib.pushstyles != null) { for (Iterator i = ib.pushstyles.iterator(); i.hasNext();) { StylePush sp = (StylePush) i.next(); c.pushStyle(c.getCss().getCascadedStyle(sp.getElement(), restyle)); //Now we know that an inline element started here, handle borders and such? Relative.translateRelative(c); //TODO: push to current border-list (and paint left edge) //HACK: this might do for now - tobe 2004-12-27 paintPadding(c, line, ib); } } if (ib.floated) { paintFloat(c, ib, restyle); debugInlines(c, ib, lx, ly); } // Uu.p("paintInline: " + inline); else if (ib instanceof InlineBlockBox) { c.pushStyle(c.getCss().getCascadedStyle(ib.element, restyle)); c.translate(line.x, line.y + (line.getBaseline() - VerticalAlign.getBaselineOffset(c, line, ib, blockLineHeight, blockLineMetrics) - ib.height)); BoxRendering.paint(c, ib, true, restyle); c.translate(-line.x, -(line.y + (line.getBaseline() - VerticalAlign.getBaselineOffset(c, line, ib, blockLineHeight, blockLineMetrics) - ib.height))); debugInlines(c, ib, lx, ly); c.popStyle(); } else { InlineTextBox inline = (InlineTextBox) ib; c.updateSelection(inline); // calculate the Xx and y relative to the baseline of the line (ly) and the // left edge of the line (lx) int iy = ly - VerticalAlign.getBaselineOffset(c, line, inline, blockLineHeight, blockLineMetrics); int ix = lx + inline.x;//TODO: find the right way to work this out // account for padding // Uu.p("adjusted inline by: " + inline.totalLeftPadding()); // Uu.p("inline = " + inline); // Uu.p("padding = " + inline.padding); paintSelection(c, inline, lx, ly); // JMM: new adjustments to move the text to account for horizontal insets int padding_xoff = inline.totalLeftPadding(c.getCurrentStyle()); c.translate(padding_xoff,0); paintText(c, lx, ly, ix, iy, inline); c.translate(-padding_xoff,0); debugInlines(c, inline, lx, ly); } if (ib.popstyles != null) { for (Iterator i = ib.popstyles.iterator(); i.hasNext();) { StylePop sp = (StylePop) i.next(); //TODO: paint right edge and pop current border-list Relative.untranslateRelative(c); c.popStyle(); } } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/8f81e5fe9f6f8593d3c596d30a3f100cb87dbf27/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
int padWidth = ib.totalRightPadding(c.getCurrentStyle()); paintRightPadding(c, line, ib, padX, padWidth); padX += padWidth;
static void paintInline(Context c, InlineBox ib, int lx, int ly, LineBox line, int blockLineHeight, LineMetrics blockLineMetrics, boolean restyle) { restyle = restyle || ib.restyle;//cascade it down ib.restyle = false;//reset if (ib.pushstyles != null) { for (Iterator i = ib.pushstyles.iterator(); i.hasNext();) { StylePush sp = (StylePush) i.next(); c.pushStyle(c.getCss().getCascadedStyle(sp.getElement(), restyle)); //Now we know that an inline element started here, handle borders and such? Relative.translateRelative(c); //TODO: push to current border-list (and paint left edge) //HACK: this might do for now - tobe 2004-12-27 paintPadding(c, line, ib); } } if (ib.floated) { paintFloat(c, ib, restyle); debugInlines(c, ib, lx, ly); } // Uu.p("paintInline: " + inline); else if (ib instanceof InlineBlockBox) { c.pushStyle(c.getCss().getCascadedStyle(ib.element, restyle)); c.translate(line.x, line.y + (line.getBaseline() - VerticalAlign.getBaselineOffset(c, line, ib, blockLineHeight, blockLineMetrics) - ib.height)); BoxRendering.paint(c, ib, true, restyle); c.translate(-line.x, -(line.y + (line.getBaseline() - VerticalAlign.getBaselineOffset(c, line, ib, blockLineHeight, blockLineMetrics) - ib.height))); debugInlines(c, ib, lx, ly); c.popStyle(); } else { InlineTextBox inline = (InlineTextBox) ib; c.updateSelection(inline); // calculate the Xx and y relative to the baseline of the line (ly) and the // left edge of the line (lx) int iy = ly - VerticalAlign.getBaselineOffset(c, line, inline, blockLineHeight, blockLineMetrics); int ix = lx + inline.x;//TODO: find the right way to work this out // account for padding // Uu.p("adjusted inline by: " + inline.totalLeftPadding()); // Uu.p("inline = " + inline); // Uu.p("padding = " + inline.padding); paintSelection(c, inline, lx, ly); // JMM: new adjustments to move the text to account for horizontal insets int padding_xoff = inline.totalLeftPadding(c.getCurrentStyle()); c.translate(padding_xoff,0); paintText(c, lx, ly, ix, iy, inline); c.translate(-padding_xoff,0); debugInlines(c, inline, lx, ly); } if (ib.popstyles != null) { for (Iterator i = ib.popstyles.iterator(); i.hasNext();) { StylePop sp = (StylePop) i.next(); //TODO: paint right edge and pop current border-list Relative.untranslateRelative(c); c.popStyle(); } } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/8f81e5fe9f6f8593d3c596d30a3f100cb87dbf27/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
if (pushedStyles != null) pushedStyles.removeLast();
static void paintInline(Context c, InlineBox ib, int lx, int ly, LineBox line, int blockLineHeight, LineMetrics blockLineMetrics, boolean restyle) { restyle = restyle || ib.restyle;//cascade it down ib.restyle = false;//reset if (ib.pushstyles != null) { for (Iterator i = ib.pushstyles.iterator(); i.hasNext();) { StylePush sp = (StylePush) i.next(); c.pushStyle(c.getCss().getCascadedStyle(sp.getElement(), restyle)); //Now we know that an inline element started here, handle borders and such? Relative.translateRelative(c); //TODO: push to current border-list (and paint left edge) //HACK: this might do for now - tobe 2004-12-27 paintPadding(c, line, ib); } } if (ib.floated) { paintFloat(c, ib, restyle); debugInlines(c, ib, lx, ly); } // Uu.p("paintInline: " + inline); else if (ib instanceof InlineBlockBox) { c.pushStyle(c.getCss().getCascadedStyle(ib.element, restyle)); c.translate(line.x, line.y + (line.getBaseline() - VerticalAlign.getBaselineOffset(c, line, ib, blockLineHeight, blockLineMetrics) - ib.height)); BoxRendering.paint(c, ib, true, restyle); c.translate(-line.x, -(line.y + (line.getBaseline() - VerticalAlign.getBaselineOffset(c, line, ib, blockLineHeight, blockLineMetrics) - ib.height))); debugInlines(c, ib, lx, ly); c.popStyle(); } else { InlineTextBox inline = (InlineTextBox) ib; c.updateSelection(inline); // calculate the Xx and y relative to the baseline of the line (ly) and the // left edge of the line (lx) int iy = ly - VerticalAlign.getBaselineOffset(c, line, inline, blockLineHeight, blockLineMetrics); int ix = lx + inline.x;//TODO: find the right way to work this out // account for padding // Uu.p("adjusted inline by: " + inline.totalLeftPadding()); // Uu.p("inline = " + inline); // Uu.p("padding = " + inline.padding); paintSelection(c, inline, lx, ly); // JMM: new adjustments to move the text to account for horizontal insets int padding_xoff = inline.totalLeftPadding(c.getCurrentStyle()); c.translate(padding_xoff,0); paintText(c, lx, ly, ix, iy, inline); c.translate(-padding_xoff,0); debugInlines(c, inline, lx, ly); } if (ib.popstyles != null) { for (Iterator i = ib.popstyles.iterator(); i.hasNext();) { StylePop sp = (StylePop) i.next(); //TODO: paint right edge and pop current border-list Relative.untranslateRelative(c); c.popStyle(); } } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/8f81e5fe9f6f8593d3c596d30a3f100cb87dbf27/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
c.pushStyle(block.firstLineStyle);
firstLineStyle = block.firstLineStyle;
static void paintInlineContext(Context c, Box box, boolean restyle) { //dummy style to make sure that text nodes don't get extra padding and such c.pushStyle(new CascadedStyle()); //BlockBox block = (BlockBox)box; // translate into local coords // account for the origin of the containing box c.translate(box.x, box.y); // for each line box BlockBox block = null; if (box instanceof BlockBox) {//Why isn't it always a BlockBox? Because of e.g. Floats! block = (BlockBox) box; } int blockLineHeight = FontUtil.lineHeight(c); LineMetrics blockLineMetrics = c.getTextRenderer().getLineMetrics(c.getGraphics(), FontUtil.getFont(c), "thequickbrownfoxjumpedoverthelazydogTHEQUICKBROWNFOXJUMPEDOVERTHELAZYDOG"); for (int i = 0; i < box.getChildCount(); i++) { if (i == 0 && block != null && block.firstLineStyle != null) { c.pushStyle(block.firstLineStyle); } // get the line box paintLine(c, (LineBox) box.getChild(i), blockLineHeight, blockLineMetrics, restyle); if (i == 0 && block != null && block.firstLineStyle != null) { c.popStyle(); } } // translate back to parent coords c.translate(-box.x, -box.y); //pop dummy style c.popStyle(); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/8f81e5fe9f6f8593d3c596d30a3f100cb87dbf27/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
paintLine(c, (LineBox) box.getChild(i), blockLineHeight, blockLineMetrics, restyle);
paintLine(c, (LineBox) box.getChild(i), blockLineHeight, blockLineMetrics, restyle, firstLineStyle);
static void paintInlineContext(Context c, Box box, boolean restyle) { //dummy style to make sure that text nodes don't get extra padding and such c.pushStyle(new CascadedStyle()); //BlockBox block = (BlockBox)box; // translate into local coords // account for the origin of the containing box c.translate(box.x, box.y); // for each line box BlockBox block = null; if (box instanceof BlockBox) {//Why isn't it always a BlockBox? Because of e.g. Floats! block = (BlockBox) box; } int blockLineHeight = FontUtil.lineHeight(c); LineMetrics blockLineMetrics = c.getTextRenderer().getLineMetrics(c.getGraphics(), FontUtil.getFont(c), "thequickbrownfoxjumpedoverthelazydogTHEQUICKBROWNFOXJUMPEDOVERTHELAZYDOG"); for (int i = 0; i < box.getChildCount(); i++) { if (i == 0 && block != null && block.firstLineStyle != null) { c.pushStyle(block.firstLineStyle); } // get the line box paintLine(c, (LineBox) box.getChild(i), blockLineHeight, blockLineMetrics, restyle); if (i == 0 && block != null && block.firstLineStyle != null) { c.popStyle(); } } // translate back to parent coords c.translate(-box.x, -box.y); //pop dummy style c.popStyle(); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/8f81e5fe9f6f8593d3c596d30a3f100cb87dbf27/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
c.popStyle();
firstLineStyle = null;
static void paintInlineContext(Context c, Box box, boolean restyle) { //dummy style to make sure that text nodes don't get extra padding and such c.pushStyle(new CascadedStyle()); //BlockBox block = (BlockBox)box; // translate into local coords // account for the origin of the containing box c.translate(box.x, box.y); // for each line box BlockBox block = null; if (box instanceof BlockBox) {//Why isn't it always a BlockBox? Because of e.g. Floats! block = (BlockBox) box; } int blockLineHeight = FontUtil.lineHeight(c); LineMetrics blockLineMetrics = c.getTextRenderer().getLineMetrics(c.getGraphics(), FontUtil.getFont(c), "thequickbrownfoxjumpedoverthelazydogTHEQUICKBROWNFOXJUMPEDOVERTHELAZYDOG"); for (int i = 0; i < box.getChildCount(); i++) { if (i == 0 && block != null && block.firstLineStyle != null) { c.pushStyle(block.firstLineStyle); } // get the line box paintLine(c, (LineBox) box.getChild(i), blockLineHeight, blockLineMetrics, restyle); if (i == 0 && block != null && block.firstLineStyle != null) { c.popStyle(); } } // translate back to parent coords c.translate(-box.x, -box.y); //pop dummy style c.popStyle(); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/8f81e5fe9f6f8593d3c596d30a3f100cb87dbf27/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
static void paintLine(Context c, LineBox line, int blockLineHeight, LineMetrics blockLineMetrics, boolean restyle) {
static void paintLine(Context c, LineBox line, int blockLineHeight, LineMetrics blockLineMetrics, boolean restyle, CascadedStyle firstLineStyle) {
static void paintLine(Context c, LineBox line, int blockLineHeight, LineMetrics blockLineMetrics, boolean restyle) { // get Xx and y int lx = line.x; int ly = line.y + line.getBaseline(); // for each inline box for (int j = 0; j < line.getChildCount(); j++) { Box child = line.getChild(j); if (child.absolute) { paintAbsolute(c, child, restyle); continue; } InlineBox box = (InlineBox) child; paintInline(c, box, lx, ly, line, blockLineHeight, blockLineMetrics, restyle); } if (c.debugDrawLineBoxes()) { GraphicsUtil.drawBox(c.getGraphics(), line, Color.blue); } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/8f81e5fe9f6f8593d3c596d30a3f100cb87dbf27/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
paintInline(c, box, lx, ly, line, blockLineHeight, blockLineMetrics, restyle);
paintInline(c, box, lx, ly, line, blockLineHeight, blockLineMetrics, restyle, pushedStyles); } if (firstLineStyle != null) { for (int i = 0; i < pushedStyles.size(); i++) { c.popStyle(); } c.popStyle(); for (Iterator i = pushedStyles.iterator(); i.hasNext();) { c.pushStyle((CascadedStyle) i.next()); }
static void paintLine(Context c, LineBox line, int blockLineHeight, LineMetrics blockLineMetrics, boolean restyle) { // get Xx and y int lx = line.x; int ly = line.y + line.getBaseline(); // for each inline box for (int j = 0; j < line.getChildCount(); j++) { Box child = line.getChild(j); if (child.absolute) { paintAbsolute(c, child, restyle); continue; } InlineBox box = (InlineBox) child; paintInline(c, box, lx, ly, line, blockLineHeight, blockLineMetrics, restyle); } if (c.debugDrawLineBoxes()) { GraphicsUtil.drawBox(c.getGraphics(), line, Color.blue); } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/8f81e5fe9f6f8593d3c596d30a3f100cb87dbf27/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
InternalID orderID = new InternalID(""+0);
public Command cancelAllCommand() throws ParserException { consumeToken("Expected cancel all command.", null); InternalID orderID = new InternalID(""+0); Message message = new quickfix.fix42.Message(); message.getHeader().setField(new MsgType(MsgType.ORDER_CANCEL_REQUEST)); List aList = new ArrayList(); aList.add(message); return new Command(MsgType.ORDER_CANCEL_REQUEST, aList); }
52787 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52787/9fb11b7767d32b3467191724d48832c4d3721a43/Parser.java/clean/source/trunk/src/main/java/org/marketcetera/photon/parser/Parser.java
newValue = RubyArray.newArray(runtime, value);
newValue = runtime.newArray(value);
private RubyArray arrayValue(IRubyObject value) { IRubyObject newValue = value.convertToType("Array", "to_ary", false); if (newValue.isNil()) { // XXXEnebo: We should call to_a except if it is kernel def.... // but we will forego for now. newValue = RubyArray.newArray(runtime, value); } return (RubyArray) newValue; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/870e1da9b41bfdbae259e1fc5f18fc8b76686998/EvaluateVisitor.java/clean/src/org/jruby/evaluator/EvaluateVisitor.java
return RubyArray.newArray(runtime, value);
return runtime.newArray(value);
private IRubyObject aryToAry(IRubyObject value) { if (value instanceof RubyArray) { return value; } if (value.respondsTo("to_ary")) { return value.convertToType("Array", "to_ary", false); } return RubyArray.newArray(runtime, value); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/870e1da9b41bfdbae259e1fc5f18fc8b76686998/EvaluateVisitor.java/clean/src/org/jruby/evaluator/EvaluateVisitor.java
return RubyArray.newArray(runtime, value);
return runtime.newArray(value);
private IRubyObject splatValue(IRubyObject value) { if (value.isNil()) { return RubyArray.newArray(runtime, value); } return arrayValue(value); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/870e1da9b41bfdbae259e1fc5f18fc8b76686998/EvaluateVisitor.java/clean/src/org/jruby/evaluator/EvaluateVisitor.java
RubyArray.newArray(runtime, args);
runtime.newArray(args);
public void visitArgsCatNode(ArgsCatNode iVisited) { IRubyObject args = eval(iVisited.getFirstNode()); IRubyObject secondArgs = splatValue(eval(iVisited.getSecondNode())); RubyArray list = args instanceof RubyArray ? (RubyArray) args : RubyArray.newArray(runtime, args); result = list.concat(secondArgs); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/870e1da9b41bfdbae259e1fc5f18fc8b76686998/EvaluateVisitor.java/clean/src/org/jruby/evaluator/EvaluateVisitor.java
result = RubyArray.newArray(runtime, list);
result = runtime.newArray(list);
public void visitArrayNode(ArrayNode iVisited) { ArrayList list = new ArrayList(iVisited.size()); for (Iterator iterator = iVisited.iterator(); iterator.hasNext();) { list.add(eval((Node) iterator.next())); } result = RubyArray.newArray(runtime, list); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/870e1da9b41bfdbae259e1fc5f18fc8b76686998/EvaluateVisitor.java/clean/src/org/jruby/evaluator/EvaluateVisitor.java
throw new ArgumentError(runtime, "wrong # of arguments(" + threadContext.getCurrentFrame().getArgs().length + "for 1)");
throw runtime.newArgumentError("wrong # of arguments(" + threadContext.getCurrentFrame().getArgs().length + "for 1)");
public void visitAttrSetNode(AttrSetNode iVisited) { if (runtime.getCurrentFrame().getArgs().length != 1) { throw new ArgumentError(runtime, "wrong # of arguments(" + threadContext.getCurrentFrame().getArgs().length + "for 1)"); } result = self.setInstanceVariable(iVisited.getAttributeName(), threadContext.getCurrentFrame().getArgs()[0]); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/870e1da9b41bfdbae259e1fc5f18fc8b76686998/EvaluateVisitor.java/clean/src/org/jruby/evaluator/EvaluateVisitor.java
result = RubyFixnum.newFixnum(runtime, iVisited.getValue());
result = runtime.newFixnum(iVisited.getValue());
public void visitFixnumNode(FixnumNode iVisited) { result = RubyFixnum.newFixnum(runtime, iVisited.getValue()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/870e1da9b41bfdbae259e1fc5f18fc8b76686998/EvaluateVisitor.java/clean/src/org/jruby/evaluator/EvaluateVisitor.java
Box box = BoxFinder.findElementBox(panel.getRootBox(),evt.getX(),evt.getY(),null);
Box box = BoxFinder.findElementBox2(panel.getRootBox(),evt.getX(),evt.getY(),null);
public Box findBox(MouseEvent evt) { //Box box = panel.findElementBox(evt.getX(), evt.getY()); Box box = BoxFinder.findElementBox(panel.getRootBox(),evt.getX(),evt.getY(),null); if (box == null) return null; if (box instanceof LineBox) return null; return box; }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/b57073f02256b87b5ff6a36d2816f62d11326b48/HoverListener.java/clean/src/java/org/xhtmlrenderer/swing/HoverListener.java
inlineList.add(new InlineBlockContent((Element) curr, style));
inlineList.add(new AbsoluteBlockContent((Element) curr, style));
static List getChildContentList(Context c, Content parent) { List inlineList = new LinkedList(); List blockList = null; FirstLineStyle firstLineStyle = null; FirstLetterStyle firstLetterStyle = null; StringBuffer textContent = null; CascadedStyle parentStyle = parent.getStyle(); Element parentElement = parent.getElement(); if (parentElement != null) { if (mayHaveFirstLine(parentStyle)) { //put in a marker if there is first-line styling CascadedStyle firstLine = c.css.getPseudoElementStyle(parentElement, "first-line"); if (firstLine != null) { firstLineStyle = new FirstLineStyle(firstLine); } } if (mayHaveFirstLetter(parentStyle)) { //put in a marker if there is first-letter styling CascadedStyle firstLetter = c.css.getPseudoElementStyle(parentElement, "first-letter"); if (firstLetter != null) { firstLetterStyle = new FirstLetterStyle(firstLetter); } } //TODO: before and after may be block! //<br/> handling should be done by :before content CascadedStyle before = c.css.getPseudoElementStyle(parentElement, "before"); if (before != null && before.hasProperty(CSSName.CONTENT)) { String content = ((CSSPrimitiveValue) before.propertyByName(CSSName.CONTENT).getValue()).getStringValue(); if (!content.equals("")) { inlineList.add(new StylePush(before, parentElement)); c.pushStyle(before); textContent = new StringBuffer(); textContent.append(content.replaceAll("\\\\A", "\n")); inlineList.add(new TextContent(parentElement, textContent.toString())); textContent = null; c.popStyle(); inlineList.add(new StylePop(parentElement)); } //do not reset style here, because if this element is empty, we will not have changed context } } Node node = parentElement; if (node == null) node = ((DomToplevelNode) parent).getNode(); NodeList children = node.getChildNodes(); //each child node can result in only one addition to content for (int i = 0; i < children.getLength(); i++) { Node curr = children.item(i); if (curr.getNodeType() != Node.ELEMENT_NODE && curr.getNodeType() != Node.TEXT_NODE) continue;//must be a comment or pi or something if (curr.getNodeType() == Node.TEXT_NODE) { String text = curr.getNodeValue(); if (textContent == null) textContent = new StringBuffer(); textContent.append(text); continue; } Element elem = (Element) curr; CascadedStyle style = c.css.getCascadedStyle(elem); c.pushStyle(style);//just remember to pop it before continue if (isHidden(style)) { c.popStyle(); continue;//at least for now, don't generate hidden content } if (isAbsoluteOrFixed(style)) { // Uu.p("adding replaced: " + curr); if (textContent != null) { inlineList.add(new TextContent(parentElement, textContent.toString())); textContent = null; } inlineList.add(new InlineBlockContent((Element) curr, style)); c.popStyle(); continue; } //have to check for float here already. The element may still be replaced, though if (isFloated(style)) { // Uu.p("adding floated block: " + curr); if (textContent != null) { inlineList.add(new TextContent(parentElement, textContent.toString())); textContent = null; } inlineList.add(new FloatedBlockContent((Element) curr, style)); c.popStyle(); continue; } if (isInlineBlock(style)) { //treat it like a replaced element if (textContent != null) { inlineList.add(new TextContent(parentElement, textContent.toString())); textContent = null; } inlineList.add(new InlineBlockContent(elem, style)); c.popStyle(); continue; } if (isRunIn(style)) { RunInContent runIn = new RunInContent(elem, style); List childContent = runIn.getChildContent(c); if (isBlockContent(childContent)) { if (textContent != null) { inlineList.add(new TextContent(parentElement, textContent.toString())); textContent = null; } if (blockList == null) blockList = new LinkedList(); if (inlineList.size() != 0) { blockList.addAll(resolveRunInContent(inlineList, parentElement, c)); inlineList = new LinkedList(); } blockList.add(runIn); } else { inlineList.add(runIn); //resolve it when we can } c.popStyle(); continue; } if (isBlockLevel(style)) { if (textContent != null) { inlineList.add(new TextContent(parentElement, textContent.toString())); textContent = null; } if (blockList == null) blockList = new LinkedList(); if (inlineList.size() != 0) { blockList.addAll(resolveRunInContent(inlineList, parentElement, c)); inlineList = new LinkedList(); } BlockContent block = new BlockContent(elem, style); blockList.add(block); c.popStyle(); continue; } //TODO:list-items, tables, etc. //TODO: this replaced thing is Namespace-dependent if (LayoutUtil.isReplaced(c, curr)) { // Uu.p("adding replaced: " + curr); if (textContent != null) { inlineList.add(new TextContent(parentElement, textContent.toString())); textContent = null; } inlineList.add(new InlineBlockContent((Element) curr, style)); c.popStyle(); continue; } //if we get here, we have inline content, need to get into it. if (textContent != null) { inlineList.add(new TextContent(parentElement, textContent.toString())); textContent = null; } Content inline = new InlineContent(elem, style); List childList = inline.getChildContent(c); if (isBlockContent(childList)) { //need to put current inlineList in front, with a StylePush appended inlineList.add(new StylePush(style, elem));//this is already pushed to context //the child list represents the entire contents of an element, //therefore we need not concern ourselves with style-changes, as they will even out for (Iterator ci = childList.iterator(); ci.hasNext();) { Object o = ci.next(); if (o instanceof BlockContent) break; ci.remove();//have to take it out to avoid duplicates if (o instanceof AnonymousBlockContent) { inlineList.addAll(((AnonymousBlockContent) o).getChildContent(c)); } else { inlineList.add(o); } } if (blockList == null) blockList = new LinkedList(); if (inlineList.size() != 0) { blockList.addAll(resolveRunInContent(inlineList, parentElement, c)); inlineList = new LinkedList(); } //extract any trailing AnonymousBlock and put it in the inlineList Object last = childList.get(childList.size() - 1); if (last instanceof AnonymousBlockContent) { inlineList.addAll(((AnonymousBlockContent) last).getChildContent(c)); childList.remove(childList.size() - 1); } //add the rest of the children blockList.addAll(childList); //append StylePop inlineList.add(new StylePop(elem));//pop from c below } else { inlineList.add(new StylePush(style, elem)); inlineList.addAll(childList); inlineList.add(new StylePop(elem));//pop from c below } c.popStyle(); } if (textContent != null) { inlineList.add(new TextContent(parentElement, textContent.toString())); textContent = null; } if (parentElement != null) { //TODO: after may be block! CascadedStyle after = c.css.getPseudoElementStyle(parentElement, "after"); if (after != null && after.hasProperty(CSSName.CONTENT)) { String content = ((CSSPrimitiveValue) after.propertyByName(CSSName.CONTENT).getValue()).getStringValue(); if (!content.equals("")) {//a worthwhile reduncancy-check if (textContent != null) { inlineList.add(new TextContent(parentElement, textContent.toString())); textContent = null; } inlineList.add(new StylePush(after, parentElement)); textContent = new StringBuffer(); textContent.append(content.replaceAll("\\\\A", "\n")); inlineList.add(new TextContent(parentElement, textContent.toString())); textContent = null; inlineList.add(new StylePop(parentElement)); } } } //have to check if there were run-ins pending if (isBlockContent(inlineList)) { if (blockList == null) blockList = new LinkedList(); blockList.addAll(resolveRunInContent(inlineList, parentElement, c)); inlineList = new LinkedList(); } if (blockList == null) { inlineList = WhitespaceStripper.stripInlineContent(c, inlineList); if (inlineList.size() == 0) return inlineList; if (firstLetterStyle != null) { inlineList.add(0, firstLetterStyle); } if (firstLineStyle != null) { inlineList.add(0, firstLineStyle); } return inlineList; } else { inlineList = WhitespaceStripper.stripInlineContent(c, inlineList); if (inlineList.size() != 0) { blockList.add(new AnonymousBlockContent(parentElement, inlineList)); } //HACK: there should instead be a way of propagating firstLineStyles down through box-hierarchy if (blockList.get(0) instanceof AnonymousBlockContent) { inlineList = ((AnonymousBlockContent) blockList.get(0)).getChildContent(c); blockList.remove(0); if (firstLetterStyle != null) { inlineList.add(0, firstLetterStyle); firstLetterStyle = null; } if (firstLineStyle != null) { inlineList.add(0, firstLineStyle); firstLineStyle = null; } blockList.add(0, new AnonymousBlockContent(parentElement, inlineList)); } //END-HACK if (firstLetterStyle != null) { blockList.add(0, firstLetterStyle); } if (firstLineStyle != null) { blockList.add(0, firstLineStyle); } return blockList; } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/5ae86d99f9d4c15ae44feb4a759289dfb63751cc/ContentUtil.java/clean/src/java/org/xhtmlrenderer/layout/content/ContentUtil.java
public static boolean isBlockContent(List childContent) { if (childContent.size() == 0) return false; Object o = childContent.get(childContent.size() - 1); if (o instanceof BlockContent) return true; if (o instanceof AnonymousBlockContent) return true; if (o instanceof RunInContent) return true;//if it has run-ins, it will be block, one way or another return false; }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/5ae86d99f9d4c15ae44feb4a759289dfb63751cc/ContentUtil.java/clean/src/java/org/xhtmlrenderer/layout/content/ContentUtil.java
*/
static List resolveRunInContent(List pendingInlines, Element parentElement, Context c) { List inline = new LinkedList(); List block = new LinkedList(); for (Iterator i = pendingInlines.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof RunInContent) { inline = WhitespaceStripper.stripInlineContent(c, inline); if (inline.size() != 0) { block.add(new AnonymousBlockContent(parentElement, inline)); inline = new LinkedList(); } block.add(o); } else { inline.add(o); } } inline = WhitespaceStripper.stripInlineContent(c, inline); if (inline.size() != 0) { block.add(new AnonymousBlockContent(parentElement, inline)); } return block; }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/5ae86d99f9d4c15ae44feb4a759289dfb63751cc/ContentUtil.java/clean/src/java/org/xhtmlrenderer/layout/content/ContentUtil.java
public JavaSupport getJavaSupport() { throw new MockException(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f11f183fa177acbe7f7b2685c56f38fb3261856d/BaseMockRuby.java/buggy/test/org/jruby/test/BaseMockRuby.java
return value.equals(matcherValue.toString());
boolean returnValue = shouldInclude ^ value.equals(matcherValue.toString()); return returnValue;
public boolean matches(MessageHolder item) { try { Message aMessage = item.getMessage(); if (matcherValue == null){ try { String value = getFieldValueString(aMessage, matcherFIXField); return (value == null); } catch (FieldNotFound ex){ return true; } } else { String value = getFieldValueString(aMessage, matcherFIXField); return value.equals(matcherValue.toString()); } } catch (Exception ex) { //do nothing } return false; }
52787 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52787/baf951cf5ccda70586b4d9ffdcb6835d0bcfe319/FIXMatcher.java/buggy/source/trunk/plugins/org.marketcetera.photon/src/main/java/org/marketcetera/photon/views/FIXMatcher.java
TransactTime ttField = new TransactTime(new Date(10000000)); TransactTime ttFieldLater = new TransactTime(new Date(10010000));
SendingTime stField = new SendingTime(new Date(10000000)); SendingTime stFieldLater = new SendingTime(new Date(10010000));
public void testExecutionReportOrder() throws FieldNotFound { InternalID orderID1 = new InternalID("1"); InternalID clOrderID1 = new InternalID("2"); String execID = "3"; char execTransType = ExecTransType.STATUS; char execType = ExecType.PARTIAL_FILL; char ordStatus = OrdStatus.PARTIALLY_FILLED; char side = Side.SELL_SHORT; BigDecimal orderQty = new BigDecimal(1000); BigDecimal orderPrice = new BigDecimal(789); BigDecimal lastQty = new BigDecimal(100); BigDecimal lastPrice = new BigDecimal("12.3"); BigDecimal leavesQty = new BigDecimal(900); BigDecimal cumQty = new BigDecimal(100); BigDecimal avgPrice = new BigDecimal("12.3"); MSymbol symbol = new MSymbol("ASDF"); TransactTime ttField = new TransactTime(new Date(10000000)); TransactTime ttFieldLater = new TransactTime(new Date(10010000)); Message message1 = FIXMessageUtil.newExecutionReport(null, clOrderID1, execID, execTransType, execType, ordStatus, side, orderQty, orderPrice, lastQty, lastPrice, leavesQty, cumQty, avgPrice, symbol, null); message1.setField(ttField); lastQty = new BigDecimal(200); Message message2 = FIXMessageUtil.newExecutionReport(orderID1, clOrderID1, execID, execTransType, execType, ordStatus, side, orderQty, orderPrice, lastQty, lastPrice, leavesQty, cumQty, avgPrice, symbol, null); message2.setField(ttField); lastQty = new BigDecimal(300); Message message3 = FIXMessageUtil.newExecutionReport(orderID1, clOrderID1, execID, execTransType, execType, ordStatus, side, orderQty, orderPrice, lastQty, lastPrice, leavesQty, cumQty, avgPrice, symbol, null); message3.setField(ttFieldLater); FIXMessageHistory history = getMessageHistory(); history.addIncomingMessage(message1); history.addIncomingMessage(message2); assertEquals(new BigDecimal(200), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertEquals(orderID1.toString(), history.getLatestExecutionReport(clOrderID1.toString()).getString(OrderID.FIELD)); history = getMessageHistory(); history.addIncomingMessage(message2); history.addIncomingMessage(message1); assertEquals(new BigDecimal(100), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertTrue(!history.getLatestExecutionReport(clOrderID1.toString()).isSetField(OrderID.FIELD)); history = getMessageHistory(); history.addIncomingMessage(message1); history.addIncomingMessage(message2); history.addIncomingMessage(message3); assertEquals(new BigDecimal(300), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertEquals(orderID1.toString(), history.getLatestExecutionReport(clOrderID1.toString()).getString(OrderID.FIELD)); history = getMessageHistory(); history.addIncomingMessage(message3); history.addIncomingMessage(message2); history.addIncomingMessage(message1); assertEquals(new BigDecimal(300), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertEquals(orderID1.toString(), history.getLatestExecutionReport(clOrderID1.toString()).getString(OrderID.FIELD)); history = getMessageHistory(); history.addIncomingMessage(message3); history.addIncomingMessage(message1); history.addIncomingMessage(message2); assertEquals(new BigDecimal(300), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertEquals(orderID1.toString(), history.getLatestExecutionReport(clOrderID1.toString()).getString(OrderID.FIELD));}
52787 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52787/48153406f5051ec752935487d4f294d7298761d8/FIXMessageHistoryTest.java/buggy/source/trunk/src/test/java/org/marketcetera/photon/model/FIXMessageHistoryTest.java
message1.setField(ttField);
message1.getHeader().setField(stField);
public void testExecutionReportOrder() throws FieldNotFound { InternalID orderID1 = new InternalID("1"); InternalID clOrderID1 = new InternalID("2"); String execID = "3"; char execTransType = ExecTransType.STATUS; char execType = ExecType.PARTIAL_FILL; char ordStatus = OrdStatus.PARTIALLY_FILLED; char side = Side.SELL_SHORT; BigDecimal orderQty = new BigDecimal(1000); BigDecimal orderPrice = new BigDecimal(789); BigDecimal lastQty = new BigDecimal(100); BigDecimal lastPrice = new BigDecimal("12.3"); BigDecimal leavesQty = new BigDecimal(900); BigDecimal cumQty = new BigDecimal(100); BigDecimal avgPrice = new BigDecimal("12.3"); MSymbol symbol = new MSymbol("ASDF"); TransactTime ttField = new TransactTime(new Date(10000000)); TransactTime ttFieldLater = new TransactTime(new Date(10010000)); Message message1 = FIXMessageUtil.newExecutionReport(null, clOrderID1, execID, execTransType, execType, ordStatus, side, orderQty, orderPrice, lastQty, lastPrice, leavesQty, cumQty, avgPrice, symbol, null); message1.setField(ttField); lastQty = new BigDecimal(200); Message message2 = FIXMessageUtil.newExecutionReport(orderID1, clOrderID1, execID, execTransType, execType, ordStatus, side, orderQty, orderPrice, lastQty, lastPrice, leavesQty, cumQty, avgPrice, symbol, null); message2.setField(ttField); lastQty = new BigDecimal(300); Message message3 = FIXMessageUtil.newExecutionReport(orderID1, clOrderID1, execID, execTransType, execType, ordStatus, side, orderQty, orderPrice, lastQty, lastPrice, leavesQty, cumQty, avgPrice, symbol, null); message3.setField(ttFieldLater); FIXMessageHistory history = getMessageHistory(); history.addIncomingMessage(message1); history.addIncomingMessage(message2); assertEquals(new BigDecimal(200), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertEquals(orderID1.toString(), history.getLatestExecutionReport(clOrderID1.toString()).getString(OrderID.FIELD)); history = getMessageHistory(); history.addIncomingMessage(message2); history.addIncomingMessage(message1); assertEquals(new BigDecimal(100), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertTrue(!history.getLatestExecutionReport(clOrderID1.toString()).isSetField(OrderID.FIELD)); history = getMessageHistory(); history.addIncomingMessage(message1); history.addIncomingMessage(message2); history.addIncomingMessage(message3); assertEquals(new BigDecimal(300), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertEquals(orderID1.toString(), history.getLatestExecutionReport(clOrderID1.toString()).getString(OrderID.FIELD)); history = getMessageHistory(); history.addIncomingMessage(message3); history.addIncomingMessage(message2); history.addIncomingMessage(message1); assertEquals(new BigDecimal(300), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertEquals(orderID1.toString(), history.getLatestExecutionReport(clOrderID1.toString()).getString(OrderID.FIELD)); history = getMessageHistory(); history.addIncomingMessage(message3); history.addIncomingMessage(message1); history.addIncomingMessage(message2); assertEquals(new BigDecimal(300), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertEquals(orderID1.toString(), history.getLatestExecutionReport(clOrderID1.toString()).getString(OrderID.FIELD));}
52787 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52787/48153406f5051ec752935487d4f294d7298761d8/FIXMessageHistoryTest.java/buggy/source/trunk/src/test/java/org/marketcetera/photon/model/FIXMessageHistoryTest.java
message2.setField(ttField);
message2.getHeader().setField(stField);
public void testExecutionReportOrder() throws FieldNotFound { InternalID orderID1 = new InternalID("1"); InternalID clOrderID1 = new InternalID("2"); String execID = "3"; char execTransType = ExecTransType.STATUS; char execType = ExecType.PARTIAL_FILL; char ordStatus = OrdStatus.PARTIALLY_FILLED; char side = Side.SELL_SHORT; BigDecimal orderQty = new BigDecimal(1000); BigDecimal orderPrice = new BigDecimal(789); BigDecimal lastQty = new BigDecimal(100); BigDecimal lastPrice = new BigDecimal("12.3"); BigDecimal leavesQty = new BigDecimal(900); BigDecimal cumQty = new BigDecimal(100); BigDecimal avgPrice = new BigDecimal("12.3"); MSymbol symbol = new MSymbol("ASDF"); TransactTime ttField = new TransactTime(new Date(10000000)); TransactTime ttFieldLater = new TransactTime(new Date(10010000)); Message message1 = FIXMessageUtil.newExecutionReport(null, clOrderID1, execID, execTransType, execType, ordStatus, side, orderQty, orderPrice, lastQty, lastPrice, leavesQty, cumQty, avgPrice, symbol, null); message1.setField(ttField); lastQty = new BigDecimal(200); Message message2 = FIXMessageUtil.newExecutionReport(orderID1, clOrderID1, execID, execTransType, execType, ordStatus, side, orderQty, orderPrice, lastQty, lastPrice, leavesQty, cumQty, avgPrice, symbol, null); message2.setField(ttField); lastQty = new BigDecimal(300); Message message3 = FIXMessageUtil.newExecutionReport(orderID1, clOrderID1, execID, execTransType, execType, ordStatus, side, orderQty, orderPrice, lastQty, lastPrice, leavesQty, cumQty, avgPrice, symbol, null); message3.setField(ttFieldLater); FIXMessageHistory history = getMessageHistory(); history.addIncomingMessage(message1); history.addIncomingMessage(message2); assertEquals(new BigDecimal(200), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertEquals(orderID1.toString(), history.getLatestExecutionReport(clOrderID1.toString()).getString(OrderID.FIELD)); history = getMessageHistory(); history.addIncomingMessage(message2); history.addIncomingMessage(message1); assertEquals(new BigDecimal(100), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertTrue(!history.getLatestExecutionReport(clOrderID1.toString()).isSetField(OrderID.FIELD)); history = getMessageHistory(); history.addIncomingMessage(message1); history.addIncomingMessage(message2); history.addIncomingMessage(message3); assertEquals(new BigDecimal(300), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertEquals(orderID1.toString(), history.getLatestExecutionReport(clOrderID1.toString()).getString(OrderID.FIELD)); history = getMessageHistory(); history.addIncomingMessage(message3); history.addIncomingMessage(message2); history.addIncomingMessage(message1); assertEquals(new BigDecimal(300), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertEquals(orderID1.toString(), history.getLatestExecutionReport(clOrderID1.toString()).getString(OrderID.FIELD)); history = getMessageHistory(); history.addIncomingMessage(message3); history.addIncomingMessage(message1); history.addIncomingMessage(message2); assertEquals(new BigDecimal(300), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertEquals(orderID1.toString(), history.getLatestExecutionReport(clOrderID1.toString()).getString(OrderID.FIELD));}
52787 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52787/48153406f5051ec752935487d4f294d7298761d8/FIXMessageHistoryTest.java/buggy/source/trunk/src/test/java/org/marketcetera/photon/model/FIXMessageHistoryTest.java
message3.setField(ttFieldLater);
message3.getHeader().setField(stFieldLater);
public void testExecutionReportOrder() throws FieldNotFound { InternalID orderID1 = new InternalID("1"); InternalID clOrderID1 = new InternalID("2"); String execID = "3"; char execTransType = ExecTransType.STATUS; char execType = ExecType.PARTIAL_FILL; char ordStatus = OrdStatus.PARTIALLY_FILLED; char side = Side.SELL_SHORT; BigDecimal orderQty = new BigDecimal(1000); BigDecimal orderPrice = new BigDecimal(789); BigDecimal lastQty = new BigDecimal(100); BigDecimal lastPrice = new BigDecimal("12.3"); BigDecimal leavesQty = new BigDecimal(900); BigDecimal cumQty = new BigDecimal(100); BigDecimal avgPrice = new BigDecimal("12.3"); MSymbol symbol = new MSymbol("ASDF"); TransactTime ttField = new TransactTime(new Date(10000000)); TransactTime ttFieldLater = new TransactTime(new Date(10010000)); Message message1 = FIXMessageUtil.newExecutionReport(null, clOrderID1, execID, execTransType, execType, ordStatus, side, orderQty, orderPrice, lastQty, lastPrice, leavesQty, cumQty, avgPrice, symbol, null); message1.setField(ttField); lastQty = new BigDecimal(200); Message message2 = FIXMessageUtil.newExecutionReport(orderID1, clOrderID1, execID, execTransType, execType, ordStatus, side, orderQty, orderPrice, lastQty, lastPrice, leavesQty, cumQty, avgPrice, symbol, null); message2.setField(ttField); lastQty = new BigDecimal(300); Message message3 = FIXMessageUtil.newExecutionReport(orderID1, clOrderID1, execID, execTransType, execType, ordStatus, side, orderQty, orderPrice, lastQty, lastPrice, leavesQty, cumQty, avgPrice, symbol, null); message3.setField(ttFieldLater); FIXMessageHistory history = getMessageHistory(); history.addIncomingMessage(message1); history.addIncomingMessage(message2); assertEquals(new BigDecimal(200), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertEquals(orderID1.toString(), history.getLatestExecutionReport(clOrderID1.toString()).getString(OrderID.FIELD)); history = getMessageHistory(); history.addIncomingMessage(message2); history.addIncomingMessage(message1); assertEquals(new BigDecimal(100), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertTrue(!history.getLatestExecutionReport(clOrderID1.toString()).isSetField(OrderID.FIELD)); history = getMessageHistory(); history.addIncomingMessage(message1); history.addIncomingMessage(message2); history.addIncomingMessage(message3); assertEquals(new BigDecimal(300), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertEquals(orderID1.toString(), history.getLatestExecutionReport(clOrderID1.toString()).getString(OrderID.FIELD)); history = getMessageHistory(); history.addIncomingMessage(message3); history.addIncomingMessage(message2); history.addIncomingMessage(message1); assertEquals(new BigDecimal(300), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertEquals(orderID1.toString(), history.getLatestExecutionReport(clOrderID1.toString()).getString(OrderID.FIELD)); history = getMessageHistory(); history.addIncomingMessage(message3); history.addIncomingMessage(message1); history.addIncomingMessage(message2); assertEquals(new BigDecimal(300), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertEquals(orderID1.toString(), history.getLatestExecutionReport(clOrderID1.toString()).getString(OrderID.FIELD));}
52787 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52787/48153406f5051ec752935487d4f294d7298761d8/FIXMessageHistoryTest.java/buggy/source/trunk/src/test/java/org/marketcetera/photon/model/FIXMessageHistoryTest.java
assertEquals(new BigDecimal(100), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertTrue(!history.getLatestExecutionReport(clOrderID1.toString()).isSetField(OrderID.FIELD));
assertEquals(new BigDecimal(200), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertTrue(history.getLatestExecutionReport(clOrderID1.toString()).isSetField(OrderID.FIELD));
public void testExecutionReportOrder() throws FieldNotFound { InternalID orderID1 = new InternalID("1"); InternalID clOrderID1 = new InternalID("2"); String execID = "3"; char execTransType = ExecTransType.STATUS; char execType = ExecType.PARTIAL_FILL; char ordStatus = OrdStatus.PARTIALLY_FILLED; char side = Side.SELL_SHORT; BigDecimal orderQty = new BigDecimal(1000); BigDecimal orderPrice = new BigDecimal(789); BigDecimal lastQty = new BigDecimal(100); BigDecimal lastPrice = new BigDecimal("12.3"); BigDecimal leavesQty = new BigDecimal(900); BigDecimal cumQty = new BigDecimal(100); BigDecimal avgPrice = new BigDecimal("12.3"); MSymbol symbol = new MSymbol("ASDF"); TransactTime ttField = new TransactTime(new Date(10000000)); TransactTime ttFieldLater = new TransactTime(new Date(10010000)); Message message1 = FIXMessageUtil.newExecutionReport(null, clOrderID1, execID, execTransType, execType, ordStatus, side, orderQty, orderPrice, lastQty, lastPrice, leavesQty, cumQty, avgPrice, symbol, null); message1.setField(ttField); lastQty = new BigDecimal(200); Message message2 = FIXMessageUtil.newExecutionReport(orderID1, clOrderID1, execID, execTransType, execType, ordStatus, side, orderQty, orderPrice, lastQty, lastPrice, leavesQty, cumQty, avgPrice, symbol, null); message2.setField(ttField); lastQty = new BigDecimal(300); Message message3 = FIXMessageUtil.newExecutionReport(orderID1, clOrderID1, execID, execTransType, execType, ordStatus, side, orderQty, orderPrice, lastQty, lastPrice, leavesQty, cumQty, avgPrice, symbol, null); message3.setField(ttFieldLater); FIXMessageHistory history = getMessageHistory(); history.addIncomingMessage(message1); history.addIncomingMessage(message2); assertEquals(new BigDecimal(200), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertEquals(orderID1.toString(), history.getLatestExecutionReport(clOrderID1.toString()).getString(OrderID.FIELD)); history = getMessageHistory(); history.addIncomingMessage(message2); history.addIncomingMessage(message1); assertEquals(new BigDecimal(100), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertTrue(!history.getLatestExecutionReport(clOrderID1.toString()).isSetField(OrderID.FIELD)); history = getMessageHistory(); history.addIncomingMessage(message1); history.addIncomingMessage(message2); history.addIncomingMessage(message3); assertEquals(new BigDecimal(300), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertEquals(orderID1.toString(), history.getLatestExecutionReport(clOrderID1.toString()).getString(OrderID.FIELD)); history = getMessageHistory(); history.addIncomingMessage(message3); history.addIncomingMessage(message2); history.addIncomingMessage(message1); assertEquals(new BigDecimal(300), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertEquals(orderID1.toString(), history.getLatestExecutionReport(clOrderID1.toString()).getString(OrderID.FIELD)); history = getMessageHistory(); history.addIncomingMessage(message3); history.addIncomingMessage(message1); history.addIncomingMessage(message2); assertEquals(new BigDecimal(300), new BigDecimal(history.getLatestExecutionReport(clOrderID1.toString()).getString(LastQty.FIELD))); assertEquals(orderID1.toString(), history.getLatestExecutionReport(clOrderID1.toString()).getString(OrderID.FIELD));}
52787 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52787/48153406f5051ec752935487d4f294d7298761d8/FIXMessageHistoryTest.java/buggy/source/trunk/src/test/java/org/marketcetera/photon/model/FIXMessageHistoryTest.java
executionReportForOrder1.setField(new TransactTime(new Date(System.currentTimeMillis() - 10000)));
executionReportForOrder1.getHeader().setField(new SendingTime(new Date(currentTime - 10000)));
public void testGetLatestExecutionReports() throws FieldNotFound { FIXMessageHistory history = getMessageHistory(); Message order1 = FIXMessageUtil.newMarketOrder(new InternalID("1"), Side.BUY, new BigDecimal(1000), new MSymbol("ASDF"), TimeInForce.FILL_OR_KILL, new AccountID("ACCT")); Message executionReportForOrder1 = FIXMessageUtil.newExecutionReport(new InternalID("1001"), new InternalID("1"), "2001", ExecTransType.NEW, ExecType.NEW, OrdStatus.NEW, Side.BUY, new BigDecimal(1000), new BigDecimal(789), null, null, new BigDecimal(1000), BigDecimal.ZERO, BigDecimal.ZERO, new MSymbol("ASDF"), null); executionReportForOrder1.setField(new TransactTime(new Date(System.currentTimeMillis() - 10000))); Message order2 = FIXMessageUtil.newLimitOrder(new InternalID("3"), Side.SELL, new BigDecimal(2000), new MSymbol("QWER"), new BigDecimal("12.3"), TimeInForce.DAY, new AccountID("ACCT")); Message executionReportForOrder2 = FIXMessageUtil.newExecutionReport(new InternalID("1003"), new InternalID("3"), "2003", ExecTransType.NEW, ExecType.NEW, OrdStatus.NEW, Side.SELL, new BigDecimal(2000), new BigDecimal(789), null, null, new BigDecimal(2000), BigDecimal.ZERO, BigDecimal.ZERO, new MSymbol("QWER"), null); executionReportForOrder1.setField(new TransactTime(new Date(System.currentTimeMillis() - 8000))); Message secondExecutionReportForOrder1 = FIXMessageUtil.newExecutionReport(new InternalID("1001"), new InternalID("1"), "2004", ExecTransType.STATUS, ExecType.PARTIAL_FILL, OrdStatus.PARTIALLY_FILLED, Side.BUY, new BigDecimal(1000), new BigDecimal(789), new BigDecimal(100), new BigDecimal("11.5"), new BigDecimal(900), new BigDecimal(100), new BigDecimal("11.5"), new MSymbol("ASDF"), null); executionReportForOrder1.setField(new TransactTime(new Date(System.currentTimeMillis() - 7000))); history.addOutgoingMessage(order1); history.addIncomingMessage(executionReportForOrder1); history.addOutgoingMessage(order2); history.addIncomingMessage(executionReportForOrder2); history.addIncomingMessage(secondExecutionReportForOrder1); EventList<MessageHolder> historyList = history.getLatestExecutionReports(); assertEquals(2, historyList.size()); Message historyExecutionReportForOrder1 = historyList.get(0).getMessage(); Message historyExecutionReportForOrder2 = historyList.get(1).getMessage(); assertEquals("1001", historyExecutionReportForOrder1.getString(OrderID.FIELD)); assertEquals("2004", historyExecutionReportForOrder1.getString(ExecID.FIELD)); assertEquals(order1.getString(ClOrdID.FIELD), historyExecutionReportForOrder1.getString(ClOrdID.FIELD)); assertEquals(order1.getString(Side.FIELD), historyExecutionReportForOrder1.getString(Side.FIELD)); assertEquals(order1.getString(OrderQty.FIELD), historyExecutionReportForOrder1.getString(OrderQty.FIELD)); assertEquals(order1.getString(Symbol.FIELD), historyExecutionReportForOrder1.getString(Symbol.FIELD)); assertEquals("1003", historyExecutionReportForOrder2.getString(OrderID.FIELD)); assertEquals("2003", historyExecutionReportForOrder2.getString(ExecID.FIELD)); assertEquals(order2.getString(ClOrdID.FIELD), historyExecutionReportForOrder2.getString(ClOrdID.FIELD)); assertEquals(order2.getString(Side.FIELD), historyExecutionReportForOrder2.getString(Side.FIELD)); assertEquals(order2.getString(OrderQty.FIELD), historyExecutionReportForOrder2.getString(OrderQty.FIELD)); assertEquals(order2.getString(Symbol.FIELD), historyExecutionReportForOrder2.getString(Symbol.FIELD));}
52787 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52787/48153406f5051ec752935487d4f294d7298761d8/FIXMessageHistoryTest.java/buggy/source/trunk/src/test/java/org/marketcetera/photon/model/FIXMessageHistoryTest.java
executionReportForOrder1.setField(new TransactTime(new Date(System.currentTimeMillis() - 8000)));
executionReportForOrder2.getHeader().setField(new SendingTime(new Date(currentTime - 8000)));
public void testGetLatestExecutionReports() throws FieldNotFound { FIXMessageHistory history = getMessageHistory(); Message order1 = FIXMessageUtil.newMarketOrder(new InternalID("1"), Side.BUY, new BigDecimal(1000), new MSymbol("ASDF"), TimeInForce.FILL_OR_KILL, new AccountID("ACCT")); Message executionReportForOrder1 = FIXMessageUtil.newExecutionReport(new InternalID("1001"), new InternalID("1"), "2001", ExecTransType.NEW, ExecType.NEW, OrdStatus.NEW, Side.BUY, new BigDecimal(1000), new BigDecimal(789), null, null, new BigDecimal(1000), BigDecimal.ZERO, BigDecimal.ZERO, new MSymbol("ASDF"), null); executionReportForOrder1.setField(new TransactTime(new Date(System.currentTimeMillis() - 10000))); Message order2 = FIXMessageUtil.newLimitOrder(new InternalID("3"), Side.SELL, new BigDecimal(2000), new MSymbol("QWER"), new BigDecimal("12.3"), TimeInForce.DAY, new AccountID("ACCT")); Message executionReportForOrder2 = FIXMessageUtil.newExecutionReport(new InternalID("1003"), new InternalID("3"), "2003", ExecTransType.NEW, ExecType.NEW, OrdStatus.NEW, Side.SELL, new BigDecimal(2000), new BigDecimal(789), null, null, new BigDecimal(2000), BigDecimal.ZERO, BigDecimal.ZERO, new MSymbol("QWER"), null); executionReportForOrder1.setField(new TransactTime(new Date(System.currentTimeMillis() - 8000))); Message secondExecutionReportForOrder1 = FIXMessageUtil.newExecutionReport(new InternalID("1001"), new InternalID("1"), "2004", ExecTransType.STATUS, ExecType.PARTIAL_FILL, OrdStatus.PARTIALLY_FILLED, Side.BUY, new BigDecimal(1000), new BigDecimal(789), new BigDecimal(100), new BigDecimal("11.5"), new BigDecimal(900), new BigDecimal(100), new BigDecimal("11.5"), new MSymbol("ASDF"), null); executionReportForOrder1.setField(new TransactTime(new Date(System.currentTimeMillis() - 7000))); history.addOutgoingMessage(order1); history.addIncomingMessage(executionReportForOrder1); history.addOutgoingMessage(order2); history.addIncomingMessage(executionReportForOrder2); history.addIncomingMessage(secondExecutionReportForOrder1); EventList<MessageHolder> historyList = history.getLatestExecutionReports(); assertEquals(2, historyList.size()); Message historyExecutionReportForOrder1 = historyList.get(0).getMessage(); Message historyExecutionReportForOrder2 = historyList.get(1).getMessage(); assertEquals("1001", historyExecutionReportForOrder1.getString(OrderID.FIELD)); assertEquals("2004", historyExecutionReportForOrder1.getString(ExecID.FIELD)); assertEquals(order1.getString(ClOrdID.FIELD), historyExecutionReportForOrder1.getString(ClOrdID.FIELD)); assertEquals(order1.getString(Side.FIELD), historyExecutionReportForOrder1.getString(Side.FIELD)); assertEquals(order1.getString(OrderQty.FIELD), historyExecutionReportForOrder1.getString(OrderQty.FIELD)); assertEquals(order1.getString(Symbol.FIELD), historyExecutionReportForOrder1.getString(Symbol.FIELD)); assertEquals("1003", historyExecutionReportForOrder2.getString(OrderID.FIELD)); assertEquals("2003", historyExecutionReportForOrder2.getString(ExecID.FIELD)); assertEquals(order2.getString(ClOrdID.FIELD), historyExecutionReportForOrder2.getString(ClOrdID.FIELD)); assertEquals(order2.getString(Side.FIELD), historyExecutionReportForOrder2.getString(Side.FIELD)); assertEquals(order2.getString(OrderQty.FIELD), historyExecutionReportForOrder2.getString(OrderQty.FIELD)); assertEquals(order2.getString(Symbol.FIELD), historyExecutionReportForOrder2.getString(Symbol.FIELD));}
52787 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52787/48153406f5051ec752935487d4f294d7298761d8/FIXMessageHistoryTest.java/buggy/source/trunk/src/test/java/org/marketcetera/photon/model/FIXMessageHistoryTest.java
executionReportForOrder1.setField(new TransactTime(new Date(System.currentTimeMillis() - 7000)));
secondExecutionReportForOrder1.getHeader().setField(new SendingTime(new Date(currentTime - 7000)));
public void testGetLatestExecutionReports() throws FieldNotFound { FIXMessageHistory history = getMessageHistory(); Message order1 = FIXMessageUtil.newMarketOrder(new InternalID("1"), Side.BUY, new BigDecimal(1000), new MSymbol("ASDF"), TimeInForce.FILL_OR_KILL, new AccountID("ACCT")); Message executionReportForOrder1 = FIXMessageUtil.newExecutionReport(new InternalID("1001"), new InternalID("1"), "2001", ExecTransType.NEW, ExecType.NEW, OrdStatus.NEW, Side.BUY, new BigDecimal(1000), new BigDecimal(789), null, null, new BigDecimal(1000), BigDecimal.ZERO, BigDecimal.ZERO, new MSymbol("ASDF"), null); executionReportForOrder1.setField(new TransactTime(new Date(System.currentTimeMillis() - 10000))); Message order2 = FIXMessageUtil.newLimitOrder(new InternalID("3"), Side.SELL, new BigDecimal(2000), new MSymbol("QWER"), new BigDecimal("12.3"), TimeInForce.DAY, new AccountID("ACCT")); Message executionReportForOrder2 = FIXMessageUtil.newExecutionReport(new InternalID("1003"), new InternalID("3"), "2003", ExecTransType.NEW, ExecType.NEW, OrdStatus.NEW, Side.SELL, new BigDecimal(2000), new BigDecimal(789), null, null, new BigDecimal(2000), BigDecimal.ZERO, BigDecimal.ZERO, new MSymbol("QWER"), null); executionReportForOrder1.setField(new TransactTime(new Date(System.currentTimeMillis() - 8000))); Message secondExecutionReportForOrder1 = FIXMessageUtil.newExecutionReport(new InternalID("1001"), new InternalID("1"), "2004", ExecTransType.STATUS, ExecType.PARTIAL_FILL, OrdStatus.PARTIALLY_FILLED, Side.BUY, new BigDecimal(1000), new BigDecimal(789), new BigDecimal(100), new BigDecimal("11.5"), new BigDecimal(900), new BigDecimal(100), new BigDecimal("11.5"), new MSymbol("ASDF"), null); executionReportForOrder1.setField(new TransactTime(new Date(System.currentTimeMillis() - 7000))); history.addOutgoingMessage(order1); history.addIncomingMessage(executionReportForOrder1); history.addOutgoingMessage(order2); history.addIncomingMessage(executionReportForOrder2); history.addIncomingMessage(secondExecutionReportForOrder1); EventList<MessageHolder> historyList = history.getLatestExecutionReports(); assertEquals(2, historyList.size()); Message historyExecutionReportForOrder1 = historyList.get(0).getMessage(); Message historyExecutionReportForOrder2 = historyList.get(1).getMessage(); assertEquals("1001", historyExecutionReportForOrder1.getString(OrderID.FIELD)); assertEquals("2004", historyExecutionReportForOrder1.getString(ExecID.FIELD)); assertEquals(order1.getString(ClOrdID.FIELD), historyExecutionReportForOrder1.getString(ClOrdID.FIELD)); assertEquals(order1.getString(Side.FIELD), historyExecutionReportForOrder1.getString(Side.FIELD)); assertEquals(order1.getString(OrderQty.FIELD), historyExecutionReportForOrder1.getString(OrderQty.FIELD)); assertEquals(order1.getString(Symbol.FIELD), historyExecutionReportForOrder1.getString(Symbol.FIELD)); assertEquals("1003", historyExecutionReportForOrder2.getString(OrderID.FIELD)); assertEquals("2003", historyExecutionReportForOrder2.getString(ExecID.FIELD)); assertEquals(order2.getString(ClOrdID.FIELD), historyExecutionReportForOrder2.getString(ClOrdID.FIELD)); assertEquals(order2.getString(Side.FIELD), historyExecutionReportForOrder2.getString(Side.FIELD)); assertEquals(order2.getString(OrderQty.FIELD), historyExecutionReportForOrder2.getString(OrderQty.FIELD)); assertEquals(order2.getString(Symbol.FIELD), historyExecutionReportForOrder2.getString(Symbol.FIELD));}
52787 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52787/48153406f5051ec752935487d4f294d7298761d8/FIXMessageHistoryTest.java/buggy/source/trunk/src/test/java/org/marketcetera/photon/model/FIXMessageHistoryTest.java
public void paintFixed( Context c, BlockBox block ) {
public void paintFixed( Context c, Box block ) {
public void paintFixed( Context c, BlockBox block ) { int xoff = 0; int yoff = 0; xoff = c.canvas.getWidth(); yoff = c.canvas.getHeight(); if ( block.right_set ) { xoff = xoff - block.width; } if ( block.bottom_set ) { //joshy: this should really be block.height instead of bnds.y // need to fix the setting of block.height //joshy: need to do horizontal calcs too, inc scrolling //joshy: need to make the body paint the whole canvas. // start at the bottom of the viewport yoff = c.viewport.getHeight(); // account for the width of the box yoff = yoff - block.height; // - bnds.y // account for the current y offset of the box yoff = yoff - c.getExtents().y; //orig.y; // account for the scrolling of the viewport yoff = yoff - c.canvas.getLocation().y; } c.translate( xoff, yoff ); paintNormal( c, block ); c.translate( -xoff, -yoff ); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/0c66b0065199584307997eaf70c9585a4d0964be/BoxRenderer.java/clean/src/java/org/xhtmlrenderer/render/BoxRenderer.java
public void paintNormal( Context c, BlockBox block ) {
public void paintNormal( Context c, Box block ) {
public void paintNormal( Context c, BlockBox block ) { paintBackground( c, block ); c.translateInsets( block ); paintComponent( c, block ); paintChildren( c, block ); c.untranslateInsets( block ); paintBorder( c, block ); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/0c66b0065199584307997eaf70c9585a4d0964be/BoxRenderer.java/clean/src/java/org/xhtmlrenderer/render/BoxRenderer.java
public void paintRelative( Context ctx, BlockBox block ) {
public void paintRelative( Context ctx, Box block ) {
public void paintRelative( Context ctx, BlockBox block ) { ctx.getGraphics().translate( block.left, block.top ); paintNormal( ctx, block ); ctx.getGraphics().translate( -block.left, -block.top ); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/0c66b0065199584307997eaf70c9585a4d0964be/BoxRenderer.java/clean/src/java/org/xhtmlrenderer/render/BoxRenderer.java
_validate(
validate(
public EmailAddress addEmailAddress( String userId, String className, String classPK, String address, String typeId, boolean primary) throws PortalException, SystemException { User user = UserUtil.findByPrimaryKey(userId); _validate( null, user.getCompanyId(), className, classPK, address, typeId, primary); String emailAddressId = Long.toString(CounterServiceUtil.increment( EmailAddress.class.getName())); EmailAddress emailAddress = EmailAddressUtil.create(emailAddressId); Date now = new Date(); emailAddress.setCompanyId(user.getCompanyId()); emailAddress.setUserId(user.getUserId()); emailAddress.setUserName(user.getFullName()); emailAddress.setCreateDate(now); emailAddress.setModifiedDate(now); emailAddress.setClassName(className); emailAddress.setClassPK(classPK); emailAddress.setAddress(address); emailAddress.setTypeId(typeId); emailAddress.setPrimary(primary); EmailAddressUtil.update(emailAddress); return emailAddress; }
57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f3ad9fb1651cda52873ea772c3df0bb9bd03b52f/EmailAddressLocalServiceImpl.java/clean/portal-ejb/src/com/liferay/portal/service/impl/EmailAddressLocalServiceImpl.java
Date now = new Date();
public EmailAddress addEmailAddress( String userId, String className, String classPK, String address, String typeId, boolean primary) throws PortalException, SystemException { User user = UserUtil.findByPrimaryKey(userId); _validate( null, user.getCompanyId(), className, classPK, address, typeId, primary); String emailAddressId = Long.toString(CounterServiceUtil.increment( EmailAddress.class.getName())); EmailAddress emailAddress = EmailAddressUtil.create(emailAddressId); Date now = new Date(); emailAddress.setCompanyId(user.getCompanyId()); emailAddress.setUserId(user.getUserId()); emailAddress.setUserName(user.getFullName()); emailAddress.setCreateDate(now); emailAddress.setModifiedDate(now); emailAddress.setClassName(className); emailAddress.setClassPK(classPK); emailAddress.setAddress(address); emailAddress.setTypeId(typeId); emailAddress.setPrimary(primary); EmailAddressUtil.update(emailAddress); return emailAddress; }
57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f3ad9fb1651cda52873ea772c3df0bb9bd03b52f/EmailAddressLocalServiceImpl.java/clean/portal-ejb/src/com/liferay/portal/service/impl/EmailAddressLocalServiceImpl.java
_validate(emailAddressId, null, null, null, address, typeId, primary);
validate(emailAddressId, null, null, null, address, typeId, primary);
public EmailAddress updateEmailAddress( String emailAddressId, String address, String typeId, boolean primary) throws PortalException, SystemException { _validate(emailAddressId, null, null, null, address, typeId, primary); EmailAddress emailAddress = EmailAddressUtil.findByPrimaryKey(emailAddressId); emailAddress.setModifiedDate(new Date()); emailAddress.setAddress(address); emailAddress.setTypeId(typeId); emailAddress.setPrimary(primary); EmailAddressUtil.update(emailAddress); return emailAddress; }
57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f3ad9fb1651cda52873ea772c3df0bb9bd03b52f/EmailAddressLocalServiceImpl.java/clean/portal-ejb/src/com/liferay/portal/service/impl/EmailAddressLocalServiceImpl.java
public boolean isLeaf( Object nd ) { Node node = (Node)nd; //u.p("checking leaf: " + node.getNodeName()); //u.p("is: " + node.hasChildNodes()); return !node.hasChildNodes(); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/0c66b0065199584307997eaf70c9585a4d0964be/DOMInspector.java/buggy/src/java/org/xhtmlrenderer/swing/DOMInspector.java
if(!(obj instanceof Sequential)) return false; for(ISeq s = seq(), ms = ((IPersistentCollection)obj).seq();s!=null;s = s.rest(), ms = ms.rest()) { if(ms == null || !RT.equal(s.first(),ms.first()))
if(!(obj instanceof Sequential))
public boolean equals(Object obj) { if(!(obj instanceof Sequential)) return false; for(ISeq s = seq(), ms = ((IPersistentCollection)obj).seq();s!=null;s = s.rest(), ms = ms.rest()) { if(ms == null || !RT.equal(s.first(),ms.first())) return false; } return true;}
52334 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52334/be12a746746c53c1f00758df7daa1fa5edc03935/ASeq.java/clean/src/jvm/clojure/lang/ASeq.java
}
ISeq ms = ((IPersistentCollection)obj).seq(); for(ISeq s = seq();s!=null;s = s.rest(), ms = ms.rest()) { if(ms == null || !RT.equal(s.first(),ms.first())) return false; } if(ms.rest() != null) return false;
public boolean equals(Object obj) { if(!(obj instanceof Sequential)) return false; for(ISeq s = seq(), ms = ((IPersistentCollection)obj).seq();s!=null;s = s.rest(), ms = ms.rest()) { if(ms == null || !RT.equal(s.first(),ms.first())) return false; } return true;}
52334 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52334/be12a746746c53c1f00758df7daa1fa5edc03935/ASeq.java/clean/src/jvm/clojure/lang/ASeq.java
public ActionForward render( ActionMapping mapping, ActionForm form, PortletConfig config, RenderRequest req, RenderResponse res) throws Exception { ThemeDisplay themeDisplay = (ThemeDisplay)req.getAttribute(WebKeys.THEME_DISPLAY); PermissionChecker permissionChecker = themeDisplay.getPermissionChecker(); String ownerId = Layout.getOwnerId(themeDisplay.getPlid()); String groupId = Layout.getGroupId(ownerId); String portletResource = ParamUtil.getString(req, "portletResource"); String modelResource = ParamUtil.getString(req, "modelResource"); String resourcePrimKey = ParamUtil.getString(req, "resourcePrimKey"); String selResource = portletResource; if (Validator.isNotNull(modelResource)) { selResource = modelResource; } try { PermissionServiceUtil.checkPermission(permissionChecker, groupId, selResource, resourcePrimKey); } catch (PrincipalException pe) { SessionErrors.add(req, PrincipalException.class.getName()); setForward(req, "portlet.portlet_configuration.error"); } Portlet portlet = PortletLocalServiceUtil.getPortletById( themeDisplay.getCompanyId(), portletResource); ServletContext ctx = (ServletContext)req.getAttribute(WebKeys.CTX); if (portlet != null) { res.setTitle( PortalUtil.getPortletTitle(portlet, ctx, themeDisplay.getLocale())); } return mapping.findForward( getForward(req, "portlet.portlet_configuration.edit_permissions")); }
57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/b5cc9c4eaf4897f51730cc777f5af4a427b25232/EditPermissionsAction.java/clean/portal-ejb/src/com/liferay/portlet/portletconfiguration/action/EditPermissionsAction.java
protected void updateUserPermissions(ActionRequest req) throws Exception { String resourceId = ParamUtil.getString(req, "resourceId"); String userId = ParamUtil.getString(req, "userIdsPosValue"); String[] actionIds = StringUtil.split( ParamUtil.getString(req, "userIdActionIds")); ThemeDisplay themeDisplay = (ThemeDisplay)req.getAttribute(WebKeys.THEME_DISPLAY); PermissionServiceUtil.setUserPermissions(userId, themeDisplay.getPortletGroupId(), actionIds, resourceId); }
57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/b5cc9c4eaf4897f51730cc777f5af4a427b25232/EditPermissionsAction.java/clean/portal-ejb/src/com/liferay/portlet/portletconfiguration/action/EditPermissionsAction.java
} else { setOpaque(true);
public void startLayout(Graphics g) { this.removeAll(); if ( g == null ) { return; } if ( doc == null ) { return; } Element html = (Element)doc.getDocumentElement(); //Element body = x.child( html, "body" ); //body = html; // set up CSS newContext( g ); getContext().setMaxWidth( 0 ); //long start_time = new java.util.Date().getTime(); //u.p("layout = " + layout); body_box = layout.layout( getContext(), html ); //u.p("is a fixed child: " + body_box.isChildrenExceedBounds()); // if there is a fixed child then we need to set opaque to false // so that the entire viewport will be repainted. this is slower // but that's the hit you get from using fixed layout if(body_box.isChildrenExceedBounds()) { setOpaque(false); } getRenderingContext().root_box = body_box; //u.p("after layout: " + body_box); //long end_time = new java.util.Date().getTime(); if ( enclosingScrollPane != null ) { if ( this.body_box != null ) { this.enclosingScrollPane.getViewport().setBackground( body_box.background_color ); } } intrinsic_size = new Dimension( getContext().getMaxWidth(), layout.contents_height ); if(enclosingScrollPane != null) { //u.p("enclosing scroll pane = " + this.enclosingScrollPane); int view_height = this.enclosingScrollPane.getViewport().getHeight(); // resize the outter most box incase it is too small for the viewport if(intrinsic_size.getHeight() < view_height) { if(body_box != null) { body_box.height = view_height; } } } if ( !intrinsic_size.equals( this.getSize() ) ) { this.setPreferredSize( intrinsic_size ); this.revalidate(); } this.fireDocumentLoaded(); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/f8bee2c3d6595609a6aeadf8d3660260aee7f705/HTMLPanel.java/buggy/src/java/org/xhtmlrenderer/swing/HTMLPanel.java
list.setSorter(new ViewerSorter() {});
list.setSorter(new ViewerSorter());
protected Control createDialogArea(Composite parent) { // Run super. Composite composite = (Composite)super.createDialogArea(parent); // Add perspective list. list = new TableViewer(composite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); list.getTable().setFont(parent.getFont()); list.setLabelProvider(new PerspLabelProvider()); list.setContentProvider(new PerspContentProvider()); list.setSorter(new ViewerSorter() {}); list.setInput(perspReg); list.addSelectionChangedListener(this); list.addDoubleClickListener(new IDoubleClickListener() { public void doubleClick(DoubleClickEvent event) { handleDoubleClickEvent(); } }); // Set list layout. Control ctrl = list.getControl(); GridData spec = new GridData(GridData.FILL_BOTH); spec.widthHint = LIST_WIDTH; spec.heightHint = LIST_HEIGHT; ctrl.setLayoutData(spec); ctrl.setFont(parent.getFont()); // Return results. return composite;}
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/c2190ec2085d24ea097a06d64260a852f1e22142/SelectPerspectiveDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/SelectPerspectiveDialog.java
super.init(config);
public void init(ServletConfig config) throws ServletException { super.init(config); String servletClass = config.getInitParameter("servlet-class"); ClassLoader classLoader = PortalClassLoaderUtil.getClassLoader(); try { _servlet = (HttpServlet)classLoader.loadClass( servletClass).newInstance(); } catch (ClassNotFoundException cnfe) { throw new ServletException(cnfe.getMessage()); } catch (IllegalAccessException iae) { throw new ServletException(iae.getMessage()); } catch (InstantiationException ie) { throw new ServletException(ie.getMessage()); } _servlet.init(config); }
57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/43e954ab1d12f1bb4580a2bc64f81af38c8d1e96/PortalServletWrapper.java/clean/portal-shared/src/com/liferay/portal/shared/servlet/PortalServletWrapper.java
Asserts.notNull(file, "No such file to load");
assert file != null : "No such file to load";
public void loadFile(File file, boolean wrap) { Asserts.notNull(file, "No such file to load"); try { BufferedReader source = new BufferedReader(new FileReader(file)); loadScript(file.getPath(), source, wrap); source.close(); } catch (IOException ioExcptn) { throw IOError.fromException(this, ioExcptn); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b72a2862ae5b2f01f9a767ef2ce248fd785857c4/Ruby.java/clean/src/org/jruby/Ruby.java
FolderInfo testFolder = new FolderInfo("testFolder", IdGenerator.makeId(), true);
FolderInfo testFolder = new FolderInfo("testFolder", IdGenerator .makeId(), true);
protected void setUp() throws Exception { System.out.println("DeletionSyncTest.setUp()"); super.setUp(); makeFriends(); FolderInfo testFolder = new FolderInfo("testFolder", IdGenerator.makeId(), true); folder1 = getContoller1().getFolderRepository().createFolder( testFolder, new File(BASEDIR1)); folder2 = getContoller2().getFolderRepository().createFolder( testFolder, new File(BASEDIR2)); // Give them time to join Thread.sleep(500); checkFolderJoined(); }
51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/277ea8b19ea90026784553f8d75a4b9eae65c2c0/DeletionSyncTest.java/buggy/src/test/de/dal33t/powerfolder/test/DeletionSyncTest.java
public void testDeletionSync() throws IOException, InterruptedException { // file "host" and "client" folder1.setSyncProfile(SyncProfile.MANUAL_DOWNLOAD); folder2.setSyncProfile(SyncProfile.SYNCHRONIZE_PCS); File file1 = createTestFile(folder1, "/TestFile.txt", "This are the contents of the testfile".getBytes()); File file2 = createTestFile(folder1, "/TestFile2.txt", "This are the contents of the 2nd testfile".getBytes()); File file3 = createTestFile(folder1, "/sub/sub/TestFile3.txt", "This are the contents of the 3nd testfile".getBytes()); // Let him scan the new content folder1.forceNextScan(); folder1.scan(); assertEquals(3, folder1.getFilesCount()); // Give them time to copy Thread.sleep(3000); // Test ;) assertEquals(3, folder2.getFilesCount()); // No active downloads? assertEquals(0, getContoller2().getTransferManager() .getActiveDownloadCount()); assertEquals(getContoller1().getRecycleBin().getSize(), 0); assertEquals(getContoller2().getRecycleBin().getSize(), 0); file1.delete(); file2.delete(); file3.delete(); assertFalse(file1.exists()); assertFalse(file2.exists()); assertFalse(file3.exists()); // Let him scan the new content folder1.forceNextScan(); folder1.scan(); //all 3 must be deleted FileInfo[] localFiles = folder1.getFiles(); for (FileInfo fileInfo : localFiles) { assertTrue(fileInfo.isDeleted()); } // Give them time to copy Thread.sleep(3000); // all 3 must be deleted remote FileInfo[] remoteFiles = folder2.getFiles(); for (FileInfo fileInfo : remoteFiles) { assertTrue(fileInfo.isDeleted()); File file = folder2.getDiskFile(fileInfo); assertFalse(file.exists()); } assertEquals(getContoller2().getRecycleBin().getSize(), 3); }
51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/277ea8b19ea90026784553f8d75a4b9eae65c2c0/DeletionSyncTest.java/buggy/src/test/de/dal33t/powerfolder/test/DeletionSyncTest.java
public void testDeletionSync() throws IOException, InterruptedException { // file "host" and "client" folder1.setSyncProfile(SyncProfile.MANUAL_DOWNLOAD); folder2.setSyncProfile(SyncProfile.SYNCHRONIZE_PCS); File file1 = createTestFile(folder1, "/TestFile.txt", "This are the contents of the testfile".getBytes()); File file2 = createTestFile(folder1, "/TestFile2.txt", "This are the contents of the 2nd testfile".getBytes()); File file3 = createTestFile(folder1, "/sub/sub/TestFile3.txt", "This are the contents of the 3nd testfile".getBytes()); // Let him scan the new content folder1.forceNextScan(); folder1.scan(); assertEquals(3, folder1.getFilesCount()); // Give them time to copy Thread.sleep(3000); // Test ;) assertEquals(3, folder2.getFilesCount()); // No active downloads? assertEquals(0, getContoller2().getTransferManager() .getActiveDownloadCount()); assertEquals(getContoller1().getRecycleBin().getSize(), 0); assertEquals(getContoller2().getRecycleBin().getSize(), 0); file1.delete(); file2.delete(); file3.delete(); assertFalse(file1.exists()); assertFalse(file2.exists()); assertFalse(file3.exists()); // Let him scan the new content folder1.forceNextScan(); folder1.scan(); //all 3 must be deleted FileInfo[] localFiles = folder1.getFiles(); for (FileInfo fileInfo : localFiles) { assertTrue(fileInfo.isDeleted()); } // Give them time to copy Thread.sleep(3000); // all 3 must be deleted remote FileInfo[] remoteFiles = folder2.getFiles(); for (FileInfo fileInfo : remoteFiles) { assertTrue(fileInfo.isDeleted()); File file = folder2.getDiskFile(fileInfo); assertFalse(file.exists()); } assertEquals(getContoller2().getRecycleBin().getSize(), 3); }
51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/277ea8b19ea90026784553f8d75a4b9eae65c2c0/DeletionSyncTest.java/buggy/src/test/de/dal33t/powerfolder/test/DeletionSyncTest.java
public void testDeletionSync() throws IOException, InterruptedException { // file "host" and "client" folder1.setSyncProfile(SyncProfile.MANUAL_DOWNLOAD); folder2.setSyncProfile(SyncProfile.SYNCHRONIZE_PCS); File file1 = createTestFile(folder1, "/TestFile.txt", "This are the contents of the testfile".getBytes()); File file2 = createTestFile(folder1, "/TestFile2.txt", "This are the contents of the 2nd testfile".getBytes()); File file3 = createTestFile(folder1, "/sub/sub/TestFile3.txt", "This are the contents of the 3nd testfile".getBytes()); // Let him scan the new content folder1.forceNextScan(); folder1.scan(); assertEquals(3, folder1.getFilesCount()); // Give them time to copy Thread.sleep(3000); // Test ;) assertEquals(3, folder2.getFilesCount()); // No active downloads? assertEquals(0, getContoller2().getTransferManager() .getActiveDownloadCount()); assertEquals(getContoller1().getRecycleBin().getSize(), 0); assertEquals(getContoller2().getRecycleBin().getSize(), 0); file1.delete(); file2.delete(); file3.delete(); assertFalse(file1.exists()); assertFalse(file2.exists()); assertFalse(file3.exists()); // Let him scan the new content folder1.forceNextScan(); folder1.scan(); //all 3 must be deleted FileInfo[] localFiles = folder1.getFiles(); for (FileInfo fileInfo : localFiles) { assertTrue(fileInfo.isDeleted()); } // Give them time to copy Thread.sleep(3000); // all 3 must be deleted remote FileInfo[] remoteFiles = folder2.getFiles(); for (FileInfo fileInfo : remoteFiles) { assertTrue(fileInfo.isDeleted()); File file = folder2.getDiskFile(fileInfo); assertFalse(file.exists()); } assertEquals(getContoller2().getRecycleBin().getSize(), 3); }
51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/277ea8b19ea90026784553f8d75a4b9eae65c2c0/DeletionSyncTest.java/buggy/src/test/de/dal33t/powerfolder/test/DeletionSyncTest.java
public void testDeletionSync() throws IOException, InterruptedException { // file "host" and "client" folder1.setSyncProfile(SyncProfile.MANUAL_DOWNLOAD); folder2.setSyncProfile(SyncProfile.SYNCHRONIZE_PCS); File file1 = createTestFile(folder1, "/TestFile.txt", "This are the contents of the testfile".getBytes()); File file2 = createTestFile(folder1, "/TestFile2.txt", "This are the contents of the 2nd testfile".getBytes()); File file3 = createTestFile(folder1, "/sub/sub/TestFile3.txt", "This are the contents of the 3nd testfile".getBytes()); // Let him scan the new content folder1.forceNextScan(); folder1.scan(); assertEquals(3, folder1.getFilesCount()); // Give them time to copy Thread.sleep(3000); // Test ;) assertEquals(3, folder2.getFilesCount()); // No active downloads? assertEquals(0, getContoller2().getTransferManager() .getActiveDownloadCount()); assertEquals(getContoller1().getRecycleBin().getSize(), 0); assertEquals(getContoller2().getRecycleBin().getSize(), 0); file1.delete(); file2.delete(); file3.delete(); assertFalse(file1.exists()); assertFalse(file2.exists()); assertFalse(file3.exists()); // Let him scan the new content folder1.forceNextScan(); folder1.scan(); //all 3 must be deleted FileInfo[] localFiles = folder1.getFiles(); for (FileInfo fileInfo : localFiles) { assertTrue(fileInfo.isDeleted()); } // Give them time to copy Thread.sleep(3000); // all 3 must be deleted remote FileInfo[] remoteFiles = folder2.getFiles(); for (FileInfo fileInfo : remoteFiles) { assertTrue(fileInfo.isDeleted()); File file = folder2.getDiskFile(fileInfo); assertFalse(file.exists()); } assertEquals(getContoller2().getRecycleBin().getSize(), 3); }
51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/277ea8b19ea90026784553f8d75a4b9eae65c2c0/DeletionSyncTest.java/buggy/src/test/de/dal33t/powerfolder/test/DeletionSyncTest.java
public void testDeletionSync() throws IOException, InterruptedException { // file "host" and "client" folder1.setSyncProfile(SyncProfile.MANUAL_DOWNLOAD); folder2.setSyncProfile(SyncProfile.SYNCHRONIZE_PCS); File file1 = createTestFile(folder1, "/TestFile.txt", "This are the contents of the testfile".getBytes()); File file2 = createTestFile(folder1, "/TestFile2.txt", "This are the contents of the 2nd testfile".getBytes()); File file3 = createTestFile(folder1, "/sub/sub/TestFile3.txt", "This are the contents of the 3nd testfile".getBytes()); // Let him scan the new content folder1.forceNextScan(); folder1.scan(); assertEquals(3, folder1.getFilesCount()); // Give them time to copy Thread.sleep(3000); // Test ;) assertEquals(3, folder2.getFilesCount()); // No active downloads? assertEquals(0, getContoller2().getTransferManager() .getActiveDownloadCount()); assertEquals(getContoller1().getRecycleBin().getSize(), 0); assertEquals(getContoller2().getRecycleBin().getSize(), 0); file1.delete(); file2.delete(); file3.delete(); assertFalse(file1.exists()); assertFalse(file2.exists()); assertFalse(file3.exists()); // Let him scan the new content folder1.forceNextScan(); folder1.scan(); //all 3 must be deleted FileInfo[] localFiles = folder1.getFiles(); for (FileInfo fileInfo : localFiles) { assertTrue(fileInfo.isDeleted()); } // Give them time to copy Thread.sleep(3000); // all 3 must be deleted remote FileInfo[] remoteFiles = folder2.getFiles(); for (FileInfo fileInfo : remoteFiles) { assertTrue(fileInfo.isDeleted()); File file = folder2.getDiskFile(fileInfo); assertFalse(file.exists()); } assertEquals(getContoller2().getRecycleBin().getSize(), 3); }
51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/277ea8b19ea90026784553f8d75a4b9eae65c2c0/DeletionSyncTest.java/buggy/src/test/de/dal33t/powerfolder/test/DeletionSyncTest.java
public void testDeletionSync() throws IOException, InterruptedException { // file "host" and "client" folder1.setSyncProfile(SyncProfile.MANUAL_DOWNLOAD); folder2.setSyncProfile(SyncProfile.SYNCHRONIZE_PCS); File file1 = createTestFile(folder1, "/TestFile.txt", "This are the contents of the testfile".getBytes()); File file2 = createTestFile(folder1, "/TestFile2.txt", "This are the contents of the 2nd testfile".getBytes()); File file3 = createTestFile(folder1, "/sub/sub/TestFile3.txt", "This are the contents of the 3nd testfile".getBytes()); // Let him scan the new content folder1.forceNextScan(); folder1.scan(); assertEquals(3, folder1.getFilesCount()); // Give them time to copy Thread.sleep(3000); // Test ;) assertEquals(3, folder2.getFilesCount()); // No active downloads? assertEquals(0, getContoller2().getTransferManager() .getActiveDownloadCount()); assertEquals(getContoller1().getRecycleBin().getSize(), 0); assertEquals(getContoller2().getRecycleBin().getSize(), 0); file1.delete(); file2.delete(); file3.delete(); assertFalse(file1.exists()); assertFalse(file2.exists()); assertFalse(file3.exists()); // Let him scan the new content folder1.forceNextScan(); folder1.scan(); //all 3 must be deleted FileInfo[] localFiles = folder1.getFiles(); for (FileInfo fileInfo : localFiles) { assertTrue(fileInfo.isDeleted()); } // Give them time to copy Thread.sleep(3000); // all 3 must be deleted remote FileInfo[] remoteFiles = folder2.getFiles(); for (FileInfo fileInfo : remoteFiles) { assertTrue(fileInfo.isDeleted()); File file = folder2.getDiskFile(fileInfo); assertFalse(file.exists()); } assertEquals(getContoller2().getRecycleBin().getSize(), 3); }
51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/277ea8b19ea90026784553f8d75a4b9eae65c2c0/DeletionSyncTest.java/buggy/src/test/de/dal33t/powerfolder/test/DeletionSyncTest.java