rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
refreshJob.addRemovedMarker(delta.getMarker());
removedMarkers.add(delta.getMarker());
public void resourceChanged(IResourceChangeEvent event) { String[] markerTypes = getMarkerTypes(); if(event.getType() == IResourceChangeEvent.PRE_BUILD){ refreshJob.buildDone = false; return; } if(event.getType() == IResourceChangeEvent.POST_BUILD){ refreshJob.buildDone = true; refreshJob.schedule(100); return; } for (int idx = 0; idx < markerTypes.length; idx++) { IMarkerDelta[] markerDeltas = event.findMarkerDeltas( markerTypes[idx], true); for (int i = 0; i < markerDeltas.length; i++) { IMarkerDelta delta = markerDeltas[i]; int kind = delta.getKind(); if (kind == IResourceDelta.CHANGED) { refreshJob.addChangedMarker(delta.getMarker()); } if (kind == IResourceDelta.ADDED) { refreshJob.addAddedMarker(delta.getMarker()); } if (kind == IResourceDelta.REMOVED) { refreshJob.addRemovedMarker(delta.getMarker()); } } } }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/97da45b298c8fc6737c257bdf9b28c993ca2458c/MarkerView.java/buggy/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/MarkerView.java
if (!changedMarkers.isEmpty()) { MarkerList changed = getCurrentMarkers().findMarkers( changedMarkers); if (changed.getItemCount() > 0) { changed.refresh(); updateJob.refresh(changed); getProgressService().schedule(updateJob); } } if (addRefreshRequired(addedMarkers) || removeRefreshRequired(removedMarkers)) { updateJob.refreshAll(); getProgressService().schedule(updateJob); }
public void resourceChanged(IResourceChangeEvent event) { String[] markerTypes = getMarkerTypes(); if(event.getType() == IResourceChangeEvent.PRE_BUILD){ refreshJob.buildDone = false; return; } if(event.getType() == IResourceChangeEvent.POST_BUILD){ refreshJob.buildDone = true; refreshJob.schedule(100); return; } for (int idx = 0; idx < markerTypes.length; idx++) { IMarkerDelta[] markerDeltas = event.findMarkerDeltas( markerTypes[idx], true); for (int i = 0; i < markerDeltas.length; i++) { IMarkerDelta delta = markerDeltas[i]; int kind = delta.getKind(); if (kind == IResourceDelta.CHANGED) { refreshJob.addChangedMarker(delta.getMarker()); } if (kind == IResourceDelta.ADDED) { refreshJob.addAddedMarker(delta.getMarker()); } if (kind == IResourceDelta.REMOVED) { refreshJob.addRemovedMarker(delta.getMarker()); } } } }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/97da45b298c8fc6737c257bdf9b28c993ca2458c/MarkerView.java/buggy/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/MarkerView.java
uiRefreshJob.addJobChangeListener(listener);
updateJob.addJobChangeListener(listener);
public void addUpdateFinishListener(IJobChangeListener listener) { uiRefreshJob.addJobChangeListener(listener); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/97da45b298c8fc6737c257bdf9b28c993ca2458c/MarkerView.java/buggy/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/MarkerView.java
filter.resetState();
private void createDefaultFilter() { MarkerFilter filter = createFilter(MarkerMessages.MarkerFilter_defaultFilterName); filter.resetState(); setFilters(new MarkerFilter[] { filter }); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/97da45b298c8fc6737c257bdf9b28c993ca2458c/MarkerView.java/buggy/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/MarkerView.java
markerUpdateListener,IResourceChangeEvent.POST_CHANGE | IResourceChangeEvent.PRE_BUILD | IResourceChangeEvent.POST_BUILD);
markerUpdateListener, IResourceChangeEvent.POST_CHANGE | IResourceChangeEvent.PRE_BUILD | IResourceChangeEvent.POST_BUILD);
public void createPartControl(Composite parent) { clipboard = new Clipboard(parent.getDisplay()); super.createPartControl(parent); initDragAndDrop(); getSite().getPage().addSelectionListener(focusListener); focusSelectionChanged(getSite().getPage().getActivePart(), getSite() .getPage().getSelection()); ResourcesPlugin.getWorkspace().addResourceChangeListener( markerUpdateListener,IResourceChangeEvent.POST_CHANGE | IResourceChangeEvent.PRE_BUILD | IResourceChangeEvent.POST_BUILD); PlatformUI.getWorkbench().getWorkingSetManager() .addPropertyChangeListener(getWorkingSetListener()); // Set help on the view itself getViewer().getControl().addHelpListener(new HelpListener() { /* * (non-Javadoc) * * @see org.eclipse.swt.events.HelpListener#helpRequested(org.eclipse.swt.events.HelpEvent) */ public void helpRequested(HelpEvent e) { IContext context = contextProvider.getContext(getViewer() .getControl()); PlatformUI.getWorkbench().getHelpSystem().displayHelp(context); } }); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/97da45b298c8fc6737c257bdf9b28c993ca2458c/MarkerView.java/buggy/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/MarkerView.java
public void createPartControl(Composite parent) { clipboard = new Clipboard(parent.getDisplay()); super.createPartControl(parent); initDragAndDrop(); getSite().getPage().addSelectionListener(focusListener); focusSelectionChanged(getSite().getPage().getActivePart(), getSite() .getPage().getSelection()); ResourcesPlugin.getWorkspace().addResourceChangeListener( markerUpdateListener,IResourceChangeEvent.POST_CHANGE | IResourceChangeEvent.PRE_BUILD | IResourceChangeEvent.POST_BUILD); PlatformUI.getWorkbench().getWorkingSetManager() .addPropertyChangeListener(getWorkingSetListener()); // Set help on the view itself getViewer().getControl().addHelpListener(new HelpListener() { /* * (non-Javadoc) * * @see org.eclipse.swt.events.HelpListener#helpRequested(org.eclipse.swt.events.HelpEvent) */ public void helpRequested(HelpEvent e) { IContext context = contextProvider.getContext(getViewer() .getControl()); PlatformUI.getWorkbench().getHelpSystem().displayHelp(context); } }); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/97da45b298c8fc6737c257bdf9b28c993ca2458c/MarkerView.java/buggy/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/MarkerView.java
if(!Util.isSingleConcreteSelection(structured))
if (!Util.isSingleConcreteSelection(structured))
void createShowInMenu(IMenuManager menu) { ISelection selection = getViewer().getSelection(); if (!(selection instanceof IStructuredSelection)) return; IStructuredSelection structured = (IStructuredSelection) selection; if(!Util.isSingleConcreteSelection(structured)) return; menu.add(new Separator(MENU_SHOW_IN_GROUP)); // Don't add in the filters until they are set showInMenu = new MenuManager(IDEWorkbenchMessages.Workbench_showIn); showInMenu.add(ContributionItemFactory.VIEWS_SHOW_IN .create(getViewSite().getWorkbenchWindow())); menu.appendToGroup(MENU_SHOW_IN_GROUP, showInMenu); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/97da45b298c8fc6737c257bdf9b28c993ca2458c/MarkerView.java/buggy/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/MarkerView.java
void createShowInMenu(IMenuManager menu) { ISelection selection = getViewer().getSelection(); if (!(selection instanceof IStructuredSelection)) return; IStructuredSelection structured = (IStructuredSelection) selection; if(!Util.isSingleConcreteSelection(structured)) return; menu.add(new Separator(MENU_SHOW_IN_GROUP)); // Don't add in the filters until they are set showInMenu = new MenuManager(IDEWorkbenchMessages.Workbench_showIn); showInMenu.add(ContributionItemFactory.VIEWS_SHOW_IN .create(getViewSite().getWorkbenchWindow())); menu.appendToGroup(MENU_SHOW_IN_GROUP, showInMenu); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/97da45b298c8fc6737c257bdf9b28c993ca2458c/MarkerView.java/buggy/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/MarkerView.java
if(openAction.isEnabled())
if (openAction.isEnabled())
protected void handleOpenEvent(OpenEvent event) { if(openAction.isEnabled()) openAction.run(); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/97da45b298c8fc6737c257bdf9b28c993ca2458c/MarkerView.java/buggy/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/MarkerView.java
uiRefreshJob.removeJobChangeListener(listener);
updateJob.removeJobChangeListener(listener);
public void removeUpdateFinishListener(IJobChangeListener listener) { uiRefreshJob.removeJobChangeListener(listener); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/97da45b298c8fc6737c257bdf9b28c993ca2458c/MarkerView.java/buggy/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/MarkerView.java
if (marker != null && getCurrentMarkers() != null){
if (marker != null)
protected IStructuredSelection restoreSelection(IMemento memento) { if (memento == null) { return new StructuredSelection(); } IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IMemento selectionMemento = memento.getChild(TAG_SELECTION); if (selectionMemento == null) { return new StructuredSelection(); } ArrayList selectionList = new ArrayList(); IMemento[] markerMems = selectionMemento.getChildren(TAG_MARKER); for (int i = 0; i < markerMems.length; i++) { try { long id = new Long(markerMems[i].getString(TAG_ID)).longValue(); IResource resource = root.findMember(markerMems[i] .getString(TAG_RESOURCE)); if (resource != null) { IMarker marker = resource.findMarker(id); if (marker != null && getCurrentMarkers() != null){ selectionList .add(getCurrentMarkers().getMarker(marker)); } } } catch (CoreException e) { } } return new StructuredSelection(selectionList); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/97da45b298c8fc6737c257bdf9b28c993ca2458c/MarkerView.java/buggy/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/MarkerView.java
}
protected IStructuredSelection restoreSelection(IMemento memento) { if (memento == null) { return new StructuredSelection(); } IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IMemento selectionMemento = memento.getChild(TAG_SELECTION); if (selectionMemento == null) { return new StructuredSelection(); } ArrayList selectionList = new ArrayList(); IMemento[] markerMems = selectionMemento.getChildren(TAG_MARKER); for (int i = 0; i < markerMems.length; i++) { try { long id = new Long(markerMems[i].getString(TAG_ID)).longValue(); IResource resource = root.findMember(markerMems[i] .getString(TAG_RESOURCE)); if (resource != null) { IMarker marker = resource.findMarker(id); if (marker != null && getCurrentMarkers() != null){ selectionList .add(getCurrentMarkers().getMarker(marker)); } } } catch (CoreException e) { } } return new StructuredSelection(selectionList); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/97da45b298c8fc6737c257bdf9b28c993ca2458c/MarkerView.java/buggy/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/MarkerView.java
((MarkerAdapter) getViewerInput()).markAllStale();
void updateFocusMarkers(Object[] elements) { boolean updateNeeded = updateNeeded(focusElements, elements); if (updateNeeded) { focusElements = elements; updateFilterSelection(elements); ((MarkerAdapter) getViewerInput()).markAllStale(); getViewer().refresh(); } }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/97da45b298c8fc6737c257bdf9b28c993ca2458c/MarkerView.java/buggy/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/MarkerView.java
if (contact.isNew() || contact.isModified()) { session = openSession(); if (contact.isNew()) { Contact contactModel = new Contact(); contactModel.setContactId(contact.getContactId()); contactModel.setCompanyId(contact.getCompanyId()); contactModel.setUserId(contact.getUserId()); contactModel.setUserName(contact.getUserName()); contactModel.setCreateDate(contact.getCreateDate()); contactModel.setModifiedDate(contact.getModifiedDate()); contactModel.setAccountId(contact.getAccountId()); contactModel.setParentContactId(contact.getParentContactId()); contactModel.setFirstName(contact.getFirstName()); contactModel.setMiddleName(contact.getMiddleName()); contactModel.setLastName(contact.getLastName()); contactModel.setNickName(contact.getNickName()); contactModel.setPrefixId(contact.getPrefixId()); contactModel.setSuffixId(contact.getSuffixId()); contactModel.setMale(contact.getMale()); contactModel.setBirthday(contact.getBirthday()); contactModel.setSmsSn(contact.getSmsSn()); contactModel.setAimSn(contact.getAimSn()); contactModel.setIcqSn(contact.getIcqSn()); contactModel.setJabberSn(contact.getJabberSn()); contactModel.setMsnSn(contact.getMsnSn()); contactModel.setSkypeSn(contact.getSkypeSn()); contactModel.setYmSn(contact.getYmSn()); contactModel.setEmployeeStatusId(contact.getEmployeeStatusId()); contactModel.setEmployeeNumber(contact.getEmployeeNumber()); contactModel.setJobTitle(contact.getJobTitle()); contactModel.setJobClass(contact.getJobClass()); contactModel.setHoursOfOperation(contact.getHoursOfOperation()); session.save(contactModel); session.flush(); } else { Contact contactModel = (Contact)session.get(Contact.class, contact.getPrimaryKey()); if (contactModel != null) { contactModel.setCompanyId(contact.getCompanyId()); contactModel.setUserId(contact.getUserId()); contactModel.setUserName(contact.getUserName()); contactModel.setCreateDate(contact.getCreateDate()); contactModel.setModifiedDate(contact.getModifiedDate()); contactModel.setAccountId(contact.getAccountId()); contactModel.setParentContactId(contact.getParentContactId()); contactModel.setFirstName(contact.getFirstName()); contactModel.setMiddleName(contact.getMiddleName()); contactModel.setLastName(contact.getLastName()); contactModel.setNickName(contact.getNickName()); contactModel.setPrefixId(contact.getPrefixId()); contactModel.setSuffixId(contact.getSuffixId()); contactModel.setMale(contact.getMale()); contactModel.setBirthday(contact.getBirthday()); contactModel.setSmsSn(contact.getSmsSn()); contactModel.setAimSn(contact.getAimSn()); contactModel.setIcqSn(contact.getIcqSn()); contactModel.setJabberSn(contact.getJabberSn()); contactModel.setMsnSn(contact.getMsnSn()); contactModel.setSkypeSn(contact.getSkypeSn()); contactModel.setYmSn(contact.getYmSn()); contactModel.setEmployeeStatusId(contact.getEmployeeStatusId()); contactModel.setEmployeeNumber(contact.getEmployeeNumber()); contactModel.setJobTitle(contact.getJobTitle()); contactModel.setJobClass(contact.getJobClass()); contactModel.setHoursOfOperation(contact.getHoursOfOperation()); session.flush(); } else { contactModel = new Contact(); contactModel.setContactId(contact.getContactId()); contactModel.setCompanyId(contact.getCompanyId()); contactModel.setUserId(contact.getUserId()); contactModel.setUserName(contact.getUserName()); contactModel.setCreateDate(contact.getCreateDate()); contactModel.setModifiedDate(contact.getModifiedDate()); contactModel.setAccountId(contact.getAccountId()); contactModel.setParentContactId(contact.getParentContactId()); contactModel.setFirstName(contact.getFirstName()); contactModel.setMiddleName(contact.getMiddleName()); contactModel.setLastName(contact.getLastName()); contactModel.setNickName(contact.getNickName()); contactModel.setPrefixId(contact.getPrefixId()); contactModel.setSuffixId(contact.getSuffixId()); contactModel.setMale(contact.getMale()); contactModel.setBirthday(contact.getBirthday()); contactModel.setSmsSn(contact.getSmsSn()); contactModel.setAimSn(contact.getAimSn()); contactModel.setIcqSn(contact.getIcqSn()); contactModel.setJabberSn(contact.getJabberSn()); contactModel.setMsnSn(contact.getMsnSn()); contactModel.setSkypeSn(contact.getSkypeSn()); contactModel.setYmSn(contact.getYmSn()); contactModel.setEmployeeStatusId(contact.getEmployeeStatusId()); contactModel.setEmployeeNumber(contact.getEmployeeNumber()); contactModel.setJobTitle(contact.getJobTitle()); contactModel.setJobClass(contact.getJobClass()); contactModel.setHoursOfOperation(contact.getHoursOfOperation()); session.save(contactModel); session.flush(); } } contact.setNew(false); contact.setModified(false); }
session = openSession(); session.saveOrUpdate(contact); session.flush(); contact.setNew(false);
public com.liferay.portal.model.Contact update( com.liferay.portal.model.Contact contact) throws SystemException { Session session = null; try { if (contact.isNew() || contact.isModified()) { session = openSession(); if (contact.isNew()) { Contact contactModel = new Contact(); contactModel.setContactId(contact.getContactId()); contactModel.setCompanyId(contact.getCompanyId()); contactModel.setUserId(contact.getUserId()); contactModel.setUserName(contact.getUserName()); contactModel.setCreateDate(contact.getCreateDate()); contactModel.setModifiedDate(contact.getModifiedDate()); contactModel.setAccountId(contact.getAccountId()); contactModel.setParentContactId(contact.getParentContactId()); contactModel.setFirstName(contact.getFirstName()); contactModel.setMiddleName(contact.getMiddleName()); contactModel.setLastName(contact.getLastName()); contactModel.setNickName(contact.getNickName()); contactModel.setPrefixId(contact.getPrefixId()); contactModel.setSuffixId(contact.getSuffixId()); contactModel.setMale(contact.getMale()); contactModel.setBirthday(contact.getBirthday()); contactModel.setSmsSn(contact.getSmsSn()); contactModel.setAimSn(contact.getAimSn()); contactModel.setIcqSn(contact.getIcqSn()); contactModel.setJabberSn(contact.getJabberSn()); contactModel.setMsnSn(contact.getMsnSn()); contactModel.setSkypeSn(contact.getSkypeSn()); contactModel.setYmSn(contact.getYmSn()); contactModel.setEmployeeStatusId(contact.getEmployeeStatusId()); contactModel.setEmployeeNumber(contact.getEmployeeNumber()); contactModel.setJobTitle(contact.getJobTitle()); contactModel.setJobClass(contact.getJobClass()); contactModel.setHoursOfOperation(contact.getHoursOfOperation()); session.save(contactModel); session.flush(); } else { Contact contactModel = (Contact)session.get(Contact.class, contact.getPrimaryKey()); if (contactModel != null) { contactModel.setCompanyId(contact.getCompanyId()); contactModel.setUserId(contact.getUserId()); contactModel.setUserName(contact.getUserName()); contactModel.setCreateDate(contact.getCreateDate()); contactModel.setModifiedDate(contact.getModifiedDate()); contactModel.setAccountId(contact.getAccountId()); contactModel.setParentContactId(contact.getParentContactId()); contactModel.setFirstName(contact.getFirstName()); contactModel.setMiddleName(contact.getMiddleName()); contactModel.setLastName(contact.getLastName()); contactModel.setNickName(contact.getNickName()); contactModel.setPrefixId(contact.getPrefixId()); contactModel.setSuffixId(contact.getSuffixId()); contactModel.setMale(contact.getMale()); contactModel.setBirthday(contact.getBirthday()); contactModel.setSmsSn(contact.getSmsSn()); contactModel.setAimSn(contact.getAimSn()); contactModel.setIcqSn(contact.getIcqSn()); contactModel.setJabberSn(contact.getJabberSn()); contactModel.setMsnSn(contact.getMsnSn()); contactModel.setSkypeSn(contact.getSkypeSn()); contactModel.setYmSn(contact.getYmSn()); contactModel.setEmployeeStatusId(contact.getEmployeeStatusId()); contactModel.setEmployeeNumber(contact.getEmployeeNumber()); contactModel.setJobTitle(contact.getJobTitle()); contactModel.setJobClass(contact.getJobClass()); contactModel.setHoursOfOperation(contact.getHoursOfOperation()); session.flush(); } else { contactModel = new Contact(); contactModel.setContactId(contact.getContactId()); contactModel.setCompanyId(contact.getCompanyId()); contactModel.setUserId(contact.getUserId()); contactModel.setUserName(contact.getUserName()); contactModel.setCreateDate(contact.getCreateDate()); contactModel.setModifiedDate(contact.getModifiedDate()); contactModel.setAccountId(contact.getAccountId()); contactModel.setParentContactId(contact.getParentContactId()); contactModel.setFirstName(contact.getFirstName()); contactModel.setMiddleName(contact.getMiddleName()); contactModel.setLastName(contact.getLastName()); contactModel.setNickName(contact.getNickName()); contactModel.setPrefixId(contact.getPrefixId()); contactModel.setSuffixId(contact.getSuffixId()); contactModel.setMale(contact.getMale()); contactModel.setBirthday(contact.getBirthday()); contactModel.setSmsSn(contact.getSmsSn()); contactModel.setAimSn(contact.getAimSn()); contactModel.setIcqSn(contact.getIcqSn()); contactModel.setJabberSn(contact.getJabberSn()); contactModel.setMsnSn(contact.getMsnSn()); contactModel.setSkypeSn(contact.getSkypeSn()); contactModel.setYmSn(contact.getYmSn()); contactModel.setEmployeeStatusId(contact.getEmployeeStatusId()); contactModel.setEmployeeNumber(contact.getEmployeeNumber()); contactModel.setJobTitle(contact.getJobTitle()); contactModel.setJobClass(contact.getJobClass()); contactModel.setHoursOfOperation(contact.getHoursOfOperation()); session.save(contactModel); session.flush(); } } contact.setNew(false); contact.setModified(false); } return contact; } catch (HibernateException he) { throw new SystemException(he); } finally { closeSession(session); } }
57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f4d6afc6707f57fd84bf6b624f0c119657b0a766/ContactPersistence.java/buggy/portal-ejb/src/com/liferay/portal/service/persistence/ContactPersistence.java
if (pageInfo != null) { extents = new Rectangle(0, 0, (int) pageInfo.getContentWidth(), (int) pageInfo.getContentHeight()); } else if (enclosingScrollPane != null) { Rectangle bnds = enclosingScrollPane.getViewportBorderBounds(); extents = new Rectangle(0, 0, bnds.width, bnds.height); } else { extents = new Rectangle(getWidth(), getHeight()); }
extents = getBaseExtents(pageInfo);
protected LayoutContext newLayoutContext(PageInfo pageInfo, Graphics2D g) { XRLog.layout(Level.FINEST, "new context begin"); getSharedContext().setCanvas(this); Rectangle extents; if (pageInfo != null) { extents = new Rectangle(0, 0, (int) pageInfo.getContentWidth(), (int) pageInfo.getContentHeight()); } else if (enclosingScrollPane != null) { Rectangle bnds = enclosingScrollPane.getViewportBorderBounds(); extents = new Rectangle(0, 0, bnds.width, bnds.height); //Uu.p("bnds = " + bnds); } else { extents = new Rectangle(getWidth(), getHeight());//200, 200 ) ); } //Uu.p("newContext() = extents = " + extents); getSharedContext().setMaxWidth(0); //getSharedContext().setMaxHeight(0); XRLog.layout(Level.FINEST, "new context end"); //Uu.p("new context with extents: " + extents); LayoutContext result = getSharedContext().newLayoutContextInstance(extents); result.setGraphics(g.getDeviceConfiguration().createCompatibleImage(1, 1).createGraphics()); result.setPrint(pageInfo != null); result.setInteractive(pageInfo == null); return result; }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/64c3183c146f6b53b2057df9750f030a3b20c4b2/RootPanel.java/buggy/src/java/org/xhtmlrenderer/swing/RootPanel.java
if (pageInfo != null) { extents = new Rectangle(0, 0, (int) pageInfo.getContentWidth(), (int) pageInfo.getContentHeight()); } else if (enclosingScrollPane != null) { Rectangle bnds = enclosingScrollPane.getViewportBorderBounds(); extents = new Rectangle(0, 0, bnds.width, bnds.height); } else { extents = new Rectangle(getWidth(), getHeight()); }
extents = getBaseExtents(pageInfo);
protected RenderingContext newRenderingContext(PageInfo pageInfo, Graphics2D g) { XRLog.layout(Level.FINEST, "new context begin"); getSharedContext().setCanvas(this); Rectangle extents; if (pageInfo != null) { extents = new Rectangle(0, 0, (int) pageInfo.getContentWidth(), (int) pageInfo.getContentHeight()); } else if (enclosingScrollPane != null) { Rectangle bnds = enclosingScrollPane.getViewportBorderBounds(); extents = new Rectangle(0, 0, bnds.width, bnds.height); //Uu.p("bnds = " + bnds); } else { extents = new Rectangle(getWidth(), getHeight());//200, 200 ) ); } //Uu.p("newContext() = extents = " + extents); getSharedContext().setMaxWidth(0); //getSharedContext().setMaxHeight(0); XRLog.layout(Level.FINEST, "new context end"); //Uu.p("new context with extents: " + extents); RenderingContext result = getSharedContext().newRenderingContextInstance(extents); result.setGraphics(g); result.setPrint(pageInfo != null); result.setInteractive(pageInfo == null); return result; }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/64c3183c146f6b53b2057df9750f030a3b20c4b2/RootPanel.java/buggy/src/java/org/xhtmlrenderer/swing/RootPanel.java
companyId, plid, languageId);;
companyId, plid, languageId, isIe);
public void doFilter( ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { if (USE_LAYOUT_CACHE_FILTER) { _log.debug("Layout Cache is enabled"); } else { _log.debug("Layout Cache is disabled"); } HttpServletRequest request = (HttpServletRequest)req; HttpServletResponse response = (HttpServletResponse)res; String companyId = PortalUtil.getCompanyId(request); String plid = _getPlid(request.getPathInfo(), request.getServletPath(), ParamUtil.getString(request, "p_l_id")); String portletId = ParamUtil.getString(request, "p_p_id"); String languageId = LanguageUtil.getLanguageId(request); if (Validator.isNull(portletId) && Validator.isNotNull(plid)) { if (USE_LAYOUT_CACHE_FILTER && !_isAlreadyFiltered(request) && !_isSignedIn(request) && !_isInclude(request) && _isCacheable(companyId, plid)) { request.setAttribute(_ALREADY_FILTERED, Boolean.TRUE); LayoutCacheResponseData layoutCacheResponseData = LayoutCacheUtil.getLayoutCacheResponseData( companyId, plid, languageId);; if (layoutCacheResponseData == null) { _log.info("Caching layout " + plid); LayoutCacheResponse layoutCacheResponse = new LayoutCacheResponse(response); chain.doFilter(req, layoutCacheResponse); layoutCacheResponseData = new LayoutCacheResponseData( layoutCacheResponse.getData(), layoutCacheResponse.getContentType()); LayoutCacheUtil.putLayoutCacheResponseData( companyId, plid, languageId, layoutCacheResponseData); } byte[] byteArray = layoutCacheResponseData.getData(); res.setContentLength(byteArray.length); res.setContentType(layoutCacheResponseData.getContentType()); ServletOutputStream out = response.getOutputStream(); out.write(byteArray, 0, byteArray.length); out.flush(); out.close(); } else { _log.debug("Not checking cached layout " + plid); chain.doFilter(req, res); } } else { _log.debug("Did not request a layout"); chain.doFilter(req, res); } }
57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/ed678eafef9f21b2ca10149aaf7679c2201d8133/LayoutCacheFilter.java/clean/portal-ejb/src/com/liferay/portal/servlet/filters/layoutcache/LayoutCacheFilter.java
LayoutCacheUtil.putLayoutCacheResponseData( companyId, plid, languageId, layoutCacheResponseData);
LayoutCacheUtil.putLayoutCacheResponseData(companyId, plid, languageId, isIe, layoutCacheResponseData);
public void doFilter( ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { if (USE_LAYOUT_CACHE_FILTER) { _log.debug("Layout Cache is enabled"); } else { _log.debug("Layout Cache is disabled"); } HttpServletRequest request = (HttpServletRequest)req; HttpServletResponse response = (HttpServletResponse)res; String companyId = PortalUtil.getCompanyId(request); String plid = _getPlid(request.getPathInfo(), request.getServletPath(), ParamUtil.getString(request, "p_l_id")); String portletId = ParamUtil.getString(request, "p_p_id"); String languageId = LanguageUtil.getLanguageId(request); if (Validator.isNull(portletId) && Validator.isNotNull(plid)) { if (USE_LAYOUT_CACHE_FILTER && !_isAlreadyFiltered(request) && !_isSignedIn(request) && !_isInclude(request) && _isCacheable(companyId, plid)) { request.setAttribute(_ALREADY_FILTERED, Boolean.TRUE); LayoutCacheResponseData layoutCacheResponseData = LayoutCacheUtil.getLayoutCacheResponseData( companyId, plid, languageId);; if (layoutCacheResponseData == null) { _log.info("Caching layout " + plid); LayoutCacheResponse layoutCacheResponse = new LayoutCacheResponse(response); chain.doFilter(req, layoutCacheResponse); layoutCacheResponseData = new LayoutCacheResponseData( layoutCacheResponse.getData(), layoutCacheResponse.getContentType()); LayoutCacheUtil.putLayoutCacheResponseData( companyId, plid, languageId, layoutCacheResponseData); } byte[] byteArray = layoutCacheResponseData.getData(); res.setContentLength(byteArray.length); res.setContentType(layoutCacheResponseData.getContentType()); ServletOutputStream out = response.getOutputStream(); out.write(byteArray, 0, byteArray.length); out.flush(); out.close(); } else { _log.debug("Not checking cached layout " + plid); chain.doFilter(req, res); } } else { _log.debug("Did not request a layout"); chain.doFilter(req, res); } }
57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/ed678eafef9f21b2ca10149aaf7679c2201d8133/LayoutCacheFilter.java/clean/portal-ejb/src/com/liferay/portal/servlet/filters/layoutcache/LayoutCacheFilter.java
if (shoppingCoupon.isNew() || shoppingCoupon.isModified()) { session = openSession(); if (shoppingCoupon.isNew()) { ShoppingCoupon shoppingCouponModel = new ShoppingCoupon(); shoppingCouponModel.setCouponId(shoppingCoupon.getCouponId()); shoppingCouponModel.setGroupId(shoppingCoupon.getGroupId()); shoppingCouponModel.setCompanyId(shoppingCoupon.getCompanyId()); shoppingCouponModel.setUserId(shoppingCoupon.getUserId()); shoppingCouponModel.setUserName(shoppingCoupon.getUserName()); shoppingCouponModel.setCreateDate(shoppingCoupon.getCreateDate()); shoppingCouponModel.setModifiedDate(shoppingCoupon.getModifiedDate()); shoppingCouponModel.setName(shoppingCoupon.getName()); shoppingCouponModel.setDescription(shoppingCoupon.getDescription()); shoppingCouponModel.setStartDate(shoppingCoupon.getStartDate()); shoppingCouponModel.setEndDate(shoppingCoupon.getEndDate()); shoppingCouponModel.setActive(shoppingCoupon.getActive()); shoppingCouponModel.setLimitCategories(shoppingCoupon.getLimitCategories()); shoppingCouponModel.setLimitSkus(shoppingCoupon.getLimitSkus()); shoppingCouponModel.setMinOrder(shoppingCoupon.getMinOrder()); shoppingCouponModel.setDiscount(shoppingCoupon.getDiscount()); shoppingCouponModel.setDiscountType(shoppingCoupon.getDiscountType()); session.save(shoppingCouponModel); session.flush(); } else { ShoppingCoupon shoppingCouponModel = (ShoppingCoupon)session.get(ShoppingCoupon.class, shoppingCoupon.getPrimaryKey()); if (shoppingCouponModel != null) { shoppingCouponModel.setGroupId(shoppingCoupon.getGroupId()); shoppingCouponModel.setCompanyId(shoppingCoupon.getCompanyId()); shoppingCouponModel.setUserId(shoppingCoupon.getUserId()); shoppingCouponModel.setUserName(shoppingCoupon.getUserName()); shoppingCouponModel.setCreateDate(shoppingCoupon.getCreateDate()); shoppingCouponModel.setModifiedDate(shoppingCoupon.getModifiedDate()); shoppingCouponModel.setName(shoppingCoupon.getName()); shoppingCouponModel.setDescription(shoppingCoupon.getDescription()); shoppingCouponModel.setStartDate(shoppingCoupon.getStartDate()); shoppingCouponModel.setEndDate(shoppingCoupon.getEndDate()); shoppingCouponModel.setActive(shoppingCoupon.getActive()); shoppingCouponModel.setLimitCategories(shoppingCoupon.getLimitCategories()); shoppingCouponModel.setLimitSkus(shoppingCoupon.getLimitSkus()); shoppingCouponModel.setMinOrder(shoppingCoupon.getMinOrder()); shoppingCouponModel.setDiscount(shoppingCoupon.getDiscount()); shoppingCouponModel.setDiscountType(shoppingCoupon.getDiscountType()); session.flush(); } else { shoppingCouponModel = new ShoppingCoupon(); shoppingCouponModel.setCouponId(shoppingCoupon.getCouponId()); shoppingCouponModel.setGroupId(shoppingCoupon.getGroupId()); shoppingCouponModel.setCompanyId(shoppingCoupon.getCompanyId()); shoppingCouponModel.setUserId(shoppingCoupon.getUserId()); shoppingCouponModel.setUserName(shoppingCoupon.getUserName()); shoppingCouponModel.setCreateDate(shoppingCoupon.getCreateDate()); shoppingCouponModel.setModifiedDate(shoppingCoupon.getModifiedDate()); shoppingCouponModel.setName(shoppingCoupon.getName()); shoppingCouponModel.setDescription(shoppingCoupon.getDescription()); shoppingCouponModel.setStartDate(shoppingCoupon.getStartDate()); shoppingCouponModel.setEndDate(shoppingCoupon.getEndDate()); shoppingCouponModel.setActive(shoppingCoupon.getActive()); shoppingCouponModel.setLimitCategories(shoppingCoupon.getLimitCategories()); shoppingCouponModel.setLimitSkus(shoppingCoupon.getLimitSkus()); shoppingCouponModel.setMinOrder(shoppingCoupon.getMinOrder()); shoppingCouponModel.setDiscount(shoppingCoupon.getDiscount()); shoppingCouponModel.setDiscountType(shoppingCoupon.getDiscountType()); session.save(shoppingCouponModel); session.flush(); } } shoppingCoupon.setNew(false); shoppingCoupon.setModified(false); }
session = openSession(); session.saveOrUpdate(shoppingCoupon); session.flush(); shoppingCoupon.setNew(false);
public com.liferay.portlet.shopping.model.ShoppingCoupon update( com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon) throws SystemException { Session session = null; try { if (shoppingCoupon.isNew() || shoppingCoupon.isModified()) { session = openSession(); if (shoppingCoupon.isNew()) { ShoppingCoupon shoppingCouponModel = new ShoppingCoupon(); shoppingCouponModel.setCouponId(shoppingCoupon.getCouponId()); shoppingCouponModel.setGroupId(shoppingCoupon.getGroupId()); shoppingCouponModel.setCompanyId(shoppingCoupon.getCompanyId()); shoppingCouponModel.setUserId(shoppingCoupon.getUserId()); shoppingCouponModel.setUserName(shoppingCoupon.getUserName()); shoppingCouponModel.setCreateDate(shoppingCoupon.getCreateDate()); shoppingCouponModel.setModifiedDate(shoppingCoupon.getModifiedDate()); shoppingCouponModel.setName(shoppingCoupon.getName()); shoppingCouponModel.setDescription(shoppingCoupon.getDescription()); shoppingCouponModel.setStartDate(shoppingCoupon.getStartDate()); shoppingCouponModel.setEndDate(shoppingCoupon.getEndDate()); shoppingCouponModel.setActive(shoppingCoupon.getActive()); shoppingCouponModel.setLimitCategories(shoppingCoupon.getLimitCategories()); shoppingCouponModel.setLimitSkus(shoppingCoupon.getLimitSkus()); shoppingCouponModel.setMinOrder(shoppingCoupon.getMinOrder()); shoppingCouponModel.setDiscount(shoppingCoupon.getDiscount()); shoppingCouponModel.setDiscountType(shoppingCoupon.getDiscountType()); session.save(shoppingCouponModel); session.flush(); } else { ShoppingCoupon shoppingCouponModel = (ShoppingCoupon)session.get(ShoppingCoupon.class, shoppingCoupon.getPrimaryKey()); if (shoppingCouponModel != null) { shoppingCouponModel.setGroupId(shoppingCoupon.getGroupId()); shoppingCouponModel.setCompanyId(shoppingCoupon.getCompanyId()); shoppingCouponModel.setUserId(shoppingCoupon.getUserId()); shoppingCouponModel.setUserName(shoppingCoupon.getUserName()); shoppingCouponModel.setCreateDate(shoppingCoupon.getCreateDate()); shoppingCouponModel.setModifiedDate(shoppingCoupon.getModifiedDate()); shoppingCouponModel.setName(shoppingCoupon.getName()); shoppingCouponModel.setDescription(shoppingCoupon.getDescription()); shoppingCouponModel.setStartDate(shoppingCoupon.getStartDate()); shoppingCouponModel.setEndDate(shoppingCoupon.getEndDate()); shoppingCouponModel.setActive(shoppingCoupon.getActive()); shoppingCouponModel.setLimitCategories(shoppingCoupon.getLimitCategories()); shoppingCouponModel.setLimitSkus(shoppingCoupon.getLimitSkus()); shoppingCouponModel.setMinOrder(shoppingCoupon.getMinOrder()); shoppingCouponModel.setDiscount(shoppingCoupon.getDiscount()); shoppingCouponModel.setDiscountType(shoppingCoupon.getDiscountType()); session.flush(); } else { shoppingCouponModel = new ShoppingCoupon(); shoppingCouponModel.setCouponId(shoppingCoupon.getCouponId()); shoppingCouponModel.setGroupId(shoppingCoupon.getGroupId()); shoppingCouponModel.setCompanyId(shoppingCoupon.getCompanyId()); shoppingCouponModel.setUserId(shoppingCoupon.getUserId()); shoppingCouponModel.setUserName(shoppingCoupon.getUserName()); shoppingCouponModel.setCreateDate(shoppingCoupon.getCreateDate()); shoppingCouponModel.setModifiedDate(shoppingCoupon.getModifiedDate()); shoppingCouponModel.setName(shoppingCoupon.getName()); shoppingCouponModel.setDescription(shoppingCoupon.getDescription()); shoppingCouponModel.setStartDate(shoppingCoupon.getStartDate()); shoppingCouponModel.setEndDate(shoppingCoupon.getEndDate()); shoppingCouponModel.setActive(shoppingCoupon.getActive()); shoppingCouponModel.setLimitCategories(shoppingCoupon.getLimitCategories()); shoppingCouponModel.setLimitSkus(shoppingCoupon.getLimitSkus()); shoppingCouponModel.setMinOrder(shoppingCoupon.getMinOrder()); shoppingCouponModel.setDiscount(shoppingCoupon.getDiscount()); shoppingCouponModel.setDiscountType(shoppingCoupon.getDiscountType()); session.save(shoppingCouponModel); session.flush(); } } shoppingCoupon.setNew(false); shoppingCoupon.setModified(false); } return shoppingCoupon; } catch (HibernateException he) { throw new SystemException(he); } finally { closeSession(session); } }
57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f4d6afc6707f57fd84bf6b624f0c119657b0a766/ShoppingCouponPersistence.java/buggy/portal-ejb/src/com/liferay/portlet/shopping/service/persistence/ShoppingCouponPersistence.java
primitive.setCssText(Idents.convertIdent(cssName, org));
if (primitive.getCssText() == null) { primitive.setCssText(org); } String converted = Idents.convertIdent(cssName, org); if (!converted.equals(org)) { primitive.setCssText(converted); }
public DerivedValue(CSSName cssName, CSSPrimitiveValue primitive, CalculatedStyle style) { _cssName = cssName; _domCSSPrimitiveValue = primitive; String org = _domCSSPrimitiveValue.getCssText(); primitive.setCssText(Idents.convertIdent(cssName, org)); if (primitive.getCssText() == null) { throw new XRRuntimeException("CSSValue for '" + cssName + "' is null after " + "resolving CSS identifier for value '" + org + "'"); } _style = style; // We must calculate this based on the current DPI //tobe: resolve it through RenderingContext MM__PER__PX = ( CM__PER__IN * MM__PER__CM ) / style.getContext().getCtx().getDPI(); try { if (_cssName == CSSName.BACKGROUND_POSITION) { pullPointValuesForBGPos(primitive); } else { if (Idents.looksLikeALength(primitive.getCssText()) && !(_cssName == CSSName.FONT_WEIGHT)) { // split out the length (as string), as float, as the primitive type pullLengthValueParts(primitive); } } } catch (Exception ex) { if (_style.getParent() != null) { _style.getParent().dumpProperties(); } throw new XRRuntimeException("For " + cssName + ": '" + org + "', failed to instantiate DerivedValue. " + ex.getMessage()); } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/c96efe21dd32b0a4f0420c8495d49144792cbc9d/DerivedValue.java/buggy/src/java/org/xhtmlrenderer/css/style/DerivedValue.java
RubyException excptn = (RubyException) args[0].callMethod("exception", args[1]); throw new RaiseException(excptn);
if (args[0] == runtime.getClasses().getExceptionClass()) { throw new RaiseException((RubyException) args[0].callMethod("exception", args[1])); } else { RubyString string = (RubyString) args[1]; RubyException excptn = RubyException.newException(runtime, (RubyClass)args[0], string.getValue()); throw new RaiseException(excptn); }
public static IRubyObject raise(IRubyObject recv, IRubyObject args[]) { Ruby runtime = recv.getRuntime(); switch (args.length) { case 0 : IRubyObject defaultException = runtime.getGlobalVariables().get("$!"); if (defaultException.isNil()) { throw new RaiseException(runtime, runtime.getExceptions().getRuntimeError(), ""); } throw new RaiseException((RubyException) defaultException); case 1 : if (args[0] instanceof RubyException) { throw new RaiseException((RubyException) args[0]); } else { throw new RaiseException(RubyException.newInstance(runtime.getExceptions().getRuntimeError(), args)); } case 2 : RubyException excptn = (RubyException) args[0].callMethod("exception", args[1]); throw new RaiseException(excptn); default : throw new ArgumentError(runtime, "wrong # of arguments"); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f5666cc08176a37cfc1e814762070c244f395cf/KernelModule.java/clean/src/org/jruby/KernelModule.java
public void handleMapChange(IObservableMap source, MapDiff diff) { Set affectedElements = diff.getChangedKeys(); LabelProviderChangedEvent event = new LabelProviderChangedEvent(
public void handleMapChange(MapChangeEvent event) { Set affectedElements = event.diff.getChangedKeys(); LabelProviderChangedEvent newEvent = new LabelProviderChangedEvent(
public void handleMapChange(IObservableMap source, MapDiff diff) { Set affectedElements = diff.getChangedKeys(); LabelProviderChangedEvent event = new LabelProviderChangedEvent( ObservableMapLabelProvider.this, affectedElements .toArray()); fireLabelProviderChanged(event); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6aecdb31231a8602dbf72944625703c440949c78/ObservableMapLabelProvider.java/buggy/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/ObservableMapLabelProvider.java
fireLabelProviderChanged(event);
fireLabelProviderChanged(newEvent);
public void handleMapChange(IObservableMap source, MapDiff diff) { Set affectedElements = diff.getChangedKeys(); LabelProviderChangedEvent event = new LabelProviderChangedEvent( ObservableMapLabelProvider.this, affectedElements .toArray()); fireLabelProviderChanged(event); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6aecdb31231a8602dbf72944625703c440949c78/ObservableMapLabelProvider.java/buggy/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/ObservableMapLabelProvider.java
c.getBlockFormattingContext().translate(0,-box.height);
public Box layoutChildren( Context c, Box box ) { //u.p("Layout.layoutChildren: " + box); Element elem = (Element)box.node; // prepare for the list items int old_counter = c.getListCounter(); c.setListCounter( 0 ); // for each child NodeList nl = elem.getChildNodes(); for ( int i = 0; i < nl.getLength(); i++ ) { Node child = nl.item( i ); // get the layout for this child Layout layout = LayoutFactory.getLayout( child ); if ( layout == null ) { continue; } if ( layout instanceof NullLayout ) { continue; } if ( LayoutFactory.isBreak(child)) {//.getNodeName().equals( "br" ) ) { continue; } if ( child.getNodeType() == child.COMMENT_NODE ) { continue; } Box child_box = null; if ( child.getNodeType() == child.ELEMENT_NODE ) { // update the counter for printing OL list items c.setListCounter( c.getListCounter() + 1 ); Element child_elem = (Element)child; // execute the layout and get the return bounds c.parent_box = box; c.placement_point = new Point( 0, box.height ); child_box = layout.layout( c, child_elem ); child_box.list_count = c.getListCounter(); } else { // create anonymous block box // prepare the node list of the text children //child_box = new AnonymousBlockBox(child); // call layout child_box = ( (AnonymousBoxLayout)layout ).layout( c, elem, child ); // skip text children if the prev_child == anonymous block box // because that means they were sucked into this block Node last_node = ( (AnonymousBlockBox)child_box ).last_node; // if anonymous box is only one node wide then skip this // junk if ( child != last_node ) { while ( true ) { i++; Node ch = nl.item( i ); //u.p("trying to skip: " + ch); if ( ch == last_node ) { break; } } } } box.addChild( child_box ); // set the child_box location child_box.x = 0; child_box.y = box.height; //joshy fix the 'fixed' stuff later // if fixed or abs then don't modify the final layout bounds // because fixed elements are removed from normal flow if ( child_box.fixed ) { // put fixed positioning in later } if ( child_box.absolute ) { positionAbsoluteChild(c,child_box); } // skip adjusting the parent box if the child // doesn't affect flow layout if (isOutsideNormalFlow(child_box)) { continue; } // increase the final layout width if the child was greater if ( child_box.width > box.width ) { //u.p("upping: " + box.width + " -> " + child_box.width); box.width = child_box.width; } // increase the final layout height by the height of the child box.height += child_box.height; //u.p("final extents = " + lt); //u.p("final child box was: " + child_box); } c.addMaxWidth( box.width ); c.setListCounter( old_counter ); return box; }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/48f7e8ac56665ccd1af5bb9c78da411ccbc5b8da/DefaultLayout.java/clean/src/java/org/xhtmlrenderer/layout/DefaultLayout.java
setDocument(x.loadDocument(filename),new File(filename).toURL());
URL url = new File(filename).toURL(); setDocument(loadDocument(url),url);
public void setDocument(String filename) throws Exception { setDocument(x.loadDocument(filename),new File(filename).toURL()); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/ea51acfd3b140038df806bfe7c06a86e282673ae/HTMLPanel.java/clean/src/java/org/joshy/html/HTMLPanel.java
Relative.setupRelative(c, new_inline);
public static void layoutContent(Context c, Box box, List contentList) { //Here we should always be inside something that corresponds to a block-level element //for formatting purposes Rectangle bounds = new Rectangle(); bounds.width = c.getExtents().width; validateBounds(bounds); bounds.x = 0; bounds.y = 0; bounds.height = 0; //dummy style to make sure that text nodes don't get extra padding and such //doesn't work here because blocks may be inside inlines, losing inline styling: //c.pushStyle(CascadedStyle.emptyCascadedStyle); int blockLineHeight = FontUtil.lineHeight(c); LineMetrics blockLineMetrics = c.getTextRenderer().getLineMetrics(c.getGraphics(), c.getCurrentFont(), "thequickbrownfoxjumpedoverthelazydogTHEQUICKBROWNFOXJUMPEDOVERTHELAZYDOG"); // prepare remaining width and first linebox int remaining_width = bounds.width; LineBox curr_line = newLine(box, bounds, null, blockLineMetrics); LinkedList pushedOnFirstLine = null; // account for text-indent CalculatedStyle parentStyle = c.getCurrentStyle(); float indent = parentStyle.getFloatPropertyProportionalWidth(CSSName.TEXT_INDENT, remaining_width, c.getCtx()); remaining_width = remaining_width - (int) indent; curr_line.x = curr_line.x + (int) indent; // more setup LineBox prev_line = new LineBox(); prev_line.setParent(box); prev_line.y = bounds.y; prev_line.height = 0; InlineBox prev_inline = null; InlineBox prev_align_inline = null; // adjust the first line for float tabs // skip adjusting for tabs if this box is cleared if (!box.clear_left && !box.clear_right) { remaining_width = FloatUtil.adjustForTab(c, prev_line, remaining_width); } CalculatedStyle currentStyle = parentStyle; boolean isFirstLetter = true; LinkedList pendingPushStyles = null; int pendingLeftPadding = 0; int pendingRightPadding = 0; // loop until no more nodes Iterator contentIter = contentList.iterator(); while (contentIter.hasNext() && !c.shouldStop()) { Object o = contentIter.next(); if (o instanceof FirstLineStyle) {//can actually only be the first object in list box.firstLineStyle = ((FirstLineStyle) o).getStyle(); c.addFirstLineStyle(box.firstLineStyle); continue; } if (o instanceof FirstLetterStyle) {//can actually only be the first or second object in list box.firstLetterStyle = ((FirstLetterStyle) o).getStyle(); continue; } if (o instanceof StylePush) { CascadedStyle cascaded; StylePush sp = (StylePush) o; if (sp.getElement() == null) { //anonymous inline box cascaded = CascadedStyle.emptyCascadedStyle; } else if (sp.getPseudoElement() != null) { cascaded = c.getCss().getPseudoElementStyle(sp.getElement(), sp.getPseudoElement()); } else { cascaded = c.getCss().getCascadedStyle(sp.getElement(), false);//already restyled by ContentUtil } //first push first-line styles if (c.hasFirstLineStyles()) { if (pushedOnFirstLine == null) { pushedOnFirstLine = new LinkedList(); for (Iterator i = c.getFirstLineStyles().iterator(); i.hasNext();) { c.pushStyle((CascadedStyle) i.next()); } } pushedOnFirstLine.addLast(cascaded); } c.pushStyle(cascaded); if (pendingPushStyles == null) { pendingPushStyles = new LinkedList(); } pendingPushStyles.addLast((StylePush) o); Relative.translateRelative(c, false); CalculatedStyle style = c.getCurrentStyle(); int parent_width = bounds.width; Border border = style.getBorderWidth(c.getCtx()); //note: percentages here refer to width of containing block Border margin = style.getMarginWidth(parent_width, parent_width, c.getCtx()); Border padding = style.getPaddingWidth(parent_width, parent_width, c.getCtx()); pendingLeftPadding += margin.left + border.left + padding.left; pendingRightPadding += padding.right + border.right + margin.right; continue; } if (o instanceof StylePop) { if (pendingPushStyles != null && pendingPushStyles.size() != 0) { pendingPushStyles.removeLast();//was a redundant one } else { if (prev_inline == null) { prev_inline = new InlineTextBox();//hope it is decently initialised as empty ((InlineTextBox) prev_inline).setMasterText(""); ((InlineTextBox) prev_inline).start_index = 0; ((InlineTextBox) prev_inline).end_index = 0; curr_line.addChild(prev_inline); } int parent_width = bounds.width; CalculatedStyle style = c.getCurrentStyle(); Border border = style.getBorderWidth(c.getCtx()); //note: percentages here refer to width of containing block Border margin = style.getMarginWidth(parent_width, parent_width, c.getCtx()); Border padding = style.getPaddingWidth(parent_width, parent_width, c.getCtx()); int rp = padding.right + border.right + margin.right; //CHECK: not sure this is where the padding really goes, always prev_inline.rightPadding += rp; pendingRightPadding -= rp; remaining_width -= rp; prev_inline.popstyles++; } if (c.hasFirstLineStyles()) { pushedOnFirstLine.removeLast(); } Relative.untranslateRelative(c, false); c.popStyle(); continue; } Content currentContent = (Content) o; if (currentContent.getStyle() != null) { //first push first-line styles if (c.hasFirstLineStyles()) { if (pushedOnFirstLine == null) { pushedOnFirstLine = new LinkedList(); for (Iterator i = c.getFirstLineStyles().iterator(); i.hasNext();) { c.pushStyle((CascadedStyle) i.next()); } } pushedOnFirstLine.addLast(currentContent.getStyle()); } c.pushStyle(currentContent.getStyle()); } // loop until no more text in this node InlineBox new_inline = null; int start = 0; InlineBlockBox pendingBlockBox = null; do { new_inline = null; if (currentContent instanceof AbsolutelyPositionedContent) { // Uu.p("this might be a problem, but it could just be an absolute block"); // result = new BoxLayout().layout(c,content); Box absolute = Absolute.generateAbsoluteBox(c, currentContent); curr_line.addChild(absolute); break; } // debugging check if (bounds.width < 0) { Uu.p("bounds width = " + bounds.width); Uu.dump_stack(); System.exit(-1); } // the crash warning code if (bounds.width < 1) { Uu.p("warning. width < 1 " + bounds.width); } currentStyle = c.getCurrentStyle(); // look at current inline // break off the longest section that will fit int fit = pendingRightPadding;//Note: this is not necessarily entirely correct if (start == 0) fit += pendingLeftPadding; start = trimLeadingSpace(c, prev_inline, currentContent, start); new_inline = calculateInline(c, currentContent, remaining_width - fit, bounds.width, prev_align_inline, isFirstLetter, box.firstLetterStyle, curr_line, start, pendingBlockBox); pendingBlockBox = null; // if this inline needs to be on a new line if (prev_align_inline != null && new_inline.break_before) { // Uu.p("break before"); remaining_width = bounds.width; saveLine(curr_line, currentStyle, prev_line, bounds, c, box, false, blockLineHeight, pushedOnFirstLine); bounds.height += curr_line.height; prev_line = curr_line; curr_line = newLine(box, bounds, prev_line, blockLineMetrics); // skip adjusting for tabs if this box is cleared if (!box.clear_left && !box.clear_right) { remaining_width = FloatUtil.adjustForTab(c, curr_line, remaining_width); } //have to discard it and recalculate, particularly if this was the first line prev_align_inline.break_after = true; if (new_inline instanceof InlineBlockBox) pendingBlockBox = (InlineBlockBox) new_inline; new_inline = null; continue; } // save the new inline to the list // Uu.p("adding inline child: " + new_inline); //the inline might be set to size 0,0 after this, if it is first whitespace on line. // Cannot discard because it may contain style-pushes curr_line.addInlineChild(c, new_inline); // Uu.p("current line = " + curr_line); if (new_inline instanceof InlineTextBox) { start = ((InlineTextBox) new_inline).end_index; } isFirstLetter = false; new_inline.pushstyles = pendingPushStyles; pendingPushStyles = null; new_inline.leftPadding += pendingLeftPadding; pendingLeftPadding = 0; // calc new height of the line // don't count floats and absolutes if (!new_inline.floated && !new_inline.absolute) { adjustLineHeight(c, curr_line, new_inline); } if (!(currentContent instanceof FloatedBlockContent)) { // calc new width of the line curr_line.contentWidth += new_inline.getWidth(); } // reduce the available width remaining_width = remaining_width - new_inline.getWidth(); // if the last inline was at the end of a line, then go to next line if (new_inline.break_after) { // Uu.p("break after"); // then remaining_width = max_width remaining_width = bounds.width; // save the line saveLine(curr_line, currentStyle, prev_line, bounds, c, box, false, blockLineHeight, pushedOnFirstLine); // increase bounds height to account for the new line bounds.height += curr_line.height; prev_line = curr_line; curr_line = newLine(box, bounds, prev_line, blockLineMetrics); if (!box.clear_left && !box.clear_right) { remaining_width = FloatUtil.adjustForTab(c, curr_line, remaining_width); } } // set the inline to use for left alignment if (!isOutsideFlow(currentContent)) { prev_align_inline = new_inline; } prev_inline = new_inline; } while (new_inline == null || !new_inline.isEndOfParentContent()); if (currentContent.getStyle() != null) { c.popStyle(); if (c.hasFirstLineStyles()) { pushedOnFirstLine.removeLast(); } } } // save the final line saveLine(curr_line, currentStyle, prev_line, bounds, c, box, true, blockLineHeight, pushedOnFirstLine); bounds.height += curr_line.height; if (!c.shrinkWrap()) box.contentWidth = bounds.width; box.height = bounds.height; //box.x = 0; //box.y = 0; // Uu.p("- InlineLayout.layoutContent(): " + box); //pop the dummy style, but no, see above //c.popStyle(); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/2486e0a7d32e8bf7a5ba0aa3c3626b52ad12da3c/InlineBoxing.java/clean/src/java/org/xhtmlrenderer/layout/InlineBoxing.java
new Text(textComposite, SWT.MULTI | SWT.WRAP | SWT.READ_ONLY | SWT.BORDER);
new Text(textComposite, SWT.MULTI | SWT.WRAP | SWT.READ_ONLY | SWT.BORDER | SWT.H_SCROLL);
private void createDescriptionArea(Composite mainComposite) { Composite textComposite = new Composite(mainComposite, SWT.NONE); textComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); GridLayout textLayout = new GridLayout(); textLayout.marginWidth = 0; textLayout.marginHeight = 0; textComposite.setLayout(textLayout); Label descriptionLabel = new Label(textComposite, SWT.NONE); descriptionLabel.setText( WorkbenchMessages.getString("DecoratorsPreferencePage.description")); //$NON-NLS-1$ descriptionText = new Text(textComposite, SWT.MULTI | SWT.WRAP | SWT.READ_ONLY | SWT.BORDER); descriptionText.setLayoutData(new GridData(GridData.FILL_BOTH)); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/8fe9d3fe77a1f30402c3438caca78a9ebc5bffd6/DecoratorsPreferencePage.java/clean/bundles/org.eclipse.ui/Eclipse UI/org/eclipse/ui/internal/dialogs/DecoratorsPreferencePage.java
protected Rectangle getContentAreaEdge(int left, int top, CssContext cssCtx) {
public Rectangle getContentAreaEdge(int left, int top, CssContext cssCtx) {
protected Rectangle getContentAreaEdge(int left, int top, CssContext cssCtx) { return new Rectangle(-viewport.x, -viewport.y, viewport.width, viewport.height); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/2d0418135baea38113aec4c619576083cc381df4/ViewportBox.java/clean/src/java/org/xhtmlrenderer/render/ViewportBox.java
final RubyDateFormat rubyDateFormat = new RubyDateFormat("-", Locale.US);
public RubyString strftime(IRubyObject format) { rubyDateFormat.setCalendar(cal); rubyDateFormat.applyPattern(format.toString()); String result = rubyDateFormat.format(cal.getTime()); return getRuntime().newString(result); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/288f6b347dcd13a4261271562b871b3bb85d1cd1/RubyTime.java/buggy/src/org/jruby/RubyTime.java
viewer = null;
public void dispose() { //no-op }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/cdc590064230a8543dcd910f93596ce961da1d7e/WizardContentProvider.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardContentProvider.java
if (hasChildren(element))
if (!getFiltering() && hasChildren(element))
private void handleChild(Object element, ArrayList list) { if (element instanceof WizardCollectionElement) { if (hasChildren(element)) list.add(element); } else { if (getFiltering() && WorkbenchActivityHelper.filterItem(element)) { return; } list.add(element); } }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/cdc590064230a8543dcd910f93596ce961da1d7e/WizardContentProvider.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardContentProvider.java
if (getFiltering() && WorkbenchActivityHelper.filterItem(element)) { return; }
private void handleChild(Object element, ArrayList list) { if (element instanceof WizardCollectionElement) { if (hasChildren(element)) list.add(element); } else { if (getFiltering() && WorkbenchActivityHelper.filterItem(element)) { return; } list.add(element); } }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/cdc590064230a8543dcd910f93596ce961da1d7e/WizardContentProvider.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardContentProvider.java
this.viewer = viewer;
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { //no-op }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/cdc590064230a8543dcd910f93596ce961da1d7e/WizardContentProvider.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardContentProvider.java
public void handleListChange(IObservableList source, ListDiff diff) {
public void handleListChange(ListChangeEvent event) {
public void handleListChange(IObservableList source, ListDiff diff) { Set added = new HashSet(); Set removed = new HashSet(); ListDiffEntry[] differences = diff.getDifferences(); for (int i = 0; i < differences.length; i++) { ListDiffEntry entry = differences[i]; Object element = entry.getElement(); if (entry.isAddition()) { if (wrappedSet.add(element)) { if (!removed.remove(element)) added.add(element); } } else { if (wrappedSet.remove(element)) { removed.add(element); added.remove(element); } } } fireSetChange(Diffs.createSetDiff(added, removed)); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6aecdb31231a8602dbf72944625703c440949c78/ListToSetAdapter.java/clean/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/ListToSetAdapter.java
ListDiffEntry[] differences = diff.getDifferences();
ListDiffEntry[] differences = event.diff.getDifferences();
public void handleListChange(IObservableList source, ListDiff diff) { Set added = new HashSet(); Set removed = new HashSet(); ListDiffEntry[] differences = diff.getDifferences(); for (int i = 0; i < differences.length; i++) { ListDiffEntry entry = differences[i]; Object element = entry.getElement(); if (entry.isAddition()) { if (wrappedSet.add(element)) { if (!removed.remove(element)) added.add(element); } } else { if (wrappedSet.remove(element)) { removed.add(element); added.remove(element); } } } fireSetChange(Diffs.createSetDiff(added, removed)); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6aecdb31231a8602dbf72944625703c440949c78/ListToSetAdapter.java/clean/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/ListToSetAdapter.java
String variable = ParamUtil.getString(req, "variable");
String id = ParamUtil.getString(req, "id"); String callback = ParamUtil.getString(req, "callback");
protected String getContent(HttpServletRequest req, HttpServletResponse res) throws Exception { String variable = ParamUtil.getString(req, "variable"); JSONObject jsonObj = new JSONObject(); ServletContext ctx = getServletContext(); String script = StringUtil.read( ctx.getResourceAsStream("/click_image.js")); JSONRaw jsonRaw = new JSONRaw(script); jsonObj.put(jsonRaw); return "var " + variable + "=" + jsonObj.toString() + ";\n"; }
57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/b5cc9c4eaf4897f51730cc777f5af4a427b25232/JSONServlet.java/buggy/portlets/sample-json-portlet.war/WEB-INF/src/com/sample/json/servlet/JSONServlet.java
return "var " + variable + "=" + jsonObj.toString() + ";\n";
return callback + "(" + jsonObj.toString() + ");";
protected String getContent(HttpServletRequest req, HttpServletResponse res) throws Exception { String variable = ParamUtil.getString(req, "variable"); JSONObject jsonObj = new JSONObject(); ServletContext ctx = getServletContext(); String script = StringUtil.read( ctx.getResourceAsStream("/click_image.js")); JSONRaw jsonRaw = new JSONRaw(script); jsonObj.put(jsonRaw); return "var " + variable + "=" + jsonObj.toString() + ";\n"; }
57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/b5cc9c4eaf4897f51730cc777f5af4a427b25232/JSONServlet.java/buggy/portlets/sample-json-portlet.war/WEB-INF/src/com/sample/json/servlet/JSONServlet.java
PortletPreferences prefs = AdminUtil.getPreferences(companyId);
PortletPreferences prefs = PrefsPropsUtil.getPreferences(companyId);
public void checkCompany(String companyId) throws PortalException, SystemException { // Company String companyMx = companyId; Date now = new Date(); Company company = null; try { company = CompanyUtil.findByPrimaryKey(companyId); } catch (NoSuchCompanyException nsce) { String portalURL = "localhost"; String homeURL = "localhost"; String name = companyId; String legalName = null; String legalId = null; String legalType = null; String sicCode = null; String tickerSymbol = null; String industry = null; String type = null; String size = null; company = CompanyUtil.create(companyId); try { company.setKeyObj(Encryptor.generateKey()); } catch (EncryptorException ee) { throw new SystemException(ee); } company.setPortalURL(portalURL); company.setHomeURL(homeURL); company.setMx(companyMx); CompanyUtil.update(company); updateCompany( companyId, portalURL, homeURL, companyMx, name, legalName, legalId, legalType, sicCode, tickerSymbol, industry, type, size); // Demo settings if (companyId.equals("liferay.net")) { company = CompanyUtil.findByPrimaryKey(companyId); company.setPortalURL("demo.liferay.net"); company.setHomeURL("demo.liferay.net"); CompanyUtil.update(company); updateSecurity(companyId, Company.AUTH_TYPE_EA, true, true); PortletPreferences prefs = AdminUtil.getPreferences(companyId); try { prefs.setValue("email-from-name", "Liferay Demo"); prefs.setValue("email-from-address", "[email protected]"); prefs.store(); } catch (IOException ioe) { throw new SystemException(ioe); } catch (PortletException pe) { throw new SystemException(pe); } } } // Key checkCompanyKey(companyId); // Default user User defaultUser = null; try { defaultUser = UserLocalServiceUtil.getDefaultUser(companyId); } catch (NoSuchUserException nsue) { defaultUser = UserUtil.create(User.getDefaultUserId(companyId)); defaultUser.setCompanyId(User.DEFAULT); defaultUser.setCreateDate(now); defaultUser.setModifiedDate(now); defaultUser.setPassword("password"); defaultUser.setEmailAddress(User.DEFAULT + "@" + companyMx); defaultUser.setLanguageId(null); defaultUser.setTimeZoneId(null); defaultUser.setGreeting("Welcome!"); defaultUser.setResolution( PropsUtil.get(PropsUtil.DEFAULT_GUEST_LAYOUT_RESOLUTION)); defaultUser.setLoginDate(now); defaultUser.setFailedLoginAttempts(0); defaultUser.setAgreedToTermsOfUse(false); defaultUser.setActive(true); UserUtil.update(defaultUser); // Contact Contact defaultContact = ContactUtil.create( defaultUser.getUserId()); defaultContact.setCompanyId(defaultUser.getCompanyId()); defaultContact.setUserId(defaultUser.getUserId()); defaultContact.setUserName(StringPool.BLANK); defaultContact.setCreateDate(now); defaultContact.setModifiedDate(now); defaultContact.setAccountId(defaultUser.getCompanyId()); defaultContact.setParentContactId( Contact.DEFAULT_PARENT_CONTACT_ID); defaultContact.setFirstName(StringPool.BLANK); defaultContact.setMiddleName(StringPool.BLANK); defaultContact.setLastName(StringPool.BLANK); defaultContact.setMale(true); defaultContact.setBirthday(now); ContactUtil.update(defaultContact); } // System groups GroupLocalServiceUtil.checkSystemGroups(companyId); // System roles RoleLocalServiceUtil.checkSystemRoles(companyId); // Default admin if (UserUtil.countByCompanyId(companyId) == 0) { String creatorUserId = null; boolean autoUserId = true; String userId = StringPool.BLANK; boolean autoPassword = false; String password1 = "test"; String password2 = "test"; boolean passwordReset = false; String emailAddress = "test@" + companyMx; Locale locale = defaultUser.getLocale(); String firstName = "Test"; String middleName = StringPool.BLANK; String lastName = "Test"; String nickName = StringPool.BLANK; String prefixId = StringPool.BLANK; String suffixId = StringPool.BLANK; boolean male = true; int birthdayMonth = Calendar.JANUARY; int birthdayDay = 1; int birthdayYear = 1970; String jobTitle = StringPool.BLANK; String organizationId = null; String locationId = null; if (companyId.equals("liferay.net")) { firstName = "Liferay"; lastName = "Demo"; } User user = UserLocalServiceUtil.addUser( creatorUserId, companyId, autoUserId, userId, autoPassword, password1, password2, passwordReset, emailAddress, locale, firstName, middleName, lastName, nickName, prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear, jobTitle, organizationId, locationId, false); Role adminRole = RoleLocalServiceUtil.getRole( companyId, Role.ADMINISTRATOR); Role powerUserRole = RoleLocalServiceUtil.getRole( companyId, Role.POWER_USER); String[] roleIds = new String[] { adminRole.getRoleId(), powerUserRole.getRoleId() }; RoleLocalServiceUtil.setUserRoles(user.getUserId(), roleIds); } }
57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/58a5501f2dec858b085420e7613b08c0cdc7f24d/CompanyLocalServiceImpl.java/clean/portal-ejb/src/com/liferay/portal/service/impl/CompanyLocalServiceImpl.java
prefs.setValue("email-from-name", "Liferay Demo"); prefs.setValue("email-from-address", "[email protected]");
prefs.setValue( PropsUtil.ADMIN_EMAIL_FROM_NAME, "Liferay Demo"); prefs.setValue( PropsUtil.ADMIN_EMAIL_FROM_ADDRESS, "[email protected]");
public void checkCompany(String companyId) throws PortalException, SystemException { // Company String companyMx = companyId; Date now = new Date(); Company company = null; try { company = CompanyUtil.findByPrimaryKey(companyId); } catch (NoSuchCompanyException nsce) { String portalURL = "localhost"; String homeURL = "localhost"; String name = companyId; String legalName = null; String legalId = null; String legalType = null; String sicCode = null; String tickerSymbol = null; String industry = null; String type = null; String size = null; company = CompanyUtil.create(companyId); try { company.setKeyObj(Encryptor.generateKey()); } catch (EncryptorException ee) { throw new SystemException(ee); } company.setPortalURL(portalURL); company.setHomeURL(homeURL); company.setMx(companyMx); CompanyUtil.update(company); updateCompany( companyId, portalURL, homeURL, companyMx, name, legalName, legalId, legalType, sicCode, tickerSymbol, industry, type, size); // Demo settings if (companyId.equals("liferay.net")) { company = CompanyUtil.findByPrimaryKey(companyId); company.setPortalURL("demo.liferay.net"); company.setHomeURL("demo.liferay.net"); CompanyUtil.update(company); updateSecurity(companyId, Company.AUTH_TYPE_EA, true, true); PortletPreferences prefs = AdminUtil.getPreferences(companyId); try { prefs.setValue("email-from-name", "Liferay Demo"); prefs.setValue("email-from-address", "[email protected]"); prefs.store(); } catch (IOException ioe) { throw new SystemException(ioe); } catch (PortletException pe) { throw new SystemException(pe); } } } // Key checkCompanyKey(companyId); // Default user User defaultUser = null; try { defaultUser = UserLocalServiceUtil.getDefaultUser(companyId); } catch (NoSuchUserException nsue) { defaultUser = UserUtil.create(User.getDefaultUserId(companyId)); defaultUser.setCompanyId(User.DEFAULT); defaultUser.setCreateDate(now); defaultUser.setModifiedDate(now); defaultUser.setPassword("password"); defaultUser.setEmailAddress(User.DEFAULT + "@" + companyMx); defaultUser.setLanguageId(null); defaultUser.setTimeZoneId(null); defaultUser.setGreeting("Welcome!"); defaultUser.setResolution( PropsUtil.get(PropsUtil.DEFAULT_GUEST_LAYOUT_RESOLUTION)); defaultUser.setLoginDate(now); defaultUser.setFailedLoginAttempts(0); defaultUser.setAgreedToTermsOfUse(false); defaultUser.setActive(true); UserUtil.update(defaultUser); // Contact Contact defaultContact = ContactUtil.create( defaultUser.getUserId()); defaultContact.setCompanyId(defaultUser.getCompanyId()); defaultContact.setUserId(defaultUser.getUserId()); defaultContact.setUserName(StringPool.BLANK); defaultContact.setCreateDate(now); defaultContact.setModifiedDate(now); defaultContact.setAccountId(defaultUser.getCompanyId()); defaultContact.setParentContactId( Contact.DEFAULT_PARENT_CONTACT_ID); defaultContact.setFirstName(StringPool.BLANK); defaultContact.setMiddleName(StringPool.BLANK); defaultContact.setLastName(StringPool.BLANK); defaultContact.setMale(true); defaultContact.setBirthday(now); ContactUtil.update(defaultContact); } // System groups GroupLocalServiceUtil.checkSystemGroups(companyId); // System roles RoleLocalServiceUtil.checkSystemRoles(companyId); // Default admin if (UserUtil.countByCompanyId(companyId) == 0) { String creatorUserId = null; boolean autoUserId = true; String userId = StringPool.BLANK; boolean autoPassword = false; String password1 = "test"; String password2 = "test"; boolean passwordReset = false; String emailAddress = "test@" + companyMx; Locale locale = defaultUser.getLocale(); String firstName = "Test"; String middleName = StringPool.BLANK; String lastName = "Test"; String nickName = StringPool.BLANK; String prefixId = StringPool.BLANK; String suffixId = StringPool.BLANK; boolean male = true; int birthdayMonth = Calendar.JANUARY; int birthdayDay = 1; int birthdayYear = 1970; String jobTitle = StringPool.BLANK; String organizationId = null; String locationId = null; if (companyId.equals("liferay.net")) { firstName = "Liferay"; lastName = "Demo"; } User user = UserLocalServiceUtil.addUser( creatorUserId, companyId, autoUserId, userId, autoPassword, password1, password2, passwordReset, emailAddress, locale, firstName, middleName, lastName, nickName, prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear, jobTitle, organizationId, locationId, false); Role adminRole = RoleLocalServiceUtil.getRole( companyId, Role.ADMINISTRATOR); Role powerUserRole = RoleLocalServiceUtil.getRole( companyId, Role.POWER_USER); String[] roleIds = new String[] { adminRole.getRoleId(), powerUserRole.getRoleId() }; RoleLocalServiceUtil.setUserRoles(user.getUserId(), roleIds); } }
57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/58a5501f2dec858b085420e7613b08c0cdc7f24d/CompanyLocalServiceImpl.java/clean/portal-ejb/src/com/liferay/portal/service/impl/CompanyLocalServiceImpl.java
Properties propertiesObj = PropertiesLocalServiceUtil.getPortalProperties(companyId);
PortletPreferences prefs = PrefsPropsUtil.getPreferences(companyId);
public void updateSecurity( String companyId, String authType, boolean autoLogin, boolean strangers) throws PortalException, SystemException { Properties propertiesObj = PropertiesLocalServiceUtil.getPortalProperties(companyId); propertiesObj.setProperty( PropsUtil.COMPANY_SECURITY_AUTH_TYPE, authType); propertiesObj.setProperty( PropsUtil.COMPANY_SECURITY_AUTO_LOGIN, Boolean.toString(autoLogin)); propertiesObj.setProperty( PropsUtil.COMPANY_SECURITY_STRANGERS, Boolean.toString(strangers)); PropertiesLocalServiceUtil.updatePortalProperties( companyId, propertiesObj); }
57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/58a5501f2dec858b085420e7613b08c0cdc7f24d/CompanyLocalServiceImpl.java/clean/portal-ejb/src/com/liferay/portal/service/impl/CompanyLocalServiceImpl.java
propertiesObj.setProperty( PropsUtil.COMPANY_SECURITY_AUTH_TYPE, authType); propertiesObj.setProperty( PropsUtil.COMPANY_SECURITY_AUTO_LOGIN, Boolean.toString(autoLogin)); propertiesObj.setProperty( PropsUtil.COMPANY_SECURITY_STRANGERS, Boolean.toString(strangers));
try { prefs.setValue(PropsUtil.COMPANY_SECURITY_AUTH_TYPE, authType); prefs.setValue( PropsUtil.COMPANY_SECURITY_AUTO_LOGIN, Boolean.toString(autoLogin)); prefs.setValue( PropsUtil.COMPANY_SECURITY_STRANGERS, Boolean.toString(strangers));
public void updateSecurity( String companyId, String authType, boolean autoLogin, boolean strangers) throws PortalException, SystemException { Properties propertiesObj = PropertiesLocalServiceUtil.getPortalProperties(companyId); propertiesObj.setProperty( PropsUtil.COMPANY_SECURITY_AUTH_TYPE, authType); propertiesObj.setProperty( PropsUtil.COMPANY_SECURITY_AUTO_LOGIN, Boolean.toString(autoLogin)); propertiesObj.setProperty( PropsUtil.COMPANY_SECURITY_STRANGERS, Boolean.toString(strangers)); PropertiesLocalServiceUtil.updatePortalProperties( companyId, propertiesObj); }
57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/58a5501f2dec858b085420e7613b08c0cdc7f24d/CompanyLocalServiceImpl.java/clean/portal-ejb/src/com/liferay/portal/service/impl/CompanyLocalServiceImpl.java
PropertiesLocalServiceUtil.updatePortalProperties( companyId, propertiesObj);
prefs.store(); } catch (IOException ioe) { throw new SystemException(ioe); } catch (PortletException pe) { throw new SystemException(pe); }
public void updateSecurity( String companyId, String authType, boolean autoLogin, boolean strangers) throws PortalException, SystemException { Properties propertiesObj = PropertiesLocalServiceUtil.getPortalProperties(companyId); propertiesObj.setProperty( PropsUtil.COMPANY_SECURITY_AUTH_TYPE, authType); propertiesObj.setProperty( PropsUtil.COMPANY_SECURITY_AUTO_LOGIN, Boolean.toString(autoLogin)); propertiesObj.setProperty( PropsUtil.COMPANY_SECURITY_STRANGERS, Boolean.toString(strangers)); PropertiesLocalServiceUtil.updatePortalProperties( companyId, propertiesObj); }
57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/58a5501f2dec858b085420e7613b08c0cdc7f24d/CompanyLocalServiceImpl.java/clean/portal-ejb/src/com/liferay/portal/service/impl/CompanyLocalServiceImpl.java
public void handleSetChange(IObservableSet source, SetDiff diff) {
public void handleSetChange(SetChangeEvent event) {
public void handleSetChange(IObservableSet source, SetDiff diff) { if (!updating) { fireSetChange(diff); } }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6aecdb31231a8602dbf72944625703c440949c78/DetailObservableSet.java/clean/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/masterdetail/DetailObservableSet.java
fireSetChange(diff);
fireSetChange(event.diff);
public void handleSetChange(IObservableSet source, SetDiff diff) { if (!updating) { fireSetChange(diff); } }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6aecdb31231a8602dbf72944625703c440949c78/DetailObservableSet.java/clean/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/masterdetail/DetailObservableSet.java
public void handleValueChange(IObservableValue source, ValueDiff diff) {
public void handleValueChange(ValueChangeEvent event) {
public void handleValueChange(IObservableValue source, ValueDiff diff) { Set oldSet = new HashSet(wrappedSet); updateInnerObservableValue(outerObservableValue); fireSetChange(Diffs.computeSetDiff(oldSet, wrappedSet)); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6aecdb31231a8602dbf72944625703c440949c78/DetailObservableSet.java/clean/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/masterdetail/DetailObservableSet.java
model.setEditorSelectedPane(0);
model.setEditorSelectedPane(Editor.PROPERTIES_INDEX);
public void propertyChange(PropertyChangeEvent pce) { String name = pce.getPropertyName(); if (name == null) return; if (name.equals(TreeViewer.CANCEL_LOADING_PROPERTY)) { Browser browser = model.getSelectedBrowser(); if (browser != null) browser.cancel(); } else if (name.equals(Browser.POPUP_MENU_PROPERTY)) { Component c = (Component) pce.getNewValue(); Browser browser = model.getSelectedBrowser(); if (browser != null && c != null) view.showPopup(c, browser.getClickPoint()); } else if (name.equals(Browser.CLOSE_PROPERTY)) { Browser browser = (Browser) pce.getNewValue(); if (browser != null) view.removeBrowser(browser); } else if (name.equals(Editor.CLOSE_EDITOR_PROPERTY)) { Browser b = model.getSelectedBrowser(); TreeImageDisplay d = null; if (b != null) d = b.getLastSelectedDisplay(); int editorType = model.getEditorType(); model.removeEditor(); model.onComponentStateChange(true); if (editorType == TreeViewer.CREATE_EDITOR) resetSelectedDisplay(d); } else if (name.equals(Classifier.CLOSE_CLASSIFIER_PROPERTY)) { Browser b = model.getSelectedBrowser(); if (b != null) resetSelectedDisplay(b.getLastSelectedDisplay()); model.onComponentStateChange(true); } else if (name.equals(TreeViewer.FINDER_VISIBLE_PROPERTY)) { Boolean b = (Boolean) pce.getNewValue(); if (!b.booleanValue()) { model.clearFoundResults(); model.onComponentStateChange(true); } } else if (name.equals(TreeViewer.SELECTED_BROWSER_PROPERTY)) { Browser b = model.getSelectedBrowser(); Iterator i = model.getBrowsers().values().iterator(); Browser browser; while (i.hasNext()) { browser = (Browser) i.next(); browser.setSelected(browser.equals(b)); } } else if (name.equals(TreeViewer.THUMBNAIL_LOADING_PROPERTY)) { model.retrieveThumbnail((ImageData) pce.getNewValue()); } else if (name.equals(Browser.SELECTED_DISPLAY_PROPERTY)) { Object oldValue = pce.getOldValue(); Object newValue = pce.getNewValue(); if (oldValue != null && newValue != null) { if (!(oldValue.getClass().equals(newValue.getClass()))) model.setEditorSelectedPane(0); } model.onSelectedDisplay(); } else if (name.equals(TreeViewer.HIERARCHY_ROOT_PROPERTY)) { Map browsers = model.getBrowsers(); Iterator i = browsers.values().iterator(); while (i.hasNext()) ((Browser) i.next()).refreshTree(); } else if (name.equals( AddExistingObjectsDialog.EXISTING_ADD_PROPERTY)) { model.addExistingObjects((Set) pce.getNewValue()); } else if (name.equals(EditorSaverDialog.SAVING_DATA_EDITOR_PROPERTY)) { boolean b = ((Boolean) pce.getNewValue()).booleanValue(); model.saveInEditor(b); } else if (name.equals(DataHandler.ANNOTATED_PROPERTY) || name.equals(DataHandler.CLASSIFIED_PROPERTY)) { if (view.getDataHandler() == null) return; view.discardDataHandler(); Map browsers = model.getBrowsers(); Iterator i = browsers.values().iterator(); while (i.hasNext()) ((Browser) i.next()).refreshTree(); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/TreeViewerControl.java/buggy/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewerControl.java
public void addExistingObjects(Set set);
public void addExistingObjects(DataObject ho);
public void addExistingObjects(Set set);
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/TreeViewer.java/buggy/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewer.java
statusBar.setStatusIcon( b);
statusBar.setStatusIcon(b);
void setStatusIcon(boolean b) { if (b) setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); else setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); statusBar.setStatusIcon( b); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/146920a8791fff71320ced0f240b9d8f3d319a13/TreeViewerWin.java/buggy/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewerWin.java
public ClassifyCmd(HiViewer model, int mode) { this(getImages(model), mode, model.getUI(), model.getUserDetails().getId(), model.getRootID());
public ClassifyCmd(ImageData[] images, int mode, JFrame owner, long userID, long groupID) { if (owner == null) throw new NullPointerException("No owner."); this.images = images; this.mode = mode; this.owner = owner; this.userID = userID; this.groupID = groupID;
public ClassifyCmd(HiViewer model, int mode) { this(getImages(model), mode, model.getUI(), model.getUserDetails().getId(), model.getRootID()); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/947238c0240434ee7f77d0f2ecbd324bcbdfb460/ClassifyCmd.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/cmd/ClassifyCmd.java
index++;
private static ImageData[] getImages(HiViewer model) { ImageData[] images = null; if (model != null) { Set nodes = model.getBrowser().getSelectedDisplays(); if (nodes != null) { Iterator i = nodes.iterator(); Object x; images = new ImageData[nodes.size()]; int index = 0; while (i.hasNext()) { x = ((ImageDisplay) i.next()).getHierarchyObject(); if (x instanceof ImageData) { images[index] = (ImageData) x; index++; } index++; } } } return images; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/947238c0240434ee7f77d0f2ecbd324bcbdfb460/ClassifyCmd.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/cmd/ClassifyCmd.java
SwingWorker worker = new SwingWorker() {
if (!(room instanceof ChatRoomImpl)) { return; } final SwingWorker userLoadingThread = new SwingWorker() {
private void loadUserInformation(final ChatRoom room, final String participantJID) { SwingWorker worker = new SwingWorker() { public Object construct() { return SparkManager.getVCardManager().getVCard(participantJID); } public void finished() { final VCard vcard = (VCard)get(); if (vcard == null) { // Do nothing. return; } // Add VCard Panel final VCardPanel vcardPanel = new VCardPanel(vcard, participantJID); room.getToolBar().add(vcardPanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); scrollOnTimer(room); } }; worker.start(); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/f678f06c6fbc4a84079c230a0a7461759cb20755/ChatTranscriptPlugin.java/buggy/src/java/org/jivesoftware/sparkimpl/plugin/transcripts/ChatTranscriptPlugin.java
worker.start();
userLoadingThread.start();
private void loadUserInformation(final ChatRoom room, final String participantJID) { SwingWorker worker = new SwingWorker() { public Object construct() { return SparkManager.getVCardManager().getVCard(participantJID); } public void finished() { final VCard vcard = (VCard)get(); if (vcard == null) { // Do nothing. return; } // Add VCard Panel final VCardPanel vcardPanel = new VCardPanel(vcard, participantJID); room.getToolBar().add(vcardPanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); scrollOnTimer(room); } }; worker.start(); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/f678f06c6fbc4a84079c230a0a7461759cb20755/ChatTranscriptPlugin.java/buggy/src/java/org/jivesoftware/sparkimpl/plugin/transcripts/ChatTranscriptPlugin.java
final JScrollPane pane = new JScrollPane(browser); pane.setBorder(null); add(pane, BorderLayout.CENTER);
add(browser, BorderLayout.CENTER); browser.setMinimumSize(new Dimension(0, 0));
public TranscriptWindow() { setLayout(new BorderLayout()); themeManager = ThemeManager.getInstance(); vcardManager = SparkManager.getVCardManager(); extraPanel = new JPanel(); browser = new WebBrowser(); browser.setURL(themeManager.getTemplateURL()); browser.addWebBrowserListener(new WebBrowserListener() { public void downloadStarted(WebBrowserEvent webBrowserEvent) { } public void downloadCompleted(WebBrowserEvent webBrowserEvent) { } public void downloadProgress(WebBrowserEvent webBrowserEvent) { } public void downloadError(WebBrowserEvent webBrowserEvent) { } public void documentCompleted(WebBrowserEvent webBrowserEvent) { documentLoaded = true; } public void titleChange(WebBrowserEvent webBrowserEvent) { } public void statusTextChange(WebBrowserEvent webBrowserEvent) { } public void initializationCompleted(WebBrowserEvent webBrowserEvent) { } }); final JScrollPane pane = new JScrollPane(browser); pane.setBorder(null); add(pane, BorderLayout.CENTER); extraPanel.setBackground(Color.white); extraPanel.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false)); add(extraPanel, BorderLayout.SOUTH); startCommandListener(); browser.setFocusable(false); this.setFocusable(false); setBorder(null); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/ad8343da83861b145373d811238d8e2939352153/TranscriptWindow.java/buggy/src/java/org/jivesoftware/spark/ui/TranscriptWindow.java
public VCard getVCard(String jid) { if (!vcardMap.containsKey(jid)) { VCard vcard = new VCard();
public VCard getVCard() { if (!vcardLoaded) {
public VCard getVCard(String jid) { if (!vcardMap.containsKey(jid)) { VCard vcard = new VCard(); try { vcard.load(SparkManager.getConnection(), jid); vcardMap.put(jid, vcard); } catch (XMPPException e) { Log.warning("Unable to load vcard for " + jid, e); vcard.setError(new XMPPError(409)); } } return (VCard)vcardMap.get(jid); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/0807e1b794eeaa6c07d31a5c351697146a85040b/VCardManager.java/buggy/src/java/org/jivesoftware/sparkimpl/profile/VCardManager.java
vcard.load(SparkManager.getConnection(), jid); vcardMap.put(jid, vcard);
vcard.load(SparkManager.getConnection());
public VCard getVCard(String jid) { if (!vcardMap.containsKey(jid)) { VCard vcard = new VCard(); try { vcard.load(SparkManager.getConnection(), jid); vcardMap.put(jid, vcard); } catch (XMPPException e) { Log.warning("Unable to load vcard for " + jid, e); vcard.setError(new XMPPError(409)); } } return (VCard)vcardMap.get(jid); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/0807e1b794eeaa6c07d31a5c351697146a85040b/VCardManager.java/buggy/src/java/org/jivesoftware/sparkimpl/profile/VCardManager.java
Log.warning("Unable to load vcard for " + jid, e); vcard.setError(new XMPPError(409));
public VCard getVCard(String jid) { if (!vcardMap.containsKey(jid)) { VCard vcard = new VCard(); try { vcard.load(SparkManager.getConnection(), jid); vcardMap.put(jid, vcard); } catch (XMPPException e) { Log.warning("Unable to load vcard for " + jid, e); vcard.setError(new XMPPError(409)); } } return (VCard)vcardMap.get(jid); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/0807e1b794eeaa6c07d31a5c351697146a85040b/VCardManager.java/buggy/src/java/org/jivesoftware/sparkimpl/profile/VCardManager.java
return (VCard)vcardMap.get(jid);
return vcard;
public VCard getVCard(String jid) { if (!vcardMap.containsKey(jid)) { VCard vcard = new VCard(); try { vcard.load(SparkManager.getConnection(), jid); vcardMap.put(jid, vcard); } catch (XMPPException e) { Log.warning("Unable to load vcard for " + jid, e); vcard.setError(new XMPPError(409)); } } return (VCard)vcardMap.get(jid); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/0807e1b794eeaa6c07d31a5c351697146a85040b/VCardManager.java/buggy/src/java/org/jivesoftware/sparkimpl/profile/VCardManager.java
public void addArticleViews(IWBundle bundle){ ContentViewManager cViewManager = ContentViewManager.getInstance(bundle.getApplication()); ViewNode contentNode = cViewManager.getContentNode(); DefaultViewNode articleNode = new DefaultViewNode("article",contentNode); articleNode.setJspUri(bundle.getJSPURI("createarticle.jsp")); articleNode.setKeyboardShortcut(new KeyboardShortcut("a")); articleNode.setName("#{localizedStrings['com.idega.block.article']['article']}"); DefaultViewNode createNewArticleNode = new DefaultViewNode("create",articleNode); String jspUri = bundle.getJSPURI("createarticle.jsp"); createNewArticleNode.setJspUri(jspUri); createNewArticleNode.setName("#{localizedStrings['com.idega.block.article']['create_article']}"); DefaultViewNode editNewArticleNode = new DefaultViewNode("edit",articleNode);// editNewArticleNode.setJspUri(bundle.getJSPURI("createarticle.jsp")); editNewArticleNode.setJspUri(bundle.getJSPURI("editarticle.jsp")); editNewArticleNode.setVisibleInMenus(false); editNewArticleNode.setName("#{localizedStrings['com.idega.block.article']['edit']}"); DefaultViewNode listArticlesNode = new DefaultViewNode("list",articleNode); listArticlesNode.setJspUri(bundle.getJSPURI("listarticles.jsp")); listArticlesNode.setName("#{localizedStrings['com.idega.block.article']['list_articles']}"); DefaultViewNode previewArticlesNode = new DefaultViewNode("preview",articleNode); previewArticlesNode.setJspUri(bundle.getJSPURI("previewarticle.jsp")); previewArticlesNode.setVisibleInMenus(false); previewArticlesNode.setName("#{localizedStrings['com.idega.block.article']['preview']}"); DefaultViewNode searchArticlesNode = new DefaultViewNode("search",articleNode); searchArticlesNode.setJspUri(bundle.getJSPURI("searcharticle.jsp")); searchArticlesNode.setName("#{localizedStrings['com.idega.block.article']['search_articles']}"); //searchArticlesNode.setVisibleInMenus(false); }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/5db26355cf68616cbd8859fa37cd6aa73d783808/IWBundleStarter.java/buggy/src/java/com/idega/block/article/IWBundleStarter.java
DefaultViewNode deleteArticleNode = new DefaultViewNode("delete",articleNode); deleteArticleNode.setJspUri(bundle.getJSPURI("deletearticle.jsp")); deleteArticleNode.setVisibleInMenus(false); deleteArticleNode.setName("#{localizedStrings['com.idega.block.article']['delete']}");
public void addArticleViews(IWBundle bundle){ ContentViewManager cViewManager = ContentViewManager.getInstance(bundle.getApplication()); ViewNode contentNode = cViewManager.getContentNode(); DefaultViewNode articleNode = new DefaultViewNode("article",contentNode); articleNode.setJspUri(bundle.getJSPURI("createarticle.jsp")); articleNode.setKeyboardShortcut(new KeyboardShortcut("a")); articleNode.setName("#{localizedStrings['com.idega.block.article']['article']}"); DefaultViewNode createNewArticleNode = new DefaultViewNode("create",articleNode); String jspUri = bundle.getJSPURI("createarticle.jsp"); createNewArticleNode.setJspUri(jspUri); createNewArticleNode.setName("#{localizedStrings['com.idega.block.article']['create_article']}"); DefaultViewNode editNewArticleNode = new DefaultViewNode("edit",articleNode);// editNewArticleNode.setJspUri(bundle.getJSPURI("createarticle.jsp")); editNewArticleNode.setJspUri(bundle.getJSPURI("editarticle.jsp")); editNewArticleNode.setVisibleInMenus(false); editNewArticleNode.setName("#{localizedStrings['com.idega.block.article']['edit']}"); DefaultViewNode listArticlesNode = new DefaultViewNode("list",articleNode); listArticlesNode.setJspUri(bundle.getJSPURI("listarticles.jsp")); listArticlesNode.setName("#{localizedStrings['com.idega.block.article']['list_articles']}"); DefaultViewNode previewArticlesNode = new DefaultViewNode("preview",articleNode); previewArticlesNode.setJspUri(bundle.getJSPURI("previewarticle.jsp")); previewArticlesNode.setVisibleInMenus(false); previewArticlesNode.setName("#{localizedStrings['com.idega.block.article']['preview']}"); DefaultViewNode searchArticlesNode = new DefaultViewNode("search",articleNode); searchArticlesNode.setJspUri(bundle.getJSPURI("searcharticle.jsp")); searchArticlesNode.setName("#{localizedStrings['com.idega.block.article']['search_articles']}"); //searchArticlesNode.setVisibleInMenus(false); }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/5db26355cf68616cbd8859fa37cd6aa73d783808/IWBundleStarter.java/buggy/src/java/com/idega/block/article/IWBundleStarter.java
ArticleDocument articleDoc = ArticleDocument.Factory.newInstance(); ArticleDocument.Article article = articleDoc.addNewArticle();
public Boolean store() { boolean storeOk = true; clearErrorKeys(); if (getHeadline().trim().equals("")) { addErrorKey(KEY_ERROR_HEADLINE_EMPTY); storeOk = false; } if (getBody().trim().equals("")) { addErrorKey(KEY_ERROR_BODY_EMPTY); storeOk = false; } if (getRequestedStatus() != null && getRequestedStatus().equals(ContentItemCase.STATUS_PUBLISHED)) { if (getCase().getPublishedFromDate() == null) { addErrorKey(KEY_ERROR_PUBLISHED_FROM_DATE_EMPTY); storeOk = false; } } if (storeOk) { if (getRequestedStatus() != null) { setStatus(getRequestedStatus()); setRequestedStatus(null); } } return new Boolean(storeOk); }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/2cd921b37179b60f73b08e496f3539f6703ee5c0/ArticleItemBean.java/clean/src/java/com/idega/block/article/bean/ArticleItemBean.java
public Boolean store() { boolean storeOk = true; clearErrorKeys(); if (getHeadline().trim().equals("")) { addErrorKey(KEY_ERROR_HEADLINE_EMPTY); storeOk = false; } if (getBody().trim().equals("")) { addErrorKey(KEY_ERROR_BODY_EMPTY); storeOk = false; } if (getRequestedStatus() != null && getRequestedStatus().equals(ContentItemCase.STATUS_PUBLISHED)) { if (getCase().getPublishedFromDate() == null) { addErrorKey(KEY_ERROR_PUBLISHED_FROM_DATE_EMPTY); storeOk = false; } } if (storeOk) { if (getRequestedStatus() != null) { setStatus(getRequestedStatus()); setRequestedStatus(null); } } return new Boolean(storeOk); }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/2cd921b37179b60f73b08e496f3539f6703ee5c0/ArticleItemBean.java/clean/src/java/com/idega/block/article/bean/ArticleItemBean.java
return Collections.EMPTY_LIST;
return EMPTY_LIST;
public List childNodes() { return Collections.EMPTY_LIST; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b1293eda8454686e846e2a9837b348e2983bb423/RetryNode.java/clean/src/org/jruby/ast/RetryNode.java
ZYPlane(byte[] data, PlaneDef pDef, int sizeX, int sizeY, int bytesPerPixel, BytesConverter strategy)
ZYPlane(PlaneDef pDef, Pixels pixels, MappedByteBuffer data)
ZYPlane(byte[] data, PlaneDef pDef, int sizeX, int sizeY, int bytesPerPixel, BytesConverter strategy) { super(data, pDef, sizeX, sizeY, bytesPerPixel, strategy); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b2d1563defffc9fa654271400d754843f42e2810/ZYPlane.java/buggy/components/rendering/src/omeis/providers/re/data/ZYPlane.java
super(data, pDef, sizeX, sizeY, bytesPerPixel, strategy);
super(pDef, pixels, data);
ZYPlane(byte[] data, PlaneDef pDef, int sizeX, int sizeY, int bytesPerPixel, BytesConverter strategy) { super(data, pDef, sizeX, sizeY, bytesPerPixel, strategy); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b2d1563defffc9fa654271400d754843f42e2810/ZYPlane.java/buggy/components/rendering/src/omeis/providers/re/data/ZYPlane.java
protected Plane2D(byte[] data, PlaneDef pDef, int sizeX, int sizeY, int bytesPerPixel, BytesConverter strategy)
protected Plane2D(PlaneDef pDef, Pixels pixels, MappedByteBuffer data)
protected Plane2D(byte[] data, PlaneDef pDef, int sizeX, int sizeY, int bytesPerPixel, BytesConverter strategy) { this.data = data; this.planeDef = pDef; this.sizeX = sizeX; this.sizeY = sizeY; this.bytesPerPixel = bytesPerPixel; this.strategy = strategy; log.info("Created Plane2D with dimensions " + sizeX + "x" + sizeY + "x" + bytesPerPixel); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b2d1563defffc9fa654271400d754843f42e2810/Plane2D.java/buggy/components/rendering/src/omeis/providers/re/data/Plane2D.java
this.planeDef = pDef; this.sizeX = sizeX; this.sizeY = sizeY; this.bytesPerPixel = bytesPerPixel; this.strategy = strategy;
this.data.order(ByteOrder.LITTLE_ENDIAN); PixelsType type = pixels.getPixelsType(); this.bytesPerPixel = PlaneFactory.bytesPerPixel(type); this.javaType = PlaneFactory.javaType(type);
protected Plane2D(byte[] data, PlaneDef pDef, int sizeX, int sizeY, int bytesPerPixel, BytesConverter strategy) { this.data = data; this.planeDef = pDef; this.sizeX = sizeX; this.sizeY = sizeY; this.bytesPerPixel = bytesPerPixel; this.strategy = strategy; log.info("Created Plane2D with dimensions " + sizeX + "x" + sizeY + "x" + bytesPerPixel); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b2d1563defffc9fa654271400d754843f42e2810/Plane2D.java/buggy/components/rendering/src/omeis/providers/re/data/Plane2D.java
private void buildEmptyPanel() { if (emptyMessagePanel != null) return; emptyMessagePanel = new JPanel(); emptyMessagePanel.setBorder( BorderFactory.createLineBorder(Color.BLACK)); Rectangle r = titlePanel.getBounds(); emptyMessagePanel.setLayout(new BoxLayout(emptyMessagePanel, BoxLayout.X_AXIS)); IconManager im = IconManager.getInstance(); JLabel label = new JLabel(im.getIcon(IconManager.ERROR)); emptyMessagePanel.add(label); int w = label.getWidth(); label = new JLabel(EMPTY_MSG); int h = label.getFontMetrics(label.getFont()).getHeight(); w += EMPTY_MSG.length()*getFontMetrics(getFont()).charWidth('m'); emptyMessagePanel.add(label); Insets i = emptyMessagePanel.getInsets(); h += i.top+i.bottom+2; emptyMessagePanel.setBounds(0, r.height-h, w, h); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3e61288608c35981cf31d6efdc892bc088b005bd/EditorUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/treeviewer/editors/EditorUI.java
titleLayer.add(titlePanel, 0);
titleLayer.add(titlePanel, new Integer(0));
private void buildTitlePanel() { IconManager im = IconManager.getInstance(); switch (model.getEditorType()) { case Editor.CREATE_EDITOR: titlePanel = new TitlePanel(message, "Create a new "+ message.toLowerCase()+".", im.getIcon(IconManager.CREATE_BIG)); break; case Editor.PROPERTIES_EDITOR: titlePanel = new TitlePanel(message, "Edit the "+ message.toLowerCase()+": "+ model.getDataObjectName(), im.getIcon(IconManager.PROPERTIES_BIG)); } titleLayer.add(titlePanel, 0); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3e61288608c35981cf31d6efdc892bc088b005bd/EditorUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/treeviewer/editors/EditorUI.java
titleLayer.add(emptyMessagePanel, 1);
titleLayer.add(emptyMessagePanel, new Integer(1));
void handleEmptyNameArea() { warning = true; finishButton.setEnabled(false); buildEmptyPanel(); titleLayer.add(emptyMessagePanel, 1); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3e61288608c35981cf31d6efdc892bc088b005bd/EditorUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/treeviewer/editors/EditorUI.java
List getAnnotations(long ownerID) { return (List) annotations.get(new Long(ownerID)); }
Map getAnnotations() { return annotations; }
List getAnnotations(long ownerID) { return (List) annotations.get(new Long(ownerID)); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/43f8c678f03aa7cac6a19865461c28a00cf7eb2b/EditorModel.java/buggy/SRC/org/openmicroscopy/shoola/agents/treeviewer/editors/EditorModel.java
DOInfo(Map details, EditorModel model)
DOInfo(Map details, EditorModel model, boolean permission)
DOInfo(Map details, EditorModel model) { if (details == null) throw new IllegalArgumentException("Visualization map cannot be" + " null"); if (model == null) throw new IllegalArgumentException("No model."); this.model = model; buildGUI(details, null); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0f24af159634bdc4228febad328548fbedecdb1d/DOInfo.java/buggy/SRC/org/openmicroscopy/shoola/agents/treeviewer/editors/DOInfo.java
buildGUI(details, null);
buildGUI(details, permission);
DOInfo(Map details, EditorModel model) { if (details == null) throw new IllegalArgumentException("Visualization map cannot be" + " null"); if (model == null) throw new IllegalArgumentException("No model."); this.model = model; buildGUI(details, null); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0f24af159634bdc4228febad328548fbedecdb1d/DOInfo.java/buggy/SRC/org/openmicroscopy/shoola/agents/treeviewer/editors/DOInfo.java
data = null;
static Map transformPixelsData(PixelsData data) { LinkedHashMap details = new LinkedHashMap(8); if (data == null) { details.put(SIZE_X, ""); details.put(SIZE_Y, ""); details.put(PIXEL_SIZE_X, ""); details.put(PIXEL_SIZE_Y, ""); details.put(PIXEL_SIZE_Z, ""); details.put(SECTIONS, ""); details.put(TIMEPOINTS, ""); //details.put("Emission wavelength", ""); details.put(PIXEL_TYPE, ""); } else { NumberFormat nf = NumberFormat.getInstance(); details.put(SIZE_X, ""+data.getSizeX()); details.put(SIZE_Y, ""+data.getSizeY()); details.put(PIXEL_SIZE_X, nf.format(data.getPixelSizeX())); details.put(PIXEL_SIZE_Y, nf.format(data.getPixelSizeY())); details.put(PIXEL_SIZE_Z, nf.format(data.getPixelSizeZ())); details.put(SECTIONS, ""+data.getSizeZ()); details.put(TIMEPOINTS, ""+data.getSizeT()); //details.put("Emission wavelength", ""); details.put(PIXEL_TYPE, ""+data.getPixelType()); } return details; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/19e616f1a21d8d2e1618b2797311c5290179232c/EditorUtil.java/buggy/SRC/org/openmicroscopy/shoola/agents/treeviewer/editors/EditorUtil.java
addResult(((RubyString) matchData.group(i)).getValue());
IRubyObject matchValue = matchData.group(i); if (!matchValue.isNil()) { addResult(((RubyString) matchValue).getValue()); }
private void process() { if (limit == 1) { result.add(splitee); return; } int last = 0; int beg = 0; int hits = 0; int len = splitee.length(); while ((beg = pattern.searchAgain(splitee)) > -1) { hits++; RubyMatchData matchData = (RubyMatchData) runtime.getCurrentContext().getBackref(); int end = matchData.matchEndPosition(); // Skip first positive lookahead match if (beg == 0 && beg == end) { continue; } // Whitespace splits are supposed to ignore leading whitespace if (beg != 0 || !isWhitespace) { addResult(substring(splitee, last, (beg == last && end == beg) ? 1 : beg - last)); // Add to list any /(.)/ matched. long extraPatterns = matchData.getSize(); for (int i = 1; i < extraPatterns; i++) { addResult(((RubyString) matchData.group(i)).getValue()); } } last = end; if (hits + 1 == limit) { break; } } if (hits == 0) { addResult(splitee); } else if (last <= len) { addResult(substring(splitee, last, len - last)); } if (limit == 0 && result.size() > 0) { for (int size = result.size() - 1; size >= 0 && ((String) result.get(size)).length() == 0; size--) { result.remove(size); } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/77268b2ba9287b3c288cd7a953725815a97cd0d4/Split.java/buggy/src/org/jruby/util/Split.java
public RaiseException newArgumentError(int got, int expected);
public RaiseException newArgumentError(String message);
public RaiseException newArgumentError(int got, int expected);
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/IRuby.java/buggy/src/org/jruby/IRuby.java
return scriptFileName;
return getScriptFileName();
public String displayedFileName() { if (hasInlineScript()) { return "-e"; } else if (isSourceFromStdin()) { return "-"; } else { return scriptFileName; } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7fc9704f263fb0e26619a38cdcd58fae7692e4da/CommandlineParser.java/clean/src/org/jruby/util/CommandlineParser.java
File file = new File(scriptFileName);
File file = new File(getScriptFileName());
public Reader getScriptSource() { if (hasInlineScript()) { return new StringReader(inlineScript()); } else if (isSourceFromStdin()) { return new InputStreamReader(System.in); } else { File file = new File(scriptFileName); try { return new BufferedReader(new FileReader(file)); } catch (IOException e) { System.err.println("Error opening script file: " + e.getMessage()); System.exit(1); } } assert false; return null; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7fc9704f263fb0e26619a38cdcd58fae7692e4da/CommandlineParser.java/clean/src/org/jruby/util/CommandlineParser.java
return scriptFileName == null;
return getScriptFileName() == null;
private boolean isSourceFromStdin() { return scriptFileName == null; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7fc9704f263fb0e26619a38cdcd58fae7692e4da/CommandlineParser.java/clean/src/org/jruby/util/CommandlineParser.java
isBenchmarking = true;
benchmarking = true;
private void processArgument() { String argument = arguments[argumentIndex]; FOR : for (characterIndex = 1; characterIndex < argument.length(); characterIndex++) { switch (argument.charAt(characterIndex)) { case 'h' : Main.printUsage(); break; case 'I' : loadPaths.add(grabValue(" -I must be followed by a directory name to add to lib path")); break FOR; case 'r' : requiredLibraries.add(grabValue("-r must be followed by a package to require")); break FOR; case 'e' : inlineScript.append(grabValue(" -e must be followed by an expression to evaluate")); inlineScript.append('\n'); break FOR; case 'b' : isBenchmarking = true; break; case 'p' : assumePrinting = true; assumeLoop = true; break; case 'n' : assumeLoop = true; break; case 'a' : sDoSplit = true; break; case 'l' : processLineEnds = true; break; case 'v' : showVersion = true; verbose = true; break; case 'w' : verbose = true; break; case '-' : if (argument.equals("--version")) { showVersion = true; shouldRunInterpreter = false; break FOR; } default : System.err.println("unknown option " + argument.charAt(characterIndex)); System.exit(1); } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7fc9704f263fb0e26619a38cdcd58fae7692e4da/CommandlineParser.java/clean/src/org/jruby/util/CommandlineParser.java
sDoSplit = true;
split = true;
private void processArgument() { String argument = arguments[argumentIndex]; FOR : for (characterIndex = 1; characterIndex < argument.length(); characterIndex++) { switch (argument.charAt(characterIndex)) { case 'h' : Main.printUsage(); break; case 'I' : loadPaths.add(grabValue(" -I must be followed by a directory name to add to lib path")); break FOR; case 'r' : requiredLibraries.add(grabValue("-r must be followed by a package to require")); break FOR; case 'e' : inlineScript.append(grabValue(" -e must be followed by an expression to evaluate")); inlineScript.append('\n'); break FOR; case 'b' : isBenchmarking = true; break; case 'p' : assumePrinting = true; assumeLoop = true; break; case 'n' : assumeLoop = true; break; case 'a' : sDoSplit = true; break; case 'l' : processLineEnds = true; break; case 'v' : showVersion = true; verbose = true; break; case 'w' : verbose = true; break; case '-' : if (argument.equals("--version")) { showVersion = true; shouldRunInterpreter = false; break FOR; } default : System.err.println("unknown option " + argument.charAt(characterIndex)); System.exit(1); } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7fc9704f263fb0e26619a38cdcd58fae7692e4da/CommandlineParser.java/clean/src/org/jruby/util/CommandlineParser.java
shouldRunInterpreter = false;
private void processArgument() { String argument = arguments[argumentIndex]; FOR : for (characterIndex = 1; characterIndex < argument.length(); characterIndex++) { switch (argument.charAt(characterIndex)) { case 'h' : Main.printUsage(); break; case 'I' : loadPaths.add(grabValue(" -I must be followed by a directory name to add to lib path")); break FOR; case 'r' : requiredLibraries.add(grabValue("-r must be followed by a package to require")); break FOR; case 'e' : inlineScript.append(grabValue(" -e must be followed by an expression to evaluate")); inlineScript.append('\n'); break FOR; case 'b' : isBenchmarking = true; break; case 'p' : assumePrinting = true; assumeLoop = true; break; case 'n' : assumeLoop = true; break; case 'a' : sDoSplit = true; break; case 'l' : processLineEnds = true; break; case 'v' : showVersion = true; verbose = true; break; case 'w' : verbose = true; break; case '-' : if (argument.equals("--version")) { showVersion = true; shouldRunInterpreter = false; break FOR; } default : System.err.println("unknown option " + argument.charAt(characterIndex)); System.exit(1); } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7fc9704f263fb0e26619a38cdcd58fae7692e4da/CommandlineParser.java/clean/src/org/jruby/util/CommandlineParser.java
scriptFileName = arguments[argumentIndex];
setScriptFileName(arguments[argumentIndex]);
private void processArguments() { while (argumentIndex < arguments.length && isInterpreterArgument(arguments[argumentIndex])) { processArgument(); argumentIndex++; } if (! hasInlineScript()) { if (argumentIndex < arguments.length) { scriptFileName = arguments[argumentIndex]; //consume the file name argumentIndex++; } } // Remaining arguments are for the script itself scriptArguments = new String[arguments.length - argumentIndex]; System.arraycopy(arguments, argumentIndex, scriptArguments, 0, scriptArguments.length); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7fc9704f263fb0e26619a38cdcd58fae7692e4da/CommandlineParser.java/clean/src/org/jruby/util/CommandlineParser.java
System.arraycopy(arguments, argumentIndex, scriptArguments, 0, scriptArguments.length);
System.arraycopy(arguments, argumentIndex, getScriptArguments(), 0, getScriptArguments().length);
private void processArguments() { while (argumentIndex < arguments.length && isInterpreterArgument(arguments[argumentIndex])) { processArgument(); argumentIndex++; } if (! hasInlineScript()) { if (argumentIndex < arguments.length) { scriptFileName = arguments[argumentIndex]; //consume the file name argumentIndex++; } } // Remaining arguments are for the script itself scriptArguments = new String[arguments.length - argumentIndex]; System.arraycopy(arguments, argumentIndex, scriptArguments, 0, scriptArguments.length); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7fc9704f263fb0e26619a38cdcd58fae7692e4da/CommandlineParser.java/clean/src/org/jruby/util/CommandlineParser.java
return shouldRunInterpreter;
return isShouldRunInterpreter();
public boolean shouldRunInterpreter() { return shouldRunInterpreter; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7fc9704f263fb0e26619a38cdcd58fae7692e4da/CommandlineParser.java/clean/src/org/jruby/util/CommandlineParser.java
CategoryData c = (CategoryData) it.next(); cg.linkCategory((Category)mapper.map(c));
CategoryData cd = (CategoryData) it.next(); Category c = (Category)mapper.map( cd ); if ( ! linked( c.findCategoryGroupCategoryLink( cg ))) cg.linkCategory( c );
public IObject fillIObject( IObject obj, ReverseModelMapper mapper) { if ( obj instanceof CategoryGroup) { CategoryGroup cg = (CategoryGroup) obj; if (super.fill(cg)) { cg.setName(this.getName()); cg.setDescription(this.getDescription()); if (this.getCategories() != null) { for (Iterator it = this.getCategories().iterator(); it.hasNext();) { CategoryData c = (CategoryData) it.next(); cg.linkCategory((Category)mapper.map(c)); } } } return cg; } else { throw new IllegalArgumentException( "CategoryGroupData can only fille CategoryData."); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b7d44d4a82558acd2336a661072dda1f38cfc0b3/CategoryGroupData.java/clean/components/shoola-adapter/src/pojos/CategoryGroupData.java
e.printStackTrace(System.err);
public void assertStringTemplateMatches(String templateText, String resultPattern) throws Exception { String result = null; try { result = executeStringTemplate(templateText); } catch (Exception e) { System.err.println("Execution of /" + templateText + "/" + " threw " + e.getClass() + "/, expecting match /" + resultPattern + "/"); assert(false); } if (result == null) return; RE re = new RE(resultPattern); if (!re.match(result)) { System.err.println("Execution of /" + templateText + "/" + " yielded /" + result + "/, expecting match /" + resultPattern + "/"); assert(false); } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/ff709ec8523aa5b42a000462169b11be88cd46de/TemplateTestCase.java/clean/webmacro/test/unit/org/webmacro/template/TemplateTestCase.java
assertNotNull(Version.getDate(new Blank()));
assertNotNull(Version.getDate(Blank.class));
public void testGetDate() throws Exception { assertNotNull(Version.getDate(new Blank())); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/12f6ae8f254307cf501799bd57a8496e5a87439d/VersionTest.java/buggy/components/common/test/ome/system/utests/VersionTest.java
(Integer)Version.getRevision(new Blank()));
(Integer)Version.getRevision(Blank.class));
public void testGetRevision() throws Exception { assertEquals( (Integer)100, (Integer)Version.getRevision(new Blank())); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/12f6ae8f254307cf501799bd57a8496e5a87439d/VersionTest.java/buggy/components/common/test/ome/system/utests/VersionTest.java
public RubyObject call(Ruby ruby, RubyObject recv, RubyId id, RubyObject[] args, boolean noSuper) {
public RubyObject call(Ruby ruby, RubyObject recv, RubyId id, RubyPointer args, boolean noSuper) {
public RubyObject call(Ruby ruby, RubyObject recv, RubyId id, RubyObject[] args, boolean noSuper) { // HACK +++ try { // HACK --- return getCallbackMethod().execute(recv, args, ruby); // HACK +++ } catch (RaiseException rrExcptn) { System.out.print("[BUG] Cannot call method \"" + id.toName() + "\". "); System.out.println(rrExcptn.getMessage()); return ruby.getNil(); } // HACK --- }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f629550c5947df9c1dbe414645f3dc76bcb70df4/CFuncNode.java/clean/org/jruby/nodes/CFuncNode.java
return getCallbackMethod().execute(recv, args, ruby);
return getCallbackMethod().execute(recv, args == null ? null : args.toRubyArray(), ruby);
public RubyObject call(Ruby ruby, RubyObject recv, RubyId id, RubyObject[] args, boolean noSuper) { // HACK +++ try { // HACK --- return getCallbackMethod().execute(recv, args, ruby); // HACK +++ } catch (RaiseException rrExcptn) { System.out.print("[BUG] Cannot call method \"" + id.toName() + "\". "); System.out.println(rrExcptn.getMessage()); return ruby.getNil(); } // HACK --- }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f629550c5947df9c1dbe414645f3dc76bcb70df4/CFuncNode.java/clean/org/jruby/nodes/CFuncNode.java
} String name = (String)ruby.getSymbolReverseTable().get(this); if (name != null) { return name;
public String toName() { if (value < Token.LAST_TOKEN) { RubyOperatorEntry[] opTable = ruby.getOperatorTable(); for (int i = 0; i < opTable.length; i++) { if (this.equals(opTable[i].token)) { return opTable[i].name; } } } String name = (String)ruby.getSymbolReverseTable().get(this); if (name != null) { return name; } if (isAttrSetId()) { RubyId id2 = newId(ruby, (value & ~ID_SCOPE_MASK) | ID_LOCAL); while (true) { name = id2.toName(); if (name != null) { return ruby.intern(name + "=").toName(); } if (id2.isLocalId()) { id2 = new RubyId(ruby, (value & ~ID_SCOPE_MASK) | ID_CONST); continue; } break; } } return null; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyId.java/buggy/org/jruby/RubyId.java
if (isAttrSetId()) {
String name = (String)ruby.getSymbolReverseTable().get(this); if (name != null) { return name; } if (isAttrSetId()) {
public String toName() { if (value < Token.LAST_TOKEN) { RubyOperatorEntry[] opTable = ruby.getOperatorTable(); for (int i = 0; i < opTable.length; i++) { if (this.equals(opTable[i].token)) { return opTable[i].name; } } } String name = (String)ruby.getSymbolReverseTable().get(this); if (name != null) { return name; } if (isAttrSetId()) { RubyId id2 = newId(ruby, (value & ~ID_SCOPE_MASK) | ID_LOCAL); while (true) { name = id2.toName(); if (name != null) { return ruby.intern(name + "=").toName(); } if (id2.isLocalId()) { id2 = new RubyId(ruby, (value & ~ID_SCOPE_MASK) | ID_CONST); continue; } break; } } return null; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyId.java/buggy/org/jruby/RubyId.java
} } return null;
} } return null;
public String toName() { if (value < Token.LAST_TOKEN) { RubyOperatorEntry[] opTable = ruby.getOperatorTable(); for (int i = 0; i < opTable.length; i++) { if (this.equals(opTable[i].token)) { return opTable[i].name; } } } String name = (String)ruby.getSymbolReverseTable().get(this); if (name != null) { return name; } if (isAttrSetId()) { RubyId id2 = newId(ruby, (value & ~ID_SCOPE_MASK) | ID_LOCAL); while (true) { name = id2.toName(); if (name != null) { return ruby.intern(name + "=").toName(); } if (id2.isLocalId()) { id2 = new RubyId(ruby, (value & ~ID_SCOPE_MASK) | ID_CONST); continue; } break; } } return null; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyId.java/buggy/org/jruby/RubyId.java
state = ImViewer.LOADING_IMAGE;
BufferedImage getSplitComponentImage() { PlaneDef pDef = new PlaneDef(PlaneDef.XY, getDefaultT()); pDef.setZ(getDefaultZ()); state = ImViewer.LOADING_IMAGE; OmeroImageService os = ImViewerAgent.getRegistry().getImageService(); try { return os.renderImage(pixelsID, pDef); } catch (RenderingServiceException e) { handleException(e); } return null; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5aacd98a1cfb2219e218c87eed17b5a0f0e9738a/ImViewerModel.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerModel.java
un.notifyError(ImViewerAgent.ERROR, e.getMessage(), e.getCause());
un.notifyError(ImViewerAgent.ERROR, e.getExtendedMessage(), e.getCause());
private void handleException(RenderingServiceException e) { UserNotifier un = ImViewerAgent.getRegistry().getUserNotifier(); un.notifyError(ImViewerAgent.ERROR, e.getMessage(), e.getCause()); component.discard(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5aacd98a1cfb2219e218c87eed17b5a0f0e9738a/ImViewerModel.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerModel.java
throw new RubyBugException("can't convert to UTF8");
Asserts.assertNotReached("can't convert to UTF8");
public static RubyString pack(ArrayList list, RubyString iFmt) { Ruby ruby = iFmt.getRuntime(); char[] lFmt = iFmt.getValue().toCharArray(); int lFmtLength = lFmt.length; int idx = 0; int lLeftInArray = list.size(); StringBuffer lResult = new StringBuffer(); IRubyObject lFrom; String lCurElemString; for (int i = 0; i < lFmtLength;) { int lLength = 1; //first skip all spaces char lType = lFmt[i++]; if (Character.isWhitespace(lType)) continue; char lNext = i < lFmtLength ? lFmt[i] : '\0'; if (lNext == '!' || lNext == '_') { if (sNatStr.indexOf(lType) != -1) { lNext = ++i < lFmtLength ? lFmt[i] : '\0'; } else throw new ArgumentError(ruby, "'" + lNext + "' allowed only after types " + sNatStr); } if (lNext == '*') { lLength = "@Xxu".indexOf(lType) == -1 ? lLeftInArray : 0; lNext = ++i < lFmtLength ? lFmt[i] : '\0'; } else if (Character.isDigit(lNext)) { int lEndIndex = i; for (; lEndIndex < lFmtLength; lEndIndex++) if (!Character.isDigit(lFmt[lEndIndex])) break; lLength = Integer.parseInt(new String(lFmt, i, lEndIndex - i)); //an exception may occur here if an int can't hold this but ... i = lEndIndex; lNext = i < lFmtLength ? lFmt[i] : '\0'; } //no else, the original value of length is correct switch (lType) { case '%' : throw new ArgumentError(ruby, "% is not supported"); case 'A' : case 'a' : case 'Z' : case 'B' : case 'b' : case 'H' : case 'h' : if (lLeftInArray-- > 0) lFrom = (IRubyObject) list.get(idx++); else throw new ArgumentError(ruby, sTooFew); if (lFrom == ruby.getNil()) lCurElemString = ""; else lCurElemString = convert2String(lFrom); if (lFmt[i - 1] == '*') lLength = lCurElemString.length(); switch (lType) { case 'a' : case 'A' : case 'Z' : if (lCurElemString.length() >= lLength) lResult.append(lCurElemString.toCharArray(), 0, lLength); else //need padding { //I'm fairly sure there is a library call to create a //string filled with a given char with a given length but I couldn't find it lResult.append(lCurElemString); lLength -= lCurElemString.length(); grow(lResult, (lType == 'a') ? sNil10 : sSp10, lLength); } break; //I believe there is a bug in the b and B case we skip a char too easily case 'b' : { int lByte = 0; int lIndex = 0; char lCurChar; int lPadLength = 0; if (lLength > lCurElemString.length()) { //I don't understand this, why divide by 2 lPadLength = (lLength - lCurElemString.length() + 1) / 2; lLength = lCurElemString.length(); } for (lIndex = 0; lIndex < lLength;) { lCurChar = lCurElemString.charAt(lIndex++); if ((lCurChar & 1) != 0) //if the low bit of the current char is set lByte |= 128; //set the high bit of the result if ((lIndex & 7) != 0) //if the index is not a multiple of 8, we are not on a byte boundary lByte >>= 1; //shift the byte else { //we are done with one byte, append it to the result and go for the next lResult.append((char) (lByte & 0xff)); lByte = 0; } } if ((lLength & 7) != 0) //if the length is not a multiple of 8 { //we need to pad the last byte lByte >>= 7 - (lLength & 7); lResult.append((char) (lByte & 0xff)); } //do some padding, I don't understand the padding strategy lLength = lResult.length(); lResult.setLength(lLength + lPadLength); } break; case 'B' : { int lByte = 0; int lIndex = 0; char lCurChar; int lPadLength = 0; if (lLength > lCurElemString.length()) { //I don't understand this, why divide by 2 lPadLength = (lLength - lCurElemString.length() + 1) / 2; lLength = lCurElemString.length(); } for (lIndex = 0; lIndex < lLength;) { lCurChar = lCurElemString.charAt(lIndex++); lByte |= lCurChar & 1; if ((lIndex & 7) != 0) //if the index is not a multiple of 8, we are not on a byte boundary lByte <<= 1; //shift the byte else { //we are done with one byte, append it to the result and go for the next lResult.append((char) (lByte & 0xff)); lByte = 0; } } if ((lLength & 7) != 0) //if the length is not a multiple of 8 { //we need to pad the last byte lByte <<= 7 - (lLength & 7); lResult.append((char) (lByte & 0xff)); } //do some padding, I don't understand the padding strategy lLength = lResult.length(); lResult.setLength(lLength + lPadLength); } break; case 'h' : { int lByte = 0; int lIndex = 0; char lCurChar; int lPadLength = 0; if (lLength > lCurElemString.length()) { //I don't undestand this why divide by 2 lPadLength = (lLength - lCurElemString.length() + 1) / 2; lLength = lCurElemString.length(); } for (lIndex = 0; lIndex < lLength;) { lCurChar = lCurElemString.charAt(lIndex++); if (Character.isJavaIdentifierStart(lCurChar)) //this test may be too lax but it is the same as in MRI lByte |= (((lCurChar & 15) + 9) & 15) << 4; else lByte |= (lCurChar & 15) << 4; if ((lIndex & 1) != 0) lByte >>= 4; else { lResult.append((char) (lByte & 0xff)); lByte = 0; } } if ((lLength & 1) != 0) { lResult.append((char) (lByte & 0xff)); } //do some padding, I don't understand the padding strategy lLength = lResult.length(); lResult.setLength(lLength + lPadLength); } break; case 'H' : { int lByte = 0; int lIndex = 0; char lCurChar; int lPadLength = 0; if (lLength > lCurElemString.length()) { //I don't undestand this why divide by 2 lPadLength = (lLength - lCurElemString.length() + 1) / 2; lLength = lCurElemString.length(); } for (lIndex = 0; lIndex < lLength;) { lCurChar = lCurElemString.charAt(lIndex++); if (Character.isJavaIdentifierStart(lCurChar)) //this test may be too lax but it is the same as in MRI lByte |= ((lCurChar & 15) + 9) & 15; else lByte |= (lCurChar & 15); if ((lIndex & 1) != 0) lByte <<= 4; else { lResult.append((char) (lByte & 0xff)); lByte = 0; } } if ((lLength & 1) != 0) { lResult.append((char) (lByte & 0xff)); } //do some padding, I don't understand the padding strategy lLength = lResult.length(); lResult.setLength(lLength + lPadLength); } break; } break; case 'x' : grow(lResult, sNil10, lLength); break; case 'X' : shrink(lResult, lLength); break; case '@' : lLength -= lResult.length(); if (lLength > 0) grow(lResult, sNil10, lLength); lLength = -lLength; if (lLength > 0) shrink(lResult, lLength); break; case 'c' : case 'C' : while (lLength-- > 0) { char c; if (lLeftInArray-- > 0) lFrom = (IRubyObject) list.get(idx++); else throw new ArgumentError(ruby, sTooFew); if (lFrom == ruby.getNil()) c = 0; else { c = (char) (RubyNumeric.num2long(lFrom) & 0xff); } lResult.append(c); } break; case 's' : case 'v' : case 'S' : while (lLength-- > 0) { int s; if (lLeftInArray-- > 0) lFrom = (IRubyObject) list.get(idx++); else throw new ArgumentError(ruby, sTooFew); if (lFrom == ruby.getNil()) s = 0; else { s = (int) (RubyNumeric.num2long(lFrom) & 0xffff); } lResult.append((char) (s & 0xff)); lResult.append((char) ((s & 0xff00) >> 8)); } break; case 'n' : while (lLength-- > 0) { int s; if (lLeftInArray-- > 0) lFrom = (IRubyObject) list.get(idx++); else throw new ArgumentError(ruby, sTooFew); if (lFrom == ruby.getNil()) s = 0; else { s = (int) (RubyNumeric.num2long(lFrom) & 0xffff); } lResult.append((char) ((s & 0xff00) >> 8)); lResult.append((char) (s & 0xff)); } break; case 'i' : case 'I' : case 'l' : case 'L' : case 'V' : while (lLength-- > 0) { int s; if (lLeftInArray-- > 0) lFrom = (IRubyObject) list.get(idx++); else throw new ArgumentError(ruby, sTooFew); if (lFrom == ruby.getNil()) s = 0; else { s = (int) (RubyNumeric.num2long(lFrom)); } lResult.append((char) (s & 0xff)); lResult.append((char) ((s >> 8) & 0xff)); lResult.append((char) ((s >> 16) & 0xff)); lResult.append((char) ((s >> 24) & 0xff)); } break; case 'N' : while (lLength-- > 0) { int s; if (lLeftInArray-- > 0) lFrom = (IRubyObject) list.get(idx++); else throw new ArgumentError(ruby, sTooFew); if (lFrom == ruby.getNil()) s = 0; else { s = (int) (RubyNumeric.num2long(lFrom)); } lResult.append((char) ((s >> 24) & 0xff)); lResult.append((char) ((s >> 16) & 0xff)); lResult.append((char) ((s >> 8) & 0xff)); lResult.append((char) (s & 0xff)); } break; case 'u' : case 'm' : if (lLeftInArray-- > 0) lFrom = (IRubyObject) list.get(idx++); else throw new ArgumentError(ruby, sTooFew); if (lFrom == ruby.getNil()) lCurElemString = ""; else lCurElemString = convert2String(lFrom); if (lLength <= 2) lLength = 45; else lLength = lLength / 3 * 3; for (;;) { encodes(ruby, lResult, lCurElemString, lLength, lType); if (lLength < lCurElemString.length()) lCurElemString = lCurElemString.substring(lLength); else break; } break; case 'M' : if (lLeftInArray-- > 0) lFrom = (IRubyObject) list.get(idx++); else throw new ArgumentError(ruby, sTooFew); if (lFrom == ruby.getNil()) lCurElemString = ""; else lCurElemString = convert2String(lFrom); if (lLength <= 1) lLength = 72; qpencode(lResult, lCurElemString, lLength); break; case 'U' : char[] c = new char[lLength]; for (int lCurCharIdx = 0; lLength-- > 0; lCurCharIdx++) { long l; if (lLeftInArray-- > 0) lFrom = (IRubyObject) list.get(idx++); else throw new ArgumentError(ruby, sTooFew); if (lFrom == ruby.getNil()) l = 0; else { l = RubyNumeric.num2long(lFrom); } c[lCurCharIdx] = (char) l; } String s = new String(c); try { lResult.append(RubyString.bytesToString(s.getBytes("UTF-8"))); } catch (java.io.UnsupportedEncodingException e) { throw new RubyBugException("can't convert to UTF8"); } break; } } return RubyString.newString(ruby, lResult.toString()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/071973606d94103b2d5cb6c793aa1e8809fc7b2a/Pack.java/clean/org/jruby/util/Pack.java
throw new RubyBugException("can't convert from UTF8");
Asserts.assertNotReached("can't convert from UTF8");
public static RubyArray unpack(String value, RubyString iFmt) { Ruby ruby = iFmt.getRuntime(); char[] lFmt = iFmt.getValue().toCharArray(); int lFmtLength = lFmt.length; RubyArray lResult = RubyArray.newArray(ruby); int lValueLength = value.length(); int lCurValueIdx = 0; for (int i = 0; i < lFmtLength;) { int lLength = 0; char lType = lFmt[i++]; char lNext = i < lFmtLength ? lFmt[i] : '\0'; if (lNext == '_' || lNext == '!') { if (sNatStr.indexOf(lType) != -1) { i++; lNext = i < lFmtLength ? lFmt[i] : '\0'; } else throw new ArgumentError(ruby, "'" + lNext + "' allowed only after types " + sNatStr); } if (i > lFmtLength) lLength = 1; else if (lNext == '*') { lLength = lValueLength - lCurValueIdx; i++; lNext = i < lFmtLength ? lFmt[i] : '\0'; } else if (Character.isDigit(lNext)) { int lEndIndex = i; for (; lEndIndex < lFmtLength; lEndIndex++) if (!Character.isDigit(lFmt[lEndIndex])) break; lLength = Integer.parseInt(new String(lFmt, i, lEndIndex - i)); //an exception may occur here if an int can't hold this but ... i = lEndIndex; lNext = (i < lFmtLength) ? lFmt[i] : '\0'; } else { lLength = lType == '@' ? 0 : 1; } switch (lType) { case '%' : throw new ArgumentError(ruby, "% is not supported"); case 'A' : if (lLength > (lValueLength - lCurValueIdx)) lLength = (lValueLength - lCurValueIdx); { int end = lLength; for (int t = lCurValueIdx + lLength - 1; lLength > 0; lLength--, t--) if (value.charAt(t) != ' ' && value.charAt(t) != '\0') break; lResult.append( RubyString.newString(ruby, value.substring(lCurValueIdx, lCurValueIdx + lLength))); lCurValueIdx += end; } break; case 'Z' : if (lLength > (lValueLength - lCurValueIdx)) lLength = (lValueLength - lCurValueIdx); { int end = lLength; for (int t = lCurValueIdx + lLength - 1; lLength > 0; lLength--, t--) if (value.charAt(t) != '\0') break; lResult.append( RubyString.newString(ruby, value.substring(lCurValueIdx, lCurValueIdx + lLength))); lCurValueIdx += end; } break; case 'a' : if (lLength > (lValueLength - lCurValueIdx)) lLength = (lValueLength - lCurValueIdx); lResult.append(RubyString.newString(ruby, value.substring(lCurValueIdx, lCurValueIdx + lLength))); lCurValueIdx += lLength; break; case 'b' : { if (lFmt[i - 1] == '*' || lLength > (lValueLength - lCurValueIdx) * 8) lLength = (lValueLength - lCurValueIdx) * 8; int bits = 0; StringBuffer lElem = new StringBuffer(lLength); for (int lCurByte = 0; lCurByte < lLength; lCurByte++) { if ((lCurByte & 7) != 0) bits >>>= 1; else bits = value.charAt(lCurValueIdx++); lElem.append((bits & 1) != 0 ? '1' : '0'); } lResult.append(RubyString.newString(ruby, lElem.toString())); } break; case 'B' : { if (lFmt[i - 1] == '*' || lLength > (lValueLength - lCurValueIdx) * 8) lLength = (lValueLength - lCurValueIdx) * 8; int bits = 0; StringBuffer lElem = new StringBuffer(lLength); for (int lCurByte = 0; lCurByte < lLength; lCurByte++) { if ((lCurByte & 7) != 0) bits <<= 1; else bits = value.charAt(lCurValueIdx++); lElem.append((bits & 128) != 0 ? '1' : '0'); } lResult.append(RubyString.newString(ruby, lElem.toString())); } break; case 'h' : { if (lFmt[i - 1] == '*' || lLength > (lValueLength - lCurValueIdx) * 2) lLength = (lValueLength - lCurValueIdx) * 2; int bits = 0; StringBuffer lElem = new StringBuffer(lLength); for (int lCurByte = 0; lCurByte < lLength; lCurByte++) { if ((lCurByte & 1) != 0) bits >>>= 4; else bits = value.charAt(lCurValueIdx++); lElem.append(sHexDigits[bits & 15]); } lResult.append(RubyString.newString(ruby, lElem.toString())); } break; case 'H' : { if (lFmt[i - 1] == '*' || lLength > (lValueLength - lCurValueIdx) * 2) lLength = (lValueLength - lCurValueIdx) * 2; int bits = 0; StringBuffer lElem = new StringBuffer(lLength); for (int lCurByte = 0; lCurByte < lLength; lCurByte++) { if ((lCurByte & 1) != 0) bits <<= 4; else bits = value.charAt(lCurValueIdx++); lElem.append(sHexDigits[(bits >>> 4) & 15]); } lResult.append(RubyString.newString(ruby, lElem.toString())); } break; case 'c' : { int lPadLength = 0; if (lLength > (lValueLength - lCurValueIdx)) { if (lFmt[i - 1] != '*') lPadLength = lLength - (lValueLength - lCurValueIdx); lLength = (lValueLength - lCurValueIdx); } for (; lLength-- > 0;) { int c = value.charAt(lCurValueIdx++); if (c > (char) 127) c -= 256; lResult.append(RubyFixnum.newFixnum(ruby, c)); } for (; lPadLength-- > 0;) lResult.append(ruby.getNil()); } break; case 'C' : { int lPadLength = 0; if (lLength > (lValueLength - lCurValueIdx)) { if (lFmt[i - 1] != '*') lPadLength = lLength - (lValueLength - lCurValueIdx); lLength = (lValueLength - lCurValueIdx); } for (; lLength-- > 0;) { int c = value.charAt(lCurValueIdx++); lResult.append(RubyFixnum.newFixnum(ruby, c)); } for (; lPadLength-- > 0;) lResult.append(ruby.getNil()); } break; case 's' : { int lPadLength = 0; if (lLength > (lValueLength - lCurValueIdx) / 2) { if (lFmt[i - 1] != '*') lPadLength = lLength - (lValueLength - lCurValueIdx) / 2; lLength = (lValueLength - lCurValueIdx) / 2; } for (; lLength-- > 0;) { short tmp = (short) (value.charAt(lCurValueIdx++) & 0xff); short s = (short) (value.charAt(lCurValueIdx++) & 0xff); s <<= 8; s |= tmp; lResult.append(RubyFixnum.newFixnum(ruby, s)); } for (; lPadLength-- > 0;) lResult.append(ruby.getNil()); } break; case 'S' : case 'v' : { int lPadLength = 0; if (lLength > (lValueLength - lCurValueIdx) / 2) { if (lFmt[i - 1] != '*') lPadLength = lLength - (lValueLength - lCurValueIdx) / 2; lLength = (lValueLength - lCurValueIdx) / 2; } for (; lLength-- > 0;) { short tmp = (short) (value.charAt(lCurValueIdx++) & 0xff); int s = (short) (value.charAt(lCurValueIdx++) & 0xff); s <<= 8; s |= tmp; lResult.append(RubyFixnum.newFixnum(ruby, s)); } for (; lPadLength-- > 0;) lResult.append(ruby.getNil()); } break; case 'i' : case 'l' : { int lPadLength = 0; if (lLength > (lValueLength - lCurValueIdx) / 4) { if (lFmt[i - 1] != '*') lPadLength = lLength - (lValueLength - lCurValueIdx) / 4; lLength = (lValueLength - lCurValueIdx) / 4; } for (; lLength-- > 0;) { int i1 = (value.charAt(lCurValueIdx++) & 0xff); int i2 = (value.charAt(lCurValueIdx++) & 0xff); int i3 = (value.charAt(lCurValueIdx++) & 0xff); int i4 = (value.charAt(lCurValueIdx++) & 0xff); i4 <<= 24; i4 |= (i3 << 16); i4 |= (i2 << 8); i4 |= i1; lResult.append(RubyFixnum.newFixnum(ruby, i4)); } for (; lPadLength-- > 0;) lResult.append(ruby.getNil()); } break; case 'I' : case 'V' : case 'L' : { int lPadLength = 0; if (lLength > (lValueLength - lCurValueIdx) / 4) { if (lFmt[i - 1] != '*') lPadLength = lLength - (lValueLength - lCurValueIdx) / 4; lLength = (lValueLength - lCurValueIdx) / 4; } for (; lLength-- > 0;) { int i1 = (value.charAt(lCurValueIdx++) & 0xff); int i2 = (value.charAt(lCurValueIdx++) & 0xff); int i3 = (value.charAt(lCurValueIdx++) & 0xff); long i4 = (value.charAt(lCurValueIdx++) & 0xff); i4 <<= 24; i4 |= (i3 << 16); i4 |= (i2 << 8); i4 |= i1; lResult.append(RubyFixnum.newFixnum(ruby, i4)); } for (; lPadLength-- > 0;) lResult.append(ruby.getNil()); } break; case 'N' : { int lPadLength = 0; if (lLength > (lValueLength - lCurValueIdx) / 4) { if (lFmt[i - 1] != '*') lPadLength = lLength - (lValueLength - lCurValueIdx) / 4; lLength = (lValueLength - lCurValueIdx) / 4; } for (; lLength-- > 0;) { long i1 = (value.charAt(lCurValueIdx++) & 0xff); i1 <<= 8; i1 |= (value.charAt(lCurValueIdx++) & 0xff); i1 <<= 8; i1 |= (value.charAt(lCurValueIdx++) & 0xff); i1 <<= 8; i1 |= (value.charAt(lCurValueIdx++) & 0xff); lResult.append(RubyFixnum.newFixnum(ruby, i1)); } for (; lPadLength-- > 0;) lResult.append(ruby.getNil()); } break; case 'n' : { int lPadLength = 0; if (lLength > (lValueLength - lCurValueIdx) / 2) { if (lFmt[i - 1] != '*') lPadLength = lLength - (lValueLength - lCurValueIdx) / 2; lLength = (lValueLength - lCurValueIdx) / 2; } for (; lLength-- > 0;) { int i1 = (value.charAt(lCurValueIdx++) & 0xff); i1 <<= 8; i1 |= (value.charAt(lCurValueIdx++) & 0xff); lResult.append(RubyFixnum.newFixnum(ruby, i1)); } for (; lPadLength-- > 0;) lResult.append(ruby.getNil()); } break; case 'U' : { if (lLength > lValueLength - lCurValueIdx) lLength = lValueLength - lCurValueIdx; //get the correct substring String toUnpack = value.substring(lCurValueIdx); String lUtf8 = null; try { lUtf8 = new String(toUnpack.getBytes("iso8859-1"), "UTF-8"); } catch (java.io.UnsupportedEncodingException e) { throw new RubyBugException("can't convert from UTF8"); } char[] c = lUtf8.toCharArray(); int lNbChar = c.length; for (int lCurCharIdx = 0; lLength-- > 0 && lCurCharIdx < lNbChar; lCurCharIdx++) lResult.append(RubyFixnum.newFixnum(ruby, c[lCurCharIdx])); } break; } } return lResult; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/071973606d94103b2d5cb6c793aa1e8809fc7b2a/Pack.java/clean/org/jruby/util/Pack.java
IRubyObject convertToType(String string, String string1, boolean b);
IRubyObject convertToType(String targetType, String convertMethod, boolean raiseOnError);
IRubyObject convertToType(String string, String string1, boolean b);
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/50d6342dd5da06c42d25bc955addce6aaa0e6b97/IRubyObject.java/buggy/src/org/jruby/runtime/builtin/IRubyObject.java
throw new RubyBugException("unsupported encoding " + e);
Asserts.assertNotReached("unsupported encoding " + e); return null;
public static String bytesToString(byte[] bytes) { try { return new String(bytes, encoding); } catch (java.io.UnsupportedEncodingException e) { throw new RubyBugException("unsupported encoding " + e); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/071973606d94103b2d5cb6c793aa1e8809fc7b2a/RubyString.java/buggy/org/jruby/RubyString.java
public static RubyArray newArray(Ruby ruby) { /* Ruby arrays default to holding 16 elements, so we create an * ArrayList of the same size if we're not told otherwise */ return new RubyArray(ruby, new ArrayList(16));
public static RubyArray newArray(Ruby ruby, long len) { return new RubyArray(ruby, new ArrayList((int) len));
public static RubyArray newArray(Ruby ruby) { /* Ruby arrays default to holding 16 elements, so we create an * ArrayList of the same size if we're not told otherwise */ return new RubyArray(ruby, new ArrayList(16)); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0335f0acaf11ca0feb41907f65e7274f8ed49fc3/RubyArray.java/buggy/org/jruby/RubyArray.java