rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
throw new RangeError(runtime, inspect().toString() + " out of range."); | throw new RangeError(getRuntime(), inspect().toString() + " out of range."); | public long[] getBeginLength(long limit, boolean truncate, boolean isStrict) { long beginLong = RubyNumeric.num2long(begin); long endLong = RubyNumeric.num2long(end); if (! isExclusive) { endLong++; } if (beginLong < 0) { beginLong += limit; if (beginLong < 0) { if (isStrict) { throw new RangeError(runtime, inspect().toString() + " out of range."); } return null; } } if (truncate && beginLong > limit) { if (isStrict) { throw new RangeError(runtime, inspect().toString() + " out of range."); } return null; } if (truncate && endLong > limit) { endLong = limit; } if (endLong < 0 || (!isExclusive && endLong == 0)) { endLong += limit; if (endLong < 0) { if (isStrict) { throw new RangeError(runtime, inspect().toString() + " out of range."); } return null; } } if (beginLong > endLong) { if (isStrict) { throw new RangeError(runtime, inspect().toString() + " out of range."); } return null; } return new long[] { beginLong, endLong - beginLong }; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/870e1da9b41bfdbae259e1fc5f18fc8b76686998/RubyRange.java/buggy/src/org/jruby/RubyRange.java |
throw new RangeError(runtime, inspect().toString() + " out of range."); | throw new RangeError(getRuntime(), inspect().toString() + " out of range."); | public long[] getBeginLength(long limit, boolean truncate, boolean isStrict) { long beginLong = RubyNumeric.num2long(begin); long endLong = RubyNumeric.num2long(end); if (! isExclusive) { endLong++; } if (beginLong < 0) { beginLong += limit; if (beginLong < 0) { if (isStrict) { throw new RangeError(runtime, inspect().toString() + " out of range."); } return null; } } if (truncate && beginLong > limit) { if (isStrict) { throw new RangeError(runtime, inspect().toString() + " out of range."); } return null; } if (truncate && endLong > limit) { endLong = limit; } if (endLong < 0 || (!isExclusive && endLong == 0)) { endLong += limit; if (endLong < 0) { if (isStrict) { throw new RangeError(runtime, inspect().toString() + " out of range."); } return null; } } if (beginLong > endLong) { if (isStrict) { throw new RangeError(runtime, inspect().toString() + " out of range."); } return null; } return new long[] { beginLong, endLong - beginLong }; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/870e1da9b41bfdbae259e1fc5f18fc8b76686998/RubyRange.java/buggy/src/org/jruby/RubyRange.java |
throw new ArgumentError(getRuntime(), "bad value for range"); | throw getRuntime().newArgumentError("bad value for range"); | public void init(IRubyObject begin, IRubyObject end, RubyBoolean isExclusive) { if (!(begin instanceof RubyFixnum && end instanceof RubyFixnum)) { try { begin.callMethod("<=>", end); } catch (RaiseException rExcptn) { throw new ArgumentError(getRuntime(), "bad value for range"); } } this.begin = begin; this.end = end; this.isExclusive = isExclusive.isTrue(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/870e1da9b41bfdbae259e1fc5f18fc8b76686998/RubyRange.java/buggy/src/org/jruby/RubyRange.java |
throw new ArgumentError(getRuntime(), "Wrong arguments. (anObject, anObject, aBoolean = false) expected"); | throw getRuntime().newArgumentError("Wrong arguments. (anObject, anObject, aBoolean = false) expected"); | public IRubyObject initialize(IRubyObject[] args) { if (args.length == 3) { init(args[0], args[1], (RubyBoolean) args[2]); } else if (args.length == 2) { init(args[0], args[1], getRuntime().getFalse()); } else { throw new ArgumentError(getRuntime(), "Wrong arguments. (anObject, anObject, aBoolean = false) expected"); } return getRuntime().getNil(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/870e1da9b41bfdbae259e1fc5f18fc8b76686998/RubyRange.java/buggy/src/org/jruby/RubyRange.java |
return RubyFixnum.newFixnum(getRuntime(), 0); | return getRuntime().newFixnum(0); | public RubyFixnum length() { long size = 0; if (begin.callMethod(">", end).isTrue()) { return RubyFixnum.newFixnum(getRuntime(), 0); } if (begin instanceof RubyFixnum && end instanceof RubyFixnum) { size = ((RubyNumeric) end).getLongValue() - ((RubyNumeric) begin).getLongValue(); if (!isExclusive) { size++; } } else { // Support length for arbitrary classes IRubyObject currentObject = begin; String compareMethod = isExclusive ? "<" : "<="; while (currentObject.callMethod(compareMethod, end).isTrue()) { size++; if (currentObject.equals(end)) { break; } currentObject = currentObject.callMethod("succ"); } } return RubyFixnum.newFixnum(getRuntime(), size); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/870e1da9b41bfdbae259e1fc5f18fc8b76686998/RubyRange.java/buggy/src/org/jruby/RubyRange.java |
return RubyFixnum.newFixnum(getRuntime(), size); | return getRuntime().newFixnum(size); | public RubyFixnum length() { long size = 0; if (begin.callMethod(">", end).isTrue()) { return RubyFixnum.newFixnum(getRuntime(), 0); } if (begin instanceof RubyFixnum && end instanceof RubyFixnum) { size = ((RubyNumeric) end).getLongValue() - ((RubyNumeric) begin).getLongValue(); if (!isExclusive) { size++; } } else { // Support length for arbitrary classes IRubyObject currentObject = begin; String compareMethod = isExclusive ? "<" : "<="; while (currentObject.callMethod(compareMethod, end).isTrue()) { size++; if (currentObject.equals(end)) { break; } currentObject = currentObject.callMethod("succ"); } } return RubyFixnum.newFixnum(getRuntime(), size); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/870e1da9b41bfdbae259e1fc5f18fc8b76686998/RubyRange.java/buggy/src/org/jruby/RubyRange.java |
RubyArray array = RubyArray.newArray(getRuntime()); | RubyArray array = getRuntime().newArray(); | public RubyArray to_a() { IRubyObject currentObject = begin; String compareMethod = isExclusive ? "<" : "<="; RubyArray array = RubyArray.newArray(getRuntime()); while (currentObject.callMethod(compareMethod, end).isTrue()) { array.append(currentObject); if (currentObject.equals(end)) { break; } currentObject = currentObject.callMethod("succ"); } return array; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/870e1da9b41bfdbae259e1fc5f18fc8b76686998/RubyRange.java/buggy/src/org/jruby/RubyRange.java |
if (child.getSubstring().equals("")) return; | public void addInlineChild(Context c, InlineBox ib) { if (ib == null) throw new NullPointerException("trying to add null child"); if (getChildCount() == 0 && ib instanceof InlineTextBox) {//first box on line InlineTextBox child = (InlineTextBox) ib; if (child.getSubstring().startsWith(WhitespaceStripper.SPACE)) { String whitespace = c.getCurrentStyle().getStringProperty(CSSName.WHITE_SPACE); if (whitespace.equals("normal") || whitespace.equals("nowrap") || whitespace.equals("pre-line")) child.setSubstring(child.start_index + 1, child.end_index); } if (child.getSubstring().equals("")) return; } ib.setParent(this); addChild(ib); if (ib.isChildrenExceedBounds()) { setChildrenExceedBounds(true); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/c54df553d84e4640a9935c1b64985f49a735fce0/LineBox.java/clean/src/java/org/xhtmlrenderer/render/LineBox.java |
|
ActivityRequirementBinding castedObject = (ActivityRequirementBinding) object; boolean equals = true; equals &= Util.equals(requiredActivityId, castedObject.requiredActivityId); equals &= Util.equals(activityId, castedObject.activityId); return equals; | final ActivityRequirementBinding castedObject = (ActivityRequirementBinding) object; if (!Util.equals(requiredActivityId, castedObject.requiredActivityId)) { return false; } return Util.equals(activityId, castedObject.activityId); | public boolean equals(Object object) { if (!(object instanceof ActivityRequirementBinding)) return false; ActivityRequirementBinding castedObject = (ActivityRequirementBinding) object; boolean equals = true; equals &= Util.equals(requiredActivityId, castedObject.requiredActivityId); equals &= Util.equals(activityId, castedObject.activityId); return equals; } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/93a9ee73087009b29275c4fd77412f1b5a0354e8/ActivityRequirementBinding.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ActivityRequirementBinding.java |
setModified(true); | public void setCompanyId(String companyId) { if (((companyId == null) && (_companyId != null)) || ((companyId != null) && (_companyId == null)) || ((companyId != null) && (_companyId != null) && !companyId.equals(_companyId))) { if (!XSS_ALLOW_COMPANYID) { companyId = XSSUtil.strip(companyId); } _companyId = companyId; setModified(true); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f4d6afc6707f57fd84bf6b624f0c119657b0a766/JournalStructureModel.java/buggy/portal-ejb/src/com/liferay/portlet/journal/model/JournalStructureModel.java |
|
setModified(true); | public void setCreateDate(Date createDate) { if (((createDate == null) && (_createDate != null)) || ((createDate != null) && (_createDate == null)) || ((createDate != null) && (_createDate != null) && !createDate.equals(_createDate))) { _createDate = createDate; setModified(true); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f4d6afc6707f57fd84bf6b624f0c119657b0a766/JournalStructureModel.java/buggy/portal-ejb/src/com/liferay/portlet/journal/model/JournalStructureModel.java |
|
setModified(true); | public void setDescription(String description) { if (((description == null) && (_description != null)) || ((description != null) && (_description == null)) || ((description != null) && (_description != null) && !description.equals(_description))) { if (!XSS_ALLOW_DESCRIPTION) { description = XSSUtil.strip(description); } _description = description; setModified(true); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f4d6afc6707f57fd84bf6b624f0c119657b0a766/JournalStructureModel.java/buggy/portal-ejb/src/com/liferay/portlet/journal/model/JournalStructureModel.java |
|
setModified(true); | public void setGroupId(String groupId) { if (((groupId == null) && (_groupId != null)) || ((groupId != null) && (_groupId == null)) || ((groupId != null) && (_groupId != null) && !groupId.equals(_groupId))) { if (!XSS_ALLOW_GROUPID) { groupId = XSSUtil.strip(groupId); } _groupId = groupId; setModified(true); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f4d6afc6707f57fd84bf6b624f0c119657b0a766/JournalStructureModel.java/buggy/portal-ejb/src/com/liferay/portlet/journal/model/JournalStructureModel.java |
|
setModified(true); | public void setModifiedDate(Date modifiedDate) { if (((modifiedDate == null) && (_modifiedDate != null)) || ((modifiedDate != null) && (_modifiedDate == null)) || ((modifiedDate != null) && (_modifiedDate != null) && !modifiedDate.equals(_modifiedDate))) { _modifiedDate = modifiedDate; setModified(true); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f4d6afc6707f57fd84bf6b624f0c119657b0a766/JournalStructureModel.java/buggy/portal-ejb/src/com/liferay/portlet/journal/model/JournalStructureModel.java |
|
setModified(true); | public void setName(String name) { if (((name == null) && (_name != null)) || ((name != null) && (_name == null)) || ((name != null) && (_name != null) && !name.equals(_name))) { if (!XSS_ALLOW_NAME) { name = XSSUtil.strip(name); } _name = name; setModified(true); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f4d6afc6707f57fd84bf6b624f0c119657b0a766/JournalStructureModel.java/buggy/portal-ejb/src/com/liferay/portlet/journal/model/JournalStructureModel.java |
|
setModified(true); | public void setStructureId(String structureId) { if (((structureId == null) && (_structureId != null)) || ((structureId != null) && (_structureId == null)) || ((structureId != null) && (_structureId != null) && !structureId.equals(_structureId))) { if (!XSS_ALLOW_STRUCTUREID) { structureId = XSSUtil.strip(structureId); } _structureId = structureId; setModified(true); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f4d6afc6707f57fd84bf6b624f0c119657b0a766/JournalStructureModel.java/buggy/portal-ejb/src/com/liferay/portlet/journal/model/JournalStructureModel.java |
|
setModified(true); | public void setUserId(String userId) { if (((userId == null) && (_userId != null)) || ((userId != null) && (_userId == null)) || ((userId != null) && (_userId != null) && !userId.equals(_userId))) { if (!XSS_ALLOW_USERID) { userId = XSSUtil.strip(userId); } _userId = userId; setModified(true); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f4d6afc6707f57fd84bf6b624f0c119657b0a766/JournalStructureModel.java/buggy/portal-ejb/src/com/liferay/portlet/journal/model/JournalStructureModel.java |
|
setModified(true); | public void setUserName(String userName) { if (((userName == null) && (_userName != null)) || ((userName != null) && (_userName == null)) || ((userName != null) && (_userName != null) && !userName.equals(_userName))) { if (!XSS_ALLOW_USERNAME) { userName = XSSUtil.strip(userName); } _userName = userName; setModified(true); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f4d6afc6707f57fd84bf6b624f0c119657b0a766/JournalStructureModel.java/buggy/portal-ejb/src/com/liferay/portlet/journal/model/JournalStructureModel.java |
|
setModified(true); | public void setXsd(String xsd) { if (((xsd == null) && (_xsd != null)) || ((xsd != null) && (_xsd == null)) || ((xsd != null) && (_xsd != null) && !xsd.equals(_xsd))) { if (!XSS_ALLOW_XSD) { xsd = XSSUtil.strip(xsd); } _xsd = xsd; setModified(true); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f4d6afc6707f57fd84bf6b624f0c119657b0a766/JournalStructureModel.java/buggy/portal-ejb/src/com/liferay/portlet/journal/model/JournalStructureModel.java |
|
.bindExtensions(new String[] { TEST_EXTENSION_2_ID }); | .bindExtensions(new String[] { TEST_EXTENSION_2_ID }, false); | public void testBindTestExtension() { INavigatorContentService contentServiceWithProgrammaticBindings = NavigatorContentServiceFactory.INSTANCE .createContentService(COMMON_NAVIGATOR_INSTANCE_ID); INavigatorContentDescriptor[] boundDescriptors = contentServiceWithProgrammaticBindings .bindExtensions(new String[] { TEST_EXTENSION_2_ID }); contentServiceWithProgrammaticBindings.activateExtensions(new String[] {RESOURCE_EXTENSION_ID, TEST_EXTENSION_ID, TEST_EXTENSION_2_ID}, false); assertEquals("One descriptor should have been returned.", 1, boundDescriptors.length); assertEquals( "The declarative content service should have one fewer visible extension ids than the one created programmatically.", contentService.getVisibleExtensionIds().length + 1, contentServiceWithProgrammaticBindings.getVisibleExtensionIds().length); INavigatorContentDescriptor[] visibleDescriptors = contentServiceWithProgrammaticBindings .getVisibleExtensions(); boolean found = false; for (int i = 0; i < visibleDescriptors.length; i++) if (TEST_EXTENSION_2_ID.equals(visibleDescriptors[i].getId())) found = true; assertTrue("The programmatically bound extension should be bound.", found); Set enabledDescriptors = contentServiceWithProgrammaticBindings.findEnabledContentDescriptors(project); assertEquals("There should be a three extensions.", 3, enabledDescriptors.size()); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/187a6e5e9526ea47a03a969d7ddb741178d2527d/INavigatorContentServiceTests.java/clean/tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/INavigatorContentServiceTests.java |
if(child.isChildrenExceedBounds()) { setChildrenExceedBounds(true); } | public void addChild( Box child ) { child.setParent( this ); boxes.add( child ); //u.p("added child: " + child + " to " + this); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/3c2f0ef16203d2439d43879f53050721938d14f5/Box.java/buggy/src/java/org/xhtmlrenderer/render/Box.java |
|
setModified(true); | public void setCompanyId(String companyId) { if (((companyId == null) && (_companyId != null)) || ((companyId != null) && (_companyId == null)) || ((companyId != null) && (_companyId != null) && !companyId.equals(_companyId))) { if (!XSS_ALLOW_COMPANYID) { companyId = XSSUtil.strip(companyId); } _companyId = companyId; setModified(true); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f4d6afc6707f57fd84bf6b624f0c119657b0a766/BookmarksFolderModel.java/clean/portal-ejb/src/com/liferay/portlet/bookmarks/model/BookmarksFolderModel.java |
|
setModified(true); | public void setCreateDate(Date createDate) { if (((createDate == null) && (_createDate != null)) || ((createDate != null) && (_createDate == null)) || ((createDate != null) && (_createDate != null) && !createDate.equals(_createDate))) { _createDate = createDate; setModified(true); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f4d6afc6707f57fd84bf6b624f0c119657b0a766/BookmarksFolderModel.java/clean/portal-ejb/src/com/liferay/portlet/bookmarks/model/BookmarksFolderModel.java |
|
setModified(true); | public void setDescription(String description) { if (((description == null) && (_description != null)) || ((description != null) && (_description == null)) || ((description != null) && (_description != null) && !description.equals(_description))) { if (!XSS_ALLOW_DESCRIPTION) { description = XSSUtil.strip(description); } _description = description; setModified(true); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f4d6afc6707f57fd84bf6b624f0c119657b0a766/BookmarksFolderModel.java/clean/portal-ejb/src/com/liferay/portlet/bookmarks/model/BookmarksFolderModel.java |
|
setModified(true); | public void setFolderId(String folderId) { if (((folderId == null) && (_folderId != null)) || ((folderId != null) && (_folderId == null)) || ((folderId != null) && (_folderId != null) && !folderId.equals(_folderId))) { if (!XSS_ALLOW_FOLDERID) { folderId = XSSUtil.strip(folderId); } _folderId = folderId; setModified(true); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f4d6afc6707f57fd84bf6b624f0c119657b0a766/BookmarksFolderModel.java/clean/portal-ejb/src/com/liferay/portlet/bookmarks/model/BookmarksFolderModel.java |
|
setModified(true); | public void setGroupId(String groupId) { if (((groupId == null) && (_groupId != null)) || ((groupId != null) && (_groupId == null)) || ((groupId != null) && (_groupId != null) && !groupId.equals(_groupId))) { if (!XSS_ALLOW_GROUPID) { groupId = XSSUtil.strip(groupId); } _groupId = groupId; setModified(true); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f4d6afc6707f57fd84bf6b624f0c119657b0a766/BookmarksFolderModel.java/clean/portal-ejb/src/com/liferay/portlet/bookmarks/model/BookmarksFolderModel.java |
|
setModified(true); | public void setModifiedDate(Date modifiedDate) { if (((modifiedDate == null) && (_modifiedDate != null)) || ((modifiedDate != null) && (_modifiedDate == null)) || ((modifiedDate != null) && (_modifiedDate != null) && !modifiedDate.equals(_modifiedDate))) { _modifiedDate = modifiedDate; setModified(true); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f4d6afc6707f57fd84bf6b624f0c119657b0a766/BookmarksFolderModel.java/clean/portal-ejb/src/com/liferay/portlet/bookmarks/model/BookmarksFolderModel.java |
|
setModified(true); | public void setName(String name) { if (((name == null) && (_name != null)) || ((name != null) && (_name == null)) || ((name != null) && (_name != null) && !name.equals(_name))) { if (!XSS_ALLOW_NAME) { name = XSSUtil.strip(name); } _name = name; setModified(true); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f4d6afc6707f57fd84bf6b624f0c119657b0a766/BookmarksFolderModel.java/clean/portal-ejb/src/com/liferay/portlet/bookmarks/model/BookmarksFolderModel.java |
|
setModified(true); | public void setParentFolderId(String parentFolderId) { if (((parentFolderId == null) && (_parentFolderId != null)) || ((parentFolderId != null) && (_parentFolderId == null)) || ((parentFolderId != null) && (_parentFolderId != null) && !parentFolderId.equals(_parentFolderId))) { if (!XSS_ALLOW_PARENTFOLDERID) { parentFolderId = XSSUtil.strip(parentFolderId); } _parentFolderId = parentFolderId; setModified(true); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f4d6afc6707f57fd84bf6b624f0c119657b0a766/BookmarksFolderModel.java/clean/portal-ejb/src/com/liferay/portlet/bookmarks/model/BookmarksFolderModel.java |
|
setModified(true); | public void setUserId(String userId) { if (((userId == null) && (_userId != null)) || ((userId != null) && (_userId == null)) || ((userId != null) && (_userId != null) && !userId.equals(_userId))) { if (!XSS_ALLOW_USERID) { userId = XSSUtil.strip(userId); } _userId = userId; setModified(true); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f4d6afc6707f57fd84bf6b624f0c119657b0a766/BookmarksFolderModel.java/clean/portal-ejb/src/com/liferay/portlet/bookmarks/model/BookmarksFolderModel.java |
|
public InlineBox createInline(Context c, Node node, String text, InlineBox prev, InlineBox prev_align, int avail, int max, Font font) { | public static InlineBox createInline(Context c, TextContent content, InlineBox prev, InlineBox prev_align, int avail, int max, Font font, CascadedStyle firstLineStyle) { | public InlineBox createInline(Context c, Node node, String text, InlineBox prev, InlineBox prev_align, int avail, int max, Font font) { InlineBox inline = new InlineBox(); inline.setNode(node); CalculatedStyle style = c.css.getStyle(node); inline.whitespace = getWhitespace(style); // prepare a new inline with a substring that goes // from the end of the previous (if applicable) to the // end of the master string if (prev == null || prev.getNode() != node) { text = stripWhitespace(style, prev, text); inline.setMasterText(text); inline.setSubstring(0, text.length()); } else { //grab text from the previous inline text = prev.getMasterText(); inline.setMasterText(text); inline.setSubstring(prev.end_index, text.length()); } Breaker.breakText(c, inline, prev, prev_align, avail, max, font); BoxBuilder.prepBox(c, inline, prev_align, font); return inline; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/bbe26e114cd1f823901a5ca3d63b5fccfdfedf81/WhitespaceStripper.java/clean/src/java/org/xhtmlrenderer/layout/inline/WhitespaceStripper.java |
inline.setNode(node); CalculatedStyle style = c.css.getStyle(node); | inline.setNode(content.getElement()); inline.setContent(content); CalculatedStyle style = content.getStyle(); | public InlineBox createInline(Context c, Node node, String text, InlineBox prev, InlineBox prev_align, int avail, int max, Font font) { InlineBox inline = new InlineBox(); inline.setNode(node); CalculatedStyle style = c.css.getStyle(node); inline.whitespace = getWhitespace(style); // prepare a new inline with a substring that goes // from the end of the previous (if applicable) to the // end of the master string if (prev == null || prev.getNode() != node) { text = stripWhitespace(style, prev, text); inline.setMasterText(text); inline.setSubstring(0, text.length()); } else { //grab text from the previous inline text = prev.getMasterText(); inline.setMasterText(text); inline.setSubstring(prev.end_index, text.length()); } Breaker.breakText(c, inline, prev, prev_align, avail, max, font); BoxBuilder.prepBox(c, inline, prev_align, font); return inline; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/bbe26e114cd1f823901a5ca3d63b5fccfdfedf81/WhitespaceStripper.java/clean/src/java/org/xhtmlrenderer/layout/inline/WhitespaceStripper.java |
if (prev == null || prev.getNode() != node) { text = stripWhitespace(style, prev, text); | if (prev == null || prev.getContent() != content) { String text = stripWhitespace(style, prev, content.getText()); | public InlineBox createInline(Context c, Node node, String text, InlineBox prev, InlineBox prev_align, int avail, int max, Font font) { InlineBox inline = new InlineBox(); inline.setNode(node); CalculatedStyle style = c.css.getStyle(node); inline.whitespace = getWhitespace(style); // prepare a new inline with a substring that goes // from the end of the previous (if applicable) to the // end of the master string if (prev == null || prev.getNode() != node) { text = stripWhitespace(style, prev, text); inline.setMasterText(text); inline.setSubstring(0, text.length()); } else { //grab text from the previous inline text = prev.getMasterText(); inline.setMasterText(text); inline.setSubstring(prev.end_index, text.length()); } Breaker.breakText(c, inline, prev, prev_align, avail, max, font); BoxBuilder.prepBox(c, inline, prev_align, font); return inline; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/bbe26e114cd1f823901a5ca3d63b5fccfdfedf81/WhitespaceStripper.java/clean/src/java/org/xhtmlrenderer/layout/inline/WhitespaceStripper.java |
text = prev.getMasterText(); | String text = prev.getMasterText(); | public InlineBox createInline(Context c, Node node, String text, InlineBox prev, InlineBox prev_align, int avail, int max, Font font) { InlineBox inline = new InlineBox(); inline.setNode(node); CalculatedStyle style = c.css.getStyle(node); inline.whitespace = getWhitespace(style); // prepare a new inline with a substring that goes // from the end of the previous (if applicable) to the // end of the master string if (prev == null || prev.getNode() != node) { text = stripWhitespace(style, prev, text); inline.setMasterText(text); inline.setSubstring(0, text.length()); } else { //grab text from the previous inline text = prev.getMasterText(); inline.setMasterText(text); inline.setSubstring(prev.end_index, text.length()); } Breaker.breakText(c, inline, prev, prev_align, avail, max, font); BoxBuilder.prepBox(c, inline, prev_align, font); return inline; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/bbe26e114cd1f823901a5ca3d63b5fccfdfedf81/WhitespaceStripper.java/clean/src/java/org/xhtmlrenderer/layout/inline/WhitespaceStripper.java |
BoxBuilder.prepBox(c, inline, prev_align, font); | BoxBuilder.prepBox(c, inline, prev_align, font, firstLineStyle); | public InlineBox createInline(Context c, Node node, String text, InlineBox prev, InlineBox prev_align, int avail, int max, Font font) { InlineBox inline = new InlineBox(); inline.setNode(node); CalculatedStyle style = c.css.getStyle(node); inline.whitespace = getWhitespace(style); // prepare a new inline with a substring that goes // from the end of the previous (if applicable) to the // end of the master string if (prev == null || prev.getNode() != node) { text = stripWhitespace(style, prev, text); inline.setMasterText(text); inline.setSubstring(0, text.length()); } else { //grab text from the previous inline text = prev.getMasterText(); inline.setMasterText(text); inline.setSubstring(prev.end_index, text.length()); } Breaker.breakText(c, inline, prev, prev_align, avail, max, font); BoxBuilder.prepBox(c, inline, prev_align, font); return inline; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/bbe26e114cd1f823901a5ca3d63b5fccfdfedf81/WhitespaceStripper.java/clean/src/java/org/xhtmlrenderer/layout/inline/WhitespaceStripper.java |
public String getWhitespace(CalculatedStyle style) { | public static String getWhitespace(CalculatedStyle style) { | public String getWhitespace(CalculatedStyle style) { String whitespace = style.getStringProperty("white-space"); if (whitespace == null) {//should never happen whitespace = "normal"; } return whitespace; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/bbe26e114cd1f823901a5ca3d63b5fccfdfedf81/WhitespaceStripper.java/clean/src/java/org/xhtmlrenderer/layout/inline/WhitespaceStripper.java |
public String stripWhitespace(CalculatedStyle style, InlineBox prev, String text) { | public static String stripWhitespace(CalculatedStyle style, InlineBox prev, String text) { | public String stripWhitespace(CalculatedStyle style, InlineBox prev, String text) { String whitespace = getWhitespace(style); //u.p("stripWhitespace: text = -" + text + "-"); //u.p("whitespace = " + whitespace); // do step 1 if (whitespace.equals("normal") || whitespace.equals("nowrap") || whitespace.equals("pre-line")) { text = linefeed_space_collapse.matcher(text).replaceAll(SPACE); } //u.p("step 1 = \"" + text + "\""); // do step 2 // pull out pre's for breaking // still not sure here // do step 3 // convert line feeds to spaces if (whitespace.equals("normal") || whitespace.equals("nowrap")) { text = linefeed_to_space.matcher(text).replaceAll(SPACE); } //u.p("step 3 = \"" + text +"\""); // do step 4 if (whitespace.equals("normal") || whitespace.equals("nowrap") || whitespace.equals("pre-line")) { text = tab_to_space.matcher(text).replaceAll(SPACE); //u.p("step 4.1 = \"" + text + "\""); text = space_collapse.matcher(text).replaceAll(SPACE); //u.p("step 4.2 = \"" + text + "\""); // collapse first space against prev inline if (text.startsWith(SPACE) && (prev != null) && (prev.whitespace.equals("normal") || prev.whitespace.equals("nowrap") || prev.whitespace.equals("pre-line")) && (prev.getSubstring().endsWith(SPACE))) { text = text.substring(1, text.length()); } //u.p("step 4.3 = \"" + text + "\""); } //u.p("final text = \"" + text + "\""); return text; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/bbe26e114cd1f823901a5ca3d63b5fccfdfedf81/WhitespaceStripper.java/clean/src/java/org/xhtmlrenderer/layout/inline/WhitespaceStripper.java |
public void unbreakable(InlineBox box, int n) { | public static void unbreakable(InlineBox box, int n) { | public void unbreakable(InlineBox box, int n) { if (box.start_index == -1) { box.start_index = 0; } box.setSubstring(box.start_index, box.start_index + n); return; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/bbe26e114cd1f823901a5ca3d63b5fccfdfedf81/WhitespaceStripper.java/clean/src/java/org/xhtmlrenderer/layout/inline/WhitespaceStripper.java |
return getPage(c, box.getAbsY() + box.getHeight()); | return getPage(c, box.getAbsY() + box.getHeight() - 1); | public PageBox getLastPage(CssContext c, Box box) { return getPage(c, box.getAbsY() + box.getHeight()); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/3619777e312d2fe8541b6e968978bb572e099f8c/Layer.java/buggy/src/java/org/xhtmlrenderer/layout/Layer.java |
roleId, themeDisplay.getPortletGroupId(), selResource, Resource.TYPE_CLASS, scope, themeDisplay.getCompanyId(), actionId); | roleId, themeDisplay.getPortletGroupId(), selResource, Resource.TYPE_CLASS, scope, themeDisplay.getCompanyId(), actionId); | protected void updateActions(ActionRequest req, ActionResponse res) throws Exception { ThemeDisplay themeDisplay = (ThemeDisplay)req.getAttribute(WebKeys.THEME_DISPLAY); String roleId = ParamUtil.getString(req, "roleId"); String portletResource = ParamUtil.getString(req, "portletResource"); String modelResource = ParamUtil.getString(req, "modelResource"); String selResource = modelResource; if (Validator.isNull(modelResource)) { selResource = portletResource; } List groupScopeActionIds = new ArrayList(); List actions = ResourceActionsUtil.getResourceActions( themeDisplay.getCompanyId(), portletResource, modelResource); Collections.sort( actions, new ActionComparator( themeDisplay.getCompanyId(), themeDisplay.getLocale())); for (int i = 0; i < actions.size(); i++) { String actionId = (String)actions.get(i); String scope = ParamUtil.getString(req, "scope" + actionId); if (scope.equals(Resource.SCOPE_COMPANY)) { PermissionServiceUtil.setRolePermission( roleId, themeDisplay.getPortletGroupId(), selResource, Resource.TYPE_CLASS, scope, themeDisplay.getCompanyId(), actionId); } else if (scope.equals(Resource.SCOPE_GROUP)) { groupScopeActionIds.add(actionId); } else { // Remove company and group permissions PermissionServiceUtil.unsetRolePermissions( roleId, themeDisplay.getPortletGroupId(), selResource, Resource.TYPE_CLASS, Resource.SCOPE_COMPANY, actionId); PermissionServiceUtil.unsetRolePermissions( roleId, themeDisplay.getPortletGroupId(), selResource, Resource.TYPE_CLASS, Resource.SCOPE_GROUP, actionId); } } // Send redirect String redirect = ParamUtil.getString(req, "redirect"); if (groupScopeActionIds.size() == 0) { redirect += "&groupScopePos=-1"; } else { redirect += "&groupScopePos=0&groupScopeActionIds=" + StringUtil.merge(groupScopeActionIds); } res.sendRedirect(redirect); } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/d36dad22bc25af423a0bb871461e41b00cd9e96a/EditRolePermissionsAction.java/clean/portal-ejb/src/com/liferay/portlet/enterpriseadmin/action/EditRolePermissionsAction.java |
roleId, themeDisplay.getPortletGroupId(), selResource, Resource.TYPE_CLASS, Resource.SCOPE_COMPANY, actionId); | roleId, themeDisplay.getPortletGroupId(), selResource, Resource.TYPE_CLASS, Resource.SCOPE_COMPANY, actionId); | protected void updateActions(ActionRequest req, ActionResponse res) throws Exception { ThemeDisplay themeDisplay = (ThemeDisplay)req.getAttribute(WebKeys.THEME_DISPLAY); String roleId = ParamUtil.getString(req, "roleId"); String portletResource = ParamUtil.getString(req, "portletResource"); String modelResource = ParamUtil.getString(req, "modelResource"); String selResource = modelResource; if (Validator.isNull(modelResource)) { selResource = portletResource; } List groupScopeActionIds = new ArrayList(); List actions = ResourceActionsUtil.getResourceActions( themeDisplay.getCompanyId(), portletResource, modelResource); Collections.sort( actions, new ActionComparator( themeDisplay.getCompanyId(), themeDisplay.getLocale())); for (int i = 0; i < actions.size(); i++) { String actionId = (String)actions.get(i); String scope = ParamUtil.getString(req, "scope" + actionId); if (scope.equals(Resource.SCOPE_COMPANY)) { PermissionServiceUtil.setRolePermission( roleId, themeDisplay.getPortletGroupId(), selResource, Resource.TYPE_CLASS, scope, themeDisplay.getCompanyId(), actionId); } else if (scope.equals(Resource.SCOPE_GROUP)) { groupScopeActionIds.add(actionId); } else { // Remove company and group permissions PermissionServiceUtil.unsetRolePermissions( roleId, themeDisplay.getPortletGroupId(), selResource, Resource.TYPE_CLASS, Resource.SCOPE_COMPANY, actionId); PermissionServiceUtil.unsetRolePermissions( roleId, themeDisplay.getPortletGroupId(), selResource, Resource.TYPE_CLASS, Resource.SCOPE_GROUP, actionId); } } // Send redirect String redirect = ParamUtil.getString(req, "redirect"); if (groupScopeActionIds.size() == 0) { redirect += "&groupScopePos=-1"; } else { redirect += "&groupScopePos=0&groupScopeActionIds=" + StringUtil.merge(groupScopeActionIds); } res.sendRedirect(redirect); } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/d36dad22bc25af423a0bb871461e41b00cd9e96a/EditRolePermissionsAction.java/clean/portal-ejb/src/com/liferay/portlet/enterpriseadmin/action/EditRolePermissionsAction.java |
roleId, themeDisplay.getPortletGroupId(), selResource, Resource.TYPE_CLASS, Resource.SCOPE_GROUP, actionId); | roleId, themeDisplay.getPortletGroupId(), selResource, Resource.TYPE_CLASS, Resource.SCOPE_GROUP, actionId); | protected void updateActions(ActionRequest req, ActionResponse res) throws Exception { ThemeDisplay themeDisplay = (ThemeDisplay)req.getAttribute(WebKeys.THEME_DISPLAY); String roleId = ParamUtil.getString(req, "roleId"); String portletResource = ParamUtil.getString(req, "portletResource"); String modelResource = ParamUtil.getString(req, "modelResource"); String selResource = modelResource; if (Validator.isNull(modelResource)) { selResource = portletResource; } List groupScopeActionIds = new ArrayList(); List actions = ResourceActionsUtil.getResourceActions( themeDisplay.getCompanyId(), portletResource, modelResource); Collections.sort( actions, new ActionComparator( themeDisplay.getCompanyId(), themeDisplay.getLocale())); for (int i = 0; i < actions.size(); i++) { String actionId = (String)actions.get(i); String scope = ParamUtil.getString(req, "scope" + actionId); if (scope.equals(Resource.SCOPE_COMPANY)) { PermissionServiceUtil.setRolePermission( roleId, themeDisplay.getPortletGroupId(), selResource, Resource.TYPE_CLASS, scope, themeDisplay.getCompanyId(), actionId); } else if (scope.equals(Resource.SCOPE_GROUP)) { groupScopeActionIds.add(actionId); } else { // Remove company and group permissions PermissionServiceUtil.unsetRolePermissions( roleId, themeDisplay.getPortletGroupId(), selResource, Resource.TYPE_CLASS, Resource.SCOPE_COMPANY, actionId); PermissionServiceUtil.unsetRolePermissions( roleId, themeDisplay.getPortletGroupId(), selResource, Resource.TYPE_CLASS, Resource.SCOPE_GROUP, actionId); } } // Send redirect String redirect = ParamUtil.getString(req, "redirect"); if (groupScopeActionIds.size() == 0) { redirect += "&groupScopePos=-1"; } else { redirect += "&groupScopePos=0&groupScopeActionIds=" + StringUtil.merge(groupScopeActionIds); } res.sendRedirect(redirect); } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/d36dad22bc25af423a0bb871461e41b00cd9e96a/EditRolePermissionsAction.java/clean/portal-ejb/src/com/liferay/portlet/enterpriseadmin/action/EditRolePermissionsAction.java |
roleId, themeDisplay.getPortletGroupId(), selResource, Resource.TYPE_CLASS, Resource.SCOPE_GROUP, addGroupIds[i], actionId); | roleId, themeDisplay.getPortletGroupId(), selResource, Resource.TYPE_CLASS, Resource.SCOPE_GROUP, addGroupIds[i], actionId); | protected void updateGroupPermissions(ActionRequest req, ActionResponse res) throws Exception { ThemeDisplay themeDisplay = (ThemeDisplay)req.getAttribute(WebKeys.THEME_DISPLAY); String roleId = ParamUtil.getString(req, "roleId"); String portletResource = ParamUtil.getString(req, "portletResource"); String modelResource = ParamUtil.getString(req, "modelResource"); String selResource = modelResource; if (Validator.isNull(modelResource)) { selResource = portletResource; } int groupScopePos = ParamUtil.getInteger(req, "groupScopePos"); String[] groupScopeActionIds = StringUtil.split( ParamUtil.getString(req, "groupScopeActionIds")); String actionId = groupScopeActionIds[groupScopePos]; String[] addGroupIds = StringUtil.split( ParamUtil.getString(req, "addGroupIds")); String[] removeGroupIds = StringUtil.split( ParamUtil.getString(req, "removeGroupIds")); for (int i = 0; i < addGroupIds.length; i++) { PermissionServiceUtil.setRolePermission( roleId, themeDisplay.getPortletGroupId(), selResource, Resource.TYPE_CLASS, Resource.SCOPE_GROUP, addGroupIds[i], actionId); } for (int i = 0; i < removeGroupIds.length; i++) { PermissionServiceUtil.unsetRolePermission( roleId, themeDisplay.getPortletGroupId(), selResource, Resource.TYPE_CLASS, Resource.SCOPE_GROUP, removeGroupIds[i], actionId); } String redirect = ParamUtil.getString(req, "redirect"); if (redirect.indexOf("groupScopePos=" + groupScopePos + "&") != -1) { // Show message only if the user stayed on the same page SessionMessages.add(req, "request_processed"); } res.sendRedirect(redirect); } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/d36dad22bc25af423a0bb871461e41b00cd9e96a/EditRolePermissionsAction.java/clean/portal-ejb/src/com/liferay/portlet/enterpriseadmin/action/EditRolePermissionsAction.java |
roleId, themeDisplay.getPortletGroupId(), selResource, Resource.TYPE_CLASS, Resource.SCOPE_GROUP, removeGroupIds[i], actionId); | roleId, themeDisplay.getPortletGroupId(), selResource, Resource.TYPE_CLASS, Resource.SCOPE_GROUP, removeGroupIds[i], actionId); | protected void updateGroupPermissions(ActionRequest req, ActionResponse res) throws Exception { ThemeDisplay themeDisplay = (ThemeDisplay)req.getAttribute(WebKeys.THEME_DISPLAY); String roleId = ParamUtil.getString(req, "roleId"); String portletResource = ParamUtil.getString(req, "portletResource"); String modelResource = ParamUtil.getString(req, "modelResource"); String selResource = modelResource; if (Validator.isNull(modelResource)) { selResource = portletResource; } int groupScopePos = ParamUtil.getInteger(req, "groupScopePos"); String[] groupScopeActionIds = StringUtil.split( ParamUtil.getString(req, "groupScopeActionIds")); String actionId = groupScopeActionIds[groupScopePos]; String[] addGroupIds = StringUtil.split( ParamUtil.getString(req, "addGroupIds")); String[] removeGroupIds = StringUtil.split( ParamUtil.getString(req, "removeGroupIds")); for (int i = 0; i < addGroupIds.length; i++) { PermissionServiceUtil.setRolePermission( roleId, themeDisplay.getPortletGroupId(), selResource, Resource.TYPE_CLASS, Resource.SCOPE_GROUP, addGroupIds[i], actionId); } for (int i = 0; i < removeGroupIds.length; i++) { PermissionServiceUtil.unsetRolePermission( roleId, themeDisplay.getPortletGroupId(), selResource, Resource.TYPE_CLASS, Resource.SCOPE_GROUP, removeGroupIds[i], actionId); } String redirect = ParamUtil.getString(req, "redirect"); if (redirect.indexOf("groupScopePos=" + groupScopePos + "&") != -1) { // Show message only if the user stayed on the same page SessionMessages.add(req, "request_processed"); } res.sendRedirect(redirect); } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/d36dad22bc25af423a0bb871461e41b00cd9e96a/EditRolePermissionsAction.java/clean/portal-ejb/src/com/liferay/portlet/enterpriseadmin/action/EditRolePermissionsAction.java |
return MarkerMessages.MarkerList_0; | return view.getSite().getRegisteredName(); | public String getLabel(Object o) { return MarkerMessages.MarkerList_0; } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/260e053bf023d8caea39229b1fe343b9e8a23653/MarkerAdapter.java/clean/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/MarkerAdapter.java |
public void initialize(IWorkbenchConfigurer configurer) { // make sure we always save and restore workspace state configurer.setSaveAndRestore(true); // setup the event loop exception handler exceptionHandler = new IDEExceptionHandler(configurer); // register workspace adapters WorkbenchAdapterBuilder.registerAdapters(); // get the command line arguments String[] cmdLineArgs = Platform.getCommandLineArgs(); // include the workspace location in the title // if the command line option -showlocation is specified for (int i = 0; i < cmdLineArgs.length; i++) { if ("-showlocation".equalsIgnoreCase(cmdLineArgs[i])) { //$NON-NLS-1$ workspaceLocation = Platform.getLocation().toOSString(); break; } } // register shared images declareWorkbenchImages(); // initialize the activity helper activityHelper = IDEWorkbenchActivityHelper.getInstance(); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/41bbcdae37ba97f5a4389c62e031381534348b0b/IDEWorkbenchAdvisor.java/buggy/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEWorkbenchAdvisor.java |
||
idleHelper = new IDEIdleHelper(configurer); | public void initialize(IWorkbenchConfigurer configurer) { // make sure we always save and restore workspace state configurer.setSaveAndRestore(true); // setup the event loop exception handler exceptionHandler = new IDEExceptionHandler(configurer); // register workspace adapters WorkbenchAdapterBuilder.registerAdapters(); // get the command line arguments String[] cmdLineArgs = Platform.getCommandLineArgs(); // include the workspace location in the title // if the command line option -showlocation is specified for (int i = 0; i < cmdLineArgs.length; i++) { if ("-showlocation".equalsIgnoreCase(cmdLineArgs[i])) { //$NON-NLS-1$ workspaceLocation = Platform.getLocation().toOSString(); break; } } // register shared images declareWorkbenchImages(); // initialize the activity helper activityHelper = IDEWorkbenchActivityHelper.getInstance(); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/41bbcdae37ba97f5a4389c62e031381534348b0b/IDEWorkbenchAdvisor.java/buggy/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEWorkbenchAdvisor.java |
|
if (idleHelper != null) { idleHelper.shutdown(); idleHelper = null; } | public void postShutdown() { if (activityHelper != null) { activityHelper.shutdown(); activityHelper = null; } if (IDEWorkbenchPlugin.getPluginWorkspace() != null) { disconnectFromWorkspace(); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/41bbcdae37ba97f5a4389c62e031381534348b0b/IDEWorkbenchAdvisor.java/buggy/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEWorkbenchAdvisor.java |
|
public void postStartup() { try { refreshFromLocal(); checkUpdates(); } finally {//Resume background jobs after we startup Platform.getJobManager().resume(); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/41bbcdae37ba97f5a4389c62e031381534348b0b/IDEWorkbenchAdvisor.java/buggy/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEWorkbenchAdvisor.java |
||
Object target = getUIController().getInformationQuarter() | Object displayTarget = getUIController().getInformationQuarter() | public void selectionChanged(SelectionChangeEvent event) { Object[] selections = getSelectionModel().getSelections(); Object target = getUIController().getInformationQuarter() .getDisplayTarget(); final Folder folder; if (target instanceof Directory) { folder = ((Directory) target).getRootFolder(); } else if (target instanceof Folder) { folder = (Folder) target; } else { log().warn( "Unable to mark file for auto download files on target: " + target); return; } if (selections != null && selections.length != 0) { setEnabled(true); doNotAutoDownloadJCheckBoxMenuItem.setSelected(false); boolean setValueTrue = false; // detect different status boolean setValueFalse = false; // detect different status // uses some complex checks to make sure we dont have // conflicting status of files/dirs. only set this menu item to // enable if all are the same. for (Object selection : selections) { if (selection instanceof FileInfo) { FileInfo fileInfo = (FileInfo) selection; if (fileInfo.diskFileExists(getController())) { setEnabled(false); break; } else if (folder.isInBlacklist(fileInfo)) { if (setValueFalse) { setEnabled(false); doNotAutoDownloadJCheckBoxMenuItem .setSelected(false); break; } doNotAutoDownloadJCheckBoxMenuItem .setSelected(true); setValueTrue = true; } else { // detect differnt status setValueFalse = true; if (setValueTrue) { setEnabled(false); doNotAutoDownloadJCheckBoxMenuItem .setSelected(false); break; } } } else if (selection instanceof Directory) { Directory directory = (Directory) selection; if (!directory.isExpected(getController() .getFolderRepository())) { setEnabled(false); break; } else if (folder.isInBlacklist(directory .getFilesRecursive())) { // detect differnt status: if (setValueFalse) { setEnabled(false); doNotAutoDownloadJCheckBoxMenuItem .setSelected(false); break; } doNotAutoDownloadJCheckBoxMenuItem .setSelected(true); setValueTrue = true; } else { // detect differnt status setValueFalse = true; if (setValueTrue) { setEnabled(false); doNotAutoDownloadJCheckBoxMenuItem .setSelected(false); break; } } } else { setEnabled(false); break; } } } } | 51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/27c9b602815b2eaa671bc83e687bb92f28446eaa/DirectoryPanel.java/buggy/src/main/de/dal33t/powerfolder/ui/folder/DirectoryPanel.java |
if (target instanceof Directory) { folder = ((Directory) target).getRootFolder(); } else if (target instanceof Folder) { folder = (Folder) target; } else { log().warn( "Unable to mark file for auto download files on target: " + target); | if (displayTarget instanceof Directory) { folder = ((Directory) displayTarget).getRootFolder(); } else if (displayTarget instanceof Folder) { folder = (Folder) displayTarget; } else { | public void selectionChanged(SelectionChangeEvent event) { Object[] selections = getSelectionModel().getSelections(); Object target = getUIController().getInformationQuarter() .getDisplayTarget(); final Folder folder; if (target instanceof Directory) { folder = ((Directory) target).getRootFolder(); } else if (target instanceof Folder) { folder = (Folder) target; } else { log().warn( "Unable to mark file for auto download files on target: " + target); return; } if (selections != null && selections.length != 0) { setEnabled(true); doNotAutoDownloadJCheckBoxMenuItem.setSelected(false); boolean setValueTrue = false; // detect different status boolean setValueFalse = false; // detect different status // uses some complex checks to make sure we dont have // conflicting status of files/dirs. only set this menu item to // enable if all are the same. for (Object selection : selections) { if (selection instanceof FileInfo) { FileInfo fileInfo = (FileInfo) selection; if (fileInfo.diskFileExists(getController())) { setEnabled(false); break; } else if (folder.isInBlacklist(fileInfo)) { if (setValueFalse) { setEnabled(false); doNotAutoDownloadJCheckBoxMenuItem .setSelected(false); break; } doNotAutoDownloadJCheckBoxMenuItem .setSelected(true); setValueTrue = true; } else { // detect differnt status setValueFalse = true; if (setValueTrue) { setEnabled(false); doNotAutoDownloadJCheckBoxMenuItem .setSelected(false); break; } } } else if (selection instanceof Directory) { Directory directory = (Directory) selection; if (!directory.isExpected(getController() .getFolderRepository())) { setEnabled(false); break; } else if (folder.isInBlacklist(directory .getFilesRecursive())) { // detect differnt status: if (setValueFalse) { setEnabled(false); doNotAutoDownloadJCheckBoxMenuItem .setSelected(false); break; } doNotAutoDownloadJCheckBoxMenuItem .setSelected(true); setValueTrue = true; } else { // detect differnt status setValueFalse = true; if (setValueTrue) { setEnabled(false); doNotAutoDownloadJCheckBoxMenuItem .setSelected(false); break; } } } else { setEnabled(false); break; } } } } | 51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/27c9b602815b2eaa671bc83e687bb92f28446eaa/DirectoryPanel.java/buggy/src/main/de/dal33t/powerfolder/ui/folder/DirectoryPanel.java |
parent.setLayout(new FillLayout()); | private CTabFolder createContainer(Composite parent) { // use SWT.FLAT style so that an extra 1 pixel border is not reserved // inside the folder final CTabFolder newContainer = new CTabFolder(parent, SWT.BOTTOM | SWT.FLAT); newContainer.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { int newPageIndex = newContainer.indexOf((CTabItem) e.item); pageChange(newPageIndex); } }); return newContainer; } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/4833607a5f036ef0fb885025992c55e5d5eea6bc/MultiPageEditorPart.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/MultiPageEditorPart.java |
|
this.container = createContainer(parent); | Composite pageContainer = createPageContainer(parent); this.container = createContainer(pageContainer); | public final void createPartControl(Composite parent) { this.container = createContainer(parent); createPages(); // set the active page (page 0 by default), unless it has already been done if (getActivePage() == -1) setActivePage(0); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/4833607a5f036ef0fb885025992c55e5d5eea6bc/MultiPageEditorPart.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/MultiPageEditorPart.java |
private static int runInShell(IRuby runtime, IRubyObject[] rawArgs, OutputStream output) { | public static int runInShell(IRuby runtime, IRubyObject[] rawArgs, OutputStream output) { | private static int runInShell(IRuby runtime, IRubyObject[] rawArgs, OutputStream output) { try { // startup scripts set jruby.shell to /bin/sh for Unix, cmd.exe for Windows String shell = System.getProperty("jruby.shell"); rawArgs[0] = runtime.newString(repairDirSeps(rawArgs[0].toString())); Process aProcess = null; InProcessScript ipScript = null; if (isRubyCommand(rawArgs[0].toString())) { List args = parseCommandLine(rawArgs); PrintStream redirect = new PrintStream(output); String command = (String)args.get(0); String[] argArray = new String[args.size()-1]; // snip off ruby or jruby command from list of arguments // leave alone if the command is the name of a script int startIndex = command.endsWith(".rb") ? 0 : 1; args.subList(startIndex,args.size()).toArray(argArray); // FIXME: Where should we get in and err from? ipScript = new InProcessScript(argArray, System.in, redirect, redirect); // execute ruby command in-process ipScript.start(); ipScript.join(); } else if (shell != null && rawArgs.length == 1) { // execute command with sh -c or cmd.exe /c // this does shell expansion of wildcards String shellSwitch = shell.endsWith("sh") ? "-c" : "/c"; String[] argArray = new String[3]; argArray[0] = shell; argArray[1] = shellSwitch; argArray[2] = rawArgs[0].toString(); aProcess = Runtime.getRuntime().exec(argArray); } else { // execute command directly, no wildcard expansion if (rawArgs.length > 1) { String[] argArray = new String[rawArgs.length]; for (int i=0;i<rawArgs.length;i++) { argArray[i] = rawArgs[i].toString(); } aProcess = Runtime.getRuntime().exec(argArray); } else { aProcess = Runtime.getRuntime().exec(rawArgs[0].toString()); } } if (aProcess != null) { InputStream processOutput = aProcess.getInputStream(); // Fairly innefficient impl, but readLine is unable to tell // whether the last line in a process ended with a newline or not. int b; boolean crSeen = false; while ((b = processOutput.read()) != -1) { if (b == '\r') { crSeen = true; } else { if (crSeen) { if (b != '\n') { output.write('\r'); } crSeen = false; } output.write(b); } } if (crSeen) { output.write('\r'); } aProcess.getErrorStream().close(); aProcess.getOutputStream().close(); processOutput.close(); return aProcess.waitFor(); } else if (ipScript != null) { return ipScript.getResult(); } else { return 0; } } catch (IOException e) { throw runtime.newIOErrorFromException(e); } catch (InterruptedException e) { throw runtime.newThreadError("unexpected interrupt"); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f67bf159b486fa2ceb3335f98a350e2e5fefe664/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java |
gc.setBackground(interiorColor); | if (interiorColor != null) { gc.setBackground(interiorColor); } | public void paintControl(PaintEvent e) { GC gc = e.gc; Color color = e.display.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW); gc.setForeground(color); gc.setBackground(interiorColor); Shape shape = new Shape(TOP_LEFT_CORNER.length + 2); IntAffineMatrix rotation = IntAffineMatrix .getRotation(orientation); rotation = rotation.multiply(IntAffineMatrix.ROT_180); Point size = getSize(); if (!Geometry.isHorizontal(orientation)) { Geometry.flipXY(size); } shape.add(0, size.y); shape.add(new Shape(TOP_LEFT_CORNER)); shape.add(IntAffineMatrix.translation(size.x - 3, 0).multiply(IntAffineMatrix.FLIP_YAXIS), shape.reverse()); Point rawSize = getSize(); Point adjust = new Point(0,0); switch(orientation) { case SWT.TOP: adjust = rawSize; break; case SWT.LEFT: adjust = new Point(rawSize.x - 1, 0); break; case SWT.RIGHT: adjust = new Point(0, rawSize.y - 3); break; } Shape targetShape = IntAffineMatrix.translation(adjust.x, adjust.y) .multiply(rotation) .transform(shape); int[] shapeArray = targetShape.getData(); gc.fillPolygon(shapeArray); gc.drawPolygon(shapeArray); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/be641b78754f5c68409eb40001d92c984c331698/OvalComposite.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/OvalComposite.java |
gc.fillPolygon(shapeArray); | if (interiorColor != null) { gc.fillPolygon(shapeArray); } | public void paintControl(PaintEvent e) { GC gc = e.gc; Color color = e.display.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW); gc.setForeground(color); gc.setBackground(interiorColor); Shape shape = new Shape(TOP_LEFT_CORNER.length + 2); IntAffineMatrix rotation = IntAffineMatrix .getRotation(orientation); rotation = rotation.multiply(IntAffineMatrix.ROT_180); Point size = getSize(); if (!Geometry.isHorizontal(orientation)) { Geometry.flipXY(size); } shape.add(0, size.y); shape.add(new Shape(TOP_LEFT_CORNER)); shape.add(IntAffineMatrix.translation(size.x - 3, 0).multiply(IntAffineMatrix.FLIP_YAXIS), shape.reverse()); Point rawSize = getSize(); Point adjust = new Point(0,0); switch(orientation) { case SWT.TOP: adjust = rawSize; break; case SWT.LEFT: adjust = new Point(rawSize.x - 1, 0); break; case SWT.RIGHT: adjust = new Point(0, rawSize.y - 3); break; } Shape targetShape = IntAffineMatrix.translation(adjust.x, adjust.y) .multiply(rotation) .transform(shape); int[] shapeArray = targetShape.getData(); gc.fillPolygon(shapeArray); gc.drawPolygon(shapeArray); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/be641b78754f5c68409eb40001d92c984c331698/OvalComposite.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/OvalComposite.java |
File debugFile = new File("debug/" + targetFolder.getName() | File debugFile = new File(Logger.getDebugDir(), targetFolder.getName() | public void handleMessage(Message message) { if (message == null) { throw new NullPointerException( "Unable to handle message, message is null"); } // related folder is filled if message is a folder related message FolderInfo targetedFolderInfo = null; Folder targetFolder = null; if (message instanceof FolderRelatedMessage) { targetedFolderInfo = ((FolderRelatedMessage) message).folder; targetFolder = getController().getFolderRepository().getFolder( targetedFolderInfo); } // do all the message processing // Processing of message also should take only // a short time, because member is not able // to received any other message meanwhile ! // Identity is not handled HERE ! if (message instanceof FolderList) { FolderList fList = (FolderList) message; lastFolderList = fList; joinToLocalFolders(fList); // Notify waiting ppl synchronized (folderListWaiter) { folderListWaiter.notifyAll(); } // Inform folder repo getController().getFolderRepository().receivedFolderList(this, fList); } else if (message instanceof RequestNetworkFolderList) { RequestNetworkFolderList request = (RequestNetworkFolderList) message; // Answer request for network folder list if (request.completeList()) { sendMessagesAsynchron(NetworkFolderList .createNetworkFolderLists(getController() .getFolderRepository())); } else { sendMessagesAsynchron(NetworkFolderList .createNetworkFolderLists(getController() .getFolderRepository(), request.folders)); } } else if (message instanceof NetworkFolderList) { NetworkFolderList netFolderList = (NetworkFolderList) message; // Inform repo getController().getFolderRepository().receivedNetworkFolderList( this, netFolderList); } else if (message instanceof RequestFileList) { if (targetFolder != null && !targetFolder.isSecret()) { // a file list of a folder if (logVerbose) { log().verbose( targetFolder + ": Sending new filelist to " + this); } sendMessagesAsynchron(FileList .createFileListMessages(targetFolder)); } else { // Send folder not found if not found or folder is secret sendMessageAsynchron(new Problem("Folder not found: " + targetedFolderInfo, false), null); } } else if (message instanceof RequestDownload) { // a download is requested RequestDownload dlReq = (RequestDownload) message; getController().getTransferManager().queueUpload(this, dlReq); } else if (message instanceof DownloadQueued) { // set queued flag here, if we received status from other side DownloadQueued dlQueued = (DownloadQueued) message; getController().getTransferManager().setQueued(dlQueued); } else if (message instanceof AbortDownload) { AbortDownload abort = (AbortDownload) message; // Abort the upload getController().getTransferManager().abortUpload(abort.file, this); } else if (message instanceof FileChunk) { // File chunk received FileChunk chunk = (FileChunk) message; getController().getTransferManager().chunkReceived(chunk, this); } else if (message instanceof RequestNodeList) { // Nodemanager will handle that RequestNodeList request = (RequestNodeList) message; getController().getNodeManager().receivedRequestNodeList(request, this); } else if (message instanceof KnownNodes) { KnownNodes newNodes = (KnownNodes) message; // TODO Move this code into NodeManager.receivedKnownNodes(....) if (isMaster()) { // Set friendship setFriend(true); log().verbose("Syncing friendlist with master"); } // This might also just be a search result and thus not include us // mutalFriend = false; for (int i = 0; i < newNodes.nodes.length; i++) { MemberInfo remoteNodeInfo = newNodes.nodes[i]; if (remoteNodeInfo == null) { continue; } if (getInfo().equals(remoteNodeInfo)) { // Take his info updateInfo(remoteNodeInfo); } if (remoteNodeInfo .equals(getController().getMySelf().getInfo())) { // Check for mutal friendship mutalFriend = remoteNodeInfo.isFriend; } // Syncing friendlist with master if (isMaster()) { Member node = remoteNodeInfo.getNode(getController(), true); node.setFriend(remoteNodeInfo.isFriend); } } // Queue arrived node list at nodemanager getController().getNodeManager().queueNewNodes(newNodes.nodes); } else if (message instanceof RequestNodeInformation) { // send him our node information sendMessageAsynchron(new NodeInformation(getController()), null); } else if (message instanceof TransferStatus) { // Hold transfer status lastTransferStatus = (TransferStatus) message; } else if (message instanceof NodeInformation) { if (logVerbose) { log().verbose("Node information received"); } if (Logger.isLogToFileEnabled()) { Debug.writeNodeInformation((NodeInformation) message); } // Cache the last node information // lastNodeInformation = (NodeInformation) message; } else if (message instanceof SettingsChange) { SettingsChange settingsChange = (SettingsChange) message; if (settingsChange.newInfo != null) { log().debug( this.getInfo().nick + " changed nick to " + settingsChange.newInfo.nick); setNick(settingsChange.newInfo.nick); } } else if (message instanceof FileList) { FileList remoteFileList = (FileList) message; if (logVerbose) { log().verbose( remoteFileList.folder + ": Received new filelist (" + remoteFileList.folder.filesCount + " file(s)) from " + this); } // Add filelist to filelist cache Map<FileInfo, FileInfo> cachedFileList = Collections .synchronizedMap(new HashMap<FileInfo, FileInfo>( remoteFileList.files.length)); for (int i = 0; i < remoteFileList.files.length; i++) { cachedFileList.put(remoteFileList.files[i], remoteFileList.files[i]); } lastFiles.put(remoteFileList.folder, cachedFileList); // Trigger requesting if (targetFolder != null) { // Write filelist if (Logger.isLogToFileEnabled()) { // Write filelist to disk File debugFile = new File("debug/" + targetFolder.getName() + "/" + getNick() + ".list.txt"); Debug.writeFileList(cachedFileList.keySet(), "FileList of folder " + targetFolder.getName() + ", member " + this + ":", debugFile); } // Inform folder targetFolder.fileListChanged(this, remoteFileList); } } else if (message instanceof FolderFilesChanged) { if (logVerbose) { log().debug("FileListChange received: " + message); } FolderFilesChanged changes = (FolderFilesChanged) message; // Correct filelist Map<FileInfo, FileInfo> cachedFileList = getLastFileList0(changes.folder); if (cachedFileList == null) { log().warn( "Received folder changes on " + changes.folder.name + ", but not received the full filelist"); return; } synchronized (cachedFileList) { if (changes.added != null) { for (int i = 0; i < changes.added.length; i++) { FileInfo file = changes.added[i]; cachedFileList.remove(file); cachedFileList.put(file, file); } } if (changes.modified != null) { for (int i = 0; i < changes.modified.length; i++) { FileInfo file = changes.modified[i]; cachedFileList.remove(file); cachedFileList.put(file, file); } } if (changes.removed != null) { for (int i = 0; i < changes.removed.length; i++) { FileInfo file = changes.removed[i]; cachedFileList.remove(file); cachedFileList.put(file, file); // file removed so if downloading break the download TransferManager tm = getController() .getTransferManager(); if (tm.isDownloadingFileFrom(file, this)) { if (logVerbose) { log().verbose( "downloading removed file breaking it! " + file + " " + this); } tm.abortDownload(file, this); } } } } if (targetFolder != null) { // Write filelist if (Logger.isLogToFileEnabled()) { // Write filelist to disk File debugFile = new File("debug/" + targetFolder.getName() + "/" + getNick() + ".list.txt"); Debug.writeFileList(cachedFileList.keySet(), "FileList of folder " + targetFolder.getName() + ", member " + this + ":", debugFile); } // Inform folder targetFolder.fileListChanged(this, changes); } } else if (message instanceof Invitation) { // Invitation to folder Invitation invitation = (Invitation) message; // To ensure invitor is correct invitation.invitor = this.getInfo(); getController().getFolderRepository().invitationReceived( invitation, true, false); } else if (message instanceof Problem) { Problem problem = (Problem) message; if (problem.problemCode == Problem.YOU_ARE_BORING) { // Finds us boring // set unable to connect log().debug("Node finds us boring, not longer connect"); unableToConnect = true; // Not connected to public network isConnectedToNetwork = true; } else { log().warn("Problem received: " + problem); } if (problem.fatal) { // Shutdown shutdown(); } } else if (message instanceof SearchNodeRequest) { // Send nodelist that matches the search. final SearchNodeRequest request = (SearchNodeRequest) message; new Thread("Search node request") { public void run() { List<MemberInfo> reply = new LinkedList<MemberInfo>(); for (Member m : getController().getNodeManager() .getValidNodes()) { if (m.matches(request.searchString)) { reply.add(m.getInfo()); } } if (!reply.isEmpty()) { sendMessageAsynchron(new KnownNodes(reply .toArray(new MemberInfo[0])), null); } } }.start(); } else { log().warn( "Unknown message received from peer: " + message.getClass().getName()); } // now give the message to all message listeners fireMessageToListeners(message); } | 51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/345e407b12268b8a7f25e6c3dde52a19eccba263/Member.java/clean/src/main/de/dal33t/powerfolder/Member.java |
File debugFile = new File("debug/" + targetFolder.getName() | File debugFile = new File(Logger.getDebugDir(), targetFolder.getName() | public void handleMessage(Message message) { if (message == null) { throw new NullPointerException( "Unable to handle message, message is null"); } // related folder is filled if message is a folder related message FolderInfo targetedFolderInfo = null; Folder targetFolder = null; if (message instanceof FolderRelatedMessage) { targetedFolderInfo = ((FolderRelatedMessage) message).folder; targetFolder = getController().getFolderRepository().getFolder( targetedFolderInfo); } // do all the message processing // Processing of message also should take only // a short time, because member is not able // to received any other message meanwhile ! // Identity is not handled HERE ! if (message instanceof FolderList) { FolderList fList = (FolderList) message; lastFolderList = fList; joinToLocalFolders(fList); // Notify waiting ppl synchronized (folderListWaiter) { folderListWaiter.notifyAll(); } // Inform folder repo getController().getFolderRepository().receivedFolderList(this, fList); } else if (message instanceof RequestNetworkFolderList) { RequestNetworkFolderList request = (RequestNetworkFolderList) message; // Answer request for network folder list if (request.completeList()) { sendMessagesAsynchron(NetworkFolderList .createNetworkFolderLists(getController() .getFolderRepository())); } else { sendMessagesAsynchron(NetworkFolderList .createNetworkFolderLists(getController() .getFolderRepository(), request.folders)); } } else if (message instanceof NetworkFolderList) { NetworkFolderList netFolderList = (NetworkFolderList) message; // Inform repo getController().getFolderRepository().receivedNetworkFolderList( this, netFolderList); } else if (message instanceof RequestFileList) { if (targetFolder != null && !targetFolder.isSecret()) { // a file list of a folder if (logVerbose) { log().verbose( targetFolder + ": Sending new filelist to " + this); } sendMessagesAsynchron(FileList .createFileListMessages(targetFolder)); } else { // Send folder not found if not found or folder is secret sendMessageAsynchron(new Problem("Folder not found: " + targetedFolderInfo, false), null); } } else if (message instanceof RequestDownload) { // a download is requested RequestDownload dlReq = (RequestDownload) message; getController().getTransferManager().queueUpload(this, dlReq); } else if (message instanceof DownloadQueued) { // set queued flag here, if we received status from other side DownloadQueued dlQueued = (DownloadQueued) message; getController().getTransferManager().setQueued(dlQueued); } else if (message instanceof AbortDownload) { AbortDownload abort = (AbortDownload) message; // Abort the upload getController().getTransferManager().abortUpload(abort.file, this); } else if (message instanceof FileChunk) { // File chunk received FileChunk chunk = (FileChunk) message; getController().getTransferManager().chunkReceived(chunk, this); } else if (message instanceof RequestNodeList) { // Nodemanager will handle that RequestNodeList request = (RequestNodeList) message; getController().getNodeManager().receivedRequestNodeList(request, this); } else if (message instanceof KnownNodes) { KnownNodes newNodes = (KnownNodes) message; // TODO Move this code into NodeManager.receivedKnownNodes(....) if (isMaster()) { // Set friendship setFriend(true); log().verbose("Syncing friendlist with master"); } // This might also just be a search result and thus not include us // mutalFriend = false; for (int i = 0; i < newNodes.nodes.length; i++) { MemberInfo remoteNodeInfo = newNodes.nodes[i]; if (remoteNodeInfo == null) { continue; } if (getInfo().equals(remoteNodeInfo)) { // Take his info updateInfo(remoteNodeInfo); } if (remoteNodeInfo .equals(getController().getMySelf().getInfo())) { // Check for mutal friendship mutalFriend = remoteNodeInfo.isFriend; } // Syncing friendlist with master if (isMaster()) { Member node = remoteNodeInfo.getNode(getController(), true); node.setFriend(remoteNodeInfo.isFriend); } } // Queue arrived node list at nodemanager getController().getNodeManager().queueNewNodes(newNodes.nodes); } else if (message instanceof RequestNodeInformation) { // send him our node information sendMessageAsynchron(new NodeInformation(getController()), null); } else if (message instanceof TransferStatus) { // Hold transfer status lastTransferStatus = (TransferStatus) message; } else if (message instanceof NodeInformation) { if (logVerbose) { log().verbose("Node information received"); } if (Logger.isLogToFileEnabled()) { Debug.writeNodeInformation((NodeInformation) message); } // Cache the last node information // lastNodeInformation = (NodeInformation) message; } else if (message instanceof SettingsChange) { SettingsChange settingsChange = (SettingsChange) message; if (settingsChange.newInfo != null) { log().debug( this.getInfo().nick + " changed nick to " + settingsChange.newInfo.nick); setNick(settingsChange.newInfo.nick); } } else if (message instanceof FileList) { FileList remoteFileList = (FileList) message; if (logVerbose) { log().verbose( remoteFileList.folder + ": Received new filelist (" + remoteFileList.folder.filesCount + " file(s)) from " + this); } // Add filelist to filelist cache Map<FileInfo, FileInfo> cachedFileList = Collections .synchronizedMap(new HashMap<FileInfo, FileInfo>( remoteFileList.files.length)); for (int i = 0; i < remoteFileList.files.length; i++) { cachedFileList.put(remoteFileList.files[i], remoteFileList.files[i]); } lastFiles.put(remoteFileList.folder, cachedFileList); // Trigger requesting if (targetFolder != null) { // Write filelist if (Logger.isLogToFileEnabled()) { // Write filelist to disk File debugFile = new File("debug/" + targetFolder.getName() + "/" + getNick() + ".list.txt"); Debug.writeFileList(cachedFileList.keySet(), "FileList of folder " + targetFolder.getName() + ", member " + this + ":", debugFile); } // Inform folder targetFolder.fileListChanged(this, remoteFileList); } } else if (message instanceof FolderFilesChanged) { if (logVerbose) { log().debug("FileListChange received: " + message); } FolderFilesChanged changes = (FolderFilesChanged) message; // Correct filelist Map<FileInfo, FileInfo> cachedFileList = getLastFileList0(changes.folder); if (cachedFileList == null) { log().warn( "Received folder changes on " + changes.folder.name + ", but not received the full filelist"); return; } synchronized (cachedFileList) { if (changes.added != null) { for (int i = 0; i < changes.added.length; i++) { FileInfo file = changes.added[i]; cachedFileList.remove(file); cachedFileList.put(file, file); } } if (changes.modified != null) { for (int i = 0; i < changes.modified.length; i++) { FileInfo file = changes.modified[i]; cachedFileList.remove(file); cachedFileList.put(file, file); } } if (changes.removed != null) { for (int i = 0; i < changes.removed.length; i++) { FileInfo file = changes.removed[i]; cachedFileList.remove(file); cachedFileList.put(file, file); // file removed so if downloading break the download TransferManager tm = getController() .getTransferManager(); if (tm.isDownloadingFileFrom(file, this)) { if (logVerbose) { log().verbose( "downloading removed file breaking it! " + file + " " + this); } tm.abortDownload(file, this); } } } } if (targetFolder != null) { // Write filelist if (Logger.isLogToFileEnabled()) { // Write filelist to disk File debugFile = new File("debug/" + targetFolder.getName() + "/" + getNick() + ".list.txt"); Debug.writeFileList(cachedFileList.keySet(), "FileList of folder " + targetFolder.getName() + ", member " + this + ":", debugFile); } // Inform folder targetFolder.fileListChanged(this, changes); } } else if (message instanceof Invitation) { // Invitation to folder Invitation invitation = (Invitation) message; // To ensure invitor is correct invitation.invitor = this.getInfo(); getController().getFolderRepository().invitationReceived( invitation, true, false); } else if (message instanceof Problem) { Problem problem = (Problem) message; if (problem.problemCode == Problem.YOU_ARE_BORING) { // Finds us boring // set unable to connect log().debug("Node finds us boring, not longer connect"); unableToConnect = true; // Not connected to public network isConnectedToNetwork = true; } else { log().warn("Problem received: " + problem); } if (problem.fatal) { // Shutdown shutdown(); } } else if (message instanceof SearchNodeRequest) { // Send nodelist that matches the search. final SearchNodeRequest request = (SearchNodeRequest) message; new Thread("Search node request") { public void run() { List<MemberInfo> reply = new LinkedList<MemberInfo>(); for (Member m : getController().getNodeManager() .getValidNodes()) { if (m.matches(request.searchString)) { reply.add(m.getInfo()); } } if (!reply.isEmpty()) { sendMessageAsynchron(new KnownNodes(reply .toArray(new MemberInfo[0])), null); } } }.start(); } else { log().warn( "Unknown message received from peer: " + message.getClass().getName()); } // now give the message to all message listeners fireMessageToListeners(message); } | 51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/345e407b12268b8a7f25e6c3dde52a19eccba263/Member.java/clean/src/main/de/dal33t/powerfolder/Member.java |
final String message = "Key bindings need a scheme or key configuration: '" | final String message = "Key bindings need a scheme or key configuration: commandId='" | private static final void readBindingsFromPreferences( final IMemento preferences, final BindingManager bindingManager, final ICommandService commandService) { /* * If necessary, this list of status items will be constructed. It will * only contains instances of <code>IStatus</code>. */ List warningsToLog = new ArrayList(1); if (preferences != null) { final IMemento[] preferenceMementos = preferences .getChildren(ELEMENT_KEY_BINDING); int preferenceMementoCount = preferenceMementos.length; for (int i = preferenceMementoCount - 1; i >= 0; i--) { final IMemento memento = preferenceMementos[i]; // Read out the command id. String commandId = memento.getString(ATTRIBUTE_COMMAND_ID); if ((commandId == null) || (commandId.length() == 0)) { commandId = memento.getString(ATTRIBUTE_COMMAND); } if ((commandId != null) && (commandId.length() == 0)) { commandId = null; } final Command command; if (commandId != null) { command = commandService.getCommand(commandId); } else { command = null; } // Read out the scheme id. String schemeId = memento .getString(ATTRIBUTE_KEY_CONFIGURATION_ID); if ((schemeId == null) || (schemeId.length() == 0)) { schemeId = memento.getString(ATTRIBUTE_CONFIGURATION); if ((schemeId == null) || (schemeId.length() == 0)) { // The scheme id should never be null. This is invalid. final String message = "Key bindings need a scheme or key configuration: '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } // Read out the context id. String contextId = memento.getString(ATTRIBUTE_CONTEXT_ID); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } else if ((contextId == null) || (contextId.length() == 0)) { contextId = memento.getString(ATTRIBUTE_SCOPE); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } } if ((contextId == null) || (contextId.length() == 0)) { contextId = IContextIds.CONTEXT_ID_WINDOW; } // Read out the key sequence. String keySequenceText = memento .getString(ATTRIBUTE_KEY_SEQUENCE); KeySequence keySequence = null; if ((keySequenceText == null) || (keySequenceText.length() == 0)) { keySequenceText = memento.getString(ATTRIBUTE_STRING); if ((keySequenceText == null) || (keySequenceText.length() == 0)) { /* * The key sequence should never be null. This is * pointless */ final String message = "Key bindings need a key sequence or string: '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } // The key sequence is in the old-style format. keySequence = convert2_1Sequence(parse2_1Sequence(keySequenceText)); } else { // The key sequence is in the new-style format. try { keySequence = KeySequence.getInstance(keySequenceText); } catch (final ParseException e) { final String message = "Could not parse: '" //$NON-NLS-1$ + keySequenceText + "': '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } if (keySequence.isEmpty() || !keySequence.isComplete()) { final String message = "Key bindings cannot use an empty or incomplete key sequence: '" //$NON-NLS-1$ + keySequence + "': '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } // Read out the locale and platform. String locale = memento.getString(ATTRIBUTE_LOCALE); if ((locale != null) && (locale.length() == 0)) { locale = null; } String platform = memento.getString(ATTRIBUTE_PLATFORM); if ((platform != null) && (platform.length() == 0)) { platform = null; } // Read out the parameters final ParameterizedCommand parameterizedCommand; if (command == null) { parameterizedCommand = null; } else { parameterizedCommand = readParameters(memento, warningsToLog, command); } final Binding binding = new KeyBinding(keySequence, parameterizedCommand, schemeId, contextId, locale, platform, null, Binding.USER); bindingManager.addBinding(binding); } } // If there were any warnings, then log them now. if (!warningsToLog.isEmpty()) { final String message = "Warnings while parsing the key bindings from the preference store."; //$NON-NLS-1$ final IStatus status = new MultiStatus( WorkbenchPlugin.PI_WORKBENCH, 0, (IStatus[]) warningsToLog .toArray(new IStatus[warningsToLog.size()]), message, null); WorkbenchPlugin.log(message, status); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/2aa0965bbe6d7e1c9acd243af620354c7eb93e19/BindingPersistence.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java |
final String message = "Key bindings need a key sequence or string: '" | final String message = "Key bindings need a key sequence or string: commandId='" | private static final void readBindingsFromPreferences( final IMemento preferences, final BindingManager bindingManager, final ICommandService commandService) { /* * If necessary, this list of status items will be constructed. It will * only contains instances of <code>IStatus</code>. */ List warningsToLog = new ArrayList(1); if (preferences != null) { final IMemento[] preferenceMementos = preferences .getChildren(ELEMENT_KEY_BINDING); int preferenceMementoCount = preferenceMementos.length; for (int i = preferenceMementoCount - 1; i >= 0; i--) { final IMemento memento = preferenceMementos[i]; // Read out the command id. String commandId = memento.getString(ATTRIBUTE_COMMAND_ID); if ((commandId == null) || (commandId.length() == 0)) { commandId = memento.getString(ATTRIBUTE_COMMAND); } if ((commandId != null) && (commandId.length() == 0)) { commandId = null; } final Command command; if (commandId != null) { command = commandService.getCommand(commandId); } else { command = null; } // Read out the scheme id. String schemeId = memento .getString(ATTRIBUTE_KEY_CONFIGURATION_ID); if ((schemeId == null) || (schemeId.length() == 0)) { schemeId = memento.getString(ATTRIBUTE_CONFIGURATION); if ((schemeId == null) || (schemeId.length() == 0)) { // The scheme id should never be null. This is invalid. final String message = "Key bindings need a scheme or key configuration: '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } // Read out the context id. String contextId = memento.getString(ATTRIBUTE_CONTEXT_ID); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } else if ((contextId == null) || (contextId.length() == 0)) { contextId = memento.getString(ATTRIBUTE_SCOPE); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } } if ((contextId == null) || (contextId.length() == 0)) { contextId = IContextIds.CONTEXT_ID_WINDOW; } // Read out the key sequence. String keySequenceText = memento .getString(ATTRIBUTE_KEY_SEQUENCE); KeySequence keySequence = null; if ((keySequenceText == null) || (keySequenceText.length() == 0)) { keySequenceText = memento.getString(ATTRIBUTE_STRING); if ((keySequenceText == null) || (keySequenceText.length() == 0)) { /* * The key sequence should never be null. This is * pointless */ final String message = "Key bindings need a key sequence or string: '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } // The key sequence is in the old-style format. keySequence = convert2_1Sequence(parse2_1Sequence(keySequenceText)); } else { // The key sequence is in the new-style format. try { keySequence = KeySequence.getInstance(keySequenceText); } catch (final ParseException e) { final String message = "Could not parse: '" //$NON-NLS-1$ + keySequenceText + "': '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } if (keySequence.isEmpty() || !keySequence.isComplete()) { final String message = "Key bindings cannot use an empty or incomplete key sequence: '" //$NON-NLS-1$ + keySequence + "': '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } // Read out the locale and platform. String locale = memento.getString(ATTRIBUTE_LOCALE); if ((locale != null) && (locale.length() == 0)) { locale = null; } String platform = memento.getString(ATTRIBUTE_PLATFORM); if ((platform != null) && (platform.length() == 0)) { platform = null; } // Read out the parameters final ParameterizedCommand parameterizedCommand; if (command == null) { parameterizedCommand = null; } else { parameterizedCommand = readParameters(memento, warningsToLog, command); } final Binding binding = new KeyBinding(keySequence, parameterizedCommand, schemeId, contextId, locale, platform, null, Binding.USER); bindingManager.addBinding(binding); } } // If there were any warnings, then log them now. if (!warningsToLog.isEmpty()) { final String message = "Warnings while parsing the key bindings from the preference store."; //$NON-NLS-1$ final IStatus status = new MultiStatus( WorkbenchPlugin.PI_WORKBENCH, 0, (IStatus[]) warningsToLog .toArray(new IStatus[warningsToLog.size()]), message, null); WorkbenchPlugin.log(message, status); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/2aa0965bbe6d7e1c9acd243af620354c7eb93e19/BindingPersistence.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java |
final String message = "Could not parse: '" + keySequenceText + "': '" | final String message = "Could not parse: sequence='" + keySequenceText + "': commandId='" | private static final void readBindingsFromPreferences( final IMemento preferences, final BindingManager bindingManager, final ICommandService commandService) { /* * If necessary, this list of status items will be constructed. It will * only contains instances of <code>IStatus</code>. */ List warningsToLog = new ArrayList(1); if (preferences != null) { final IMemento[] preferenceMementos = preferences .getChildren(ELEMENT_KEY_BINDING); int preferenceMementoCount = preferenceMementos.length; for (int i = preferenceMementoCount - 1; i >= 0; i--) { final IMemento memento = preferenceMementos[i]; // Read out the command id. String commandId = memento.getString(ATTRIBUTE_COMMAND_ID); if ((commandId == null) || (commandId.length() == 0)) { commandId = memento.getString(ATTRIBUTE_COMMAND); } if ((commandId != null) && (commandId.length() == 0)) { commandId = null; } final Command command; if (commandId != null) { command = commandService.getCommand(commandId); } else { command = null; } // Read out the scheme id. String schemeId = memento .getString(ATTRIBUTE_KEY_CONFIGURATION_ID); if ((schemeId == null) || (schemeId.length() == 0)) { schemeId = memento.getString(ATTRIBUTE_CONFIGURATION); if ((schemeId == null) || (schemeId.length() == 0)) { // The scheme id should never be null. This is invalid. final String message = "Key bindings need a scheme or key configuration: '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } // Read out the context id. String contextId = memento.getString(ATTRIBUTE_CONTEXT_ID); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } else if ((contextId == null) || (contextId.length() == 0)) { contextId = memento.getString(ATTRIBUTE_SCOPE); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } } if ((contextId == null) || (contextId.length() == 0)) { contextId = IContextIds.CONTEXT_ID_WINDOW; } // Read out the key sequence. String keySequenceText = memento .getString(ATTRIBUTE_KEY_SEQUENCE); KeySequence keySequence = null; if ((keySequenceText == null) || (keySequenceText.length() == 0)) { keySequenceText = memento.getString(ATTRIBUTE_STRING); if ((keySequenceText == null) || (keySequenceText.length() == 0)) { /* * The key sequence should never be null. This is * pointless */ final String message = "Key bindings need a key sequence or string: '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } // The key sequence is in the old-style format. keySequence = convert2_1Sequence(parse2_1Sequence(keySequenceText)); } else { // The key sequence is in the new-style format. try { keySequence = KeySequence.getInstance(keySequenceText); } catch (final ParseException e) { final String message = "Could not parse: '" //$NON-NLS-1$ + keySequenceText + "': '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } if (keySequence.isEmpty() || !keySequence.isComplete()) { final String message = "Key bindings cannot use an empty or incomplete key sequence: '" //$NON-NLS-1$ + keySequence + "': '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } // Read out the locale and platform. String locale = memento.getString(ATTRIBUTE_LOCALE); if ((locale != null) && (locale.length() == 0)) { locale = null; } String platform = memento.getString(ATTRIBUTE_PLATFORM); if ((platform != null) && (platform.length() == 0)) { platform = null; } // Read out the parameters final ParameterizedCommand parameterizedCommand; if (command == null) { parameterizedCommand = null; } else { parameterizedCommand = readParameters(memento, warningsToLog, command); } final Binding binding = new KeyBinding(keySequence, parameterizedCommand, schemeId, contextId, locale, platform, null, Binding.USER); bindingManager.addBinding(binding); } } // If there were any warnings, then log them now. if (!warningsToLog.isEmpty()) { final String message = "Warnings while parsing the key bindings from the preference store."; //$NON-NLS-1$ final IStatus status = new MultiStatus( WorkbenchPlugin.PI_WORKBENCH, 0, (IStatus[]) warningsToLog .toArray(new IStatus[warningsToLog.size()]), message, null); WorkbenchPlugin.log(message, status); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/2aa0965bbe6d7e1c9acd243af620354c7eb93e19/BindingPersistence.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java |
final String message = "Key bindings cannot use an empty or incomplete key sequence: '" + keySequence + "': '" | final String message = "Key bindings cannot use an empty or incomplete key sequence: sequence='" + keySequence + "': commandId='" | private static final void readBindingsFromPreferences( final IMemento preferences, final BindingManager bindingManager, final ICommandService commandService) { /* * If necessary, this list of status items will be constructed. It will * only contains instances of <code>IStatus</code>. */ List warningsToLog = new ArrayList(1); if (preferences != null) { final IMemento[] preferenceMementos = preferences .getChildren(ELEMENT_KEY_BINDING); int preferenceMementoCount = preferenceMementos.length; for (int i = preferenceMementoCount - 1; i >= 0; i--) { final IMemento memento = preferenceMementos[i]; // Read out the command id. String commandId = memento.getString(ATTRIBUTE_COMMAND_ID); if ((commandId == null) || (commandId.length() == 0)) { commandId = memento.getString(ATTRIBUTE_COMMAND); } if ((commandId != null) && (commandId.length() == 0)) { commandId = null; } final Command command; if (commandId != null) { command = commandService.getCommand(commandId); } else { command = null; } // Read out the scheme id. String schemeId = memento .getString(ATTRIBUTE_KEY_CONFIGURATION_ID); if ((schemeId == null) || (schemeId.length() == 0)) { schemeId = memento.getString(ATTRIBUTE_CONFIGURATION); if ((schemeId == null) || (schemeId.length() == 0)) { // The scheme id should never be null. This is invalid. final String message = "Key bindings need a scheme or key configuration: '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } // Read out the context id. String contextId = memento.getString(ATTRIBUTE_CONTEXT_ID); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } else if ((contextId == null) || (contextId.length() == 0)) { contextId = memento.getString(ATTRIBUTE_SCOPE); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } } if ((contextId == null) || (contextId.length() == 0)) { contextId = IContextIds.CONTEXT_ID_WINDOW; } // Read out the key sequence. String keySequenceText = memento .getString(ATTRIBUTE_KEY_SEQUENCE); KeySequence keySequence = null; if ((keySequenceText == null) || (keySequenceText.length() == 0)) { keySequenceText = memento.getString(ATTRIBUTE_STRING); if ((keySequenceText == null) || (keySequenceText.length() == 0)) { /* * The key sequence should never be null. This is * pointless */ final String message = "Key bindings need a key sequence or string: '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } // The key sequence is in the old-style format. keySequence = convert2_1Sequence(parse2_1Sequence(keySequenceText)); } else { // The key sequence is in the new-style format. try { keySequence = KeySequence.getInstance(keySequenceText); } catch (final ParseException e) { final String message = "Could not parse: '" //$NON-NLS-1$ + keySequenceText + "': '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } if (keySequence.isEmpty() || !keySequence.isComplete()) { final String message = "Key bindings cannot use an empty or incomplete key sequence: '" //$NON-NLS-1$ + keySequence + "': '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } // Read out the locale and platform. String locale = memento.getString(ATTRIBUTE_LOCALE); if ((locale != null) && (locale.length() == 0)) { locale = null; } String platform = memento.getString(ATTRIBUTE_PLATFORM); if ((platform != null) && (platform.length() == 0)) { platform = null; } // Read out the parameters final ParameterizedCommand parameterizedCommand; if (command == null) { parameterizedCommand = null; } else { parameterizedCommand = readParameters(memento, warningsToLog, command); } final Binding binding = new KeyBinding(keySequence, parameterizedCommand, schemeId, contextId, locale, platform, null, Binding.USER); bindingManager.addBinding(binding); } } // If there were any warnings, then log them now. if (!warningsToLog.isEmpty()) { final String message = "Warnings while parsing the key bindings from the preference store."; //$NON-NLS-1$ final IStatus status = new MultiStatus( WorkbenchPlugin.PI_WORKBENCH, 0, (IStatus[]) warningsToLog .toArray(new IStatus[warningsToLog.size()]), message, null); WorkbenchPlugin.log(message, status); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/2aa0965bbe6d7e1c9acd243af620354c7eb93e19/BindingPersistence.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java |
final String message = "Warnings while parsing the key bindings from the preference store."; | final String message = "Warnings while parsing the key bindings from the preference store"; | private static final void readBindingsFromPreferences( final IMemento preferences, final BindingManager bindingManager, final ICommandService commandService) { /* * If necessary, this list of status items will be constructed. It will * only contains instances of <code>IStatus</code>. */ List warningsToLog = new ArrayList(1); if (preferences != null) { final IMemento[] preferenceMementos = preferences .getChildren(ELEMENT_KEY_BINDING); int preferenceMementoCount = preferenceMementos.length; for (int i = preferenceMementoCount - 1; i >= 0; i--) { final IMemento memento = preferenceMementos[i]; // Read out the command id. String commandId = memento.getString(ATTRIBUTE_COMMAND_ID); if ((commandId == null) || (commandId.length() == 0)) { commandId = memento.getString(ATTRIBUTE_COMMAND); } if ((commandId != null) && (commandId.length() == 0)) { commandId = null; } final Command command; if (commandId != null) { command = commandService.getCommand(commandId); } else { command = null; } // Read out the scheme id. String schemeId = memento .getString(ATTRIBUTE_KEY_CONFIGURATION_ID); if ((schemeId == null) || (schemeId.length() == 0)) { schemeId = memento.getString(ATTRIBUTE_CONFIGURATION); if ((schemeId == null) || (schemeId.length() == 0)) { // The scheme id should never be null. This is invalid. final String message = "Key bindings need a scheme or key configuration: '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } // Read out the context id. String contextId = memento.getString(ATTRIBUTE_CONTEXT_ID); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } else if ((contextId == null) || (contextId.length() == 0)) { contextId = memento.getString(ATTRIBUTE_SCOPE); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } } if ((contextId == null) || (contextId.length() == 0)) { contextId = IContextIds.CONTEXT_ID_WINDOW; } // Read out the key sequence. String keySequenceText = memento .getString(ATTRIBUTE_KEY_SEQUENCE); KeySequence keySequence = null; if ((keySequenceText == null) || (keySequenceText.length() == 0)) { keySequenceText = memento.getString(ATTRIBUTE_STRING); if ((keySequenceText == null) || (keySequenceText.length() == 0)) { /* * The key sequence should never be null. This is * pointless */ final String message = "Key bindings need a key sequence or string: '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } // The key sequence is in the old-style format. keySequence = convert2_1Sequence(parse2_1Sequence(keySequenceText)); } else { // The key sequence is in the new-style format. try { keySequence = KeySequence.getInstance(keySequenceText); } catch (final ParseException e) { final String message = "Could not parse: '" //$NON-NLS-1$ + keySequenceText + "': '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } if (keySequence.isEmpty() || !keySequence.isComplete()) { final String message = "Key bindings cannot use an empty or incomplete key sequence: '" //$NON-NLS-1$ + keySequence + "': '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } // Read out the locale and platform. String locale = memento.getString(ATTRIBUTE_LOCALE); if ((locale != null) && (locale.length() == 0)) { locale = null; } String platform = memento.getString(ATTRIBUTE_PLATFORM); if ((platform != null) && (platform.length() == 0)) { platform = null; } // Read out the parameters final ParameterizedCommand parameterizedCommand; if (command == null) { parameterizedCommand = null; } else { parameterizedCommand = readParameters(memento, warningsToLog, command); } final Binding binding = new KeyBinding(keySequence, parameterizedCommand, schemeId, contextId, locale, platform, null, Binding.USER); bindingManager.addBinding(binding); } } // If there were any warnings, then log them now. if (!warningsToLog.isEmpty()) { final String message = "Warnings while parsing the key bindings from the preference store."; //$NON-NLS-1$ final IStatus status = new MultiStatus( WorkbenchPlugin.PI_WORKBENCH, 0, (IStatus[]) warningsToLog .toArray(new IStatus[warningsToLog.size()]), message, null); WorkbenchPlugin.log(message, status); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/2aa0965bbe6d7e1c9acd243af620354c7eb93e19/BindingPersistence.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java |
private static final void readBindingsFromRegistry( final IConfigurationElement[] configurationElements, final int configurationElementCount, final BindingManager bindingManager, final ICommandService commandService) { final Collection bindings = new ArrayList(configurationElementCount); /* * If necessary, this list of status items will be constructed. It will * only contains instances of <code>IStatus</code>. */ List warningsToLog = new ArrayList(1); for (int i = 0; i < configurationElementCount; i++) { final IConfigurationElement configurationElement = configurationElements[i]; /* * Read out the command id. Doing this before determining if the key * binding is actually valid is a bit wasteful. However, it is * helpful to have the command identifier when logging syntax * errors. */ String commandId = configurationElement .getAttribute(ATTRIBUTE_COMMAND_ID); if ((commandId == null) || (commandId.length() == 0)) { commandId = configurationElement .getAttribute(ATTRIBUTE_COMMAND); } if ((commandId != null) && (commandId.length() == 0)) { commandId = null; } final Command command; if (commandId != null) { command = commandService.getCommand(commandId); if (!command.isDefined()) { // Reference to an undefined command. This is invalid. final String message = "Cannot bind to an undefined command: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } else { command = null; } // Read out the scheme id. String schemeId = configurationElement .getAttribute(ATTRIBUTE_SCHEME_ID); if ((schemeId == null) || (schemeId.length() == 0)) { schemeId = configurationElement .getAttribute(ATTRIBUTE_KEY_CONFIGURATION_ID); if ((schemeId == null) || (schemeId.length() == 0)) { schemeId = configurationElement .getAttribute(ATTRIBUTE_CONFIGURATION); if ((schemeId == null) || (schemeId.length() == 0)) { // The scheme id should never be null. This is invalid. final String message = "Key bindings need a scheme: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } } // Read out the context id. String contextId = configurationElement .getAttribute(ATTRIBUTE_CONTEXT_ID); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } else if ((contextId == null) || (contextId.length() == 0)) { contextId = configurationElement.getAttribute(ATTRIBUTE_SCOPE); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } } if ((contextId == null) || (contextId.length() == 0)) { contextId = IContextIds.CONTEXT_ID_WINDOW; } // Read out the key sequence. KeySequence keySequence = null; String keySequenceText = configurationElement .getAttribute(ATTRIBUTE_SEQUENCE); if ((keySequenceText == null) || (keySequenceText.length() == 0)) { keySequenceText = configurationElement .getAttribute(ATTRIBUTE_KEY_SEQUENCE); } if ((keySequenceText == null) || (keySequenceText.length() == 0)) { keySequenceText = configurationElement .getAttribute(ATTRIBUTE_STRING); if ((keySequenceText == null) || (keySequenceText.length() == 0)) { // The key sequence should never be null. This is // pointless final String message = "Defining a key binding with no key sequence has no effect: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } // The key sequence is in the old-style format. keySequence = convert2_1Sequence(parse2_1Sequence(keySequenceText)); } else { // The key sequence is in the new-style format. try { keySequence = KeySequence.getInstance(keySequenceText); } catch (final ParseException e) { final String message = "Could not parse '" + keySequenceText //$NON-NLS-1$ + "': '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } if (keySequence.isEmpty() || !keySequence.isComplete()) { final String message = "Key bindings should not have an empty or incomplete key sequence: '" //$NON-NLS-1$ + keySequence + "': '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } // Read out the locale and platform. String locale = configurationElement.getAttribute(ATTRIBUTE_LOCALE); if ((locale != null) && (locale.length() == 0)) { locale = null; } String platform = configurationElement .getAttribute(ATTRIBUTE_PLATFORM); if ((platform != null) && (platform.length() == 0)) { platform = null; } // Read out the parameters, if any. final ParameterizedCommand parameterizedCommand; if (command == null) { parameterizedCommand = null; } else { parameterizedCommand = readParameters(configurationElement, warningsToLog, command); } final Binding binding = new KeyBinding(keySequence, parameterizedCommand, schemeId, contextId, locale, platform, null, Binding.SYSTEM); bindings.add(binding); } final Binding[] bindingArray = (Binding[]) bindings .toArray(new Binding[bindings.size()]); bindingManager.setBindings(bindingArray); // If there were any warnings, then log them now. if (!warningsToLog.isEmpty()) { final String message = "Warnings while parsing the key bindings from the 'org.eclipse.ui.commands' extension point."; //$NON-NLS-1$ final IStatus status = new MultiStatus( WorkbenchPlugin.PI_WORKBENCH, 0, (IStatus[]) warningsToLog .toArray(new IStatus[warningsToLog.size()]), message, null); WorkbenchPlugin.log(message, status); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/2aa0965bbe6d7e1c9acd243af620354c7eb93e19/BindingPersistence.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java |
||
final String message = "Cannot bind to an undefined command: '" + configurationElement.getNamespace() + "', '" | final String message = "Cannot bind to an undefined command: plug-in='" + configurationElement.getNamespace() + "', commandId='" | private static final void readBindingsFromRegistry( final IConfigurationElement[] configurationElements, final int configurationElementCount, final BindingManager bindingManager, final ICommandService commandService) { final Collection bindings = new ArrayList(configurationElementCount); /* * If necessary, this list of status items will be constructed. It will * only contains instances of <code>IStatus</code>. */ List warningsToLog = new ArrayList(1); for (int i = 0; i < configurationElementCount; i++) { final IConfigurationElement configurationElement = configurationElements[i]; /* * Read out the command id. Doing this before determining if the key * binding is actually valid is a bit wasteful. However, it is * helpful to have the command identifier when logging syntax * errors. */ String commandId = configurationElement .getAttribute(ATTRIBUTE_COMMAND_ID); if ((commandId == null) || (commandId.length() == 0)) { commandId = configurationElement .getAttribute(ATTRIBUTE_COMMAND); } if ((commandId != null) && (commandId.length() == 0)) { commandId = null; } final Command command; if (commandId != null) { command = commandService.getCommand(commandId); if (!command.isDefined()) { // Reference to an undefined command. This is invalid. final String message = "Cannot bind to an undefined command: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } else { command = null; } // Read out the scheme id. String schemeId = configurationElement .getAttribute(ATTRIBUTE_SCHEME_ID); if ((schemeId == null) || (schemeId.length() == 0)) { schemeId = configurationElement .getAttribute(ATTRIBUTE_KEY_CONFIGURATION_ID); if ((schemeId == null) || (schemeId.length() == 0)) { schemeId = configurationElement .getAttribute(ATTRIBUTE_CONFIGURATION); if ((schemeId == null) || (schemeId.length() == 0)) { // The scheme id should never be null. This is invalid. final String message = "Key bindings need a scheme: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } } // Read out the context id. String contextId = configurationElement .getAttribute(ATTRIBUTE_CONTEXT_ID); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } else if ((contextId == null) || (contextId.length() == 0)) { contextId = configurationElement.getAttribute(ATTRIBUTE_SCOPE); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } } if ((contextId == null) || (contextId.length() == 0)) { contextId = IContextIds.CONTEXT_ID_WINDOW; } // Read out the key sequence. KeySequence keySequence = null; String keySequenceText = configurationElement .getAttribute(ATTRIBUTE_SEQUENCE); if ((keySequenceText == null) || (keySequenceText.length() == 0)) { keySequenceText = configurationElement .getAttribute(ATTRIBUTE_KEY_SEQUENCE); } if ((keySequenceText == null) || (keySequenceText.length() == 0)) { keySequenceText = configurationElement .getAttribute(ATTRIBUTE_STRING); if ((keySequenceText == null) || (keySequenceText.length() == 0)) { // The key sequence should never be null. This is // pointless final String message = "Defining a key binding with no key sequence has no effect: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } // The key sequence is in the old-style format. keySequence = convert2_1Sequence(parse2_1Sequence(keySequenceText)); } else { // The key sequence is in the new-style format. try { keySequence = KeySequence.getInstance(keySequenceText); } catch (final ParseException e) { final String message = "Could not parse '" + keySequenceText //$NON-NLS-1$ + "': '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } if (keySequence.isEmpty() || !keySequence.isComplete()) { final String message = "Key bindings should not have an empty or incomplete key sequence: '" //$NON-NLS-1$ + keySequence + "': '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } // Read out the locale and platform. String locale = configurationElement.getAttribute(ATTRIBUTE_LOCALE); if ((locale != null) && (locale.length() == 0)) { locale = null; } String platform = configurationElement .getAttribute(ATTRIBUTE_PLATFORM); if ((platform != null) && (platform.length() == 0)) { platform = null; } // Read out the parameters, if any. final ParameterizedCommand parameterizedCommand; if (command == null) { parameterizedCommand = null; } else { parameterizedCommand = readParameters(configurationElement, warningsToLog, command); } final Binding binding = new KeyBinding(keySequence, parameterizedCommand, schemeId, contextId, locale, platform, null, Binding.SYSTEM); bindings.add(binding); } final Binding[] bindingArray = (Binding[]) bindings .toArray(new Binding[bindings.size()]); bindingManager.setBindings(bindingArray); // If there were any warnings, then log them now. if (!warningsToLog.isEmpty()) { final String message = "Warnings while parsing the key bindings from the 'org.eclipse.ui.commands' extension point."; //$NON-NLS-1$ final IStatus status = new MultiStatus( WorkbenchPlugin.PI_WORKBENCH, 0, (IStatus[]) warningsToLog .toArray(new IStatus[warningsToLog.size()]), message, null); WorkbenchPlugin.log(message, status); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/2aa0965bbe6d7e1c9acd243af620354c7eb93e19/BindingPersistence.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java |
final String message = "Key bindings need a scheme: '" + configurationElement.getNamespace() + "', '" | final String message = "Key bindings need a scheme: plug-in='" + configurationElement.getNamespace() + "', commandId='" | private static final void readBindingsFromRegistry( final IConfigurationElement[] configurationElements, final int configurationElementCount, final BindingManager bindingManager, final ICommandService commandService) { final Collection bindings = new ArrayList(configurationElementCount); /* * If necessary, this list of status items will be constructed. It will * only contains instances of <code>IStatus</code>. */ List warningsToLog = new ArrayList(1); for (int i = 0; i < configurationElementCount; i++) { final IConfigurationElement configurationElement = configurationElements[i]; /* * Read out the command id. Doing this before determining if the key * binding is actually valid is a bit wasteful. However, it is * helpful to have the command identifier when logging syntax * errors. */ String commandId = configurationElement .getAttribute(ATTRIBUTE_COMMAND_ID); if ((commandId == null) || (commandId.length() == 0)) { commandId = configurationElement .getAttribute(ATTRIBUTE_COMMAND); } if ((commandId != null) && (commandId.length() == 0)) { commandId = null; } final Command command; if (commandId != null) { command = commandService.getCommand(commandId); if (!command.isDefined()) { // Reference to an undefined command. This is invalid. final String message = "Cannot bind to an undefined command: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } else { command = null; } // Read out the scheme id. String schemeId = configurationElement .getAttribute(ATTRIBUTE_SCHEME_ID); if ((schemeId == null) || (schemeId.length() == 0)) { schemeId = configurationElement .getAttribute(ATTRIBUTE_KEY_CONFIGURATION_ID); if ((schemeId == null) || (schemeId.length() == 0)) { schemeId = configurationElement .getAttribute(ATTRIBUTE_CONFIGURATION); if ((schemeId == null) || (schemeId.length() == 0)) { // The scheme id should never be null. This is invalid. final String message = "Key bindings need a scheme: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } } // Read out the context id. String contextId = configurationElement .getAttribute(ATTRIBUTE_CONTEXT_ID); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } else if ((contextId == null) || (contextId.length() == 0)) { contextId = configurationElement.getAttribute(ATTRIBUTE_SCOPE); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } } if ((contextId == null) || (contextId.length() == 0)) { contextId = IContextIds.CONTEXT_ID_WINDOW; } // Read out the key sequence. KeySequence keySequence = null; String keySequenceText = configurationElement .getAttribute(ATTRIBUTE_SEQUENCE); if ((keySequenceText == null) || (keySequenceText.length() == 0)) { keySequenceText = configurationElement .getAttribute(ATTRIBUTE_KEY_SEQUENCE); } if ((keySequenceText == null) || (keySequenceText.length() == 0)) { keySequenceText = configurationElement .getAttribute(ATTRIBUTE_STRING); if ((keySequenceText == null) || (keySequenceText.length() == 0)) { // The key sequence should never be null. This is // pointless final String message = "Defining a key binding with no key sequence has no effect: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } // The key sequence is in the old-style format. keySequence = convert2_1Sequence(parse2_1Sequence(keySequenceText)); } else { // The key sequence is in the new-style format. try { keySequence = KeySequence.getInstance(keySequenceText); } catch (final ParseException e) { final String message = "Could not parse '" + keySequenceText //$NON-NLS-1$ + "': '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } if (keySequence.isEmpty() || !keySequence.isComplete()) { final String message = "Key bindings should not have an empty or incomplete key sequence: '" //$NON-NLS-1$ + keySequence + "': '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } // Read out the locale and platform. String locale = configurationElement.getAttribute(ATTRIBUTE_LOCALE); if ((locale != null) && (locale.length() == 0)) { locale = null; } String platform = configurationElement .getAttribute(ATTRIBUTE_PLATFORM); if ((platform != null) && (platform.length() == 0)) { platform = null; } // Read out the parameters, if any. final ParameterizedCommand parameterizedCommand; if (command == null) { parameterizedCommand = null; } else { parameterizedCommand = readParameters(configurationElement, warningsToLog, command); } final Binding binding = new KeyBinding(keySequence, parameterizedCommand, schemeId, contextId, locale, platform, null, Binding.SYSTEM); bindings.add(binding); } final Binding[] bindingArray = (Binding[]) bindings .toArray(new Binding[bindings.size()]); bindingManager.setBindings(bindingArray); // If there were any warnings, then log them now. if (!warningsToLog.isEmpty()) { final String message = "Warnings while parsing the key bindings from the 'org.eclipse.ui.commands' extension point."; //$NON-NLS-1$ final IStatus status = new MultiStatus( WorkbenchPlugin.PI_WORKBENCH, 0, (IStatus[]) warningsToLog .toArray(new IStatus[warningsToLog.size()]), message, null); WorkbenchPlugin.log(message, status); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/2aa0965bbe6d7e1c9acd243af620354c7eb93e19/BindingPersistence.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java |
final String message = "Defining a key binding with no key sequence has no effect: '" + configurationElement.getNamespace() + "', '" | final String message = "Defining a key binding with no key sequence has no effect: plug-in='" + configurationElement.getNamespace() + "', commandId='" | private static final void readBindingsFromRegistry( final IConfigurationElement[] configurationElements, final int configurationElementCount, final BindingManager bindingManager, final ICommandService commandService) { final Collection bindings = new ArrayList(configurationElementCount); /* * If necessary, this list of status items will be constructed. It will * only contains instances of <code>IStatus</code>. */ List warningsToLog = new ArrayList(1); for (int i = 0; i < configurationElementCount; i++) { final IConfigurationElement configurationElement = configurationElements[i]; /* * Read out the command id. Doing this before determining if the key * binding is actually valid is a bit wasteful. However, it is * helpful to have the command identifier when logging syntax * errors. */ String commandId = configurationElement .getAttribute(ATTRIBUTE_COMMAND_ID); if ((commandId == null) || (commandId.length() == 0)) { commandId = configurationElement .getAttribute(ATTRIBUTE_COMMAND); } if ((commandId != null) && (commandId.length() == 0)) { commandId = null; } final Command command; if (commandId != null) { command = commandService.getCommand(commandId); if (!command.isDefined()) { // Reference to an undefined command. This is invalid. final String message = "Cannot bind to an undefined command: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } else { command = null; } // Read out the scheme id. String schemeId = configurationElement .getAttribute(ATTRIBUTE_SCHEME_ID); if ((schemeId == null) || (schemeId.length() == 0)) { schemeId = configurationElement .getAttribute(ATTRIBUTE_KEY_CONFIGURATION_ID); if ((schemeId == null) || (schemeId.length() == 0)) { schemeId = configurationElement .getAttribute(ATTRIBUTE_CONFIGURATION); if ((schemeId == null) || (schemeId.length() == 0)) { // The scheme id should never be null. This is invalid. final String message = "Key bindings need a scheme: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } } // Read out the context id. String contextId = configurationElement .getAttribute(ATTRIBUTE_CONTEXT_ID); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } else if ((contextId == null) || (contextId.length() == 0)) { contextId = configurationElement.getAttribute(ATTRIBUTE_SCOPE); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } } if ((contextId == null) || (contextId.length() == 0)) { contextId = IContextIds.CONTEXT_ID_WINDOW; } // Read out the key sequence. KeySequence keySequence = null; String keySequenceText = configurationElement .getAttribute(ATTRIBUTE_SEQUENCE); if ((keySequenceText == null) || (keySequenceText.length() == 0)) { keySequenceText = configurationElement .getAttribute(ATTRIBUTE_KEY_SEQUENCE); } if ((keySequenceText == null) || (keySequenceText.length() == 0)) { keySequenceText = configurationElement .getAttribute(ATTRIBUTE_STRING); if ((keySequenceText == null) || (keySequenceText.length() == 0)) { // The key sequence should never be null. This is // pointless final String message = "Defining a key binding with no key sequence has no effect: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } // The key sequence is in the old-style format. keySequence = convert2_1Sequence(parse2_1Sequence(keySequenceText)); } else { // The key sequence is in the new-style format. try { keySequence = KeySequence.getInstance(keySequenceText); } catch (final ParseException e) { final String message = "Could not parse '" + keySequenceText //$NON-NLS-1$ + "': '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } if (keySequence.isEmpty() || !keySequence.isComplete()) { final String message = "Key bindings should not have an empty or incomplete key sequence: '" //$NON-NLS-1$ + keySequence + "': '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } // Read out the locale and platform. String locale = configurationElement.getAttribute(ATTRIBUTE_LOCALE); if ((locale != null) && (locale.length() == 0)) { locale = null; } String platform = configurationElement .getAttribute(ATTRIBUTE_PLATFORM); if ((platform != null) && (platform.length() == 0)) { platform = null; } // Read out the parameters, if any. final ParameterizedCommand parameterizedCommand; if (command == null) { parameterizedCommand = null; } else { parameterizedCommand = readParameters(configurationElement, warningsToLog, command); } final Binding binding = new KeyBinding(keySequence, parameterizedCommand, schemeId, contextId, locale, platform, null, Binding.SYSTEM); bindings.add(binding); } final Binding[] bindingArray = (Binding[]) bindings .toArray(new Binding[bindings.size()]); bindingManager.setBindings(bindingArray); // If there were any warnings, then log them now. if (!warningsToLog.isEmpty()) { final String message = "Warnings while parsing the key bindings from the 'org.eclipse.ui.commands' extension point."; //$NON-NLS-1$ final IStatus status = new MultiStatus( WorkbenchPlugin.PI_WORKBENCH, 0, (IStatus[]) warningsToLog .toArray(new IStatus[warningsToLog.size()]), message, null); WorkbenchPlugin.log(message, status); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/2aa0965bbe6d7e1c9acd243af620354c7eb93e19/BindingPersistence.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java |
final String message = "Could not parse '" + keySequenceText + "': '" + configurationElement.getNamespace() + "', '" | final String message = "Could not parse key sequence '" + keySequenceText + "': plug-in='" + configurationElement.getNamespace() + "', commandId='" | private static final void readBindingsFromRegistry( final IConfigurationElement[] configurationElements, final int configurationElementCount, final BindingManager bindingManager, final ICommandService commandService) { final Collection bindings = new ArrayList(configurationElementCount); /* * If necessary, this list of status items will be constructed. It will * only contains instances of <code>IStatus</code>. */ List warningsToLog = new ArrayList(1); for (int i = 0; i < configurationElementCount; i++) { final IConfigurationElement configurationElement = configurationElements[i]; /* * Read out the command id. Doing this before determining if the key * binding is actually valid is a bit wasteful. However, it is * helpful to have the command identifier when logging syntax * errors. */ String commandId = configurationElement .getAttribute(ATTRIBUTE_COMMAND_ID); if ((commandId == null) || (commandId.length() == 0)) { commandId = configurationElement .getAttribute(ATTRIBUTE_COMMAND); } if ((commandId != null) && (commandId.length() == 0)) { commandId = null; } final Command command; if (commandId != null) { command = commandService.getCommand(commandId); if (!command.isDefined()) { // Reference to an undefined command. This is invalid. final String message = "Cannot bind to an undefined command: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } else { command = null; } // Read out the scheme id. String schemeId = configurationElement .getAttribute(ATTRIBUTE_SCHEME_ID); if ((schemeId == null) || (schemeId.length() == 0)) { schemeId = configurationElement .getAttribute(ATTRIBUTE_KEY_CONFIGURATION_ID); if ((schemeId == null) || (schemeId.length() == 0)) { schemeId = configurationElement .getAttribute(ATTRIBUTE_CONFIGURATION); if ((schemeId == null) || (schemeId.length() == 0)) { // The scheme id should never be null. This is invalid. final String message = "Key bindings need a scheme: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } } // Read out the context id. String contextId = configurationElement .getAttribute(ATTRIBUTE_CONTEXT_ID); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } else if ((contextId == null) || (contextId.length() == 0)) { contextId = configurationElement.getAttribute(ATTRIBUTE_SCOPE); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } } if ((contextId == null) || (contextId.length() == 0)) { contextId = IContextIds.CONTEXT_ID_WINDOW; } // Read out the key sequence. KeySequence keySequence = null; String keySequenceText = configurationElement .getAttribute(ATTRIBUTE_SEQUENCE); if ((keySequenceText == null) || (keySequenceText.length() == 0)) { keySequenceText = configurationElement .getAttribute(ATTRIBUTE_KEY_SEQUENCE); } if ((keySequenceText == null) || (keySequenceText.length() == 0)) { keySequenceText = configurationElement .getAttribute(ATTRIBUTE_STRING); if ((keySequenceText == null) || (keySequenceText.length() == 0)) { // The key sequence should never be null. This is // pointless final String message = "Defining a key binding with no key sequence has no effect: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } // The key sequence is in the old-style format. keySequence = convert2_1Sequence(parse2_1Sequence(keySequenceText)); } else { // The key sequence is in the new-style format. try { keySequence = KeySequence.getInstance(keySequenceText); } catch (final ParseException e) { final String message = "Could not parse '" + keySequenceText //$NON-NLS-1$ + "': '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } if (keySequence.isEmpty() || !keySequence.isComplete()) { final String message = "Key bindings should not have an empty or incomplete key sequence: '" //$NON-NLS-1$ + keySequence + "': '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } // Read out the locale and platform. String locale = configurationElement.getAttribute(ATTRIBUTE_LOCALE); if ((locale != null) && (locale.length() == 0)) { locale = null; } String platform = configurationElement .getAttribute(ATTRIBUTE_PLATFORM); if ((platform != null) && (platform.length() == 0)) { platform = null; } // Read out the parameters, if any. final ParameterizedCommand parameterizedCommand; if (command == null) { parameterizedCommand = null; } else { parameterizedCommand = readParameters(configurationElement, warningsToLog, command); } final Binding binding = new KeyBinding(keySequence, parameterizedCommand, schemeId, contextId, locale, platform, null, Binding.SYSTEM); bindings.add(binding); } final Binding[] bindingArray = (Binding[]) bindings .toArray(new Binding[bindings.size()]); bindingManager.setBindings(bindingArray); // If there were any warnings, then log them now. if (!warningsToLog.isEmpty()) { final String message = "Warnings while parsing the key bindings from the 'org.eclipse.ui.commands' extension point."; //$NON-NLS-1$ final IStatus status = new MultiStatus( WorkbenchPlugin.PI_WORKBENCH, 0, (IStatus[]) warningsToLog .toArray(new IStatus[warningsToLog.size()]), message, null); WorkbenchPlugin.log(message, status); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/2aa0965bbe6d7e1c9acd243af620354c7eb93e19/BindingPersistence.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java |
final String message = "Key bindings should not have an empty or incomplete key sequence: '" + keySequence + "': '" + configurationElement.getNamespace() + "', '" | final String message = "Key bindings should not have an empty or incomplete key sequence: sequence='" + keySequence + "': plug-in='" + configurationElement.getNamespace() + "', commandId='" | private static final void readBindingsFromRegistry( final IConfigurationElement[] configurationElements, final int configurationElementCount, final BindingManager bindingManager, final ICommandService commandService) { final Collection bindings = new ArrayList(configurationElementCount); /* * If necessary, this list of status items will be constructed. It will * only contains instances of <code>IStatus</code>. */ List warningsToLog = new ArrayList(1); for (int i = 0; i < configurationElementCount; i++) { final IConfigurationElement configurationElement = configurationElements[i]; /* * Read out the command id. Doing this before determining if the key * binding is actually valid is a bit wasteful. However, it is * helpful to have the command identifier when logging syntax * errors. */ String commandId = configurationElement .getAttribute(ATTRIBUTE_COMMAND_ID); if ((commandId == null) || (commandId.length() == 0)) { commandId = configurationElement .getAttribute(ATTRIBUTE_COMMAND); } if ((commandId != null) && (commandId.length() == 0)) { commandId = null; } final Command command; if (commandId != null) { command = commandService.getCommand(commandId); if (!command.isDefined()) { // Reference to an undefined command. This is invalid. final String message = "Cannot bind to an undefined command: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } else { command = null; } // Read out the scheme id. String schemeId = configurationElement .getAttribute(ATTRIBUTE_SCHEME_ID); if ((schemeId == null) || (schemeId.length() == 0)) { schemeId = configurationElement .getAttribute(ATTRIBUTE_KEY_CONFIGURATION_ID); if ((schemeId == null) || (schemeId.length() == 0)) { schemeId = configurationElement .getAttribute(ATTRIBUTE_CONFIGURATION); if ((schemeId == null) || (schemeId.length() == 0)) { // The scheme id should never be null. This is invalid. final String message = "Key bindings need a scheme: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } } // Read out the context id. String contextId = configurationElement .getAttribute(ATTRIBUTE_CONTEXT_ID); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } else if ((contextId == null) || (contextId.length() == 0)) { contextId = configurationElement.getAttribute(ATTRIBUTE_SCOPE); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } } if ((contextId == null) || (contextId.length() == 0)) { contextId = IContextIds.CONTEXT_ID_WINDOW; } // Read out the key sequence. KeySequence keySequence = null; String keySequenceText = configurationElement .getAttribute(ATTRIBUTE_SEQUENCE); if ((keySequenceText == null) || (keySequenceText.length() == 0)) { keySequenceText = configurationElement .getAttribute(ATTRIBUTE_KEY_SEQUENCE); } if ((keySequenceText == null) || (keySequenceText.length() == 0)) { keySequenceText = configurationElement .getAttribute(ATTRIBUTE_STRING); if ((keySequenceText == null) || (keySequenceText.length() == 0)) { // The key sequence should never be null. This is // pointless final String message = "Defining a key binding with no key sequence has no effect: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } // The key sequence is in the old-style format. keySequence = convert2_1Sequence(parse2_1Sequence(keySequenceText)); } else { // The key sequence is in the new-style format. try { keySequence = KeySequence.getInstance(keySequenceText); } catch (final ParseException e) { final String message = "Could not parse '" + keySequenceText //$NON-NLS-1$ + "': '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } if (keySequence.isEmpty() || !keySequence.isComplete()) { final String message = "Key bindings should not have an empty or incomplete key sequence: '" //$NON-NLS-1$ + keySequence + "': '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } // Read out the locale and platform. String locale = configurationElement.getAttribute(ATTRIBUTE_LOCALE); if ((locale != null) && (locale.length() == 0)) { locale = null; } String platform = configurationElement .getAttribute(ATTRIBUTE_PLATFORM); if ((platform != null) && (platform.length() == 0)) { platform = null; } // Read out the parameters, if any. final ParameterizedCommand parameterizedCommand; if (command == null) { parameterizedCommand = null; } else { parameterizedCommand = readParameters(configurationElement, warningsToLog, command); } final Binding binding = new KeyBinding(keySequence, parameterizedCommand, schemeId, contextId, locale, platform, null, Binding.SYSTEM); bindings.add(binding); } final Binding[] bindingArray = (Binding[]) bindings .toArray(new Binding[bindings.size()]); bindingManager.setBindings(bindingArray); // If there were any warnings, then log them now. if (!warningsToLog.isEmpty()) { final String message = "Warnings while parsing the key bindings from the 'org.eclipse.ui.commands' extension point."; //$NON-NLS-1$ final IStatus status = new MultiStatus( WorkbenchPlugin.PI_WORKBENCH, 0, (IStatus[]) warningsToLog .toArray(new IStatus[warningsToLog.size()]), message, null); WorkbenchPlugin.log(message, status); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/2aa0965bbe6d7e1c9acd243af620354c7eb93e19/BindingPersistence.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java |
private static final void readBindingsFromRegistry( final IConfigurationElement[] configurationElements, final int configurationElementCount, final BindingManager bindingManager, final ICommandService commandService) { final Collection bindings = new ArrayList(configurationElementCount); /* * If necessary, this list of status items will be constructed. It will * only contains instances of <code>IStatus</code>. */ List warningsToLog = new ArrayList(1); for (int i = 0; i < configurationElementCount; i++) { final IConfigurationElement configurationElement = configurationElements[i]; /* * Read out the command id. Doing this before determining if the key * binding is actually valid is a bit wasteful. However, it is * helpful to have the command identifier when logging syntax * errors. */ String commandId = configurationElement .getAttribute(ATTRIBUTE_COMMAND_ID); if ((commandId == null) || (commandId.length() == 0)) { commandId = configurationElement .getAttribute(ATTRIBUTE_COMMAND); } if ((commandId != null) && (commandId.length() == 0)) { commandId = null; } final Command command; if (commandId != null) { command = commandService.getCommand(commandId); if (!command.isDefined()) { // Reference to an undefined command. This is invalid. final String message = "Cannot bind to an undefined command: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } else { command = null; } // Read out the scheme id. String schemeId = configurationElement .getAttribute(ATTRIBUTE_SCHEME_ID); if ((schemeId == null) || (schemeId.length() == 0)) { schemeId = configurationElement .getAttribute(ATTRIBUTE_KEY_CONFIGURATION_ID); if ((schemeId == null) || (schemeId.length() == 0)) { schemeId = configurationElement .getAttribute(ATTRIBUTE_CONFIGURATION); if ((schemeId == null) || (schemeId.length() == 0)) { // The scheme id should never be null. This is invalid. final String message = "Key bindings need a scheme: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } } // Read out the context id. String contextId = configurationElement .getAttribute(ATTRIBUTE_CONTEXT_ID); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } else if ((contextId == null) || (contextId.length() == 0)) { contextId = configurationElement.getAttribute(ATTRIBUTE_SCOPE); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } } if ((contextId == null) || (contextId.length() == 0)) { contextId = IContextIds.CONTEXT_ID_WINDOW; } // Read out the key sequence. KeySequence keySequence = null; String keySequenceText = configurationElement .getAttribute(ATTRIBUTE_SEQUENCE); if ((keySequenceText == null) || (keySequenceText.length() == 0)) { keySequenceText = configurationElement .getAttribute(ATTRIBUTE_KEY_SEQUENCE); } if ((keySequenceText == null) || (keySequenceText.length() == 0)) { keySequenceText = configurationElement .getAttribute(ATTRIBUTE_STRING); if ((keySequenceText == null) || (keySequenceText.length() == 0)) { // The key sequence should never be null. This is // pointless final String message = "Defining a key binding with no key sequence has no effect: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } // The key sequence is in the old-style format. keySequence = convert2_1Sequence(parse2_1Sequence(keySequenceText)); } else { // The key sequence is in the new-style format. try { keySequence = KeySequence.getInstance(keySequenceText); } catch (final ParseException e) { final String message = "Could not parse '" + keySequenceText //$NON-NLS-1$ + "': '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } if (keySequence.isEmpty() || !keySequence.isComplete()) { final String message = "Key bindings should not have an empty or incomplete key sequence: '" //$NON-NLS-1$ + keySequence + "': '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } // Read out the locale and platform. String locale = configurationElement.getAttribute(ATTRIBUTE_LOCALE); if ((locale != null) && (locale.length() == 0)) { locale = null; } String platform = configurationElement .getAttribute(ATTRIBUTE_PLATFORM); if ((platform != null) && (platform.length() == 0)) { platform = null; } // Read out the parameters, if any. final ParameterizedCommand parameterizedCommand; if (command == null) { parameterizedCommand = null; } else { parameterizedCommand = readParameters(configurationElement, warningsToLog, command); } final Binding binding = new KeyBinding(keySequence, parameterizedCommand, schemeId, contextId, locale, platform, null, Binding.SYSTEM); bindings.add(binding); } final Binding[] bindingArray = (Binding[]) bindings .toArray(new Binding[bindings.size()]); bindingManager.setBindings(bindingArray); // If there were any warnings, then log them now. if (!warningsToLog.isEmpty()) { final String message = "Warnings while parsing the key bindings from the 'org.eclipse.ui.commands' extension point."; //$NON-NLS-1$ final IStatus status = new MultiStatus( WorkbenchPlugin.PI_WORKBENCH, 0, (IStatus[]) warningsToLog .toArray(new IStatus[warningsToLog.size()]), message, null); WorkbenchPlugin.log(message, status); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/2aa0965bbe6d7e1c9acd243af620354c7eb93e19/BindingPersistence.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java |
||
final String message = "Warnings while parsing the key bindings from the 'org.eclipse.ui.commands' extension point."; | final String message = "Warnings while parsing the key bindings from the 'org.eclipse.ui.commands' extension point"; | private static final void readBindingsFromRegistry( final IConfigurationElement[] configurationElements, final int configurationElementCount, final BindingManager bindingManager, final ICommandService commandService) { final Collection bindings = new ArrayList(configurationElementCount); /* * If necessary, this list of status items will be constructed. It will * only contains instances of <code>IStatus</code>. */ List warningsToLog = new ArrayList(1); for (int i = 0; i < configurationElementCount; i++) { final IConfigurationElement configurationElement = configurationElements[i]; /* * Read out the command id. Doing this before determining if the key * binding is actually valid is a bit wasteful. However, it is * helpful to have the command identifier when logging syntax * errors. */ String commandId = configurationElement .getAttribute(ATTRIBUTE_COMMAND_ID); if ((commandId == null) || (commandId.length() == 0)) { commandId = configurationElement .getAttribute(ATTRIBUTE_COMMAND); } if ((commandId != null) && (commandId.length() == 0)) { commandId = null; } final Command command; if (commandId != null) { command = commandService.getCommand(commandId); if (!command.isDefined()) { // Reference to an undefined command. This is invalid. final String message = "Cannot bind to an undefined command: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } else { command = null; } // Read out the scheme id. String schemeId = configurationElement .getAttribute(ATTRIBUTE_SCHEME_ID); if ((schemeId == null) || (schemeId.length() == 0)) { schemeId = configurationElement .getAttribute(ATTRIBUTE_KEY_CONFIGURATION_ID); if ((schemeId == null) || (schemeId.length() == 0)) { schemeId = configurationElement .getAttribute(ATTRIBUTE_CONFIGURATION); if ((schemeId == null) || (schemeId.length() == 0)) { // The scheme id should never be null. This is invalid. final String message = "Key bindings need a scheme: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } } // Read out the context id. String contextId = configurationElement .getAttribute(ATTRIBUTE_CONTEXT_ID); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } else if ((contextId == null) || (contextId.length() == 0)) { contextId = configurationElement.getAttribute(ATTRIBUTE_SCOPE); if (LEGACY_DEFAULT_SCOPE.equals(contextId)) { contextId = null; } } if ((contextId == null) || (contextId.length() == 0)) { contextId = IContextIds.CONTEXT_ID_WINDOW; } // Read out the key sequence. KeySequence keySequence = null; String keySequenceText = configurationElement .getAttribute(ATTRIBUTE_SEQUENCE); if ((keySequenceText == null) || (keySequenceText.length() == 0)) { keySequenceText = configurationElement .getAttribute(ATTRIBUTE_KEY_SEQUENCE); } if ((keySequenceText == null) || (keySequenceText.length() == 0)) { keySequenceText = configurationElement .getAttribute(ATTRIBUTE_STRING); if ((keySequenceText == null) || (keySequenceText.length() == 0)) { // The key sequence should never be null. This is // pointless final String message = "Defining a key binding with no key sequence has no effect: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } // The key sequence is in the old-style format. keySequence = convert2_1Sequence(parse2_1Sequence(keySequenceText)); } else { // The key sequence is in the new-style format. try { keySequence = KeySequence.getInstance(keySequenceText); } catch (final ParseException e) { final String message = "Could not parse '" + keySequenceText //$NON-NLS-1$ + "': '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } if (keySequence.isEmpty() || !keySequence.isComplete()) { final String message = "Key bindings should not have an empty or incomplete key sequence: '" //$NON-NLS-1$ + keySequence + "': '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + commandId + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } } // Read out the locale and platform. String locale = configurationElement.getAttribute(ATTRIBUTE_LOCALE); if ((locale != null) && (locale.length() == 0)) { locale = null; } String platform = configurationElement .getAttribute(ATTRIBUTE_PLATFORM); if ((platform != null) && (platform.length() == 0)) { platform = null; } // Read out the parameters, if any. final ParameterizedCommand parameterizedCommand; if (command == null) { parameterizedCommand = null; } else { parameterizedCommand = readParameters(configurationElement, warningsToLog, command); } final Binding binding = new KeyBinding(keySequence, parameterizedCommand, schemeId, contextId, locale, platform, null, Binding.SYSTEM); bindings.add(binding); } final Binding[] bindingArray = (Binding[]) bindings .toArray(new Binding[bindings.size()]); bindingManager.setBindings(bindingArray); // If there were any warnings, then log them now. if (!warningsToLog.isEmpty()) { final String message = "Warnings while parsing the key bindings from the 'org.eclipse.ui.commands' extension point."; //$NON-NLS-1$ final IStatus status = new MultiStatus( WorkbenchPlugin.PI_WORKBENCH, 0, (IStatus[]) warningsToLog .toArray(new IStatus[warningsToLog.size()]), message, null); WorkbenchPlugin.log(message, status); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/2aa0965bbe6d7e1c9acd243af620354c7eb93e19/BindingPersistence.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java |
final String message = "Parameters need a name: '" | final String message = "Parameters need a name: plug-in='" | private static final ParameterizedCommand readParameters( final IConfigurationElement configurationElement, final List warningsToLog, final Command command) { final IConfigurationElement[] parameterElements = configurationElement .getChildren(ELEMENT_PARAMETER); if ((parameterElements == null) || (parameterElements.length == 0)) { return new ParameterizedCommand(command, null); } final Collection parameters = new ArrayList(); for (int i = 0; i < parameterElements.length; i++) { final IConfigurationElement parameterElement = parameterElements[i]; // Read out the id. final String id = parameterElement.getAttribute(ATTRIBUTE_ID); if ((id == null) || (id.length() == 0)) { // The name should never be null. This is invalid. final String message = "Parameters need a name: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } // Find the parameter on the command. IParameter parameter = null; try { final IParameter[] commandParameters = command.getParameters(); if (parameters != null) { for (int j = 0; j < commandParameters.length; j++) { final IParameter currentParameter = commandParameters[j]; if (Util.equals(currentParameter.getId(), id)) { parameter = currentParameter; break; } } } } catch (final NotDefinedException e) { // This should not happen. } if (parameter == null) { // The name should never be null. This is invalid. final String message = "Could not find a matching parameter: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" + id //$NON-NLS-1$ + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } // Read out the value. final String value = parameterElement.getAttribute(ATTRIBUTE_VALUE); if ((value == null) || (value.length() == 0)) { // The name should never be null. This is invalid. final String message = "Parameters need a value: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + id + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } parameters.add(new Parameterization(parameter, value)); } if (parameters.isEmpty()) { return new ParameterizedCommand(command, null); } return new ParameterizedCommand(command, (Parameterization[]) parameters .toArray(new Parameterization[parameters.size()])); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/2aa0965bbe6d7e1c9acd243af620354c7eb93e19/BindingPersistence.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java |
final String message = "Could not find a matching parameter: '" + configurationElement.getNamespace() + "', '" + id | final String message = "Could not find a matching parameter: plug-in='" + configurationElement.getNamespace() + "', parameterId='" + id | private static final ParameterizedCommand readParameters( final IConfigurationElement configurationElement, final List warningsToLog, final Command command) { final IConfigurationElement[] parameterElements = configurationElement .getChildren(ELEMENT_PARAMETER); if ((parameterElements == null) || (parameterElements.length == 0)) { return new ParameterizedCommand(command, null); } final Collection parameters = new ArrayList(); for (int i = 0; i < parameterElements.length; i++) { final IConfigurationElement parameterElement = parameterElements[i]; // Read out the id. final String id = parameterElement.getAttribute(ATTRIBUTE_ID); if ((id == null) || (id.length() == 0)) { // The name should never be null. This is invalid. final String message = "Parameters need a name: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } // Find the parameter on the command. IParameter parameter = null; try { final IParameter[] commandParameters = command.getParameters(); if (parameters != null) { for (int j = 0; j < commandParameters.length; j++) { final IParameter currentParameter = commandParameters[j]; if (Util.equals(currentParameter.getId(), id)) { parameter = currentParameter; break; } } } } catch (final NotDefinedException e) { // This should not happen. } if (parameter == null) { // The name should never be null. This is invalid. final String message = "Could not find a matching parameter: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" + id //$NON-NLS-1$ + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } // Read out the value. final String value = parameterElement.getAttribute(ATTRIBUTE_VALUE); if ((value == null) || (value.length() == 0)) { // The name should never be null. This is invalid. final String message = "Parameters need a value: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + id + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } parameters.add(new Parameterization(parameter, value)); } if (parameters.isEmpty()) { return new ParameterizedCommand(command, null); } return new ParameterizedCommand(command, (Parameterization[]) parameters .toArray(new Parameterization[parameters.size()])); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/2aa0965bbe6d7e1c9acd243af620354c7eb93e19/BindingPersistence.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java |
final String message = "Parameters need a value: '" + configurationElement.getNamespace() + "', '" | final String message = "Parameters need a value: plug-in='" + configurationElement.getNamespace() + "', parameterId='" | private static final ParameterizedCommand readParameters( final IConfigurationElement configurationElement, final List warningsToLog, final Command command) { final IConfigurationElement[] parameterElements = configurationElement .getChildren(ELEMENT_PARAMETER); if ((parameterElements == null) || (parameterElements.length == 0)) { return new ParameterizedCommand(command, null); } final Collection parameters = new ArrayList(); for (int i = 0; i < parameterElements.length; i++) { final IConfigurationElement parameterElement = parameterElements[i]; // Read out the id. final String id = parameterElement.getAttribute(ATTRIBUTE_ID); if ((id == null) || (id.length() == 0)) { // The name should never be null. This is invalid. final String message = "Parameters need a name: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } // Find the parameter on the command. IParameter parameter = null; try { final IParameter[] commandParameters = command.getParameters(); if (parameters != null) { for (int j = 0; j < commandParameters.length; j++) { final IParameter currentParameter = commandParameters[j]; if (Util.equals(currentParameter.getId(), id)) { parameter = currentParameter; break; } } } } catch (final NotDefinedException e) { // This should not happen. } if (parameter == null) { // The name should never be null. This is invalid. final String message = "Could not find a matching parameter: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" + id //$NON-NLS-1$ + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } // Read out the value. final String value = parameterElement.getAttribute(ATTRIBUTE_VALUE); if ((value == null) || (value.length() == 0)) { // The name should never be null. This is invalid. final String message = "Parameters need a value: '" //$NON-NLS-1$ + configurationElement.getNamespace() + "', '" //$NON-NLS-1$ + id + "'."; //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, message, null); warningsToLog.add(status); continue; } parameters.add(new Parameterization(parameter, value)); } if (parameters.isEmpty()) { return new ParameterizedCommand(command, null); } return new ParameterizedCommand(command, (Parameterization[]) parameters .toArray(new Parameterization[parameters.size()])); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/2aa0965bbe6d7e1c9acd243af620354c7eb93e19/BindingPersistence.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java |
control.setFont(tabFont); | public static void setTabAttributes(BasicStackPresentation presentation, final CTabFolder control) { if (presentation == null) // the reference to the presentation was lost by the listener return; ITheme theme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme(); if (control.getData(LISTENER_KEY) == null) { final WeakReference ref = new WeakReference(presentation); final IPropertyChangeListener listener = new IPropertyChangeListener() { /* (non-Javadoc) * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent) */ public void propertyChange(PropertyChangeEvent event) { String property = event.getProperty(); if (property.equals(IThemeManager.CHANGE_CURRENT_THEME) || property.equals(IWorkbenchThemeConstants.INACTIVE_TAB_BG_START) || property.equals(IWorkbenchThemeConstants.INACTIVE_TAB_BG_END) || property.equals(IWorkbenchThemeConstants.INACTIVE_TAB_TEXT_COLOR) || property.equals(IWorkbenchThemeConstants.ACTIVE_TAB_TEXT_COLOR) || property.equals(IWorkbenchThemeConstants.ACTIVE_TAB_BG_START) || property.equals(IWorkbenchThemeConstants.ACTIVE_TAB_BG_END) || property.equals(IWorkbenchThemeConstants.TAB_TEXT_FONT)) { setTabAttributes((BasicStackPresentation) ref.get(), control); } } }; control.setData(LISTENER_KEY, listener); control.addDisposeListener(new DisposeListener() { /* (non-Javadoc) * @see org.eclipse.swt.events.DisposeListener#widgetDisposed(org.eclipse.swt.events.DisposeEvent) */ public void widgetDisposed(DisposeEvent e) { PlatformUI .getWorkbench() .getThemeManager() .removePropertyChangeListener(listener); control.setData(LISTENER_KEY, null); }}); PlatformUI .getWorkbench() .getThemeManager() .addPropertyChangeListener(listener); } int [] percent = new int[1]; boolean vertical; ColorRegistry colorRegistry = theme.getColorRegistry(); control.setForeground(colorRegistry.get(IWorkbenchThemeConstants.INACTIVE_TAB_TEXT_COLOR)); Color [] c = new Color[2]; c[0] = colorRegistry.get(IWorkbenchThemeConstants.INACTIVE_TAB_BG_START); c[1] = colorRegistry.get(IWorkbenchThemeConstants.INACTIVE_TAB_BG_END); // Note: This is currently being overridden in PartTabFolderPresentation percent[0] = theme.getInt(IWorkbenchThemeConstants.INACTIVE_TAB_PERCENT); // Note: This is currently being overridden in PartTabFolderPresentation vertical = theme.getBoolean(IWorkbenchThemeConstants.INACTIVE_TAB_VERTICAL); presentation.setBackgroundColors(c[0], c[1], c[1]); if (presentation.isActive()) { control.setSelectionForeground(colorRegistry.get(IWorkbenchThemeConstants.ACTIVE_TAB_TEXT_COLOR)); c[0] = colorRegistry.get(IWorkbenchThemeConstants.ACTIVE_TAB_BG_START); c[1] = colorRegistry.get(IWorkbenchThemeConstants.ACTIVE_TAB_BG_END); percent[0] = theme.getInt(IWorkbenchThemeConstants.ACTIVE_TAB_PERCENT); vertical = theme.getBoolean(IWorkbenchThemeConstants.ACTIVE_TAB_VERTICAL); } control.setSelectionBackground(c, percent, vertical); CTabItem [] items = control.getItems(); Font tabFont = theme.getFontRegistry().get(IWorkbenchThemeConstants.TAB_TEXT_FONT); for (int i = 0; i < items.length; i++) { items[i].setFont(tabFont); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/92c7fed3e14cfd9615025d1a45cc728ae4af3c1a/ColorSchemeService.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ColorSchemeService.java |
|
public static IRubyObject chmod(IRubyObject recv, RubyInteger mode, IRubyObject[] names) { // no-op for now return RubyFixnum.newFixnum(recv.getRuntime(), 0); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/4c689a812e20d4fcf2da0cdc9b527b00cc1960ef/RubyFile.java/buggy/src/org/jruby/RubyFile.java |
||
closeStreams(); | if (handler != null) { close(); } | public IRubyObject initialize(IRubyObject[] args) { if (args.length == 0) { throw new ArgumentError(getRuntime(), 0, 1); } args[0].checkSafeString(); path = args[0].toString(); String mode = "r"; if (args.length > 1 && args[1] instanceof RubyString) { mode = ((RubyString)args[1]).getValue(); } closeStreams(); openInternal(path, mode); if (getRuntime().isBlockGiven()) { // getRuby().getRuntime().warn("File::new does not take block; use File::open instead"); } return this; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/4c689a812e20d4fcf2da0cdc9b527b00cc1960ef/RubyFile.java/buggy/src/org/jruby/RubyFile.java |
updateEnabledState(event.getChecked()); markDirty(); }; | markDirty(); } | protected void createTypesArea(Composite parent) { Font font = parent.getFont(); Composite composite = new Composite(parent, SWT.NONE); composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); GridLayout layout = new GridLayout(); composite.setLayout(layout); Label label = new Label(composite, SWT.NONE); label.setText(MarkerMessages.filtersDialog_showItemsOfType); label.setFont(font); Table table = new Table(composite, SWT.CHECK | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER); table.setLinesVisible(true); table.setHeaderVisible(true); TableLayout tableLayout = new TableLayout(); table.setLayout(tableLayout); tableLayout.addColumnData(new ColumnWeightData(40, true)); TableColumn tc = new TableColumn(table, SWT.NONE, 0); tc.setText(MarkerMessages.filtersDialog_type_columnHeader); tableLayout.addColumnData(new ColumnWeightData(60, true)); tc = new TableColumn(table, SWT.NONE, 1); tc.setText(MarkerMessages.filtersDialog_superTypecolumnHeader); typesViewer = new CheckboxTableViewer(table); GridData gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.heightHint = 105; gridData.widthHint = 350; typesViewer.getTable().setFont(font); typesViewer.getControl().setLayoutData(gridData); typesViewer.setContentProvider(getContentProvider()); typesViewer.setLabelProvider(getLabelProvider()); typesViewer.setSorter(getSorter()); typesViewer.addCheckStateListener(new ICheckStateListener(){ public void checkStateChanged(CheckStateChangedEvent event) { updateEnabledState(event.getChecked()); markDirty(); }; }); typesViewer.setInput(getSelectedFilter().getRootTypes().toArray()); Composite buttonComposite = new Composite(composite, SWT.NONE); GridLayout buttonLayout = new GridLayout(); buttonLayout.marginWidth = 0; buttonComposite.setLayout(buttonLayout); selectAllButton = createButton( buttonComposite, SELECT_ALL_ID, MarkerMessages.filtersDialog_selectAll, false); deselectAllButton = createButton( buttonComposite, DESELECT_ALL_ID, MarkerMessages.filtersDialog_deselectAll, false); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6ec04993784c8138b4186f6b643bfffdcb86eb3d/DialogMarkerFilter.java/buggy/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/DialogMarkerFilter.java |
updateEnabledState(event.getChecked()); markDirty(); }; | markDirty(); } | public void checkStateChanged(CheckStateChangedEvent event) { updateEnabledState(event.getChecked()); markDirty(); }; | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6ec04993784c8138b4186f6b643bfffdcb86eb3d/DialogMarkerFilter.java/buggy/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/DialogMarkerFilter.java |
Box box = panel.findBox(evt.getX(), evt.getY()); | Box box = panel.findElementBox(evt.getX(), evt.getY()); | private Box findBox(MouseEvent evt) { Box box = panel.findBox(evt.getX(), evt.getY()); 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/66fbe8d8d4ec4d3bb0fc39cbd89ca783bccb51dd/HoverListener.java/clean/src/java/org/xhtmlrenderer/swing/HoverListener.java |
boolean restyled = panel.getContext().css.wasHoverRestyled(ib.getRealElement()); CalculatedStyle style = panel.getContext().css.getStyle(ib.getRealElement()); if (restyled) { Layout lt = panel.getContext().getLayout(ib.getRealElement()); if (lt instanceof InlineLayout) { ((InlineLayout) lt).restyle(panel.getContext(), ib); panel.repaint(); | /* if the box is an inline box and if it is a text only box, meaning it does not have it's own element but is merely a child of an enclosing box. is inline element */ if(ib.isInlineElement() || !(ib instanceof InlineBox)) { boolean restyled = panel.getContext().css.wasHoverRestyled(ib.getRealElement()); CalculatedStyle style = panel.getContext().css.getStyle(ib.getRealElement()); if (restyled) { Layout lt = panel.getContext().getLayout(ib.getRealElement()); if (lt instanceof InlineLayout) { ((InlineLayout) lt).restyle(panel.getContext(), ib); panel.repaint(); } | private void restyle(Box ib) { if (prev == ib) { return; } if (ib == null) panel.hovered_element = null; else panel.hovered_element = ib.getRealElement(); // if moved out of the old block then unstyle it if (prev != null) { boolean restyled = panel.getContext().css.wasHoverRestyled(prev.getRealElement()); //u.p("previous was styled = " + restyled); //u.p("prev = " + prev); CalculatedStyle style = panel.getContext().css.getStyle(prev.getRealElement()); //u.p("prev calc style = " + style); //u.p("prev color = " + style.getColor()); if (restyled) { Layout lt = panel.getContext().getLayout(prev.getRealElement()); if (lt instanceof InlineLayout) { ((InlineLayout) lt).restyle(panel.getContext(), prev); panel.repaint(); } } } prev = ib; // return if no new hovered block; if (ib == null) { return; } boolean restyled = panel.getContext().css.wasHoverRestyled(ib.getRealElement()); //u.p("was styled = " + restyled); CalculatedStyle style = panel.getContext().css.getStyle(ib.getRealElement()); //u.p("color = " + style.getColor()); // if the block has a hover style then restyle it if (restyled) { Layout lt = panel.getContext().getLayout(ib.getRealElement()); if (lt instanceof InlineLayout) { ((InlineLayout) lt).restyle(panel.getContext(), ib); panel.repaint(); } } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/66fbe8d8d4ec4d3bb0fc39cbd89ca783bccb51dd/HoverListener.java/clean/src/java/org/xhtmlrenderer/swing/HoverListener.java |
if (array == null) return new char[] { suffix }; int length = array.length; System.arraycopy(array, 0, array = new char[length + 1], 0, length); array[length] = suffix; return array; } | if (array == null) return new char[] { suffix }; int length = array.length; System.arraycopy(array, 0, array = new char[length + 1], 0, length); array[length] = suffix; return array; } | public static final char[] append(char[] array, char suffix) { if (array == null) return new char[] { suffix }; int length = array.length; System.arraycopy(array, 0, array = new char[length + 1], 0, length); array[length] = suffix; return array;} | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/e33c1f7b0c1f9dbe66a73370c1b98e653087c2df/CharOperation.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/CharOperation.java |
if (first == null) return second; if (second == null) return first; | if (first == null) return second; if (second == null) return first; | public static final char[][] arrayConcat(char[][] first, char[][] second) { if (first == null) return second; if (second == null) return first; int length1 = first.length; int length2 = second.length; char[][] result = new char[length1 + length2][]; System.arraycopy(first, 0, result, 0, length1); System.arraycopy(second, 0, result, length1, length2); return result;} | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/e33c1f7b0c1f9dbe66a73370c1b98e653087c2df/CharOperation.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/CharOperation.java |
int length1 = first.length; int length2 = second.length; char[][] result = new char[length1 + length2][]; System.arraycopy(first, 0, result, 0, length1); System.arraycopy(second, 0, result, length1, length2); return result; } | int length1 = first.length; int length2 = second.length; char[][] result = new char[length1 + length2][]; System.arraycopy(first, 0, result, 0, length1); System.arraycopy(second, 0, result, length1, length2); return result; } | public static final char[][] arrayConcat(char[][] first, char[][] second) { if (first == null) return second; if (second == null) return first; int length1 = first.length; int length2 = second.length; char[][] result = new char[length1 + length2][]; System.arraycopy(first, 0, result, 0, length1); System.arraycopy(second, 0, result, length1, length2); return result;} | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/e33c1f7b0c1f9dbe66a73370c1b98e653087c2df/CharOperation.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/CharOperation.java |
if (charArrays == null) return null; int length = charArrays.length; if (length == 0) return NO_STRINGS; String[] strings= new String[length]; for (int i= 0; i < length; i++) strings[i]= new String(charArrays[i]); return strings; } | if (charArrays == null) return null; int length = charArrays.length; if (length == 0) return NO_STRINGS; String[] strings = new String[length]; for (int i = 0; i < length; i++) strings[i] = new String(charArrays[i]); return strings; } | public static String[] charArrayToStringArray(char[][] charArrays) { if (charArrays == null) return null; int length = charArrays.length; if (length == 0) return NO_STRINGS; String[] strings= new String[length]; for (int i= 0; i < length; i++) strings[i]= new String(charArrays[i]); return strings;} | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/e33c1f7b0c1f9dbe66a73370c1b98e653087c2df/CharOperation.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/CharOperation.java |
if (charArray == null) return null; return new String(charArray); } | if (charArray == null) return null; return new String(charArray); } | public static String charToString(char[] charArray) { if (charArray == null) return null; return new String(charArray);} | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/e33c1f7b0c1f9dbe66a73370c1b98e653087c2df/CharOperation.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/CharOperation.java |
int arrayLength = array.length; int prefixLength = prefix.length; int min = Math.min(arrayLength, prefixLength); int i = 0; while (min-- != 0) { char c1 = array[i]; char c2 = prefix[i++]; if (c1 != c2) return c1 - c2; | int arrayLength = array.length; int prefixLength = prefix.length; int min = Math.min(arrayLength, prefixLength); int i = 0; while (min-- != 0) { char c1 = array[i]; char c2 = prefix[i++]; if (c1 != c2) return c1 - c2; } if (prefixLength == i) return 0; return -1; | public static final int compareWith(char[] array, char[] prefix) { int arrayLength = array.length; int prefixLength = prefix.length; int min = Math.min(arrayLength, prefixLength); int i = 0; while (min-- != 0) { char c1 = array[i]; char c2 = prefix[i++]; if (c1 != c2) return c1 - c2; } if (prefixLength == i) return 0; return -1; // array is shorter than prefix (e.g. array:'ab' < prefix:'abc').} | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/e33c1f7b0c1f9dbe66a73370c1b98e653087c2df/CharOperation.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/CharOperation.java |
if (prefixLength == i) return 0; return -1; } | public static final int compareWith(char[] array, char[] prefix) { int arrayLength = array.length; int prefixLength = prefix.length; int min = Math.min(arrayLength, prefixLength); int i = 0; while (min-- != 0) { char c1 = array[i]; char c2 = prefix[i++]; if (c1 != c2) return c1 - c2; } if (prefixLength == i) return 0; return -1; // array is shorter than prefix (e.g. array:'ab' < prefix:'abc').} | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/e33c1f7b0c1f9dbe66a73370c1b98e653087c2df/CharOperation.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/CharOperation.java |
|
if (first == null) return second; if (second == null) return first; | if (first == null) return second; if (second == null) return first; | public static final char[] concat(char[] first, char[] second) { if (first == null) return second; if (second == null) return first; int length1 = first.length; int length2 = second.length; char[] result = new char[length1 + length2]; System.arraycopy(first, 0, result, 0, length1); System.arraycopy(second, 0, result, length1, length2); return result;} | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/e33c1f7b0c1f9dbe66a73370c1b98e653087c2df/CharOperation.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/CharOperation.java |
int length1 = first.length; int length2 = second.length; char[] result = new char[length1 + length2]; System.arraycopy(first, 0, result, 0, length1); System.arraycopy(second, 0, result, length1, length2); return result; } | int length1 = first.length; int length2 = second.length; char[] result = new char[length1 + length2]; System.arraycopy(first, 0, result, 0, length1); System.arraycopy(second, 0, result, length1, length2); return result; } | public static final char[] concat(char[] first, char[] second) { if (first == null) return second; if (second == null) return first; int length1 = first.length; int length2 = second.length; char[] result = new char[length1 + length2]; System.arraycopy(first, 0, result, 0, length1); System.arraycopy(second, 0, result, length1, length2); return result;} | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/e33c1f7b0c1f9dbe66a73370c1b98e653087c2df/CharOperation.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/CharOperation.java |
public static final char[] concatWith( char[] name, char[][] array, char separator) { int nameLength = name == null ? 0 : name.length; if (nameLength == 0) return concatWith(array, separator); | public static final char[] concatWith(char[] name, char[][] array, char separator) { int nameLength = name == null ? 0 : name.length; if (nameLength == 0) return concatWith(array, separator); | public static final char[] concatWith( char[] name, char[][] array, char separator) { int nameLength = name == null ? 0 : name.length; if (nameLength == 0) return concatWith(array, separator); int length = array == null ? 0 : array.length; if (length == 0) return name; int size = nameLength; int index = length; while (--index >= 0) if (array[index].length > 0) size += array[index].length + 1; char[] result = new char[size]; index = size; for (int i = length - 1; i >= 0; i--) { int subLength = array[i].length; if (subLength > 0) { index -= subLength; System.arraycopy(array[i], 0, result, index, subLength); result[--index] = separator; } } System.arraycopy(name, 0, result, 0, nameLength); return result;} | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/e33c1f7b0c1f9dbe66a73370c1b98e653087c2df/CharOperation.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/CharOperation.java |
int length = array == null ? 0 : array.length; if (length == 0) return name; | int length = array == null ? 0 : array.length; if (length == 0) return name; | public static final char[] concatWith( char[] name, char[][] array, char separator) { int nameLength = name == null ? 0 : name.length; if (nameLength == 0) return concatWith(array, separator); int length = array == null ? 0 : array.length; if (length == 0) return name; int size = nameLength; int index = length; while (--index >= 0) if (array[index].length > 0) size += array[index].length + 1; char[] result = new char[size]; index = size; for (int i = length - 1; i >= 0; i--) { int subLength = array[i].length; if (subLength > 0) { index -= subLength; System.arraycopy(array[i], 0, result, index, subLength); result[--index] = separator; } } System.arraycopy(name, 0, result, 0, nameLength); return result;} | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/e33c1f7b0c1f9dbe66a73370c1b98e653087c2df/CharOperation.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/CharOperation.java |
int size = nameLength; int index = length; while (--index >= 0) if (array[index].length > 0) size += array[index].length + 1; char[] result = new char[size]; index = size; for (int i = length - 1; i >= 0; i--) { int subLength = array[i].length; if (subLength > 0) { index -= subLength; System.arraycopy(array[i], 0, result, index, subLength); result[--index] = separator; | int size = nameLength; int index = length; while (--index >= 0) if (array[index].length > 0) size += array[index].length + 1; char[] result = new char[size]; index = size; for (int i = length - 1; i >= 0; i--) { int subLength = array[i].length; if (subLength > 0) { index -= subLength; System.arraycopy(array[i], 0, result, index, subLength); result[--index] = separator; } | public static final char[] concatWith( char[] name, char[][] array, char separator) { int nameLength = name == null ? 0 : name.length; if (nameLength == 0) return concatWith(array, separator); int length = array == null ? 0 : array.length; if (length == 0) return name; int size = nameLength; int index = length; while (--index >= 0) if (array[index].length > 0) size += array[index].length + 1; char[] result = new char[size]; index = size; for (int i = length - 1; i >= 0; i--) { int subLength = array[i].length; if (subLength > 0) { index -= subLength; System.arraycopy(array[i], 0, result, index, subLength); result[--index] = separator; } } System.arraycopy(name, 0, result, 0, nameLength); return result;} | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/e33c1f7b0c1f9dbe66a73370c1b98e653087c2df/CharOperation.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/CharOperation.java |
System.arraycopy(name, 0, result, 0, nameLength); return result; } | public static final char[] concatWith( char[] name, char[][] array, char separator) { int nameLength = name == null ? 0 : name.length; if (nameLength == 0) return concatWith(array, separator); int length = array == null ? 0 : array.length; if (length == 0) return name; int size = nameLength; int index = length; while (--index >= 0) if (array[index].length > 0) size += array[index].length + 1; char[] result = new char[size]; index = size; for (int i = length - 1; i >= 0; i--) { int subLength = array[i].length; if (subLength > 0) { index -= subLength; System.arraycopy(array[i], 0, result, index, subLength); result[--index] = separator; } } System.arraycopy(name, 0, result, 0, nameLength); return result;} | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/e33c1f7b0c1f9dbe66a73370c1b98e653087c2df/CharOperation.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/CharOperation.java |
|
for (int i = array.length; --i >= 0;) { char[] subarray = array[i]; for (int j = subarray.length; --j >= 0;) if (subarray[j] == character) return true; | for (int i = array.length; --i >= 0;) { char[] subarray = array[i]; for (int j = subarray.length; --j >= 0;) if (subarray[j] == character) return true; } return false; | public static final boolean contains(char character, char[][] array) { for (int i = array.length; --i >= 0;) { char[] subarray = array[i]; for (int j = subarray.length; --j >= 0;) if (subarray[j] == character) return true; } return false;} | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/e33c1f7b0c1f9dbe66a73370c1b98e653087c2df/CharOperation.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/CharOperation.java |
return false; } | public static final boolean contains(char character, char[][] array) { for (int i = array.length; --i >= 0;) { char[] subarray = array[i]; for (int j = subarray.length; --j >= 0;) if (subarray[j] == character) return true; } return false;} | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/e33c1f7b0c1f9dbe66a73370c1b98e653087c2df/CharOperation.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/CharOperation.java |
|
int toCopyLength = toCopy.length; char[][] result = new char[toCopyLength][]; for (int i = 0; i < toCopyLength; i++) { char[] toElement = toCopy[i]; int toElementLength = toElement.length; char[] resultElement = new char[toElementLength]; System.arraycopy(toElement, 0, resultElement, 0, toElementLength); result[i] = resultElement; | int toCopyLength = toCopy.length; char[][] result = new char[toCopyLength][]; for (int i = 0; i < toCopyLength; i++) { char[] toElement = toCopy[i]; int toElementLength = toElement.length; char[] resultElement = new char[toElementLength]; System.arraycopy(toElement, 0, resultElement, 0, toElementLength); result[i] = resultElement; } return result; | public static final char[][] deepCopy(char[][] toCopy) { int toCopyLength = toCopy.length; char[][] result = new char[toCopyLength][]; for (int i = 0; i < toCopyLength; i++) { char[] toElement = toCopy[i]; int toElementLength = toElement.length; char[] resultElement = new char[toElementLength]; System.arraycopy(toElement, 0, resultElement, 0, toElementLength); result[i] = resultElement; } return result;} | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/e33c1f7b0c1f9dbe66a73370c1b98e653087c2df/CharOperation.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/CharOperation.java |
return result; } | public static final char[][] deepCopy(char[][] toCopy) { int toCopyLength = toCopy.length; char[][] result = new char[toCopyLength][]; for (int i = 0; i < toCopyLength; i++) { char[] toElement = toCopy[i]; int toElementLength = toElement.length; char[] resultElement = new char[toElementLength]; System.arraycopy(toElement, 0, resultElement, 0, toElementLength); result[i] = resultElement; } return result;} | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/e33c1f7b0c1f9dbe66a73370c1b98e653087c2df/CharOperation.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/CharOperation.java |
|
int i = toBeFound.length; int j = array.length - i; | int i = toBeFound.length; int j = array.length - i; | public static final boolean endsWith(char[] array, char[] toBeFound) { int i = toBeFound.length; int j = array.length - i; if (j < 0) return false; while (--i >= 0) if (toBeFound[i] != array[i + j]) return false; return true;} | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/e33c1f7b0c1f9dbe66a73370c1b98e653087c2df/CharOperation.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/CharOperation.java |
if (j < 0) return false; while (--i >= 0) if (toBeFound[i] != array[i + j]) | if (j < 0) | public static final boolean endsWith(char[] array, char[] toBeFound) { int i = toBeFound.length; int j = array.length - i; if (j < 0) return false; while (--i >= 0) if (toBeFound[i] != array[i + j]) return false; return true;} | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/e33c1f7b0c1f9dbe66a73370c1b98e653087c2df/CharOperation.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/CharOperation.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.