rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
ITableLabelProvider provider = new ITableLabelProvider() { Map imageTable = new HashMap(); /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener) */ public void addListener(ILabelProviderListener listener) { } | ITableLabelProvider provider = new ITableLabelProvider() { Map imageTable = new HashMap(); | private void initLabelProvider() { ITableLabelProvider provider = new ITableLabelProvider() { Map imageTable = new HashMap(); /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener) */ public void addListener(ILabelProviderListener listener) { //Do nothing } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose() */ public void dispose() { if (!imageTable.isEmpty()) { for (Iterator iter = imageTable.values().iterator(); iter.hasNext();) { Image image = (Image) iter.next(); image.dispose(); } } } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, * int) */ public Image getColumnImage(Object element, int columnIndex) { return getIcon(((ErrorInfo)element).getJob()); } /* * Get the icon for the job. Code copied from NewProgressViewer */ private Image getIcon(Job job) { if (job != null) { Object property = job.getProperty(IProgressConstants.ICON_PROPERTY); // If we already have an image cached, return it Image im = (Image)imageTable.get(property); if (im != null) { return im; } // Create an image from the job's icon property or family Display display = getShell().getDisplay(); if (property instanceof ImageDescriptor) { im = ((ImageDescriptor) property).createImage(display); imageTable.put(property, im); // Cache for disposal } else if (property instanceof URL) { im = ImageDescriptor.createFromURL((URL) property) .createImage(display); imageTable.put(property, im); // Cache for disposal } else { im = ProgressManager.getInstance().getIconFor(job); // No need to cache since the progress manager will } return im; } return null; } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, * int) */ public String getColumnText(Object element, int columnIndex) { return ((ErrorInfo) element).getDisplayString(); } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, * java.lang.String) */ public boolean isLabelProperty(Object element, String property) { return false; } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener) */ public void removeListener(ILabelProviderListener listener) { //Do nothing } }; jobListViewer.setLabelProvider(provider); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
/* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose() */ public void dispose() { if (!imageTable.isEmpty()) { for (Iterator iter = imageTable.values().iterator(); iter.hasNext();) { Image image = (Image) iter.next(); image.dispose(); } } } | /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener) */ public void addListener(ILabelProviderListener listener) { } | private void initLabelProvider() { ITableLabelProvider provider = new ITableLabelProvider() { Map imageTable = new HashMap(); /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener) */ public void addListener(ILabelProviderListener listener) { //Do nothing } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose() */ public void dispose() { if (!imageTable.isEmpty()) { for (Iterator iter = imageTable.values().iterator(); iter.hasNext();) { Image image = (Image) iter.next(); image.dispose(); } } } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, * int) */ public Image getColumnImage(Object element, int columnIndex) { return getIcon(((ErrorInfo)element).getJob()); } /* * Get the icon for the job. Code copied from NewProgressViewer */ private Image getIcon(Job job) { if (job != null) { Object property = job.getProperty(IProgressConstants.ICON_PROPERTY); // If we already have an image cached, return it Image im = (Image)imageTable.get(property); if (im != null) { return im; } // Create an image from the job's icon property or family Display display = getShell().getDisplay(); if (property instanceof ImageDescriptor) { im = ((ImageDescriptor) property).createImage(display); imageTable.put(property, im); // Cache for disposal } else if (property instanceof URL) { im = ImageDescriptor.createFromURL((URL) property) .createImage(display); imageTable.put(property, im); // Cache for disposal } else { im = ProgressManager.getInstance().getIconFor(job); // No need to cache since the progress manager will } return im; } return null; } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, * int) */ public String getColumnText(Object element, int columnIndex) { return ((ErrorInfo) element).getDisplayString(); } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, * java.lang.String) */ public boolean isLabelProperty(Object element, String property) { return false; } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener) */ public void removeListener(ILabelProviderListener listener) { //Do nothing } }; jobListViewer.setLabelProvider(provider); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
/* * (non-Javadoc) * * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, * int) */ public Image getColumnImage(Object element, int columnIndex) { return getIcon(((ErrorInfo)element).getJob()); } | /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose() */ public void dispose() { if (!imageTable.isEmpty()) { for (Iterator iter = imageTable.values().iterator(); iter .hasNext();) { Image image = (Image) iter.next(); image.dispose(); } } } | private void initLabelProvider() { ITableLabelProvider provider = new ITableLabelProvider() { Map imageTable = new HashMap(); /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener) */ public void addListener(ILabelProviderListener listener) { //Do nothing } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose() */ public void dispose() { if (!imageTable.isEmpty()) { for (Iterator iter = imageTable.values().iterator(); iter.hasNext();) { Image image = (Image) iter.next(); image.dispose(); } } } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, * int) */ public Image getColumnImage(Object element, int columnIndex) { return getIcon(((ErrorInfo)element).getJob()); } /* * Get the icon for the job. Code copied from NewProgressViewer */ private Image getIcon(Job job) { if (job != null) { Object property = job.getProperty(IProgressConstants.ICON_PROPERTY); // If we already have an image cached, return it Image im = (Image)imageTable.get(property); if (im != null) { return im; } // Create an image from the job's icon property or family Display display = getShell().getDisplay(); if (property instanceof ImageDescriptor) { im = ((ImageDescriptor) property).createImage(display); imageTable.put(property, im); // Cache for disposal } else if (property instanceof URL) { im = ImageDescriptor.createFromURL((URL) property) .createImage(display); imageTable.put(property, im); // Cache for disposal } else { im = ProgressManager.getInstance().getIconFor(job); // No need to cache since the progress manager will } return im; } return null; } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, * int) */ public String getColumnText(Object element, int columnIndex) { return ((ErrorInfo) element).getDisplayString(); } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, * java.lang.String) */ public boolean isLabelProperty(Object element, String property) { return false; } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener) */ public void removeListener(ILabelProviderListener listener) { //Do nothing } }; jobListViewer.setLabelProvider(provider); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
/* * Get the icon for the job. Code copied from NewProgressViewer */ private Image getIcon(Job job) { if (job != null) { Object property = job.getProperty(IProgressConstants.ICON_PROPERTY); Image im = (Image)imageTable.get(property); if (im != null) { return im; } Display display = getShell().getDisplay(); if (property instanceof ImageDescriptor) { im = ((ImageDescriptor) property).createImage(display); imageTable.put(property, im); } else if (property instanceof URL) { im = ImageDescriptor.createFromURL((URL) property) .createImage(display); imageTable.put(property, im); } else { im = ProgressManager.getInstance().getIconFor(job); } return im; } return null; } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, * int) */ public String getColumnText(Object element, int columnIndex) { return ((ErrorInfo) element).getDisplayString(); } | /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, * int) */ public Image getColumnImage(Object element, int columnIndex) { return getIcon(((ErrorInfo) element).getJob()); } | private void initLabelProvider() { ITableLabelProvider provider = new ITableLabelProvider() { Map imageTable = new HashMap(); /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener) */ public void addListener(ILabelProviderListener listener) { //Do nothing } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose() */ public void dispose() { if (!imageTable.isEmpty()) { for (Iterator iter = imageTable.values().iterator(); iter.hasNext();) { Image image = (Image) iter.next(); image.dispose(); } } } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, * int) */ public Image getColumnImage(Object element, int columnIndex) { return getIcon(((ErrorInfo)element).getJob()); } /* * Get the icon for the job. Code copied from NewProgressViewer */ private Image getIcon(Job job) { if (job != null) { Object property = job.getProperty(IProgressConstants.ICON_PROPERTY); // If we already have an image cached, return it Image im = (Image)imageTable.get(property); if (im != null) { return im; } // Create an image from the job's icon property or family Display display = getShell().getDisplay(); if (property instanceof ImageDescriptor) { im = ((ImageDescriptor) property).createImage(display); imageTable.put(property, im); // Cache for disposal } else if (property instanceof URL) { im = ImageDescriptor.createFromURL((URL) property) .createImage(display); imageTable.put(property, im); // Cache for disposal } else { im = ProgressManager.getInstance().getIconFor(job); // No need to cache since the progress manager will } return im; } return null; } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, * int) */ public String getColumnText(Object element, int columnIndex) { return ((ErrorInfo) element).getDisplayString(); } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, * java.lang.String) */ public boolean isLabelProperty(Object element, String property) { return false; } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener) */ public void removeListener(ILabelProviderListener listener) { //Do nothing } }; jobListViewer.setLabelProvider(provider); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
/* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, * java.lang.String) */ public boolean isLabelProperty(Object element, String property) { return false; } | /* * Get the icon for the job. Code copied from NewProgressViewer */ private Image getIcon(Job job) { if (job != null) { | private void initLabelProvider() { ITableLabelProvider provider = new ITableLabelProvider() { Map imageTable = new HashMap(); /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener) */ public void addListener(ILabelProviderListener listener) { //Do nothing } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose() */ public void dispose() { if (!imageTable.isEmpty()) { for (Iterator iter = imageTable.values().iterator(); iter.hasNext();) { Image image = (Image) iter.next(); image.dispose(); } } } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, * int) */ public Image getColumnImage(Object element, int columnIndex) { return getIcon(((ErrorInfo)element).getJob()); } /* * Get the icon for the job. Code copied from NewProgressViewer */ private Image getIcon(Job job) { if (job != null) { Object property = job.getProperty(IProgressConstants.ICON_PROPERTY); // If we already have an image cached, return it Image im = (Image)imageTable.get(property); if (im != null) { return im; } // Create an image from the job's icon property or family Display display = getShell().getDisplay(); if (property instanceof ImageDescriptor) { im = ((ImageDescriptor) property).createImage(display); imageTable.put(property, im); // Cache for disposal } else if (property instanceof URL) { im = ImageDescriptor.createFromURL((URL) property) .createImage(display); imageTable.put(property, im); // Cache for disposal } else { im = ProgressManager.getInstance().getIconFor(job); // No need to cache since the progress manager will } return im; } return null; } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, * int) */ public String getColumnText(Object element, int columnIndex) { return ((ErrorInfo) element).getDisplayString(); } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, * java.lang.String) */ public boolean isLabelProperty(Object element, String property) { return false; } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener) */ public void removeListener(ILabelProviderListener listener) { //Do nothing } }; jobListViewer.setLabelProvider(provider); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
/* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener) */ public void removeListener(ILabelProviderListener listener) { } }; jobListViewer.setLabelProvider(provider); } | Object property = job .getProperty(IProgressConstants.ICON_PROPERTY); Image im = (Image) imageTable.get(property); if (im != null) { return im; } Display display = getShell().getDisplay(); if (property instanceof ImageDescriptor) { im = ((ImageDescriptor) property).createImage(display); imageTable.put(property, im); } else if (property instanceof URL) { im = ImageDescriptor.createFromURL((URL) property) .createImage(display); imageTable.put(property, im); } else { im = ProgressManager.getInstance().getIconFor(job); } return im; } return null; } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, * int) */ public String getColumnText(Object element, int columnIndex) { return ((ErrorInfo) element).getDisplayString(); } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, * java.lang.String) */ public boolean isLabelProperty(Object element, String property) { return false; } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener) */ public void removeListener(ILabelProviderListener listener) { } }; jobListViewer.setLabelProvider(provider); } | private void initLabelProvider() { ITableLabelProvider provider = new ITableLabelProvider() { Map imageTable = new HashMap(); /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener) */ public void addListener(ILabelProviderListener listener) { //Do nothing } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose() */ public void dispose() { if (!imageTable.isEmpty()) { for (Iterator iter = imageTable.values().iterator(); iter.hasNext();) { Image image = (Image) iter.next(); image.dispose(); } } } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, * int) */ public Image getColumnImage(Object element, int columnIndex) { return getIcon(((ErrorInfo)element).getJob()); } /* * Get the icon for the job. Code copied from NewProgressViewer */ private Image getIcon(Job job) { if (job != null) { Object property = job.getProperty(IProgressConstants.ICON_PROPERTY); // If we already have an image cached, return it Image im = (Image)imageTable.get(property); if (im != null) { return im; } // Create an image from the job's icon property or family Display display = getShell().getDisplay(); if (property instanceof ImageDescriptor) { im = ((ImageDescriptor) property).createImage(display); imageTable.put(property, im); // Cache for disposal } else if (property instanceof URL) { im = ImageDescriptor.createFromURL((URL) property) .createImage(display); imageTable.put(property, im); // Cache for disposal } else { im = ProgressManager.getInstance().getIconFor(job); // No need to cache since the progress manager will } return im; } return null; } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, * int) */ public String getColumnText(Object element, int columnIndex) { return ((ErrorInfo) element).getDisplayString(); } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, * java.lang.String) */ public boolean isLabelProperty(Object element, String property) { return false; } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener) */ public void removeListener(ILabelProviderListener listener) { //Do nothing } }; jobListViewer.setLabelProvider(provider); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
} | } | public void addListener(ILabelProviderListener listener) { //Do nothing } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
if (!imageTable.isEmpty()) { for (Iterator iter = imageTable.values().iterator(); iter.hasNext();) { Image image = (Image) iter.next(); image.dispose(); } } } | if (!imageTable.isEmpty()) { for (Iterator iter = imageTable.values().iterator(); iter .hasNext();) { Image image = (Image) iter.next(); image.dispose(); } } } | public void dispose() { if (!imageTable.isEmpty()) { for (Iterator iter = imageTable.values().iterator(); iter.hasNext();) { Image image = (Image) iter.next(); image.dispose(); } } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
return getIcon(((ErrorInfo)element).getJob()); } | return getIcon(((ErrorInfo) element).getJob()); } | public Image getColumnImage(Object element, int columnIndex) { return getIcon(((ErrorInfo)element).getJob()); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
return ((ErrorInfo) element).getDisplayString(); } | return ((ErrorInfo) element).getDisplayString(); } | public String getColumnText(Object element, int columnIndex) { return ((ErrorInfo) element).getDisplayString(); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
if (job != null) { Object property = job.getProperty(IProgressConstants.ICON_PROPERTY); Image im = (Image)imageTable.get(property); if (im != null) { return im; } Display display = getShell().getDisplay(); if (property instanceof ImageDescriptor) { im = ((ImageDescriptor) property).createImage(display); imageTable.put(property, im); } else if (property instanceof URL) { im = ImageDescriptor.createFromURL((URL) property) .createImage(display); imageTable.put(property, im); } else { im = ProgressManager.getInstance().getIconFor(job); } return im; } return null; } | if (job != null) { Object property = job .getProperty(IProgressConstants.ICON_PROPERTY); Image im = (Image) imageTable.get(property); if (im != null) { return im; } Display display = getShell().getDisplay(); if (property instanceof ImageDescriptor) { im = ((ImageDescriptor) property).createImage(display); imageTable.put(property, im); } else if (property instanceof URL) { im = ImageDescriptor.createFromURL((URL) property) .createImage(display); imageTable.put(property, im); } else { im = ProgressManager.getInstance().getIconFor(job); } return im; } return null; } | private Image getIcon(Job job) { if (job != null) { Object property = job.getProperty(IProgressConstants.ICON_PROPERTY); // If we already have an image cached, return it Image im = (Image)imageTable.get(property); if (im != null) { return im; } // Create an image from the job's icon property or family Display display = getShell().getDisplay(); if (property instanceof ImageDescriptor) { im = ((ImageDescriptor) property).createImage(display); imageTable.put(property, im); // Cache for disposal } else if (property instanceof URL) { im = ImageDescriptor.createFromURL((URL) property) .createImage(display); imageTable.put(property, im); // Cache for disposal } else { im = ProgressManager.getInstance().getIconFor(job); // No need to cache since the progress manager will } return im; } return null; } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
return false; } | return false; } | public boolean isLabelProperty(Object element, String property) { return false; } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
} | } | public void removeListener(ILabelProviderListener listener) { //Do nothing } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
refresh(); super.initializeBounds(); Rectangle shellPosition = getShell().getBounds(); ProgressManagerUtil.animateUp(shellPosition); } | refresh(); super.initializeBounds(); Rectangle shellPosition = getShell().getBounds(); ProgressManagerUtil.animateUp(shellPosition); } | protected void initializeBounds() { // We need to refesh here instead of in createContents // because the showDetailsArea requires that the content // composite be set refresh(); super.initializeBounds(); Rectangle shellPosition = getShell().getBounds(); ProgressManagerUtil.animateUp(shellPosition); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
return getManager().getErrors().size() > 1; } | return getManager().getErrors().size() > 1; } | private boolean isMultipleJobErrors() { return getManager().getErrors().size() > 1; } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
IPreferenceStore store = WorkbenchPlugin.getDefault().getPreferenceStore(); if (!store.contains(PREF_SKIP_GOTO_ACTION_PROMPT) || !store.getString(PREF_SKIP_GOTO_ACTION_PROMPT).equals(MessageDialogWithToggle.ALWAYS)) { MessageDialogWithToggle dialog = MessageDialogWithToggle.openOkCancelConfirm(getShell(), ProgressMessages.JobErrorDialog_CloseDialogTitle, ProgressMessages.JobErrorDialog_CloseDialogMessage, ProgressMessages.JobErrorDialog_DoNotShowAgainMessage, false, store, PREF_SKIP_GOTO_ACTION_PROMPT); return dialog.getReturnCode() == OK; } return true; } | IPreferenceStore store = WorkbenchPlugin.getDefault() .getPreferenceStore(); if (!store.contains(PREF_SKIP_GOTO_ACTION_PROMPT) || !store.getString(PREF_SKIP_GOTO_ACTION_PROMPT).equals( MessageDialogWithToggle.ALWAYS)) { MessageDialogWithToggle dialog = MessageDialogWithToggle .openOkCancelConfirm( getShell(), ProgressMessages.JobErrorDialog_CloseDialogTitle, ProgressMessages.JobErrorDialog_CloseDialogMessage, ProgressMessages.JobErrorDialog_DoNotShowAgainMessage, false, store, PREF_SKIP_GOTO_ACTION_PROMPT); return dialog.getReturnCode() == OK; } return true; } | private boolean isPromptToClose() { IPreferenceStore store = WorkbenchPlugin.getDefault().getPreferenceStore(); if (!store.contains(PREF_SKIP_GOTO_ACTION_PROMPT) || !store.getString(PREF_SKIP_GOTO_ACTION_PROMPT).equals(MessageDialogWithToggle.ALWAYS)) { MessageDialogWithToggle dialog = MessageDialogWithToggle.openOkCancelConfirm(getShell(), ProgressMessages.JobErrorDialog_CloseDialogTitle, ProgressMessages.JobErrorDialog_CloseDialogMessage, ProgressMessages.JobErrorDialog_DoNotShowAgainMessage, false, store, PREF_SKIP_GOTO_ACTION_PROMPT); return dialog.getReturnCode() == OK; } return true; } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
if (jobListViewer != null && !jobListViewer.getControl().isDisposed()) { jobListViewer.refresh(); Point newSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT); getShell().setSize(newSize); } setStatus(selectedError.getErrorStatus()); } | if (jobListViewer != null && !jobListViewer.getControl().isDisposed()) { jobListViewer.refresh(); Point newSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT); getShell().setSize(newSize); } setStatus(selectedError.getErrorStatus()); } | void refreshJobList() { if (jobListViewer != null && !jobListViewer.getControl().isDisposed()) { jobListViewer.refresh(); Point newSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT); getShell().setSize(newSize); } setStatus(selectedError.getErrorStatus()); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
message = messageString == null ? "" : messageString; if (messageLabel == null || messageLabel.isDisposed()) { | message = messageString == null ? "" : messageString; if (messageLabel == null || messageLabel.isDisposed()) { | private void setMessage(String messageString) { //must not set null text in a label message = messageString == null ? "" : messageString; //$NON-NLS-1$ if (messageLabel == null || messageLabel.isDisposed()) { return; } messageLabel.setText(message); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
messageLabel.setText(message); } | messageLabel.setText(message); } | private void setMessage(String messageString) { //must not set null text in a label message = messageString == null ? "" : messageString; //$NON-NLS-1$ if (messageLabel == null || messageLabel.isDisposed()) { return; } messageLabel.setText(message); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
Button details = getButton(IDialogConstants.DETAILS_ID); if (details != null) { details.setEnabled(selectedError.getErrorStatus().isMultiStatus() || isMultipleJobErrors()); } Button gotoButton = getButton(GOTO_ACTION_ID); if (gotoButton != null) { IAction gotoAction = getGotoAction(); boolean hasValidGotoAction = gotoAction != null; String text = gotoButton.getText(); String newText = null; if (hasValidGotoAction) { newText = gotoAction.getText(); } if (newText == null) { hasValidGotoAction = false; newText = ProgressMessages.JobErrorDialog_CustomJobText; } if (!newText.equals(text)) { gotoButton.setText(newText); } gotoButton.setEnabled(hasValidGotoAction); gotoButton.setVisible(hasValidGotoAction); } } | Button details = getButton(IDialogConstants.DETAILS_ID); if (details != null) { details.setEnabled(selectedError.getErrorStatus().isMultiStatus() || isMultipleJobErrors()); } Button gotoButton = getButton(GOTO_ACTION_ID); if (gotoButton != null) { IAction gotoAction = getGotoAction(); boolean hasValidGotoAction = gotoAction != null; String text = gotoButton.getText(); String newText = null; if (hasValidGotoAction) { newText = gotoAction.getText(); } if (newText == null) { hasValidGotoAction = false; newText = ProgressMessages.JobErrorDialog_CustomJobText; } if (!newText.equals(text)) { gotoButton.setText(newText); } gotoButton.setEnabled(hasValidGotoAction); gotoButton.setVisible(hasValidGotoAction); } } | private void updateEnablements() { Button details = getButton(IDialogConstants.DETAILS_ID); if (details != null) { details.setEnabled(selectedError.getErrorStatus().isMultiStatus() || isMultipleJobErrors()); } Button gotoButton = getButton(GOTO_ACTION_ID); if (gotoButton != null) { IAction gotoAction = getGotoAction(); boolean hasValidGotoAction = gotoAction != null; String text = gotoButton.getText(); String newText = null; if (hasValidGotoAction) { newText = gotoAction.getText(); } if (newText == null) { hasValidGotoAction = false; newText = ProgressMessages.JobErrorDialog_CustomJobText; } if (!newText.equals(text)) { gotoButton.setText(newText); } gotoButton.setEnabled(hasValidGotoAction); gotoButton.setVisible(hasValidGotoAction); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
Node parent = box.getNode().getParentNode(); | public static void setupVerticalAlign(Context c, CalculatedStyle style, InlineBox box) { Node node = box.getNode(); // get the parent node for styling Node parent = box.getNode().getParentNode(); Element elem = null; if (box.getNode().getNodeType() == box.getNode().TEXT_NODE) { parent = parent.getParentNode(); elem = (Element) box.getNode().getParentNode(); } else { elem = (Element) box.getNode(); } CalculatedStyle parent_style = c.css.getStyle(LineBreaker.getElement(parent)); Font parent_font = FontUtil.getFont(c, style, parent); LineMetrics parent_metrics = null; if (!LayoutUtil.isReplaced(c, node)) { if (!LayoutUtil.isFloatedBlock(node, c)) { parent_metrics = parent_font.getLineMetrics(box.getSubstring(), ((Graphics2D) c.getGraphics()).getFontRenderContext()); } else { parent_metrics = parent_font.getLineMetrics("Test", ((Graphics2D) c.getGraphics()).getFontRenderContext()); } } else { parent_metrics = parent_font.getLineMetrics("Test", ((Graphics2D) c.getGraphics()).getFontRenderContext()); } // the height of the font float parent_height = parent_metrics.getHeight(); String vertical_align = style.propertyByName("vertical-align").computedValue().asString(); // set the height of the box to the height of the font if (!LayoutUtil.isReplaced(c, node)) { box.height = FontUtil.lineHeight(c, box); } if (vertical_align == null) { vertical_align = "baseline"; } box.baseline = 0; // box.y is relative to the parent's baseline box.y = 0; // do nothing for 'baseline' box.vset = true; if (vertical_align.equals("baseline")) { Font font = FontUtil.getFont(c, box); box.y += FontUtil.getDescent(c, box, font); } // works okay i think if (vertical_align.equals("super")) { box.y = box.y + (int) (parent_metrics.getStrikethroughOffset() * 2.0); } // works okay, i think if (vertical_align.equals("sub")) { box.y = box.y - (int) parent_metrics.getStrikethroughOffset(); } // joshy: this is using the current baseline instead of the parent's baseline // must fix if (vertical_align.equals("text-top")) { // the top of this text is equal to the top of the parent's text // so we take the parent's height above the baseline and subtract our // height above the baseline box.y = -((int) parent_height - box.height); } // not implemented correctly yet if (vertical_align.equals("text-bottom")) { box.y = 0; } // not implemented correctly yet. if (vertical_align.equals("top")) { box.y = box.y - box.baseline; box.top_align = true; box.vset = false; } if (vertical_align.equals("bottom")) { box.y = box.y - box.baseline; box.bottom_align = true; box.vset = false; } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/810d20da09b135490001c813971ac26af6d13f00/VerticalAlign.java/clean/src/java/org/xhtmlrenderer/layout/inline/VerticalAlign.java |
|
Element elem = null; if (box.getNode().getNodeType() == box.getNode().TEXT_NODE) { parent = parent.getParentNode(); elem = (Element) box.getNode().getParentNode(); } else { elem = (Element) box.getNode(); } CalculatedStyle parent_style = c.css.getStyle(LineBreaker.getElement(parent)); Font parent_font = FontUtil.getFont(c, style, parent); | Font parent_font = FontUtil.getFont(c, style); | public static void setupVerticalAlign(Context c, CalculatedStyle style, InlineBox box) { Node node = box.getNode(); // get the parent node for styling Node parent = box.getNode().getParentNode(); Element elem = null; if (box.getNode().getNodeType() == box.getNode().TEXT_NODE) { parent = parent.getParentNode(); elem = (Element) box.getNode().getParentNode(); } else { elem = (Element) box.getNode(); } CalculatedStyle parent_style = c.css.getStyle(LineBreaker.getElement(parent)); Font parent_font = FontUtil.getFont(c, style, parent); LineMetrics parent_metrics = null; if (!LayoutUtil.isReplaced(c, node)) { if (!LayoutUtil.isFloatedBlock(node, c)) { parent_metrics = parent_font.getLineMetrics(box.getSubstring(), ((Graphics2D) c.getGraphics()).getFontRenderContext()); } else { parent_metrics = parent_font.getLineMetrics("Test", ((Graphics2D) c.getGraphics()).getFontRenderContext()); } } else { parent_metrics = parent_font.getLineMetrics("Test", ((Graphics2D) c.getGraphics()).getFontRenderContext()); } // the height of the font float parent_height = parent_metrics.getHeight(); String vertical_align = style.propertyByName("vertical-align").computedValue().asString(); // set the height of the box to the height of the font if (!LayoutUtil.isReplaced(c, node)) { box.height = FontUtil.lineHeight(c, box); } if (vertical_align == null) { vertical_align = "baseline"; } box.baseline = 0; // box.y is relative to the parent's baseline box.y = 0; // do nothing for 'baseline' box.vset = true; if (vertical_align.equals("baseline")) { Font font = FontUtil.getFont(c, box); box.y += FontUtil.getDescent(c, box, font); } // works okay i think if (vertical_align.equals("super")) { box.y = box.y + (int) (parent_metrics.getStrikethroughOffset() * 2.0); } // works okay, i think if (vertical_align.equals("sub")) { box.y = box.y - (int) parent_metrics.getStrikethroughOffset(); } // joshy: this is using the current baseline instead of the parent's baseline // must fix if (vertical_align.equals("text-top")) { // the top of this text is equal to the top of the parent's text // so we take the parent's height above the baseline and subtract our // height above the baseline box.y = -((int) parent_height - box.height); } // not implemented correctly yet if (vertical_align.equals("text-bottom")) { box.y = 0; } // not implemented correctly yet. if (vertical_align.equals("top")) { box.y = box.y - box.baseline; box.top_align = true; box.vset = false; } if (vertical_align.equals("bottom")) { box.y = box.y - box.baseline; box.bottom_align = true; box.vset = false; } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/810d20da09b135490001c813971ac26af6d13f00/VerticalAlign.java/clean/src/java/org/xhtmlrenderer/layout/inline/VerticalAlign.java |
+ lastModifiedDate + " by '" + modifiedNick + "'"; | + lastModifiedDate + "("+ lastModifiedDate.getTime() +") by '" + modifiedNick + "'"; | public String toDetailString() { String modifiedNick; if (modifiedBy == null) { modifiedNick = "-unknown-"; } else { modifiedNick = modifiedBy.nick; } return (deleted ? "(del) " : "") + toString() + ", size: " + size + " bytes, version: " + getVersion() + ", modified: " + lastModifiedDate + " by '" + modifiedNick + "'"; } | 51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/f590cd83348221ff0b80ca42dbcf074366595061/FileInfo.java/buggy/src/main/de/dal33t/powerfolder/light/FileInfo.java |
public void handleListChange(IObservableList source, ListDiff diff) { | public void handleListChange(ListChangeEvent event) { | public UnmodifiableObservableList(IObservableList wrappedList) { super(wrappedList.getRealm(), wrappedList, wrappedList.getElementType()); this.wrappedList = wrappedList; wrappedList.addListChangeListener(new IListChangeListener() { public void handleListChange(IObservableList source, ListDiff diff) { // Fires a Change and then ListChange event. fireListChange(diff); } }); wrappedList.addStaleListener(new IStaleListener() { public void handleStale(IObservable source) { fireStale(); } }); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6aecdb31231a8602dbf72944625703c440949c78/UnmodifiableObservableList.java/clean/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/UnmodifiableObservableList.java |
fireListChange(diff); | fireListChange(event.diff); | public UnmodifiableObservableList(IObservableList wrappedList) { super(wrappedList.getRealm(), wrappedList, wrappedList.getElementType()); this.wrappedList = wrappedList; wrappedList.addListChangeListener(new IListChangeListener() { public void handleListChange(IObservableList source, ListDiff diff) { // Fires a Change and then ListChange event. fireListChange(diff); } }); wrappedList.addStaleListener(new IStaleListener() { public void handleStale(IObservable source) { fireStale(); } }); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6aecdb31231a8602dbf72944625703c440949c78/UnmodifiableObservableList.java/clean/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/UnmodifiableObservableList.java |
public void handleStale(IObservable source) { | public void handleStale(StaleEvent event) { | public UnmodifiableObservableList(IObservableList wrappedList) { super(wrappedList.getRealm(), wrappedList, wrappedList.getElementType()); this.wrappedList = wrappedList; wrappedList.addListChangeListener(new IListChangeListener() { public void handleListChange(IObservableList source, ListDiff diff) { // Fires a Change and then ListChange event. fireListChange(diff); } }); wrappedList.addStaleListener(new IStaleListener() { public void handleStale(IObservable source) { fireStale(); } }); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6aecdb31231a8602dbf72944625703c440949c78/UnmodifiableObservableList.java/clean/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/UnmodifiableObservableList.java |
public void handleListChange(IObservableList source, ListDiff diff) { | public void handleListChange(ListChangeEvent event) { | public void handleListChange(IObservableList source, ListDiff diff) { // Fires a Change and then ListChange event. fireListChange(diff); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6aecdb31231a8602dbf72944625703c440949c78/UnmodifiableObservableList.java/clean/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/UnmodifiableObservableList.java |
fireListChange(diff); | fireListChange(event.diff); | public void handleListChange(IObservableList source, ListDiff diff) { // Fires a Change and then ListChange event. fireListChange(diff); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6aecdb31231a8602dbf72944625703c440949c78/UnmodifiableObservableList.java/clean/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/UnmodifiableObservableList.java |
public void handleStale(IObservable source) { | public void handleStale(StaleEvent event) { | public void handleStale(IObservable source) { fireStale(); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6aecdb31231a8602dbf72944625703c440949c78/UnmodifiableObservableList.java/clean/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/UnmodifiableObservableList.java |
public HTMLTest(String[] args) { super(BASE_TITLE); panel = new XHTMLPanel(); int width = 360; int height = 500; panel.setPreferredSize(new Dimension(width, height)); JScrollPane scroll = new JScrollPane(panel); scroll.setVerticalScrollBarPolicy(scroll.VERTICAL_SCROLLBAR_ALWAYS); scroll.setHorizontalScrollBarPolicy(scroll.HORIZONTAL_SCROLLBAR_ALWAYS); scroll.setPreferredSize(new Dimension(width, height)); LinkListener ll = new LinkListener(panel); panel.addMouseListener(ll); panel.addMouseMotionListener(ll); /*HoverListener hov = new HoverListener(panel);panel.addMouseListener(hov);panel.addMouseMotionListener(hov); */ if (args.length > 0) { loadDocument(args[0]); } getContentPane().add("Center", scroll); JMenuBar mb = new JMenuBar(); JMenu file = new JMenu("File"); mb.add(file); file.setMnemonic('F'); file.add(new QuitAction()); JMenu view = new JMenu("View"); mb.add(view); view.setMnemonic('V'); view.add(new RefreshPageAction()); view.add(new ReloadPageAction()); /* JMenu test = new JMenu( "Test" ); mb.add( test ); test.setMnemonic( 'T' ); String demoRootDir = "demos/browser/xhtml"; addFileLoadAction( test, "One Liner", demoRootDir + "/one-line.xhtml" ); addFileLoadAction( test, "Background Colors/Images", demoRootDir + "/background.xhtml" ); addFileLoadAction( test, "Borders", demoRootDir + "/border.xhtml" ); addFileLoadAction( test, "Box Sizing", demoRootDir + "/box-sizing.xhtml" ); addFileLoadAction( test, "Mixed Test (1)", demoRootDir + "/content.xhtml" ); addFileLoadAction( test, "Line Breaking", demoRootDir + "/breaking.xhtml" ); addFileLoadAction( test, "Headers", demoRootDir + "/header.xhtml" ); addFileLoadAction( test, "Inline Image", demoRootDir + "/image.xhtml" ); addFileLoadAction( test, "List ", demoRootDir + "/list.xhtml" ); addFileLoadAction( test, "Nesting", demoRootDir + "/nested.xhtml" ); addFileLoadAction( test, "General Styled Text", demoRootDir + "/paragraph.xhtml" ); addFileLoadAction( test, "CSS Selectors", demoRootDir + "/selectors.xhtml" ); addFileLoadAction( test, "Table", demoRootDir + "/table.xhtml" ); addFileLoadAction( test, "Text Alignment", demoRootDir + "/text-alignment.xhtml" ); addFileLoadAction( test, "Whitespace Handling", demoRootDir + "/whitespace.xhtml" ); addFileLoadAction( test, "iTunes Email", demoRootDir + "/itunes/itunes1.xhtml" ); addFileLoadAction( test, "Follow Links", demoRootDir + "/link.xhtml" ); addFileLoadAction( test, "Hamlet (slow!)", demoRootDir + "/hamlet.xhtml" ); addFileLoadAction( test, "extended", demoRootDir + "/extended.xhtml" ); addFileLoadAction( test, "XML-like", demoRootDir + "/xml.xhtml" ); addFileLoadAction( test, "XML", demoRootDir + "/xml.xml" ); addFileLoadAction( test, "pseudo-element", "/home/tobe/Projekt/xhtmlrenderer/test.xhtml" ); */ JMenu debug = new JMenu("Debug"); mb.add(debug); debug.setMnemonic('D'); JMenu debugShow = new JMenu("Show"); debug.add(debugShow); debugShow.setMnemonic('S'); debugShow.add(new JCheckBoxMenuItem(new BoxOutlinesAction())); debugShow.add(new JCheckBoxMenuItem(new LineBoxOutlinesAction())); debugShow.add(new JCheckBoxMenuItem(new InlineBoxesAction())); debugShow.add(new JCheckBoxMenuItem(new FontMetricsAction())); JMenu anti = new JMenu("Anti Aliasing"); anti.add(new JCheckBoxMenuItem(new AntiAliasedAction("None", TextRenderer.NONE))); anti.add(new JCheckBoxMenuItem(new AntiAliasedAction("Low (Default)", TextRenderer.LOW))); anti.add(new JCheckBoxMenuItem(new AntiAliasedAction("Medium", TextRenderer.MEDIUM))); anti.add(new JCheckBoxMenuItem(new AntiAliasedAction("Highest", TextRenderer.HIGH))); debug.add(anti); debug.add(new ShowDOMInspectorAction());/* debug.add( new AbstractAction( "Print Box Tree" ) { public void actionPerformed( ActionEvent evt ) { panel.printTree(); } } );*/ setJMenuBar(mb); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/a821099cb0ae20c2cf9015c8152b89c95600f113/HTMLTest.java/clean/src/java/org/xhtmlrenderer/swing/HTMLTest.java |
||
if (result == null) { return runtime.getNil(); } return result; | return result == null ? runtime.getNil() : result; | public IRubyObject getDynamicValue(String name) { IRubyObject result = ((DynamicVariableSet) dynamicVarsStack.peek()).get(name); if (result == null) { return runtime.getNil(); } return result; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f5c9a1ebd775712f2dc086acfce1a14a123ec632/ThreadContext.java/clean/src/org/jruby/runtime/ThreadContext.java |
public IRubyObject yield(IRubyObject value, IRubyObject self, RubyModule klass, boolean checkArguments) { | public IRubyObject yield(IRubyObject value, IRubyObject self, RubyModule klass, boolean yieldProc, boolean aValue) { | public IRubyObject yield(IRubyObject value, IRubyObject self, RubyModule klass, boolean checkArguments) { if (! isBlockGiven()) { throw new RaiseException(runtime, runtime.getExceptions().getLocalJumpError(), "yield called out of block"); } pushDynamicVars(); Block currentBlock = getBlockStack().getCurrent(); getFrameStack().push(currentBlock.getFrame()); Scope oldScope = (Scope) getScopeStack().getTop(); getScopeStack().setTop(currentBlock.getScope()); getBlockStack().pop(); dynamicVarsStack.push(currentBlock.getDynamicVariables()); pushClass((klass != null) ? klass : currentBlock.getKlass()); if (klass == null) { self = currentBlock.getSelf(); } if (value == null) { value = RubyArray.newArray(runtime, 0); } ICallable method = currentBlock.getMethod(); if (method == null) { return runtime.getNil(); } getIterStack().push(currentBlock.getIter()); IRubyObject[] args = prepareArguments(value, self, currentBlock.getVar(), checkArguments); try { while (true) { try { return method.call(runtime, self, null, args, false); } catch (RedoJump rExcptn) { } } } catch (NextJump nExcptn) { IRubyObject nextValue = nExcptn.getNextValue(); return nextValue == null ? runtime.getNil() : nextValue; } finally { getIterStack().pop(); popClass(); dynamicVarsStack.pop(); getBlockStack().setCurrent(currentBlock); getFrameStack().pop(); getScopeStack().setTop(oldScope); dynamicVarsStack.pop(); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f5c9a1ebd775712f2dc086acfce1a14a123ec632/ThreadContext.java/clean/src/org/jruby/runtime/ThreadContext.java |
if (value == null) { value = RubyArray.newArray(runtime, 0); | INode blockVar = currentBlock.getVar(); if (blockVar != null) { if (blockVar instanceof ZeroArgNode) { if (yieldProc && arrayLength(value) != 0) { throw new ArgumentError(runtime, "wrong # of arguments(" + ((RubyArray)value).getLength() + "for 0)"); } } else if (blockVar instanceof MultipleAsgnNode) { if (!aValue) { value = sValueToMRHS(value, ((MultipleAsgnNode)blockVar).getHeadNode()); } value = mAssign(self, (MultipleAsgnNode)blockVar, (RubyArray)value, yieldProc); } else { if (aValue) { int length = arrayLength(value); if (length == 0) { value = runtime.getNil(); } else if (length == 1) { value = ((RubyArray)value).first(); } else { } } else if (value == null) { } new AssignmentVisitor(runtime, self).assign(blockVar, value, yieldProc); } | public IRubyObject yield(IRubyObject value, IRubyObject self, RubyModule klass, boolean checkArguments) { if (! isBlockGiven()) { throw new RaiseException(runtime, runtime.getExceptions().getLocalJumpError(), "yield called out of block"); } pushDynamicVars(); Block currentBlock = getBlockStack().getCurrent(); getFrameStack().push(currentBlock.getFrame()); Scope oldScope = (Scope) getScopeStack().getTop(); getScopeStack().setTop(currentBlock.getScope()); getBlockStack().pop(); dynamicVarsStack.push(currentBlock.getDynamicVariables()); pushClass((klass != null) ? klass : currentBlock.getKlass()); if (klass == null) { self = currentBlock.getSelf(); } if (value == null) { value = RubyArray.newArray(runtime, 0); } ICallable method = currentBlock.getMethod(); if (method == null) { return runtime.getNil(); } getIterStack().push(currentBlock.getIter()); IRubyObject[] args = prepareArguments(value, self, currentBlock.getVar(), checkArguments); try { while (true) { try { return method.call(runtime, self, null, args, false); } catch (RedoJump rExcptn) { } } } catch (NextJump nExcptn) { IRubyObject nextValue = nExcptn.getNextValue(); return nextValue == null ? runtime.getNil() : nextValue; } finally { getIterStack().pop(); popClass(); dynamicVarsStack.pop(); getBlockStack().setCurrent(currentBlock); getFrameStack().pop(); getScopeStack().setTop(oldScope); dynamicVarsStack.pop(); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f5c9a1ebd775712f2dc086acfce1a14a123ec632/ThreadContext.java/clean/src/org/jruby/runtime/ThreadContext.java |
IRubyObject[] args = prepareArguments(value, self, currentBlock.getVar(), checkArguments); | IRubyObject[] args = ArgsUtil.arrayify(runtime, value); | public IRubyObject yield(IRubyObject value, IRubyObject self, RubyModule klass, boolean checkArguments) { if (! isBlockGiven()) { throw new RaiseException(runtime, runtime.getExceptions().getLocalJumpError(), "yield called out of block"); } pushDynamicVars(); Block currentBlock = getBlockStack().getCurrent(); getFrameStack().push(currentBlock.getFrame()); Scope oldScope = (Scope) getScopeStack().getTop(); getScopeStack().setTop(currentBlock.getScope()); getBlockStack().pop(); dynamicVarsStack.push(currentBlock.getDynamicVariables()); pushClass((klass != null) ? klass : currentBlock.getKlass()); if (klass == null) { self = currentBlock.getSelf(); } if (value == null) { value = RubyArray.newArray(runtime, 0); } ICallable method = currentBlock.getMethod(); if (method == null) { return runtime.getNil(); } getIterStack().push(currentBlock.getIter()); IRubyObject[] args = prepareArguments(value, self, currentBlock.getVar(), checkArguments); try { while (true) { try { return method.call(runtime, self, null, args, false); } catch (RedoJump rExcptn) { } } } catch (NextJump nExcptn) { IRubyObject nextValue = nExcptn.getNextValue(); return nextValue == null ? runtime.getNil() : nextValue; } finally { getIterStack().pop(); popClass(); dynamicVarsStack.pop(); getBlockStack().setCurrent(currentBlock); getFrameStack().pop(); getScopeStack().setTop(oldScope); dynamicVarsStack.pop(); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f5c9a1ebd775712f2dc086acfce1a14a123ec632/ThreadContext.java/clean/src/org/jruby/runtime/ThreadContext.java |
null | StringPool.BLANK | public ActionForward render( ActionMapping mapping, ActionForm form, PortletConfig config, RenderRequest req, RenderResponse res) throws Exception { String composeAction = ParamUtil.getString(req, "composeAction"); long messageId = ParamUtil.getLong(req, "messageId"); String folderId = ParamUtil.getString(req, "folderId"); RenderRequestImpl reqImpl = (RenderRequestImpl)req; HttpServletRequest svltReq = reqImpl.getHttpServletRequest(); if (composeAction.equals("forward") || composeAction.startsWith("reply")) { MailMessage mm = MailUtil.getMessage(svltReq.getSession(), folderId, messageId); User user = PortalUtil.getUser(req); DateFormat dateFormatter = DateFormats.getDateTime(user.getLocale(), user.getTimeZone()); req.setAttribute( WebKeys.MAIL_MESSAGE, _buildBody(mm, dateFormatter)); if (composeAction.equals("forward")) { req.setAttribute(WebKeys.MAIL_SUBJECT, "Fw: " + _removeSubjectPrefix(mm.getSubject(), "fw")); req.setAttribute(WebKeys.MAIL_ATTACHMENTS, mm.getRemoteAttachments()); } else { String tosStr = StringPool.BLANK; String ccsStr = StringPool.BLANK; if (composeAction.equals("replyAll")) { String userEmail = PortalUtil.getUser(req).getEmailAddress(); tosStr = InternetAddressUtil.toString( InternetAddressUtil.removeEntry(mm.getTo(), userEmail)); ccsStr = InternetAddressUtil.toString( InternetAddressUtil.removeEntry(mm.getCc(), userEmail)); String rtosStr = InternetAddressUtil.toString(mm.getReplyTo()); if (Validator.isNull(rtosStr)) { rtosStr = ((InternetAddress)mm.getFrom()).toUnicodeString(); } tosStr = rtosStr + StringPool.COMMA + StringPool.SPACE + tosStr; } else { tosStr = InternetAddressUtil.toString(mm.getReplyTo()); if (Validator.isNull(tosStr)) { tosStr = ((InternetAddress)mm.getFrom()).toUnicodeString(); } } String [] recipients = { Html.escape(tosStr, true), Html.escape(ccsStr, true), null }; req.setAttribute(WebKeys.MAIL_RECIPIENTS, recipients); req.setAttribute(WebKeys.MAIL_SUBJECT, "Re: " + _removeSubjectPrefix(mm.getSubject(), "re")); } } else if (composeAction.equals("edit")) { MailMessage mm = MailUtil.getMessage(svltReq.getSession(), folderId, messageId); String [] recipients = { Html.escape(InternetAddressUtil.toString(mm.getTo()), true), Html.escape(InternetAddressUtil.toString(mm.getCc()), true), Html.escape(InternetAddressUtil.toString(mm.getBcc()), true) }; req.setAttribute(WebKeys.MAIL_RECIPIENTS, recipients); req.setAttribute(WebKeys.MAIL_SUBJECT, mm.getSubject()); req.setAttribute(WebKeys.MAIL_ATTACHMENTS, mm.getRemoteAttachments()); req.setAttribute(WebKeys.MAIL_MESSAGE, mm.getHtmlBody()); req.setAttribute(WebKeys.MAIL_DRAFT_ID, new Long(messageId)); } return mapping.findForward( getForward(req, "portlet.mailbox.edit_message")); } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/23b90c992f469f9cb81df80ca1493224982db7bd/EditMessageAction.java/buggy/portal-ejb/src/com/liferay/portlet/mailbox/action/EditMessageAction.java |
getLogger().info("Mutation returned %s", sync.get()); | getLogger().debug("Mutation returned %s", sync.get()); | private long mutate(MutatorOperation.Mutator m, String key, int by) { final SynchronizationObject<Long> sync= new SynchronizationObject<Long>(null); conn.addOperation(getServerForKey(key), new MutatorOperation(m, key, by, new MutatorOperation.Callback() { public void mutatorResult(Long val) { if(val == null) { val=new Long(-1); } sync.set(val); }})); waitForNotNull(sync); getLogger().info("Mutation returned %s", sync.get()); return sync.get().longValue(); } | 56561 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56561/c6550fbfa3915fd4cef04241f0940905c96dea0c/MemcachedClient.java/clean/src/java/net/spy/memcached/MemcachedClient.java |
super(); | public PerspectiveExtensionReader() { super();} | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/faa16182e98feaa2242bb35fc3293c271dd882c6/PerspectiveExtensionReader.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveExtensionReader.java |
|
else if (type.equals(TAG_SHOW_IN_PART)) result = processShowInPart(child); | private boolean processExtension(IConfigurationElement element) { IConfigurationElement [] children = element.getChildren(); for (int nX = 0; nX < children.length; nX ++) { IConfigurationElement child = children[nX]; String type = child.getName(); boolean result = false; if (type.equals(TAG_ACTION_SET)) result = processActionSet(child); else if (type.equals(TAG_VIEW)) result = processView(child); else if (type.equals(TAG_VIEW_SHORTCUT)) result = processViewShortcut(child); else if (type.equals(TAG_WIZARD_SHORTCUT)) result = processWizardShortcut(child); else if (type.equals(TAG_PERSP_SHORTCUT)) result = processPerspectiveShortcut(child); if (!result) { WorkbenchPlugin.log("Unable to process element: " +//$NON-NLS-1$ type + " in perspective extension: " +//$NON-NLS-1$ element.getDeclaringExtension().getUniqueIdentifier()); } } return true;} | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/faa16182e98feaa2242bb35fc3293c271dd882c6/PerspectiveExtensionReader.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveExtensionReader.java |
|
public void scansStarted(FolderRepositoryEvent e) { | public void maintenanceStarted(FolderRepositoryEvent e) { | private JButton createSyncNowToolbarButton() { final JButton syncNowButton = createToolbarButton(getUIController() .getSyncAllFoldersAction(), Icons.SYNC_NOW); // Adapt state from folder repository getController().getFolderRepository().addFolderRepositoryListener( new FolderRepositoryListener() { public void unjoinedFolderAdded(FolderRepositoryEvent e) { } public void folderRemoved(FolderRepositoryEvent e) { } public void folderCreated(FolderRepositoryEvent e) { } public void scansStarted(FolderRepositoryEvent e) { syncNowButton.setIcon(Icons.SYNC_NOW_ACTIVE); } public void scansFinished(FolderRepositoryEvent e) { syncNowButton.setIcon(Icons.SYNC_NOW); } public void unjoinedFolderRemoved(FolderRepositoryEvent e) { } public boolean fireInEventDispathThread() { return true; } }); return syncNowButton; } | 51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/15856bebea0a30ff33b111b11f385a3e5bed19ad/Toolbar.java/buggy/src/main/de/dal33t/powerfolder/ui/Toolbar.java |
public void scansFinished(FolderRepositoryEvent e) { | public void maintenanceFinished(FolderRepositoryEvent e) { | private JButton createSyncNowToolbarButton() { final JButton syncNowButton = createToolbarButton(getUIController() .getSyncAllFoldersAction(), Icons.SYNC_NOW); // Adapt state from folder repository getController().getFolderRepository().addFolderRepositoryListener( new FolderRepositoryListener() { public void unjoinedFolderAdded(FolderRepositoryEvent e) { } public void folderRemoved(FolderRepositoryEvent e) { } public void folderCreated(FolderRepositoryEvent e) { } public void scansStarted(FolderRepositoryEvent e) { syncNowButton.setIcon(Icons.SYNC_NOW_ACTIVE); } public void scansFinished(FolderRepositoryEvent e) { syncNowButton.setIcon(Icons.SYNC_NOW); } public void unjoinedFolderRemoved(FolderRepositoryEvent e) { } public boolean fireInEventDispathThread() { return true; } }); return syncNowButton; } | 51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/15856bebea0a30ff33b111b11f385a3e5bed19ad/Toolbar.java/buggy/src/main/de/dal33t/powerfolder/ui/Toolbar.java |
if (shoppingCategory.isNew() || shoppingCategory.isModified()) { session = openSession(); if (shoppingCategory.isNew()) { ShoppingCategory shoppingCategoryModel = new ShoppingCategory(); shoppingCategoryModel.setCategoryId(shoppingCategory.getCategoryId()); shoppingCategoryModel.setGroupId(shoppingCategory.getGroupId()); shoppingCategoryModel.setCompanyId(shoppingCategory.getCompanyId()); shoppingCategoryModel.setUserId(shoppingCategory.getUserId()); shoppingCategoryModel.setUserName(shoppingCategory.getUserName()); shoppingCategoryModel.setCreateDate(shoppingCategory.getCreateDate()); shoppingCategoryModel.setModifiedDate(shoppingCategory.getModifiedDate()); shoppingCategoryModel.setParentCategoryId(shoppingCategory.getParentCategoryId()); shoppingCategoryModel.setName(shoppingCategory.getName()); shoppingCategoryModel.setDescription(shoppingCategory.getDescription()); session.save(shoppingCategoryModel); session.flush(); } else { ShoppingCategory shoppingCategoryModel = (ShoppingCategory)session.get(ShoppingCategory.class, shoppingCategory.getPrimaryKey()); if (shoppingCategoryModel != null) { shoppingCategoryModel.setGroupId(shoppingCategory.getGroupId()); shoppingCategoryModel.setCompanyId(shoppingCategory.getCompanyId()); shoppingCategoryModel.setUserId(shoppingCategory.getUserId()); shoppingCategoryModel.setUserName(shoppingCategory.getUserName()); shoppingCategoryModel.setCreateDate(shoppingCategory.getCreateDate()); shoppingCategoryModel.setModifiedDate(shoppingCategory.getModifiedDate()); shoppingCategoryModel.setParentCategoryId(shoppingCategory.getParentCategoryId()); shoppingCategoryModel.setName(shoppingCategory.getName()); shoppingCategoryModel.setDescription(shoppingCategory.getDescription()); session.flush(); } else { shoppingCategoryModel = new ShoppingCategory(); shoppingCategoryModel.setCategoryId(shoppingCategory.getCategoryId()); shoppingCategoryModel.setGroupId(shoppingCategory.getGroupId()); shoppingCategoryModel.setCompanyId(shoppingCategory.getCompanyId()); shoppingCategoryModel.setUserId(shoppingCategory.getUserId()); shoppingCategoryModel.setUserName(shoppingCategory.getUserName()); shoppingCategoryModel.setCreateDate(shoppingCategory.getCreateDate()); shoppingCategoryModel.setModifiedDate(shoppingCategory.getModifiedDate()); shoppingCategoryModel.setParentCategoryId(shoppingCategory.getParentCategoryId()); shoppingCategoryModel.setName(shoppingCategory.getName()); shoppingCategoryModel.setDescription(shoppingCategory.getDescription()); session.save(shoppingCategoryModel); session.flush(); } } shoppingCategory.setNew(false); shoppingCategory.setModified(false); } | session = openSession(); session.saveOrUpdate(shoppingCategory); session.flush(); shoppingCategory.setNew(false); | public com.liferay.portlet.shopping.model.ShoppingCategory update( com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory) throws SystemException { Session session = null; try { if (shoppingCategory.isNew() || shoppingCategory.isModified()) { session = openSession(); if (shoppingCategory.isNew()) { ShoppingCategory shoppingCategoryModel = new ShoppingCategory(); shoppingCategoryModel.setCategoryId(shoppingCategory.getCategoryId()); shoppingCategoryModel.setGroupId(shoppingCategory.getGroupId()); shoppingCategoryModel.setCompanyId(shoppingCategory.getCompanyId()); shoppingCategoryModel.setUserId(shoppingCategory.getUserId()); shoppingCategoryModel.setUserName(shoppingCategory.getUserName()); shoppingCategoryModel.setCreateDate(shoppingCategory.getCreateDate()); shoppingCategoryModel.setModifiedDate(shoppingCategory.getModifiedDate()); shoppingCategoryModel.setParentCategoryId(shoppingCategory.getParentCategoryId()); shoppingCategoryModel.setName(shoppingCategory.getName()); shoppingCategoryModel.setDescription(shoppingCategory.getDescription()); session.save(shoppingCategoryModel); session.flush(); } else { ShoppingCategory shoppingCategoryModel = (ShoppingCategory)session.get(ShoppingCategory.class, shoppingCategory.getPrimaryKey()); if (shoppingCategoryModel != null) { shoppingCategoryModel.setGroupId(shoppingCategory.getGroupId()); shoppingCategoryModel.setCompanyId(shoppingCategory.getCompanyId()); shoppingCategoryModel.setUserId(shoppingCategory.getUserId()); shoppingCategoryModel.setUserName(shoppingCategory.getUserName()); shoppingCategoryModel.setCreateDate(shoppingCategory.getCreateDate()); shoppingCategoryModel.setModifiedDate(shoppingCategory.getModifiedDate()); shoppingCategoryModel.setParentCategoryId(shoppingCategory.getParentCategoryId()); shoppingCategoryModel.setName(shoppingCategory.getName()); shoppingCategoryModel.setDescription(shoppingCategory.getDescription()); session.flush(); } else { shoppingCategoryModel = new ShoppingCategory(); shoppingCategoryModel.setCategoryId(shoppingCategory.getCategoryId()); shoppingCategoryModel.setGroupId(shoppingCategory.getGroupId()); shoppingCategoryModel.setCompanyId(shoppingCategory.getCompanyId()); shoppingCategoryModel.setUserId(shoppingCategory.getUserId()); shoppingCategoryModel.setUserName(shoppingCategory.getUserName()); shoppingCategoryModel.setCreateDate(shoppingCategory.getCreateDate()); shoppingCategoryModel.setModifiedDate(shoppingCategory.getModifiedDate()); shoppingCategoryModel.setParentCategoryId(shoppingCategory.getParentCategoryId()); shoppingCategoryModel.setName(shoppingCategory.getName()); shoppingCategoryModel.setDescription(shoppingCategory.getDescription()); session.save(shoppingCategoryModel); session.flush(); } } shoppingCategory.setNew(false); shoppingCategory.setModified(false); } return shoppingCategory; } catch (HibernateException he) { throw new SystemException(he); } finally { closeSession(session); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f4d6afc6707f57fd84bf6b624f0c119657b0a766/ShoppingCategoryPersistence.java/buggy/portal-ejb/src/com/liferay/portlet/shopping/service/persistence/ShoppingCategoryPersistence.java |
isvToolBar.setVisible(makeVisible); | isvToolBar.setVisible(makeVisible && toolbarIsVisible()); | public void setVisible(boolean makeVisible) { super.setVisible(makeVisible); if (isvToolBar != null) { isvToolBar.setVisible(makeVisible); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3f28e647de705950201fab4bfad13019c2d591c5/ViewPane.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewPane.java |
if (isvToolBar != null) { Control ctrl = getControl(); boolean visible = ctrl != null && ctrl.isVisible() && toolbarIsVisible(); isvToolBar.setVisible(visible); } | private void toolBarResized(ToolBar toolBar, int newSize) { presentableAdapter.firePropertyChange(IPresentablePart.PROP_TOOLBAR); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3f28e647de705950201fab4bfad13019c2d591c5/ViewPane.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewPane.java |
|
logger.info( "added a mouse motion listener: " + ma ); | logger.info( "added mouse selection listener: " + ma ); HoverListener hl = new HoverListener(root.panel.view); root.panel.view.addMouseListener(hl); root.panel.view.addMouseMotionListener(hl); logger.info( "added hover listener:" + hl); | public void createActions() { SelectionMouseListener ma = new SelectionMouseListener(); root.panel.view.addMouseListener( ma ); root.panel.view.addMouseMotionListener( ma ); logger.info( "added a mouse motion listener: " + ma ); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/95d146365b773a18a7e529af5965f0a6034c5e7b/BrowserMenuBar.java/clean/demos/browser/src/java/org/xhtmlrenderer/demo/browser/BrowserMenuBar.java |
demos.add( new LoadAction( "Rollovers with :hover ", "demo:demos/hover.xhtml")); | public void createLayout() { file.add( root.actions.open_file ); file.add( root.actions.quit ); add( file ); edit.add( root.actions.cut ); edit.add( root.actions.copy ); edit.add( root.actions.paste ); add( edit ); view.add( view_source ); add( view ); go.add( root.actions.forward ); go.add( root.actions.backward ); add( go ); // CLEAN demos.add( new LoadAction( "Inheritance", "demo:demos/inherit.xhtml" ) ); demos.add( new LoadAction( "Borders", "demo:demos/border.xhtml" ) ); demos.add( new LoadAction( "Backgrounds", "demo:demos/background.xhtml" ) ); demos.add( new LoadAction( "Paragraph", "demo:demos/paragraph.xhtml" ) ); demos.add( new LoadAction( "Line Breaking", "demo:demos/breaking.xhtml" ) ); demos.add( new LoadAction( "Forms", "demo:demos/forms.xhtml" ) ); demos.add( new LoadAction( "Headers", "demo:demos/header.xhtml" ) ); demos.add( new LoadAction( "Nested Divs", "demo:demos/nested.xhtml" ) ); demos.add( new LoadAction( "Selectors", "demo:demos/selectors.xhtml" ) ); demos.add( new LoadAction( "Images", "demo:demos/image.xhtml" ) ); demos.add( new LoadAction( "Lists", "demo:demos/list.xhtml" ) ); //demos.add( new LoadAction( "Tables", "demo:demos/table.xhtml")); demos.add( new LoadAction( "Hamlet", "demo:demos/hamlet.xhtml")); demos.add( new LoadAction( "Alice", "demo:demos/alice/alice.xhtml")); demos.add( new LoadAction( "Financial Report", "demo:demos/report.xhtml")); try { //demos.add(new LoadAction("File Listing (Win)","file:///c:")); //demos.add(new LoadAction("File Listing (Unix)","file:///")); } catch ( Exception ex ) { u.p( ex ); } add( demos ); JMenu debugShow = new JMenu( "Show" ); debug.add( debugShow ); debugShow.setMnemonic( 'S' ); debugShow.add( new JCheckBoxMenuItem( new BoxOutlinesAction() ) ); debugShow.add( new JCheckBoxMenuItem( new LineBoxOutlinesAction() ) ); debugShow.add( new JCheckBoxMenuItem( new InlineBoxesAction() ) ); debugShow.add( new JCheckBoxMenuItem( new FontMetricsAction() ) ); JMenu anti = new JMenu("Minium Anti Aliasing"); anti.add( new JCheckBoxMenuItem( new AntiAliasedAction("Lowest (Default)",TextRenderingHints.DEFAULT_HINTS_FASTEST) ) ); anti.add( new JCheckBoxMenuItem( new AntiAliasedAction("Low",TextRenderingHints.DEFAULT_HINTS_QUALITY_LOW) ) ); anti.add( new JCheckBoxMenuItem( new AntiAliasedAction("Medium",TextRenderingHints.DEFAULT_HINTS_QUALITY_MEDIUM) ) ); anti.add( new JCheckBoxMenuItem( new AntiAliasedAction("High",TextRenderingHints.DEFAULT_HINTS_QUALITY_HIGH) ) ); anti.add( new JCheckBoxMenuItem( new AntiAliasedAction("Highest",TextRenderingHints.DEFAULT_HINTS_QUALITY_HIGHEST) ) ); debug.add(anti); debug.add( new ShowDOMInspectorAction() ); debug.add( new AbstractAction( "Validation Console" ) { public void actionPerformed( ActionEvent evt ) { if ( root.validation_console == null ) { root.validation_console = new JFrame( "Validation Console" ); JFrame frame = root.validation_console; JTextArea jta = new JTextArea(); root.error_handler.setTextArea( jta ); frame.getContentPane().setLayout( new BorderLayout() ); frame.getContentPane().add( new JScrollPane( jta ), "Center" ); JButton close = new JButton( "Close" ); frame.getContentPane().add( close, "South" ); close.addActionListener( new ActionListener() { public void actionPerformed( ActionEvent evt ) { root.validation_console.setVisible( false ); } } ); frame.pack(); frame.setSize( 200, 400 ); } root.validation_console.setVisible( true ); } } ); debug.add(root.actions.generate_diff); add( debug ); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/95d146365b773a18a7e529af5965f0a6034c5e7b/BrowserMenuBar.java/clean/demos/browser/src/java/org/xhtmlrenderer/demo/browser/BrowserMenuBar.java |
|
public void init(ServletConfig sc) throws ServletException { | public void init(ServletConfig config) throws ServletException { | public void init(ServletConfig sc) throws ServletException { synchronized (ImageServlet.class) { super.init(sc); ServletContext ctx = getServletContext(); _companyId = ctx.getInitParameter("company_id"); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/040c2681e4d9add708033fd90dece3a20844ca53/ImageServlet.java/clean/portal-ejb/src/com/liferay/portal/servlet/ImageServlet.java |
super.init(sc); | super.init(config); | public void init(ServletConfig sc) throws ServletException { synchronized (ImageServlet.class) { super.init(sc); ServletContext ctx = getServletContext(); _companyId = ctx.getInitParameter("company_id"); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/040c2681e4d9add708033fd90dece3a20844ca53/ImageServlet.java/clean/portal-ejb/src/com/liferay/portal/servlet/ImageServlet.java |
panel.setInteractive(false); | public Graphics2DRenderer() { panel = new XHTMLPanel(); panel.setThreadedLayout(false); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/9ac58abece8ac0f02983d3b07df9656b6a59c78a/Graphics2DRenderer.java/clean/src/java/org/xhtmlrenderer/simple/Graphics2DRenderer.java |
|
} catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data.data.opt.radioRetries=0x"+Long.toHexString(get_data_data_opt_radioRetries())+"]\n"; | public String toString() { String s = "Message <BroadcastPack> \n"; try { s += " [seqno=0x"+Long.toHexString(get_seqno())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data.src=0x"+Long.toHexString(get_data_src())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data.dest=0x"+Long.toHexString(get_data_dest())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data.type=0x"+Long.toHexString(get_data_type())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data.data.opt.mask=0x"+Long.toHexString(get_data_data_opt_mask())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data.data.opt.diagMode=0x"+Long.toHexString(get_data_data_opt_diagMode())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data.data.opt.txPower=0x"+Long.toHexString(get_data_data_opt_txPower())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data.data.opt.rfAck=0x"+Long.toHexString(get_data_data_opt_rfAck())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data.data.opt.radioOffTime=0x"+Long.toHexString(get_data_data_opt_radioOffTime())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data.data.opt.hplPM=0x"+Long.toHexString(get_data_data_opt_hplPM())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data.data.opt.rfChan=0x"+Long.toHexString(get_data_data_opt_rfChan())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data.data.wData.dataSet=0x"+Long.toHexString(get_data_data_wData_dataSet())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data.data.wData.level=0x"+Long.toHexString(get_data_data_wData_level())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data.data.wData.state=0x"+Long.toHexString(get_data_data_wData_state())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data.data.wData.value="; for (int i = 0; i < 2; i++) { s += Float.toString(getElement_data_data_wData_value(i))+" "; } s += "]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data.data.bpHeader.requestType=0x"+Long.toHexString(get_data_data_bpHeader_requestType())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data.data.bpHeader.packTotal=0x"+Long.toHexString(get_data_data_bpHeader_packTotal())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data.data.bpHeader.byteTotal=0x"+Long.toHexString(get_data_data_bpHeader_byteTotal())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data.data.bpHeader.numBlocks=0x"+Long.toHexString(get_data_data_bpHeader_numBlocks())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data.data.bpHeader.numPtrs=0x"+Long.toHexString(get_data_data_bpHeader_numPtrs())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data.data.bpData.curPack=0x"+Long.toHexString(get_data_data_bpData_curPack())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data.data.bpData.data="; for (int i = 0; i < 22; i++) { s += "0x"+Long.toHexString(getElement_data_data_bpData_data(i) & 0xff)+" "; } s += "]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data.data.wState.state=0x"+Long.toHexString(get_data_data_wState_state())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data.data.wState.dataSetTime=0x"+Long.toHexString(get_data_data_wState_dataSetTime())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data.data.rData.enable=0x"+Long.toHexString(get_data_data_rData_enable())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data.data.rData.mote=0x"+Long.toHexString(get_data_data_rData_mote())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } return s; } | 52796 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52796/ef288b4400bc8209627f2dafd246545644c05d05/BroadcastPack.java/clean/java/edu/rice/compass/comm/BroadcastPack.java |
|
transferCopyEntities(toolId, oSiteId, nSiteId); | transferCopyEntities(toolId, ContentHostingService.getSiteCollection(oSiteId), ContentHostingService.getSiteCollection(nSiteId)); | private void actionForTemplate ( String direction, int index, ParameterParser params, SessionState state) { // Continue - make any permanent changes, Back - keep any data entered on the form boolean forward = direction.equals("continue") ? true : false; SiteInfo siteInfo = new SiteInfo(); switch (index) { case 0: /* actionForTemplate chef_site-list.vm * */ break; case 1: /* actionForTemplate chef_site-type.vm * */ break; case 2: /* actionForTemplate chef_site-newSiteInformation.vm * */ if(state.getAttribute(STATE_SITE_INFO) != null) { siteInfo = (SiteInfo) state.getAttribute(STATE_SITE_INFO); } //defaults to be true siteInfo.include=true; state.setAttribute(STATE_SITE_INFO, siteInfo); updateSiteInfo(params, state); String siteType = (String) state.getAttribute(STATE_SITE_TYPE); if (!siteType.equalsIgnoreCase("course")) { String form_title = params.getString ("title"); // alerts after clicking Continue but not Back if(forward) { if ((form_title == null) || (form_title.trim().length() == 0)) { addAlert(state, rb.getString("java.reqfields")); state.setAttribute(STATE_TEMPLATE_INDEX, "2"); return; } if (!SiteService.allowAddSite(form_title)) { addAlert(state, rb.getString("java.haveadd")+" " + form_title + "."); return; } } } updateSiteAttributes(state); if (state.getAttribute(STATE_MESSAGE) == null) { updateCurrentStep(state, forward); } break; case 3: /* actionForTemplate chef_site-newSiteFeatures.vm * */ if (forward) { getFeatures(params, state); } if (state.getAttribute(STATE_MESSAGE) == null) { updateCurrentStep(state, forward); } break; case 4: /* actionForTemplate chef_site-addRemoveFeature.vm * */ break; case 5: /* actionForTemplate chef_site-addParticipant.vm * */ if(forward) { checkAddParticipant(params, state); } else { // remove related state variables removeAddParticipantContext(state); } break; case 6: /* actionForTemplate chef_site-removeParticipants.vm * */ break; case 7: /* actionForTemplate chef_site-changeRoles.vm * */ if (forward) { if (!((Boolean) state.getAttribute(STATE_CHANGEROLE_SAMEROLE)).booleanValue()) { getSelectedRoles(state, params, STATE_SELECTED_USER_LIST); } else { String role = params.getString("role_to_all"); if (role == null) { addAlert(state, rb.getString("java.pleasechoose")+" "); } else { state.setAttribute(STATE_CHANGEROLE_SAMEROLE_ROLE, role); } } } else { removeChangeRoleContext(state); } break; case 8: /* actionForTemplate chef_site-siteDeleteConfirm.vm * */ break; case 9: /* actionForTemplate chef_site-publishUnpublish.vm * */ updateSiteInfo(params, state); break; case 10: /* actionForTemplate chef_site-newSiteConfirm.vm * */ if (!forward) { if (state.getAttribute(STATE_MESSAGE) == null) { updateCurrentStep(state, false); } } break; case 11: /* actionForTemplate chef_site_newsitePublishUnpublish.vm * */ break; case 12: /* actionForTemplate chef_site_siteInfo-list.vm * */ break; case 13: /* actionForTemplate chef_site_siteInfo-editInfo.vm * */ if (forward) { Site Site = getStateSite(state); List titleEditableSiteType = (List) state.getAttribute(TITLE_EDITABLE_SITE_TYPE); if (titleEditableSiteType.contains(Site.getType())) { // site titel is editable and could not be null String title = StringUtil.trimToNull(params.getString("title")); state.setAttribute(FORM_SITEINFO_TITLE, title); if (title == null) { addAlert(state, rb.getString("java.specify")+" "); } } String description = StringUtil.trimToNull(params.getString("description")); state.setAttribute(FORM_SITEINFO_DESCRIPTION, description); String short_description = StringUtil.trimToNull(params.getString("short_description")); state.setAttribute(FORM_SITEINFO_SHORT_DESCRIPTION, short_description); String skin = params.getString("skin"); if (skin != null) { // if there is a skin input for course site skin = StringUtil.trimToNull(skin); state.setAttribute(FORM_SITEINFO_SKIN, skin); } else { // if ther is a icon input for non-course site String icon = StringUtil.trimToNull(params.getString("icon")); if (icon != null) { state.setAttribute(FORM_SITEINFO_ICON_URL, icon); } else { state.removeAttribute(FORM_SITEINFO_ICON_URL); } } // site contact information String contactName = StringUtil.trimToZero(params.getString ("siteContactName")); state.setAttribute(FORM_SITEINFO_CONTACT_NAME, contactName); String email = StringUtil.trimToZero(params.getString ("siteContactEmail")); String[] parts = email.split("@"); if(email.length() > 0 && (email.indexOf("@") == -1 || parts.length != 2 || parts[0].length() == 0 || !Validator.checkEmailLocal(parts[0]))) { // invalid email addAlert(state, email + " "+rb.getString("java.invalid") + INVALID_EMAIL); } state.setAttribute(FORM_SITEINFO_CONTACT_EMAIL, email); if (state.getAttribute(STATE_MESSAGE) == null) { state.setAttribute(STATE_TEMPLATE_INDEX, "14"); } } break; case 14: /* actionForTemplate chef_site_siteInfo-editInfoConfirm.vm * */ break; case 15: /* actionForTemplate chef_site_siteInfo-addRemoveFeatureConfirm.vm * */ break; case 16: /* actionForTemplate chef_site_siteInfo-publishUnpublish-sendEmail.vm * */ if (forward) { String notify = params.getString("notify"); if (notify != null) { state.setAttribute(FORM_WILL_NOTIFY, new Boolean(notify)); } } break; case 17: /* actionForTemplate chef_site_siteInfo--publishUnpublish-confirm.vm * */ if (forward) { boolean oldStatus = getStateSite(state).isPublished(); boolean newStatus = ((SiteInfo) state.getAttribute(STATE_SITE_INFO)).getPublished(); saveSiteStatus(state, newStatus); if (oldStatus == false || newStatus == true) { // if site's status been changed from unpublish to publish and notification is selected, send out notification to participants. if (((Boolean) state.getAttribute(FORM_WILL_NOTIFY)).booleanValue()) { // %%% place holder for sending email } } // commit site edit Site site = getStateSite(state); try { SiteService.save(site); } catch (IdUnusedException e) { // TODO: } catch (PermissionException e) { // TODO: } // TODO: hard coding this frame id is fragile, portal dependent, and needs to be fixed -ggolden schedulePeerFrameRefresh("sitenav"); } break; case 18: /* actionForTemplate chef_siteInfo-editAccess.vm * */ if (!forward) { if (state.getAttribute(STATE_MESSAGE) == null) { updateCurrentStep(state, false); } } case 19: /* actionForTemplate chef_site-addParticipant-sameRole.vm * */ String roleId = StringUtil.trimToNull(params.getString("selectRole")); if (roleId == null && forward) { addAlert(state, rb.getString("java.pleasesel")+" "); } else { state.setAttribute("form_selectedRole", params.getString("selectRole")); } break; case 20: /* actionForTemplate chef_site-addParticipant-differentRole.vm * */ if (forward) { getSelectedRoles(state, params, STATE_ADD_PARTICIPANTS); } break; case 21: /* actionForTemplate chef_site-addParticipant-notification.vm * ' */ if (params.getString("notify") == null) { if (forward) addAlert(state, rb.getString("java.pleasechoice")+" "); } else { state.setAttribute("form_selectedNotify", new Boolean(params.getString("notify"))); } break; case 22: /* actionForTemplate chef_site-addParticipant-confirm.vm * */ break; case 23: /* actionForTemplate chef_siteInfo-editAccess-globalAccess.vm * */ if (forward) { String joinable = params.getString("joinable"); state.setAttribute("form_joinable", Boolean.valueOf(joinable)); String joinerRole = params.getString("joinerRole"); state.setAttribute("form_joinerRole", joinerRole); if (joinable.equals("true")) { if (joinerRole == null) { addAlert(state, rb.getString("java.pleasesel")+" "); } } } else { } break; case 24: /* actionForTemplate chef_site-siteInfo-editAccess-globalAccess-confirm.vm * */ break; case 25: /* actionForTemplate chef_site-changeRoles-confirm.vm * */ break; case 26: /* actionForTemplate chef_site-modifyENW.vm * */ updateSelectedToolList(state, params, forward); if (state.getAttribute(STATE_MESSAGE) == null) { updateCurrentStep(state, forward); } break; case 27: /* actionForTemplate chef_site-importSites.vm * */ if (forward) { Site existingSite = getStateSite(state); if (existingSite != null) { // revising a existing site's tool select_import_tools(params, state); Hashtable importTools = (Hashtable) state.getAttribute(STATE_IMPORT_SITE_TOOL); List selectedTools = (List) state.getAttribute(STATE_TOOL_REGISTRATION_SELECTED_LIST); importToolIntoSite(selectedTools, importTools, existingSite); if (state.getAttribute(STATE_MESSAGE) == null) { commitSite(existingSite); state.removeAttribute(STATE_IMPORT_SITE_TOOL); state.removeAttribute(STATE_IMPORT_SITES); } } else { // new site select_import_tools(params, state); } } else { // read form input about import tools select_import_tools(params, state); } if (state.getAttribute(STATE_MESSAGE) == null) { updateCurrentStep(state, forward); } break; case 28: /* actionForTemplate chef_siteinfo-import.vm * */ if (forward) { if (params.getStrings("importSites") == null) { addAlert(state, rb.getString("java.toimport")+" "); } else { List importSites = new ArrayList(Arrays.asList(params.getStrings("importSites"))); Hashtable sites = (Hashtable) state.getAttribute(STATE_IMPORT_SITES); if (sites == null) { sites = new Hashtable(); } for (index = 0; index < importSites.size(); index ++) { try { Site s = SiteService.getSite((String) importSites.get(index)); if (!sites.containsKey(s)) { sites.put(s, new Vector()); } } catch (IdUnusedException e) { } } state.setAttribute(STATE_IMPORT_SITES, sites); } } break; case 29: /* actionForTemplate chef_siteinfo-duplicate.vm * */ if (forward) { if (state.getAttribute(SITE_DUPLICATED) == null) { if (StringUtil.trimToNull(params.getString("title")) == null) { addAlert(state, rb.getString("java.dupli")+" "); } else { String title = params.getString("title"); state.setAttribute(SITE_DUPLICATED_NAME, title); try { String oSiteId = (String) state.getAttribute(STATE_SITE_INSTANCE_ID); String nSiteId = IdManager.createUuid(); Site site = SiteService.addSite(nSiteId, getStateSite(state)); try { SiteService.save(site); } catch (IdUnusedException e) { // TODO: } catch (PermissionException e) { // TODO: } try { site = SiteService.getSite(nSiteId); // set title site.setTitle(title); // import tool content List pageList = site.getPages(); if (!((pageList == null) || (pageList.size() == 0))) { for (ListIterator i = pageList.listIterator(); i.hasNext(); ) { SitePage page = (SitePage) i.next(); List pageToolList = page.getTools(); String toolId = ((ToolConfiguration)pageToolList.get(0)).getTool().getId(); transferCopyEntities(toolId, oSiteId, nSiteId); } } } catch (Exception e1) { //if goes here, IdService or SiteService has done something wrong. M_log.warn(this + "Exception" + e1 + ":"+ nSiteId + "when duplicating site"); } try { SiteService.save(site); } catch (IdUnusedException e) { // TODO: } catch (PermissionException e) { // TODO: } // TODO: hard coding this frame id is fragile, portal dependent, and needs to be fixed -ggolden schedulePeerFrameRefresh("sitenav"); state.setAttribute(SITE_DUPLICATED, Boolean.TRUE); } catch (IdInvalidException e) { addAlert(state, rb.getString("java.siteinval")); } catch (IdUsedException e) { addAlert(state, rb.getString("java.sitebeenused")+" "); } catch (PermissionException e) { addAlert(state, rb.getString("java.allowcreate")+" "); } } } if (state.getAttribute(STATE_MESSAGE) == null) { // site duplication confirmed state.removeAttribute(SITE_DUPLICATED); state.removeAttribute(SITE_DUPLICATED_NAME); // return to the list view state.setAttribute(STATE_TEMPLATE_INDEX, "12"); } } break; case 33: /* * actionForTemplate chef_site-sitemanage-addParticipants.vm */ checkAddParticipant(params, state); if (state.getAttribute(STATE_MESSAGE) == null) { if(state.getAttribute("form_same_role") != null) { boolean same_role = ((Boolean) state.getAttribute("form_same_role")).booleanValue(); if (same_role) { state.setAttribute(STATE_TEMPLATE_INDEX, "34"); } else { state.setAttribute(STATE_TEMPLATE_INDEX, "35"); } } } else { state.setAttribute(STATE_TEMPLATE_INDEX, "33"); } break; case 36: /* * actionForTemplate chef_site-newSiteCourse.vm */ if (forward) { List providerChosenList = new Vector(); if (params.getStrings("providerCourseAdd") == null) { state.removeAttribute(STATE_ADD_CLASS_PROVIDER_CHOSEN); if (params.getString("manualAdds") == null) { addAlert(state, rb.getString("java.manual")+" "); } } if (state.getAttribute(STATE_MESSAGE) == null) { // The list of courses selected from provider listing if (params.getStrings("providerCourseAdd") != null) { providerChosenList = new ArrayList(Arrays.asList(params.getStrings("providerCourseAdd"))); // list of course ids state.setAttribute(STATE_ADD_CLASS_PROVIDER_CHOSEN, providerChosenList); } if (state.getAttribute(STATE_MESSAGE) == null) { siteInfo = new SiteInfo(); if(state.getAttribute(STATE_SITE_INFO) != null) { siteInfo = (SiteInfo) state.getAttribute(STATE_SITE_INFO); } if (providerChosenList.size() >= 1) { siteInfo.title = getCourseTab(state, (String) providerChosenList.get(0)); } state.setAttribute(STATE_SITE_INFO, siteInfo); if (params.getString("manualAdds") != null) { // if creating a new site state.setAttribute(STATE_TEMPLATE_INDEX, "37"); state.setAttribute(STATE_MANUAL_ADD_COURSE_NUMBER, new Integer(1)); } else { // no manual add state.removeAttribute(STATE_MANUAL_ADD_COURSE_NUMBER); state.removeAttribute(STATE_MANUAL_ADD_COURSE_FIELDS); state.removeAttribute(STATE_SITE_QUEST_UNIQNAME); if (getStateSite(state) != null) { // if revising a site, go to the confirmation page of adding classes state.setAttribute(STATE_TEMPLATE_INDEX, "44"); } else { // if creating a site, go the the site information entry page state.setAttribute(STATE_TEMPLATE_INDEX, "2"); } } } } //next step state.setAttribute(SITE_CREATE_CURRENT_STEP, new Integer(2)); } break; case 38: /* * actionForTemplate chef_site-sitemange-editInfo.vm */ if (forward) { Site siteEdit = getStateSite(state); ResourcePropertiesEdit siteProperties = siteEdit.getPropertiesEdit(); if (SecurityService.isSuperUser()) { String title = StringUtil.trimToNull(params.getString("title")); state.setAttribute(FORM_SITEINFO_TITLE, title); siteEdit.setTitle(title); } String type = StringUtil.trimToNull(params.getString("type")); state.setAttribute(STATE_SITEMANAGE_SITETYPE, type); siteEdit.setType(type); String description = StringUtil.trimToNull(params.getString("description")); state.setAttribute(FORM_SITEINFO_DESCRIPTION, description); siteEdit.setDescription(description); String short_description = StringUtil.trimToNull(params.getString("short_description")); state.setAttribute(FORM_SITEINFO_SHORT_DESCRIPTION, short_description); siteEdit.setShortDescription(short_description); // "skin" will be the icon from the list (course sites), or we have the icon as a full URL String skin = StringUtil.trimToNull(params.getString("skin")); state.setAttribute(FORM_SITEINFO_SKIN, skin); if (skin != null) { setAppearance(state, siteEdit, skin); } else { String iconUrl = StringUtil.trimToNull(params.getString("icon")); state.setAttribute("siteIconUrl", iconUrl); siteEdit.setIconUrl(iconUrl); } String include = StringUtil.trimToNull(params.getString("include")); if (include != null && include.equalsIgnoreCase(Boolean.FALSE.toString())) { state.setAttribute(FORM_SITEINFO_INCLUDE, Boolean.FALSE.toString()); siteEdit.setPubView(false); } else { state.setAttribute(FORM_SITEINFO_INCLUDE, Boolean.TRUE.toString()); siteEdit.setPubView(true); } // site contact information String contactName = StringUtil.trimToZero(params.getString ("siteContactName")); state.setAttribute(FORM_SITEINFO_CONTACT_NAME, contactName); siteProperties = siteEdit.getPropertiesEdit(); if (contactName != null) { siteProperties.addProperty(PROP_SITE_CONTACT_NAME, contactName); } String email = StringUtil.trimToZero(params.getString ("siteContactEmail")); String[] parts = email.split("@"); if(email.length() > 0 && (email.indexOf("@") == -1 || parts.length != 2 || parts[0].length() == 0 || !Validator.checkEmailLocal(parts[0]))) { // invalid email addAlert(state, email + " "+rb.getString("java.invalid") + INVALID_EMAIL); } state.setAttribute(FORM_SITEINFO_CONTACT_EMAIL, email); if (email != null) { siteProperties.addProperty(PROP_SITE_CONTACT_EMAIL, email); } // for site size limit String size = params.getString("size"); if (size != null) { String currentSiteId = ToolManager.getCurrentPlacement().getContext(); String rootCollectionId = ContentHostingService.getSiteCollection(currentSiteId); try { ContentCollectionEdit cedit = ContentHostingService.editCollection(rootCollectionId); ResourcePropertiesEdit pedit = cedit.getPropertiesEdit(); // default 1 GB = 1,048,576 Kilobyte String quota = "1048576"; if (size.equals(DEFAULT_SITE_SIZE_LIMIT)) { state.setAttribute(STATE_SITE_SIZE_DEFAULT_SELECT, Boolean.TRUE); // set the quota pedit.addProperty(ResourceProperties.PROP_COLLECTION_BODY_QUOTA, quota); } else { String otherSize = StringUtil.trimToZeroLower(params.getString("otherSize")); if (otherSize.equals("")) { addAlert(state, rb.getString("java.pleasech")); state.setAttribute(STATE_SITE_SIZE_DEFAULT_SELECT, Boolean.FALSE); } else { String[] strings = null; long unit = 1; if (otherSize.endsWith("kb")){strings = StringUtil.splitFirst(otherSize,"kb");} else if (otherSize.endsWith("kilobytes")){strings = StringUtil.splitFirst(otherSize,"kilobytes");} else if (otherSize.endsWith("kilobyte")){strings = StringUtil.splitFirst(otherSize,"kilobyte");} else if (otherSize.endsWith("mb")){strings = StringUtil.splitFirst(otherSize,"mb"); unit = 1024;} else if (otherSize.endsWith("megabytes")){strings = StringUtil.splitFirst(otherSize,"megabytes"); unit = 1024;} else if (otherSize.endsWith("megabyte")){strings = StringUtil.splitFirst(otherSize,"megabytes"); unit = 1024;} else if (otherSize.endsWith("gb")){strings = StringUtil.splitFirst(otherSize,"gb"); unit = 1048576;} else if (otherSize.endsWith("gigabytes")){strings = StringUtil.splitFirst(otherSize,"gigabytes"); unit = 1048576;} else if (otherSize.endsWith("gigabyte")){strings = StringUtil.splitFirst(otherSize,"gigabyte"); unit = 1048576;} if (strings != null) { try { // strings{digital strings, size unit "kb/mb/gb"} int intSize = Integer.parseInt(strings[0]); unit = intSize * unit; // size is transferred to KB pedit.addProperty(ResourceProperties.PROP_COLLECTION_BODY_QUOTA, (new Long(unit)).toString()); } catch(NumberFormatException error) { addAlert(state, rb.getString("java.pleaseval")); } } else { addAlert(state, rb.getString("java.pleaseval")); } } // if-else } // if-else ContentHostingService.commitCollection(cedit); } catch (IdUnusedException e) { } catch (TypeException e) { } catch (PermissionException e) { } catch (InUseException e) { addAlert(state, rb.getString("java.someone")); } } try { SiteService.save(siteEdit); } catch (IdUnusedException e) { // TODO: } catch (PermissionException e) { // TODO: } if (state.getAttribute(STATE_MESSAGE) == null) { state.setAttribute(STATE_TEMPLATE_INDEX, "31"); } } break; case 39: /* * actionForTemplate chef_site-sitemange-editAccess.vm */ if (state.getAttribute(STATE_MESSAGE) == null) { updateCurrentStep(state, forward); } break; case 42: /* actionForTemplate chef_site-gradtoolsConfirm.vm * */ break; case 43: /* actionForTemplate chef_site-editClass.vm * */ if (forward) { if (params.getStrings("providerClassDeletes") == null && params.getStrings("manualClassDeletes") == null && !direction.equals("back")) { addAlert(state, rb.getString("java.classes")); } if (params.getStrings("providerClassDeletes") != null) { // build the deletions list List providerCourseList = (List) state.getAttribute(SITE_PROVIDER_COURSE_LIST); List providerCourseDeleteList = new ArrayList(Arrays.asList(params.getStrings("providerClassDeletes"))); for (ListIterator i = providerCourseDeleteList.listIterator(); i.hasNext(); ) { providerCourseList.remove((String) i.next()); } state.setAttribute(SITE_PROVIDER_COURSE_LIST, providerCourseList); } if (params.getStrings("manualClassDeletes") != null) { // build the deletions list List manualCourseList = (List) state.getAttribute(SITE_MANUAL_COURSE_LIST); List manualCourseDeleteList = new ArrayList(Arrays.asList(params.getStrings("manualClassDeletes"))); for (ListIterator i = manualCourseDeleteList.listIterator(); i.hasNext(); ) { manualCourseList.remove((String) i.next()); } state.setAttribute(SITE_MANUAL_COURSE_LIST, manualCourseList); } updateCourseClasses (state, new Vector(), new Vector()); } break; case 44: if (forward) { List providerList = (state.getAttribute(SITE_PROVIDER_COURSE_LIST) == null)?new Vector():(List) state.getAttribute(SITE_PROVIDER_COURSE_LIST); List addProviderList = (state.getAttribute(STATE_ADD_CLASS_PROVIDER_CHOSEN) == null)?new Vector():(List) state.getAttribute(STATE_ADD_CLASS_PROVIDER_CHOSEN); providerList.addAll(addProviderList); state.setAttribute(SITE_PROVIDER_COURSE_LIST, providerList); if (state.getAttribute(STATE_MANUAL_ADD_COURSE_NUMBER) != null) { // if manually added course List manualList = (state.getAttribute(SITE_MANUAL_COURSE_LIST) == null)?new Vector():(List) state.getAttribute(SITE_MANUAL_COURSE_LIST); int manualAddNumber = ((Integer) state.getAttribute(STATE_MANUAL_ADD_COURSE_NUMBER)).intValue(); List manualAddFields = (List) state.getAttribute(STATE_MANUAL_ADD_COURSE_FIELDS); Term t = (Term) state.getAttribute(STATE_TERM_SELECTED); for (int m=0; m<manualAddNumber && t!=null; m++) { String manualAddClassId = CourseManagementService.getCourseId(t, (List) manualAddFields.get(m)); manualList.add(manualAddClassId); } state.setAttribute(SITE_MANUAL_COURSE_LIST, manualList); } updateCourseClasses(state, (List) state.getAttribute(STATE_ADD_CLASS_PROVIDER_CHOSEN), (List) state.getAttribute(SITE_MANUAL_COURSE_LIST)); removeAddClassContext(state); } break; case 49: if (!forward) { state.removeAttribute(SORTED_BY); state.removeAttribute(SORTED_ASC); } break; } }// actionFor Template | 54846 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54846/1826cb9a7cb9b374439b23ead2889220c8c511b9/SiteAction.java/clean/site-manage-tool/tool/src/java/org/sakaiproject/site/tool/SiteAction.java |
item.setImage(new Image[table.getColumnCount()]); | item.setImage(new Image[Math.max(1,table.getColumnCount())]); | private void internalRefreshAll(boolean updateLabels) { // the parent // in the code below, it is important to do all disassociates // before any associates, since a later disassociate can undo an // earlier associate // e.g. if (a, b) is replaced by (b, a), the disassociate of b to // item 1 could undo // the associate of b to item 0. Object[] children = getSortedChildren(getRoot()); TableItem[] items = getTable().getItems(); int min = Math.min(children.length, items.length); for (int i = 0; i < min; ++i) { TableItem item = items[i]; // if the element is unchanged, update its label if appropriate if (equals(children[i], item.getData())) { if (updateLabels) { updateItem(item, children[i]); } else { // associate the new element, even if equal to the old // one, // to remove stale references (see bug 31314) associate(children[i], item); } } else { // updateItem does an associate(...), which can mess up // the associations if the order of elements has changed. // E.g. (a, b) -> (b, a) first replaces a->0 with b->0, then // replaces b->1 with a->1, but this actually removes b->0. // So, if the object associated with this item has changed, // just disassociate it for now, and update it below. item.setText(""); //$NON-NLS-1$ item.setImage(new Image[table.getColumnCount()]);//Clear all images disassociate(item); } } // dispose of all items beyond the end of the current elements if (min < items.length) { for (int i = items.length; --i >= min;) { disassociate(items[i]); } table.remove(min, items.length - 1); } // Workaround for 1GDGN4Q: ITPUI:WIN2000 - TableViewer icons get // scrunched if (table.getItemCount() == 0) { table.removeAll(); } // Update items which were removed above for (int i = 0; i < min; ++i) { TableItem item = items[i]; if (item.getData() == null) updateItem(item, children[i]); } // add any remaining elements for (int i = min; i < children.length; ++i) { createItem(children[i],i); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6f01e16a16348b5563fc51478dbbe2bafe8764a1/TableViewer.java/buggy/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TableViewer.java |
HashMap envs = new HashMap(); envs.put(runtime.newString("HOME"), runtime.newString(System.getProperty("user.home"))); runtime.defineGlobalConstant("ENV", RubyHash.newHash(runtime, envs, runtime.getNil())); | public static void createGlobals(IRuby runtime) { // Version information: IRubyObject version = runtime.newString(Constants.RUBY_VERSION).freeze(); IRubyObject release = runtime.newString(Constants.COMPILE_DATE).freeze(); IRubyObject platform = runtime.newString(Constants.PLATFORM).freeze(); runtime.defineGlobalConstant("RUBY_VERSION", version); runtime.defineGlobalConstant("RUBY_RELEASE_DATE", release); runtime.defineGlobalConstant("RUBY_PLATFORM", platform); runtime.defineGlobalConstant("VERSION", version); runtime.defineGlobalConstant("RELEASE_DATE", release); runtime.defineGlobalConstant("PLATFORM", platform); // FIXME: ENV Not really a RubyHash (but close) // FIXME: ENV Should not copy system properties, but should reference them instead HashMap envs = new HashMap(); envs.put(runtime.newString("HOME"), runtime.newString(System.getProperty("user.home"))); runtime.defineGlobalConstant("ENV", RubyHash.newHash(runtime, envs, runtime.getNil())); runtime.defineVariable(new StringGlobalVariable(runtime, "$KCODE", runtime.newString("UTF8"))); runtime.defineVariable(new StringGlobalVariable(runtime, "$/", runtime.newString("\n"))); runtime.defineVariable(new StringGlobalVariable(runtime, "$\\", runtime.getNil())); runtime.defineVariable(new StringGlobalVariable(runtime, "$,", runtime.getNil())); runtime.defineVariable(new LineNumberGlobalVariable(runtime, "$.", RubyFixnum.one(runtime))); runtime.defineVariable(new LastlineGlobalVariable(runtime, "$_")); runtime.defineVariable(new ErrorInfoGlobalVariable(runtime, "$!", runtime.getNil())); runtime.defineVariable(new SafeGlobalVariable(runtime, "$SAFE")); runtime.defineVariable(new BacktraceGlobalVariable(runtime, "$@")); IRubyObject stdin = RubyIO.fdOpen(runtime, RubyIO.STDIN); IRubyObject stdout = RubyIO.fdOpen(runtime, RubyIO.STDOUT); IRubyObject stderr = RubyIO.fdOpen(runtime, RubyIO.STDERR); runtime.defineVariable(new InputGlobalVariable(runtime, "$stdin", stdin)); runtime.defineVariable(new OutputGlobalVariable(runtime, "$stdout", stdout)); runtime.defineVariable(new OutputGlobalVariable(runtime, "$stderr", stderr)); runtime.defineVariable(new OutputGlobalVariable(runtime, "$>", stdout)); runtime.defineVariable(new OutputGlobalVariable(runtime, "$defout", stdout)); runtime.defineVariable(new OutputGlobalVariable(runtime, "$deferr", stderr)); runtime.defineGlobalConstant("STDIN", stdin); runtime.defineGlobalConstant("STDOUT", stdout); runtime.defineGlobalConstant("STDERR", stderr); runtime.defineVariable(new LoadedFeatures(runtime, "$\"")); runtime.defineVariable(new LoadPath(runtime, "$:")); runtime.defineVariable(new LoadPath(runtime, "$-I")); runtime.defineVariable(new LoadPath(runtime, "$LOAD_PATH")); // ARGF, $< object RubyArgsFile argsFile = new RubyArgsFile(runtime); argsFile.initArgsFile(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f67bf159b486fa2ceb3335f98a350e2e5fefe664/RubyGlobal.java/clean/src/org/jruby/RubyGlobal.java |
|
defineGlobalEnvConstants(runtime); | public static void createGlobals(IRuby runtime) { // Version information: IRubyObject version = runtime.newString(Constants.RUBY_VERSION).freeze(); IRubyObject release = runtime.newString(Constants.COMPILE_DATE).freeze(); IRubyObject platform = runtime.newString(Constants.PLATFORM).freeze(); runtime.defineGlobalConstant("RUBY_VERSION", version); runtime.defineGlobalConstant("RUBY_RELEASE_DATE", release); runtime.defineGlobalConstant("RUBY_PLATFORM", platform); runtime.defineGlobalConstant("VERSION", version); runtime.defineGlobalConstant("RELEASE_DATE", release); runtime.defineGlobalConstant("PLATFORM", platform); // FIXME: ENV Not really a RubyHash (but close) // FIXME: ENV Should not copy system properties, but should reference them instead HashMap envs = new HashMap(); envs.put(runtime.newString("HOME"), runtime.newString(System.getProperty("user.home"))); runtime.defineGlobalConstant("ENV", RubyHash.newHash(runtime, envs, runtime.getNil())); runtime.defineVariable(new StringGlobalVariable(runtime, "$KCODE", runtime.newString("UTF8"))); runtime.defineVariable(new StringGlobalVariable(runtime, "$/", runtime.newString("\n"))); runtime.defineVariable(new StringGlobalVariable(runtime, "$\\", runtime.getNil())); runtime.defineVariable(new StringGlobalVariable(runtime, "$,", runtime.getNil())); runtime.defineVariable(new LineNumberGlobalVariable(runtime, "$.", RubyFixnum.one(runtime))); runtime.defineVariable(new LastlineGlobalVariable(runtime, "$_")); runtime.defineVariable(new ErrorInfoGlobalVariable(runtime, "$!", runtime.getNil())); runtime.defineVariable(new SafeGlobalVariable(runtime, "$SAFE")); runtime.defineVariable(new BacktraceGlobalVariable(runtime, "$@")); IRubyObject stdin = RubyIO.fdOpen(runtime, RubyIO.STDIN); IRubyObject stdout = RubyIO.fdOpen(runtime, RubyIO.STDOUT); IRubyObject stderr = RubyIO.fdOpen(runtime, RubyIO.STDERR); runtime.defineVariable(new InputGlobalVariable(runtime, "$stdin", stdin)); runtime.defineVariable(new OutputGlobalVariable(runtime, "$stdout", stdout)); runtime.defineVariable(new OutputGlobalVariable(runtime, "$stderr", stderr)); runtime.defineVariable(new OutputGlobalVariable(runtime, "$>", stdout)); runtime.defineVariable(new OutputGlobalVariable(runtime, "$defout", stdout)); runtime.defineVariable(new OutputGlobalVariable(runtime, "$deferr", stderr)); runtime.defineGlobalConstant("STDIN", stdin); runtime.defineGlobalConstant("STDOUT", stdout); runtime.defineGlobalConstant("STDERR", stderr); runtime.defineVariable(new LoadedFeatures(runtime, "$\"")); runtime.defineVariable(new LoadPath(runtime, "$:")); runtime.defineVariable(new LoadPath(runtime, "$-I")); runtime.defineVariable(new LoadPath(runtime, "$LOAD_PATH")); // ARGF, $< object RubyArgsFile argsFile = new RubyArgsFile(runtime); argsFile.initArgsFile(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f67bf159b486fa2ceb3335f98a350e2e5fefe664/RubyGlobal.java/clean/src/org/jruby/RubyGlobal.java |
|
RubyArray result = RubyArray.newArray(recv.getRuntime(), 2); | RubyArray result = recv.getRuntime().newArray(2); | public static RubyArray frexp(IRubyObject recv, RubyNumeric other) { double mantissa = other.getDoubleValue(); short sign = 1; double exponent = 0; if (mantissa != 0.0) { // Make mantissa same sign so we only have one code path. if (mantissa < 0) { mantissa = -mantissa; sign = -1; } // Increase value to hit lower range. for (; mantissa < 0.5; mantissa *= 2.0, exponent -=1) { } // Decrease value to hit upper range. for (; mantissa >= 1.0; mantissa *= 0.5, exponent +=1) { } } RubyArray result = RubyArray.newArray(recv.getRuntime(), 2); result.append(RubyFloat.newFloat(recv.getRuntime(), sign * mantissa)); result.append(RubyFloat.newFloat(recv.getRuntime(), exponent)); return result; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/870e1da9b41bfdbae259e1fc5f18fc8b76686998/RubyMath.java/clean/src/org/jruby/RubyMath.java |
if ( c.debugDrawFontMetrics() ) { g.setColor(Color.red); g.drawLine(ix,iy, ix+inline.width, iy); iy += lm.getDescent(); g.drawLine(ix,iy, ix+inline.width, iy); iy -= lm.getDescent(); iy -= lm.getAscent(); g.drawLine(ix,iy, ix+inline.width, iy); } | private void paintInline( Context c, InlineBox inline, int lx, int ly, LineBox line ) { if ( InlineLayout.isReplaced( inline.node ) ) { //u.p("painting a replaced block: " + inline); c.translate( line.x, line.y + ( line.baseline - inline.height ) ); Renderer rend = LayoutFactory.getRenderer( inline.node ); //u.p("inline node = " + inline.node); //u.p("got the layout: " + layout); rend.paint( c, inline ); c.translate( -line.x, -( line.y + ( line.baseline - inline.height ) ) ); if ( c.debugDrawInlineBoxes() ) { GraphicsUtil.draw( c.getGraphics(), new Rectangle( lx + inline.x + 1, ly + inline.y + 1 - inline.height, inline.width - 2, inline.height - 2 ), Color.green ); } return; } if ( InlineLayout.isFloatedBlock( inline.node, c ) ) { Rectangle oe = c.getExtents(); c.setExtents( new Rectangle( oe.x, 0, oe.width, oe.height ) ); int xoff = line.x + inline.x; int yoff = line.y + ( line.baseline - inline.height ) + inline.y; c.translate( xoff, yoff ); Renderer rend = LayoutFactory.getRenderer( inline.node ); rend.paint( c, inline.sub_block ); c.translate( -xoff, -yoff ); c.setExtents( oe ); return; } if ( inline.is_break ) { return; } Graphics g = c.getGraphics(); // handle relative if ( inline.relative ) { c.translate( inline.left, inline.top ); } paintPadding(c,line,inline); c.updateSelection( inline ); // calculate the x and y relative to the baseline of the line (ly) and the // left edge of the line (lx) String text = inline.getSubstring(); int iy = ly + inline.y; int ix = lx + inline.x; // account for padding ix += inline.totalLeftPadding(); // draw a selection rectangle paintSelection( c, inline, lx, ly ); //adjust font for current settings Font oldfont = c.getGraphics().getFont(); c.getGraphics().setFont( inline.getFont() ); Color oldcolor = c.getGraphics().getColor(); c.getGraphics().setColor( inline.color ); Font cur_font = c.getGraphics().getFont(); LineMetrics lm = cur_font.getLineMetrics( text, ( (Graphics2D)c.getGraphics() ).getFontRenderContext() ); //u.p("lm descent = " + lm.getDescent()); iy-= (int)lm.getDescent(); //draw the line if ( text != null && text.length() > 0 ) { c.getGraphics().drawString( text, ix, iy ); } c.getGraphics().setColor( oldcolor ); //draw any text decoration if ( inline.underline ) { float down = lm.getUnderlineOffset(); float thick = lm.getUnderlineThickness(); g.fillRect( ix, iy + (int)down, g.getFontMetrics().stringWidth( text ), (int)thick ); } if ( inline.strikethrough ) { float down = lm.getStrikethroughOffset(); float thick = lm.getStrikethroughThickness(); g.fillRect( ix, iy + (int)down, g.getFontMetrics().stringWidth( text ), (int)thick ); } if ( inline.overline ) { float down = lm.getAscent(); float thick = lm.getUnderlineThickness(); g.fillRect( ix, iy - (int)down, g.getFontMetrics().stringWidth( text ), (int)thick ); } if ( c.debugDrawInlineBoxes() ) { GraphicsUtil.draw( c.getGraphics(), new Rectangle( lx + inline.x + 1, ly + inline.y + 1 - inline.height, inline.width - 2, inline.height - 2 ), Color.green ); } // restore the old font c.getGraphics().setFont( oldfont ); // handle relative if ( inline.relative ) { c.translate( -inline.left, -inline.top ); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/e79f8be3a1eeb16a1f4aa765b39fbfb66b65bdc9/InlineRenderer.java/buggy/src/java/org/xhtmlrenderer/render/InlineRenderer.java |
|
RubyObject result = null; | public RubyObject eval(Ruby ruby, RubyObject self) { RubyObject result = null; try { result = getHeadNode().eval(ruby, self); } finally { if (getEnsureNode() != null) { // RubyObject actExcptn = ruby.getActException(); getEnsureNode().eval(ruby, self); // ruby.setActException(actExcptn); // VALUE retval = prot_tag->retval; /* save retval */ // return_value(retval); } // +++ return result; // --- } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8140cac1b7c2375c549787852e38fa6c52b199df/EnsureNode.java/clean/org/jruby/nodes/EnsureNode.java |
|
result = getHeadNode().eval(ruby, self); | return getHeadNode().eval(ruby, self); | public RubyObject eval(Ruby ruby, RubyObject self) { RubyObject result = null; try { result = getHeadNode().eval(ruby, self); } finally { if (getEnsureNode() != null) { // RubyObject actExcptn = ruby.getActException(); getEnsureNode().eval(ruby, self); // ruby.setActException(actExcptn); // VALUE retval = prot_tag->retval; /* save retval */ // return_value(retval); } // +++ return result; // --- } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8140cac1b7c2375c549787852e38fa6c52b199df/EnsureNode.java/clean/org/jruby/nodes/EnsureNode.java |
public RubyObject eval(Ruby ruby, RubyObject self) { RubyObject result = null; try { result = getHeadNode().eval(ruby, self); } finally { if (getEnsureNode() != null) { // RubyObject actExcptn = ruby.getActException(); getEnsureNode().eval(ruby, self); // ruby.setActException(actExcptn); // VALUE retval = prot_tag->retval; /* save retval */ // return_value(retval); } // +++ return result; // --- } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8140cac1b7c2375c549787852e38fa6c52b199df/EnsureNode.java/clean/org/jruby/nodes/EnsureNode.java |
||
public RubyObject eval(Ruby ruby, RubyObject self) { RubyObject result = null; try { result = getHeadNode().eval(ruby, self); } finally { if (getEnsureNode() != null) { // RubyObject actExcptn = ruby.getActException(); getEnsureNode().eval(ruby, self); // ruby.setActException(actExcptn); // VALUE retval = prot_tag->retval; /* save retval */ // return_value(retval); } // +++ return result; // --- } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8140cac1b7c2375c549787852e38fa6c52b199df/EnsureNode.java/clean/org/jruby/nodes/EnsureNode.java |
||
return result; | public RubyObject eval(Ruby ruby, RubyObject self) { RubyObject result = null; try { result = getHeadNode().eval(ruby, self); } finally { if (getEnsureNode() != null) { // RubyObject actExcptn = ruby.getActException(); getEnsureNode().eval(ruby, self); // ruby.setActException(actExcptn); // VALUE retval = prot_tag->retval; /* save retval */ // return_value(retval); } // +++ return result; // --- } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8140cac1b7c2375c549787852e38fa6c52b199df/EnsureNode.java/clean/org/jruby/nodes/EnsureNode.java |
|
BrowserStartup bs = new BrowserStartup(); | final BrowserStartup bs = new BrowserStartup(); | public static void main(String[] args) throws Exception { //System.out.println(new URI("images/Stop24.gif")); JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); BrowserStartup bs = new BrowserStartup(); bs.frame = frame; bs.init(); frame.setJMenuBar(bs.menu); frame.getContentPane().add(bs.panel); frame.pack(); frame.setSize(600, 700); frame.show(); if (args.length > 0) { bs.panel.loadPage(args[0]); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/378f837b2d6420bdbab7e201000be551e4f28dbc/BrowserStartup.java/buggy/demos/browser/src/java/org/xhtmlrenderer/demo/browser/BrowserStartup.java |
frame.addComponentListener( new ComponentAdapter() { public void componentResized( ComponentEvent e ) { bs.panel.view.relayout(); } } ); | public static void main(String[] args) throws Exception { //System.out.println(new URI("images/Stop24.gif")); JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); BrowserStartup bs = new BrowserStartup(); bs.frame = frame; bs.init(); frame.setJMenuBar(bs.menu); frame.getContentPane().add(bs.panel); frame.pack(); frame.setSize(600, 700); frame.show(); if (args.length > 0) { bs.panel.loadPage(args[0]); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/378f837b2d6420bdbab7e201000be551e4f28dbc/BrowserStartup.java/buggy/demos/browser/src/java/org/xhtmlrenderer/demo/browser/BrowserStartup.java |
|
return getClass().getResource( "dependencies/" + resource).getPath().substring(1); | resource = "com/liferay/portal/deploy/dependencies/" + resource; return getClass().getResource(resource).getPath().substring(1); | protected String getResourcePath(String resource) { return getClass().getResource( "dependencies/" + resource).getPath().substring(1); } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/dba90f6a8556b14ce78fb621b9766591bbdb7b34/AutoPortletDeployer.java/buggy/portal-ejb/src/com/liferay/portal/deploy/AutoPortletDeployer.java |
row.addChild(cellBox); | private static void layoutCells(List cells, LayoutContext c, RowBox row, TableBox table, boolean fixed, int borderSpacingHorizontal, int borderSpacingVertical) { int col = 0; for (Iterator i = cells.iterator(); i.hasNext() && !c.shouldStop();) { checkColumns(table, col + 1); while (table.columnRows[col] != 0) { row.contentWidth += borderSpacingHorizontal + table.columns[col]; table.columnCell[col] = null; col = col + 1; } TableCellContent tcc = (TableCellContent) i.next(); CellBox cellBox = new CellBox(); c.translate(row.contentWidth, 0); c.setShrinkWrap(); cellBox = (CellBox) layoutCell(c, cellBox, tcc, fixed, table, col); c.unsetShrinkWrap(); c.translate(-row.contentWidth, 0); row.addChild(cellBox); cellBox.setParent(row); cellBox.element = tcc.getElement(); // set the child_box location cellBox.x = row.contentWidth + borderSpacingHorizontal; //row.y = 0; checkColumns(table, col + cellBox.colspan); for (int j = 0; j < cellBox.colspan; j++) { table.columnRows[col + j] = cellBox.rowspan; table.columnHeight[col + j] = cellBox.height; table.columnCell[col + j] = null; } table.columnCell[col] = cellBox; int width = 0; for (int j = 0; j < cellBox.colspan; j++) width += table.columns[col + j]; width += borderSpacingHorizontal * (cellBox.colspan - 1); if (!fixed && cellBox.getWidth() > width) { int extra = (cellBox.getWidth() - width) / cellBox.colspan; for (int j = 0; j < cellBox.colspan; j++) table.columns[col + j] += extra; } cellBox.contentWidth = 0; for (int j = 0; j < cellBox.colspan; j++) cellBox.contentWidth += table.columns[col + j]; cellBox.contentWidth += (cellBox.colspan - 1) * borderSpacingHorizontal; cellBox.contentWidth -= cellBox.leftPadding + cellBox.rightPadding; row.contentWidth = cellBox.x + cellBox.getWidth(); col += cellBox.colspan; //this will be fixed again later! cellBox.height = 0; } for (int j = 0; j < table.columns.length; j++) { // increase the final layout height if the child was greater int height = table.columnHeight[j] / table.columnRows[j]; if (height > row.height) { row.height = height; } table.columnHeight[j] -= height; table.columnRows[j]--; } for (int j = 0; j < table.columns.length; j++) { if (table.columnCell[j] == null) continue; table.columnCell[j].height += row.height; if (table.columnRows[j] != 0) { table.columnCell[j].height += borderSpacingVertical; } } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/acff97b0e3517c59dfd01f1112b0fe5227f5da2f/TableBoxing.java/buggy/src/java/org/xhtmlrenderer/table/TableBoxing.java |
|
if (cellBox.rowspan > 1) row.setChildrenExceedBounds(true); row.addChild(cellBox); | private static void layoutCells(List cells, LayoutContext c, RowBox row, TableBox table, boolean fixed, int borderSpacingHorizontal, int borderSpacingVertical) { int col = 0; for (Iterator i = cells.iterator(); i.hasNext() && !c.shouldStop();) { checkColumns(table, col + 1); while (table.columnRows[col] != 0) { row.contentWidth += borderSpacingHorizontal + table.columns[col]; table.columnCell[col] = null; col = col + 1; } TableCellContent tcc = (TableCellContent) i.next(); CellBox cellBox = new CellBox(); c.translate(row.contentWidth, 0); c.setShrinkWrap(); cellBox = (CellBox) layoutCell(c, cellBox, tcc, fixed, table, col); c.unsetShrinkWrap(); c.translate(-row.contentWidth, 0); row.addChild(cellBox); cellBox.setParent(row); cellBox.element = tcc.getElement(); // set the child_box location cellBox.x = row.contentWidth + borderSpacingHorizontal; //row.y = 0; checkColumns(table, col + cellBox.colspan); for (int j = 0; j < cellBox.colspan; j++) { table.columnRows[col + j] = cellBox.rowspan; table.columnHeight[col + j] = cellBox.height; table.columnCell[col + j] = null; } table.columnCell[col] = cellBox; int width = 0; for (int j = 0; j < cellBox.colspan; j++) width += table.columns[col + j]; width += borderSpacingHorizontal * (cellBox.colspan - 1); if (!fixed && cellBox.getWidth() > width) { int extra = (cellBox.getWidth() - width) / cellBox.colspan; for (int j = 0; j < cellBox.colspan; j++) table.columns[col + j] += extra; } cellBox.contentWidth = 0; for (int j = 0; j < cellBox.colspan; j++) cellBox.contentWidth += table.columns[col + j]; cellBox.contentWidth += (cellBox.colspan - 1) * borderSpacingHorizontal; cellBox.contentWidth -= cellBox.leftPadding + cellBox.rightPadding; row.contentWidth = cellBox.x + cellBox.getWidth(); col += cellBox.colspan; //this will be fixed again later! cellBox.height = 0; } for (int j = 0; j < table.columns.length; j++) { // increase the final layout height if the child was greater int height = table.columnHeight[j] / table.columnRows[j]; if (height > row.height) { row.height = height; } table.columnHeight[j] -= height; table.columnRows[j]--; } for (int j = 0; j < table.columns.length; j++) { if (table.columnCell[j] == null) continue; table.columnCell[j].height += row.height; if (table.columnRows[j] != 0) { table.columnCell[j].height += borderSpacingVertical; } } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/acff97b0e3517c59dfd01f1112b0fe5227f5da2f/TableBoxing.java/buggy/src/java/org/xhtmlrenderer/table/TableBoxing.java |
|
public static void setupFloat(Context c, Box box, CascadedStyle style) { if (ContentUtil.isFloated(style)) { | public static void setupFloat(Context c, Box box) { if (ContentUtil.isFloated(c.getCurrentStyle())) { | public static void setupFloat(Context c, Box box, CascadedStyle style) { if (ContentUtil.isFloated(style)) { //Uu.p("==== setup float ===="); //Uu.dump_stack(); IdentValue floatVal = style.getIdent(CSSName.FLOAT); if (floatVal == IdentValue.NONE) { return; } box.floated = true; Point offset = c.getBlockFormattingContext().getOffset(); box.y = -offset.y; if (floatVal == IdentValue.LEFT) { //Uu.p("doing left"); positionBoxLeft(c, box); c.getBlockFormattingContext().pushDownLeft(box); //Uu.p("final box = " + box); c.getBlockFormattingContext().addLeftFloat(box); } else if (floatVal == IdentValue.RIGHT) { positionBoxRight(c, box); c.getBlockFormattingContext().pushDownRight(box); //Uu.p("final box = " + box); c.getBlockFormattingContext().addRightFloat(box); } //Uu.p("box = " + box); //Uu.p("==== end setup ===="); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/c96efe21dd32b0a4f0420c8495d49144792cbc9d/FloatUtil.java/clean/src/java/org/xhtmlrenderer/layout/block/FloatUtil.java |
IdentValue floatVal = style.getIdent(CSSName.FLOAT); | IdentValue floatVal = c.getCurrentStyle().getIdent(CSSName.FLOAT); | public static void setupFloat(Context c, Box box, CascadedStyle style) { if (ContentUtil.isFloated(style)) { //Uu.p("==== setup float ===="); //Uu.dump_stack(); IdentValue floatVal = style.getIdent(CSSName.FLOAT); if (floatVal == IdentValue.NONE) { return; } box.floated = true; Point offset = c.getBlockFormattingContext().getOffset(); box.y = -offset.y; if (floatVal == IdentValue.LEFT) { //Uu.p("doing left"); positionBoxLeft(c, box); c.getBlockFormattingContext().pushDownLeft(box); //Uu.p("final box = " + box); c.getBlockFormattingContext().addLeftFloat(box); } else if (floatVal == IdentValue.RIGHT) { positionBoxRight(c, box); c.getBlockFormattingContext().pushDownRight(box); //Uu.p("final box = " + box); c.getBlockFormattingContext().addRightFloat(box); } //Uu.p("box = " + box); //Uu.p("==== end setup ===="); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/c96efe21dd32b0a4f0420c8495d49144792cbc9d/FloatUtil.java/clean/src/java/org/xhtmlrenderer/layout/block/FloatUtil.java |
existingSite = getStateSite(state); | private void actionForTemplate ( String direction, int index, ParameterParser params, SessionState state) { // Continue - make any permanent changes, Back - keep any data entered on the form boolean forward = direction.equals("continue") ? true : false; SiteInfo siteInfo = new SiteInfo(); switch (index) { case 0: /* actionForTemplate chef_site-list.vm * */ break; case 1: /* actionForTemplate chef_site-type.vm * */ break; case 2: /* actionForTemplate chef_site-newSiteInformation.vm * */ if(state.getAttribute(STATE_SITE_INFO) != null) { siteInfo = (SiteInfo) state.getAttribute(STATE_SITE_INFO); } //defaults to be true siteInfo.include=true; state.setAttribute(STATE_SITE_INFO, siteInfo); updateSiteInfo(params, state); // alerts after clicking Continue but not Back if(forward) { if (StringUtil.trimToNull(siteInfo.title) == null) { addAlert(state, rb.getString("java.reqfields")); state.setAttribute(STATE_TEMPLATE_INDEX, "2"); return; } } updateSiteAttributes(state); if (state.getAttribute(STATE_MESSAGE) == null) { updateCurrentStep(state, forward); } break; case 3: /* actionForTemplate chef_site-newSiteFeatures.vm * */ if (forward) { getFeatures(params, state); } if (state.getAttribute(STATE_MESSAGE) == null) { updateCurrentStep(state, forward); } break; case 4: /* actionForTemplate chef_site-addRemoveFeature.vm * */ break; case 5: /* actionForTemplate chef_site-addParticipant.vm * */ if(forward) { checkAddParticipant(params, state); } else { // remove related state variables removeAddParticipantContext(state); } break; case 6: /* actionForTemplate chef_site-removeParticipants.vm * */ break; case 7: /* actionForTemplate chef_site-changeRoles.vm * */ if (forward) { if (!((Boolean) state.getAttribute(STATE_CHANGEROLE_SAMEROLE)).booleanValue()) { getSelectedRoles(state, params, STATE_SELECTED_USER_LIST); } else { String role = params.getString("role_to_all"); if (role == null) { addAlert(state, rb.getString("java.pleasechoose")+" "); } else { state.setAttribute(STATE_CHANGEROLE_SAMEROLE_ROLE, role); } } } else { removeChangeRoleContext(state); } break; case 8: /* actionForTemplate chef_site-siteDeleteConfirm.vm * */ break; case 9: /* actionForTemplate chef_site-publishUnpublish.vm * */ updateSiteInfo(params, state); break; case 10: /* actionForTemplate chef_site-newSiteConfirm.vm * */ if (!forward) { if (state.getAttribute(STATE_MESSAGE) == null) { updateCurrentStep(state, false); } } break; case 11: /* actionForTemplate chef_site_newsitePublishUnpublish.vm * */ break; case 12: /* actionForTemplate chef_site_siteInfo-list.vm * */ break; case 13: /* actionForTemplate chef_site_siteInfo-editInfo.vm * */ if (forward) { Site Site = getStateSite(state); List titleEditableSiteType = (List) state.getAttribute(TITLE_EDITABLE_SITE_TYPE); if (titleEditableSiteType.contains(Site.getType())) { // site titel is editable and could not be null String title = StringUtil.trimToNull(params.getString("title")); state.setAttribute(FORM_SITEINFO_TITLE, title); if (title == null) { addAlert(state, rb.getString("java.specify")+" "); } } String description = StringUtil.trimToNull(params.getString("description")); state.setAttribute(FORM_SITEINFO_DESCRIPTION, description); String short_description = StringUtil.trimToNull(params.getString("short_description")); state.setAttribute(FORM_SITEINFO_SHORT_DESCRIPTION, short_description); String skin = params.getString("skin"); if (skin != null) { // if there is a skin input for course site skin = StringUtil.trimToNull(skin); state.setAttribute(FORM_SITEINFO_SKIN, skin); } else { // if ther is a icon input for non-course site String icon = StringUtil.trimToNull(params.getString("icon")); if (icon != null) { state.setAttribute(FORM_SITEINFO_ICON_URL, icon); } else { state.removeAttribute(FORM_SITEINFO_ICON_URL); } } // site contact information String contactName = StringUtil.trimToZero(params.getString ("siteContactName")); state.setAttribute(FORM_SITEINFO_CONTACT_NAME, contactName); String email = StringUtil.trimToZero(params.getString ("siteContactEmail")); String[] parts = email.split("@"); if(email.length() > 0 && (email.indexOf("@") == -1 || parts.length != 2 || parts[0].length() == 0 || !Validator.checkEmailLocal(parts[0]))) { // invalid email addAlert(state, email + " "+rb.getString("java.invalid") + INVALID_EMAIL); } state.setAttribute(FORM_SITEINFO_CONTACT_EMAIL, email); if (state.getAttribute(STATE_MESSAGE) == null) { state.setAttribute(STATE_TEMPLATE_INDEX, "14"); } } break; case 14: /* actionForTemplate chef_site_siteInfo-editInfoConfirm.vm * */ break; case 15: /* actionForTemplate chef_site_siteInfo-addRemoveFeatureConfirm.vm * */ break; case 16: /* actionForTemplate chef_site_siteInfo-publishUnpublish-sendEmail.vm * */ if (forward) { String notify = params.getString("notify"); if (notify != null) { state.setAttribute(FORM_WILL_NOTIFY, new Boolean(notify)); } } break; case 17: /* actionForTemplate chef_site_siteInfo--publishUnpublish-confirm.vm * */ if (forward) { boolean oldStatus = getStateSite(state).isPublished(); boolean newStatus = ((SiteInfo) state.getAttribute(STATE_SITE_INFO)).getPublished(); saveSiteStatus(state, newStatus); if (oldStatus == false || newStatus == true) { // if site's status been changed from unpublish to publish and notification is selected, send out notification to participants. if (((Boolean) state.getAttribute(FORM_WILL_NOTIFY)).booleanValue()) { // %%% place holder for sending email } } // commit site edit Site site = getStateSite(state); try { SiteService.save(site); } catch (IdUnusedException e) { // TODO: } catch (PermissionException e) { // TODO: } // TODO: hard coding this frame id is fragile, portal dependent, and needs to be fixed -ggolden // schedulePeerFrameRefresh("sitenav"); scheduleTopRefresh(); } break; case 18: /* actionForTemplate chef_siteInfo-editAccess.vm * */ if (!forward) { if (state.getAttribute(STATE_MESSAGE) == null) { updateCurrentStep(state, false); } } case 19: /* actionForTemplate chef_site-addParticipant-sameRole.vm * */ String roleId = StringUtil.trimToNull(params.getString("selectRole")); if (roleId == null && forward) { addAlert(state, rb.getString("java.pleasesel")+" "); } else { state.setAttribute("form_selectedRole", params.getString("selectRole")); } break; case 20: /* actionForTemplate chef_site-addParticipant-differentRole.vm * */ if (forward) { getSelectedRoles(state, params, STATE_ADD_PARTICIPANTS); } break; case 21: /* actionForTemplate chef_site-addParticipant-notification.vm * ' */ if (params.getString("notify") == null) { if (forward) addAlert(state, rb.getString("java.pleasechoice")+" "); } else { state.setAttribute("form_selectedNotify", new Boolean(params.getString("notify"))); } break; case 22: /* actionForTemplate chef_site-addParticipant-confirm.vm * */ break; case 23: /* actionForTemplate chef_siteInfo-editAccess-globalAccess.vm * */ if (forward) { String joinable = params.getString("joinable"); state.setAttribute("form_joinable", Boolean.valueOf(joinable)); String joinerRole = params.getString("joinerRole"); state.setAttribute("form_joinerRole", joinerRole); if (joinable.equals("true")) { if (joinerRole == null) { addAlert(state, rb.getString("java.pleasesel")+" "); } } } else { } break; case 24: /* actionForTemplate chef_site-siteInfo-editAccess-globalAccess-confirm.vm * */ break; case 25: /* actionForTemplate chef_site-changeRoles-confirm.vm * */ break; case 26: /* actionForTemplate chef_site-modifyENW.vm * */ updateSelectedToolList(state, params, forward); if (state.getAttribute(STATE_MESSAGE) == null) { updateCurrentStep(state, forward); } break; case 27: /* actionForTemplate chef_site-importSites.vm * */ if (forward) { Site existingSite = getStateSite(state); if (existingSite != null) { // revising a existing site's tool select_import_tools(params, state); Hashtable importTools = (Hashtable) state.getAttribute(STATE_IMPORT_SITE_TOOL); List selectedTools = (List) state.getAttribute(STATE_TOOL_REGISTRATION_SELECTED_LIST); importToolIntoSite(selectedTools, importTools, existingSite); if (state.getAttribute(STATE_MESSAGE) == null) { commitSite(existingSite); state.removeAttribute(STATE_IMPORT_SITE_TOOL); state.removeAttribute(STATE_IMPORT_SITES); } } else { // new site select_import_tools(params, state); } } else { // read form input about import tools select_import_tools(params, state); } if (state.getAttribute(STATE_MESSAGE) == null) { updateCurrentStep(state, forward); } break; case 28: /* actionForTemplate chef_siteinfo-import.vm * */ if (forward) { if (params.getStrings("importSites") == null) { addAlert(state, rb.getString("java.toimport")+" "); } else { List importSites = new ArrayList(Arrays.asList(params.getStrings("importSites"))); Hashtable sites = (Hashtable) state.getAttribute(STATE_IMPORT_SITES); if (sites == null) { sites = new Hashtable(); } for (index = 0; index < importSites.size(); index ++) { try { Site s = SiteService.getSite((String) importSites.get(index)); if (!sites.containsKey(s)) { sites.put(s, new Vector()); } } catch (IdUnusedException e) { } } state.setAttribute(STATE_IMPORT_SITES, sites); } } break; case 29: /* actionForTemplate chef_siteinfo-duplicate.vm * */ if (forward) { if (state.getAttribute(SITE_DUPLICATED) == null) { if (StringUtil.trimToNull(params.getString("title")) == null) { addAlert(state, rb.getString("java.dupli")+" "); } else { String title = params.getString("title"); state.setAttribute(SITE_DUPLICATED_NAME, title); try { String oSiteId = (String) state.getAttribute(STATE_SITE_INSTANCE_ID); String nSiteId = IdManager.createUuid(); Site site = SiteService.addSite(nSiteId, getStateSite(state)); try { SiteService.save(site); } catch (IdUnusedException e) { // TODO: } catch (PermissionException e) { // TODO: } try { site = SiteService.getSite(nSiteId); // set title site.setTitle(title); // import tool content List pageList = site.getPages(); if (!((pageList == null) || (pageList.size() == 0))) { for (ListIterator i = pageList.listIterator(); i.hasNext(); ) { SitePage page = (SitePage) i.next(); List pageToolList = page.getTools(); String toolId = ((ToolConfiguration)pageToolList.get(0)).getTool().getId(); if (toolId.equalsIgnoreCase("sakai.resources")) { // handle resource tool specially transferCopyEntities(toolId, ContentHostingService.getSiteCollection(oSiteId), ContentHostingService.getSiteCollection(nSiteId)); } else { // other tools transferCopyEntities(toolId, oSiteId, nSiteId); } } } } catch (Exception e1) { //if goes here, IdService or SiteService has done something wrong. M_log.warn(this + "Exception" + e1 + ":"+ nSiteId + "when duplicating site"); } try { SiteService.save(site); } catch (IdUnusedException e) { // TODO: } catch (PermissionException e) { // TODO: } // TODO: hard coding this frame id is fragile, portal dependent, and needs to be fixed -ggolden // schedulePeerFrameRefresh("sitenav"); scheduleTopRefresh(); state.setAttribute(SITE_DUPLICATED, Boolean.TRUE); } catch (IdInvalidException e) { addAlert(state, rb.getString("java.siteinval")); } catch (IdUsedException e) { addAlert(state, rb.getString("java.sitebeenused")+" "); } catch (PermissionException e) { addAlert(state, rb.getString("java.allowcreate")+" "); } } } if (state.getAttribute(STATE_MESSAGE) == null) { // site duplication confirmed state.removeAttribute(SITE_DUPLICATED); state.removeAttribute(SITE_DUPLICATED_NAME); // return to the list view state.setAttribute(STATE_TEMPLATE_INDEX, "12"); } } break; case 33: /* * actionForTemplate chef_site-sitemanage-addParticipants.vm */ checkAddParticipant(params, state); if (state.getAttribute(STATE_MESSAGE) == null) { if(state.getAttribute("form_same_role") != null) { boolean same_role = ((Boolean) state.getAttribute("form_same_role")).booleanValue(); if (same_role) { state.setAttribute(STATE_TEMPLATE_INDEX, "34"); } else { state.setAttribute(STATE_TEMPLATE_INDEX, "35"); } } } else { state.setAttribute(STATE_TEMPLATE_INDEX, "33"); } break; case 36: /* * actionForTemplate chef_site-newSiteCourse.vm */ if (forward) { List providerChosenList = new Vector(); if (params.getStrings("providerCourseAdd") == null) { state.removeAttribute(STATE_ADD_CLASS_PROVIDER_CHOSEN); if (params.getString("manualAdds") == null) { addAlert(state, rb.getString("java.manual")+" "); } } if (state.getAttribute(STATE_MESSAGE) == null) { // The list of courses selected from provider listing if (params.getStrings("providerCourseAdd") != null) { providerChosenList = new ArrayList(Arrays.asList(params.getStrings("providerCourseAdd"))); // list of course ids state.setAttribute(STATE_ADD_CLASS_PROVIDER_CHOSEN, providerChosenList); } if (state.getAttribute(STATE_MESSAGE) == null) { siteInfo = new SiteInfo(); if(state.getAttribute(STATE_SITE_INFO) != null) { siteInfo = (SiteInfo) state.getAttribute(STATE_SITE_INFO); } if (providerChosenList.size() >= 1) { siteInfo.title = getCourseTab(state, (String) providerChosenList.get(0)); } state.setAttribute(STATE_SITE_INFO, siteInfo); if (params.getString("manualAdds") != null) { // if creating a new site state.setAttribute(STATE_TEMPLATE_INDEX, "37"); state.setAttribute(STATE_MANUAL_ADD_COURSE_NUMBER, new Integer(1)); } else { // no manual add state.removeAttribute(STATE_MANUAL_ADD_COURSE_NUMBER); state.removeAttribute(STATE_MANUAL_ADD_COURSE_FIELDS); state.removeAttribute(STATE_SITE_QUEST_UNIQNAME); if (getStateSite(state) != null) { // if revising a site, go to the confirmation page of adding classes state.setAttribute(STATE_TEMPLATE_INDEX, "44"); } else { // if creating a site, go the the site information entry page state.setAttribute(STATE_TEMPLATE_INDEX, "2"); } } } } //next step state.setAttribute(SITE_CREATE_CURRENT_STEP, new Integer(2)); } break; case 38: /* * actionForTemplate chef_site-sitemange-editInfo.vm */ if (forward) { Site siteEdit = getStateSite(state); ResourcePropertiesEdit siteProperties = siteEdit.getPropertiesEdit(); if (SecurityService.isSuperUser()) { String title = StringUtil.trimToNull(params.getString("title")); state.setAttribute(FORM_SITEINFO_TITLE, title); siteEdit.setTitle(title); } String type = StringUtil.trimToNull(params.getString("type")); state.setAttribute(STATE_SITEMANAGE_SITETYPE, type); siteEdit.setType(type); String description = StringUtil.trimToNull(params.getString("description")); state.setAttribute(FORM_SITEINFO_DESCRIPTION, description); siteEdit.setDescription(description); String short_description = StringUtil.trimToNull(params.getString("short_description")); state.setAttribute(FORM_SITEINFO_SHORT_DESCRIPTION, short_description); siteEdit.setShortDescription(short_description); // "skin" will be the icon from the list (course sites), or we have the icon as a full URL String skin = StringUtil.trimToNull(params.getString("skin")); state.setAttribute(FORM_SITEINFO_SKIN, skin); if (skin != null) { setAppearance(state, siteEdit, skin); } else { String iconUrl = StringUtil.trimToNull(params.getString("icon")); state.setAttribute("siteIconUrl", iconUrl); siteEdit.setIconUrl(iconUrl); } String include = StringUtil.trimToNull(params.getString("include")); if (include != null && include.equalsIgnoreCase(Boolean.FALSE.toString())) { state.setAttribute(FORM_SITEINFO_INCLUDE, Boolean.FALSE.toString()); siteEdit.setPubView(false); } else { state.setAttribute(FORM_SITEINFO_INCLUDE, Boolean.TRUE.toString()); siteEdit.setPubView(true); } // site contact information String contactName = StringUtil.trimToZero(params.getString ("siteContactName")); state.setAttribute(FORM_SITEINFO_CONTACT_NAME, contactName); siteProperties = siteEdit.getPropertiesEdit(); if (contactName != null) { siteProperties.addProperty(PROP_SITE_CONTACT_NAME, contactName); } String email = StringUtil.trimToZero(params.getString ("siteContactEmail")); String[] parts = email.split("@"); if(email.length() > 0 && (email.indexOf("@") == -1 || parts.length != 2 || parts[0].length() == 0 || !Validator.checkEmailLocal(parts[0]))) { // invalid email addAlert(state, email + " "+rb.getString("java.invalid") + INVALID_EMAIL); } state.setAttribute(FORM_SITEINFO_CONTACT_EMAIL, email); if (email != null) { siteProperties.addProperty(PROP_SITE_CONTACT_EMAIL, email); } // for site size limit String size = params.getString("size"); if (size != null) { String currentSiteId = ToolManager.getCurrentPlacement().getContext(); String rootCollectionId = ContentHostingService.getSiteCollection(currentSiteId); try { ContentCollectionEdit cedit = ContentHostingService.editCollection(rootCollectionId); ResourcePropertiesEdit pedit = cedit.getPropertiesEdit(); // default 1 GB = 1,048,576 Kilobyte String quota = "1048576"; if (size.equals(DEFAULT_SITE_SIZE_LIMIT)) { state.setAttribute(STATE_SITE_SIZE_DEFAULT_SELECT, Boolean.TRUE); // set the quota pedit.addProperty(ResourceProperties.PROP_COLLECTION_BODY_QUOTA, quota); } else { String otherSize = StringUtil.trimToZeroLower(params.getString("otherSize")); if (otherSize.equals("")) { addAlert(state, rb.getString("java.pleasech")); state.setAttribute(STATE_SITE_SIZE_DEFAULT_SELECT, Boolean.FALSE); } else { String[] strings = null; long unit = 1; if (otherSize.endsWith("kb")){strings = StringUtil.splitFirst(otherSize,"kb");} else if (otherSize.endsWith("kilobytes")){strings = StringUtil.splitFirst(otherSize,"kilobytes");} else if (otherSize.endsWith("kilobyte")){strings = StringUtil.splitFirst(otherSize,"kilobyte");} else if (otherSize.endsWith("mb")){strings = StringUtil.splitFirst(otherSize,"mb"); unit = 1024;} else if (otherSize.endsWith("megabytes")){strings = StringUtil.splitFirst(otherSize,"megabytes"); unit = 1024;} else if (otherSize.endsWith("megabyte")){strings = StringUtil.splitFirst(otherSize,"megabytes"); unit = 1024;} else if (otherSize.endsWith("gb")){strings = StringUtil.splitFirst(otherSize,"gb"); unit = 1048576;} else if (otherSize.endsWith("gigabytes")){strings = StringUtil.splitFirst(otherSize,"gigabytes"); unit = 1048576;} else if (otherSize.endsWith("gigabyte")){strings = StringUtil.splitFirst(otherSize,"gigabyte"); unit = 1048576;} if (strings != null) { try { // strings{digital strings, size unit "kb/mb/gb"} int intSize = Integer.parseInt(strings[0]); unit = intSize * unit; // size is transferred to KB pedit.addProperty(ResourceProperties.PROP_COLLECTION_BODY_QUOTA, (new Long(unit)).toString()); } catch(NumberFormatException error) { addAlert(state, rb.getString("java.pleaseval")); } } else { addAlert(state, rb.getString("java.pleaseval")); } } // if-else } // if-else ContentHostingService.commitCollection(cedit); } catch (IdUnusedException e) { } catch (TypeException e) { } catch (PermissionException e) { } catch (InUseException e) { addAlert(state, rb.getString("java.someone")); } } try { SiteService.save(siteEdit); } catch (IdUnusedException e) { // TODO: } catch (PermissionException e) { // TODO: } if (state.getAttribute(STATE_MESSAGE) == null) { state.setAttribute(STATE_TEMPLATE_INDEX, "31"); } } break; case 39: /* * actionForTemplate chef_site-sitemange-editAccess.vm */ if (state.getAttribute(STATE_MESSAGE) == null) { updateCurrentStep(state, forward); } break; case 42: /* actionForTemplate chef_site-gradtoolsConfirm.vm * */ break; case 43: /* actionForTemplate chef_site-editClass.vm * */ if (forward) { if (params.getStrings("providerClassDeletes") == null && params.getStrings("manualClassDeletes") == null && !direction.equals("back")) { addAlert(state, rb.getString("java.classes")); } if (params.getStrings("providerClassDeletes") != null) { // build the deletions list List providerCourseList = (List) state.getAttribute(SITE_PROVIDER_COURSE_LIST); List providerCourseDeleteList = new ArrayList(Arrays.asList(params.getStrings("providerClassDeletes"))); for (ListIterator i = providerCourseDeleteList.listIterator(); i.hasNext(); ) { providerCourseList.remove((String) i.next()); } state.setAttribute(SITE_PROVIDER_COURSE_LIST, providerCourseList); } if (params.getStrings("manualClassDeletes") != null) { // build the deletions list List manualCourseList = (List) state.getAttribute(SITE_MANUAL_COURSE_LIST); List manualCourseDeleteList = new ArrayList(Arrays.asList(params.getStrings("manualClassDeletes"))); for (ListIterator i = manualCourseDeleteList.listIterator(); i.hasNext(); ) { manualCourseList.remove((String) i.next()); } state.setAttribute(SITE_MANUAL_COURSE_LIST, manualCourseList); } updateCourseClasses (state, new Vector(), new Vector()); } break; case 44: if (forward) { List providerList = (state.getAttribute(SITE_PROVIDER_COURSE_LIST) == null)?new Vector():(List) state.getAttribute(SITE_PROVIDER_COURSE_LIST); List addProviderList = (state.getAttribute(STATE_ADD_CLASS_PROVIDER_CHOSEN) == null)?new Vector():(List) state.getAttribute(STATE_ADD_CLASS_PROVIDER_CHOSEN); providerList.addAll(addProviderList); state.setAttribute(SITE_PROVIDER_COURSE_LIST, providerList); if (state.getAttribute(STATE_MANUAL_ADD_COURSE_NUMBER) != null) { // if manually added course List manualList = (state.getAttribute(SITE_MANUAL_COURSE_LIST) == null)?new Vector():(List) state.getAttribute(SITE_MANUAL_COURSE_LIST); int manualAddNumber = ((Integer) state.getAttribute(STATE_MANUAL_ADD_COURSE_NUMBER)).intValue(); List manualAddFields = (List) state.getAttribute(STATE_MANUAL_ADD_COURSE_FIELDS); Term t = (Term) state.getAttribute(STATE_TERM_SELECTED); for (int m=0; m<manualAddNumber && t!=null; m++) { String manualAddClassId = CourseManagementService.getCourseId(t, (List) manualAddFields.get(m)); manualList.add(manualAddClassId); } state.setAttribute(SITE_MANUAL_COURSE_LIST, manualList); } updateCourseClasses(state, (List) state.getAttribute(STATE_ADD_CLASS_PROVIDER_CHOSEN), (List) state.getAttribute(SITE_MANUAL_COURSE_LIST)); removeAddClassContext(state); } break; case 49: if (!forward) { state.removeAttribute(SORTED_BY); state.removeAttribute(SORTED_ASC); } break; } }// actionFor Template | 54846 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54846/260e4645c5211a1c110d7c42b5b7b74835909921/SiteAction.java/buggy/site-manage-tool/tool/src/java/org/sakaiproject/site/tool/SiteAction.java |
|
context.put ("selectedTools", orderToolIds(state, site_type, (List) state.getAttribute(STATE_TOOL_REGISTRATION_SELECTED_LIST))); | context.put ("selectedTools", orderToolIds(state, site_type, getToolsAvailableForImport(state))); | private String buildContextForTemplate (int index, VelocityPortlet portlet, Context context, RunData data, SessionState state) { String realmId = ""; String site_type = ""; String sortedBy = ""; String sortedAsc = ""; ParameterParser params = data.getParameters (); context.put("tlang",rb); context.put("alertMessage", state.getAttribute(STATE_MESSAGE)); // If cleanState() has removed SiteInfo, get a new instance into state SiteInfo siteInfo = new SiteInfo(); if (state.getAttribute(STATE_SITE_INFO) != null) { siteInfo = (SiteInfo) state.getAttribute(STATE_SITE_INFO); } else { state.setAttribute(STATE_SITE_INFO, siteInfo); } // Lists used in more than one template // Access List roles = new Vector(); // the hashtables for News and Web Content tools Hashtable newsTitles = new Hashtable(); Hashtable newsUrls = new Hashtable(); Hashtable wcTitles = new Hashtable(); Hashtable wcUrls = new Hashtable(); List toolRegistrationList = new Vector(); List toolRegistrationSelectedList = new Vector(); ResourceProperties siteProperties = null; // for showing site creation steps if (state.getAttribute(SITE_CREATE_TOTAL_STEPS) != null) { context.put("totalSteps", state.getAttribute(SITE_CREATE_TOTAL_STEPS)); } if (state.getAttribute(SITE_CREATE_CURRENT_STEP) != null) { context.put("step", state.getAttribute(SITE_CREATE_CURRENT_STEP)); } String hasGradSites = ServerConfigurationService.getString("withDissertation", Boolean.FALSE.toString()); Site site = getStateSite(state); switch (index) { case 0: /* buildContextForTemplate chef_site-list.vm * */ // site types List sTypes = (List) state.getAttribute(STATE_SITE_TYPES); //make sure auto-updates are enabled Hashtable views = new Hashtable(); if (SecurityService.isSuperUser()) { views.put(ALL_MY_SITES, ALL_MY_SITES); views.put(MYWORKSPACE + " sites", MYWORKSPACE); for(int sTypeIndex = 0; sTypeIndex < sTypes.size(); sTypeIndex++) { String type = (String) sTypes.get(sTypeIndex); views.put(type + " sites", type); } if (hasGradSites.equalsIgnoreCase("true")) { views.put(GRADTOOLS + " sites", GRADTOOLS); } if(state.getAttribute(STATE_VIEW_SELECTED) == null) { state.setAttribute(STATE_VIEW_SELECTED, ALL_MY_SITES); } context.put("superUser", Boolean.TRUE); } else { context.put("superUser", Boolean.FALSE); views.put(ALL_MY_SITES, ALL_MY_SITES); // if there is a GradToolsStudent choice inside boolean remove = false; if (hasGradSites.equalsIgnoreCase("true")) { try { //the Grad Tools site option is only presented to GradTools Candidates String userId = StringUtil.trimToZero(SessionManager.getCurrentSessionUserId()); //am I a grad student? if (!isGradToolsCandidate(userId)) { // not a gradstudent remove = true; } } catch(Exception e) { remove = true; } } else { // not support for dissertation sites remove=true; } //do not show this site type in views //sTypes.remove(new String(SITE_TYPE_GRADTOOLS_STUDENT)); for(int sTypeIndex = 0; sTypeIndex < sTypes.size(); sTypeIndex++) { String type = (String) sTypes.get(sTypeIndex); if(!type.equals(SITE_TYPE_GRADTOOLS_STUDENT)) { views.put(type + " "+rb.getString("java.sites"), type); } } if (!remove) { views.put(GRADTOOLS + " sites", GRADTOOLS); } //default view if(state.getAttribute(STATE_VIEW_SELECTED) == null) { state.setAttribute(STATE_VIEW_SELECTED, ALL_MY_SITES); } } context.put("views", views); if(state.getAttribute(STATE_VIEW_SELECTED) != null) { context.put("viewSelected", (String) state.getAttribute(STATE_VIEW_SELECTED)); } String search = (String) state.getAttribute(STATE_SEARCH); context.put("search_term", search); sortedBy = (String) state.getAttribute (SORTED_BY); if (sortedBy == null) { state.setAttribute(SORTED_BY, SortType.TITLE_ASC.toString()); sortedBy = SortType.TITLE_ASC.toString(); } sortedAsc = (String) state.getAttribute (SORTED_ASC); if (sortedAsc == null) { state.setAttribute(SORTED_ASC, Boolean.TRUE.toString()); sortedAsc = Boolean.TRUE.toString(); } if(sortedBy!=null) context.put ("currentSortedBy", sortedBy); if(sortedAsc!=null) context.put ("currentSortAsc", sortedAsc); String portalUrl = ServerConfigurationService.getPortalUrl(); context.put("portalUrl", portalUrl); List sites = prepPage(state); state.setAttribute(STATE_SITES, sites); context.put("sites", sites); context.put("totalPageNumber", new Integer(totalPageNumber(state))); context.put("searchString", state.getAttribute(STATE_SEARCH)); context.put("form_search", FORM_SEARCH); context.put("formPageNumber", FORM_PAGE_NUMBER); context.put("prev_page_exists", state.getAttribute(STATE_PREV_PAGE_EXISTS)); context.put("next_page_exists", state.getAttribute(STATE_NEXT_PAGE_EXISTS)); context.put("current_page", state.getAttribute(STATE_CURRENT_PAGE)); // put the service in the context (used for allow update calls on each site) context.put("service", SiteService.getInstance()); context.put("sortby_title", SortType.TITLE_ASC.toString()); context.put("sortby_type", SortType.TYPE_ASC.toString()); context.put("sortby_createdby", SortType.CREATED_BY_ASC.toString()); context.put("sortby_publish", SortType.PUBLISHED_ASC.toString()); context.put("sortby_createdon", SortType.CREATED_ON_ASC.toString()); // top menu bar Menu bar = new MenuImpl(portlet, data, (String) state.getAttribute(STATE_ACTION)); if (SiteService.allowAddSite(null)) { bar.add( new MenuEntry(rb.getString("java.new"), "doNew_site")); } bar.add( new MenuEntry(rb.getString("java.revise"), null, true, MenuItem.CHECKED_NA, "doGet_site", "sitesForm")); bar.add( new MenuEntry(rb.getString("java.delete"), null, true, MenuItem.CHECKED_NA, "doMenu_site_delete", "sitesForm")); context.put("menu", bar); // default to be no pageing context.put("paged", Boolean.FALSE); Menu bar2 = new MenuImpl(portlet, data, (String) state.getAttribute(STATE_ACTION)); // add the search commands addSearchMenus(bar2, state); context.put("menu2", bar2); pagingInfoToContext(state, context); return (String)getContext(data).get("template") + TEMPLATE[0]; case 1: /* buildContextForTemplate chef_site-type.vm * */ if (hasGradSites.equalsIgnoreCase("true")) { context.put("withDissertation", Boolean.TRUE); try { //the Grad Tools site option is only presented to UM grad students String userId = StringUtil.trimToZero(SessionManager.getCurrentSessionUserId()); //am I a UM grad student? Boolean isGradStudent = new Boolean(isGradToolsCandidate(userId)); context.put("isGradStudent", isGradStudent); //if I am a UM grad student, do I already have a Grad Tools site? boolean noGradToolsSite = true; if(hasGradToolsStudentSite(userId)) noGradToolsSite = false; context.put("noGradToolsSite", new Boolean(noGradToolsSite)); } catch(Exception e) { if(Log.isWarnEnabled()) { M_log.warn("buildContextForTemplate chef_site-type.vm " + e); } } } else { context.put("withDissertation", Boolean.FALSE); } List types = (List) state.getAttribute(STATE_SITE_TYPES); context.put("siteTypes", types); // put selected/default site type into context if (siteInfo.site_type != null && siteInfo.site_type.length() >0) { context.put("typeSelected", siteInfo.site_type); } else if (types.size() > 0) { context.put("typeSelected", types.get(0)); } List terms = CourseManagementService.getTerms(); List termsForSiteCreation = new Vector(); if (terms != null && terms.size() >0) { for (int i=0; i<terms.size();i++) { Term t = (Term) terms.get(i); if (!t.getEndTime().before(TimeService.newTime())) { // don't show those terms which have ended already termsForSiteCreation.add(t); } } } if (termsForSiteCreation.size() > 0) { context.put("termList", termsForSiteCreation); } if (state.getAttribute(STATE_TERM_SELECTED) != null) { context.put("selectedTerm", state.getAttribute(STATE_TERM_SELECTED)); } return (String)getContext(data).get("template") + TEMPLATE[1]; case 2: /* buildContextForTemplate chef_site-newSiteInformation.vm * */ context.put("siteTypes", state.getAttribute(STATE_SITE_TYPES)); String siteType = (String) state.getAttribute(STATE_SITE_TYPE); context.put("titleEditableSiteType", state.getAttribute(TITLE_EDITABLE_SITE_TYPE)); context.put("type", siteType); if (siteType.equalsIgnoreCase("course")) { context.put ("isCourseSite", Boolean.TRUE); context.put("isProjectSite", Boolean.FALSE); if (state.getAttribute(STATE_ADD_CLASS_PROVIDER_CHOSEN) != null) { context.put ("selectedProviderCourse", state.getAttribute(STATE_ADD_CLASS_PROVIDER_CHOSEN)); } if (state.getAttribute(STATE_MANUAL_ADD_COURSE_NUMBER) != null) { int number = ((Integer) state.getAttribute(STATE_MANUAL_ADD_COURSE_NUMBER)).intValue(); context.put ("manualAddNumber", new Integer(number - 1)); context.put ("manualAddFields", state.getAttribute(STATE_MANUAL_ADD_COURSE_FIELDS)); context.put("back", "37"); } else { context.put("back", "36"); } context.put ("skins", state.getAttribute(STATE_ICONS)); if (StringUtil.trimToNull(siteInfo.getIconUrl()) != null) { context.put("selectedIcon", siteInfo.getIconUrl()); } } else { context.put ("isCourseSite", Boolean.FALSE); if (siteType.equalsIgnoreCase("project")) { context.put("isProjectSite", Boolean.TRUE); } if (StringUtil.trimToNull(siteInfo.iconUrl) != null) { context.put(FORM_ICON_URL, siteInfo.iconUrl); } context.put ("back", "1"); } context.put (FORM_TITLE,siteInfo.title); context.put(FORM_SHORT_DESCRIPTION, siteInfo.short_description); context.put (FORM_DESCRIPTION,siteInfo.description); // defalt the site contact person to the site creator if (siteInfo.site_contact_name.equals(NULL_STRING) && siteInfo.site_contact_email.equals(NULL_STRING)) { User user = UserDirectoryService.getCurrentUser(); siteInfo.site_contact_name = user.getDisplayName(); siteInfo.site_contact_email = user.getEmail(); } context.put("form_site_contact_name", siteInfo.site_contact_name); context.put("form_site_contact_email", siteInfo.site_contact_email); // those manual inputs context.put("form_requiredFields", CourseManagementService.getCourseIdRequiredFields()); context.put("fieldValues", state.getAttribute(STATE_MANUAL_ADD_COURSE_FIELDS)); return (String)getContext(data).get("template") + TEMPLATE[2]; case 3: /* buildContextForTemplate chef_site-newSiteFeatures.vm * */ siteType = (String) state.getAttribute(STATE_SITE_TYPE); if (siteType!=null && siteType.equalsIgnoreCase("course")) { context.put ("isCourseSite", Boolean.TRUE); context.put("isProjectSite", Boolean.FALSE); } else { context.put ("isCourseSite", Boolean.FALSE); if (siteType.equalsIgnoreCase("project")) { context.put("isProjectSite", Boolean.TRUE); } } context.put("defaultTools", ServerConfigurationService.getToolsRequired(siteType)); toolRegistrationSelectedList = (List) state.getAttribute(STATE_TOOL_REGISTRATION_SELECTED_LIST); // If this is the first time through, check for tools // which should be selected by default. List defaultSelectedTools = ServerConfigurationService.getDefaultTools(siteType); if (toolRegistrationSelectedList == null) { toolRegistrationSelectedList = new Vector(defaultSelectedTools); } context.put (STATE_TOOL_REGISTRATION_SELECTED_LIST, toolRegistrationSelectedList); // String toolId's context.put (STATE_TOOL_REGISTRATION_LIST, state.getAttribute(STATE_TOOL_REGISTRATION_LIST) ); // %%% use ToolRegistrations for template list context.put("emailId", state.getAttribute(STATE_TOOL_EMAIL_ADDRESS)); context.put("serverName", ServerConfigurationService.getServerName()); // The "Home" tool checkbox needs special treatment to be selected by // default. Boolean checkHome = (Boolean)state.getAttribute(STATE_TOOL_HOME_SELECTED); if (checkHome == null) { if ((defaultSelectedTools != null) && defaultSelectedTools.contains("home")) { checkHome = Boolean.TRUE; } } context.put("check_home", checkHome); //titles for news tools context.put("newsTitles", state.getAttribute(STATE_NEWS_TITLES)); //titles for web content tools context.put("wcTitles", state.getAttribute(STATE_WEB_CONTENT_TITLES)); //urls for news tools context.put("newsUrls", state.getAttribute(STATE_NEWS_URLS)); //urls for web content tools context.put("wcUrls", state.getAttribute(STATE_WEB_CONTENT_URLS)); context.put("sites", SiteService.getSites(org.sakaiproject.site.api.SiteService.SelectionType.UPDATE, null, null, null, SortType.TITLE_ASC, null)); context.put("import", state.getAttribute(STATE_IMPORT)); context.put("importSites", state.getAttribute(STATE_IMPORT_SITES)); return (String)getContext(data).get("template") + TEMPLATE[3]; case 4: /* buildContextForTemplate chef_site-addRemoveFeatures.vm * */ context.put("SiteTitle", site.getTitle()); String type = (String) state.getAttribute(STATE_SITE_TYPE); context.put("defaultTools", ServerConfigurationService.getToolsRequired(type)); boolean myworkspace_site = false; //Put up tool lists filtered by category List siteTypes = (List) state.getAttribute(STATE_SITE_TYPES); if (siteTypes.contains(type)) { myworkspace_site = false; } if (SiteService.isUserSite(site.getId()) || (type!=null && type.equalsIgnoreCase("myworkspace"))) { myworkspace_site = true; type="myworkspace"; } context.put ("myworkspace_site", new Boolean(myworkspace_site)); context.put(STATE_TOOL_REGISTRATION_SELECTED_LIST, state.getAttribute(STATE_TOOL_REGISTRATION_SELECTED_LIST)); //titles for news tools context.put("newsTitles", state.getAttribute(STATE_NEWS_TITLES)); //titles for web content tools context.put("wcTitles", state.getAttribute(STATE_WEB_CONTENT_TITLES)); //urls for news tools context.put("newsUrls", state.getAttribute(STATE_NEWS_URLS)); //urls for web content tools context.put("wcUrls", state.getAttribute(STATE_WEB_CONTENT_URLS)); context.put (STATE_TOOL_REGISTRATION_LIST, state.getAttribute(STATE_TOOL_REGISTRATION_LIST)); context.put("check_home", state.getAttribute(STATE_TOOL_HOME_SELECTED)); //get the email alias when an Email Archive tool has been selected String channelReference = mailArchiveChannelReference(site.getId()); List aliases = AliasService.getAliases(channelReference, 1, 1); if (aliases.size() > 0) { state.setAttribute(STATE_TOOL_EMAIL_ADDRESS, ((Alias) aliases.get(0)).getId()); } else { state.removeAttribute(STATE_TOOL_EMAIL_ADDRESS); } if (state.getAttribute(STATE_TOOL_EMAIL_ADDRESS) != null) { context.put("emailId", state.getAttribute(STATE_TOOL_EMAIL_ADDRESS)); } context.put("serverName", ServerConfigurationService.getServerName()); context.put("backIndex", "12"); return (String)getContext(data).get("template") + TEMPLATE[4]; case 5: /* buildContextForTemplate chef_site-addParticipant.vm * */ context.put("title", site.getTitle()); roles = getRoles(state); context.put("roles", roles); // Note that (for now) these strings are in both sakai.properties and sitesetupgeneric.properties context.put("noEmailInIdAccountName", ServerConfigurationService.getString("noEmailInIdAccountName")); context.put("noEmailInIdAccountLabel", ServerConfigurationService.getString("noEmailInIdAccountLabel")); context.put("emailInIdAccountName", ServerConfigurationService.getString("emailInIdAccountName")); context.put("emailInIdAccountLabel", ServerConfigurationService.getString("emailInIdAccountLabel")); if(state.getAttribute("noEmailInIdAccountValue")!=null) { context.put("noEmailInIdAccountValue", (String)state.getAttribute("noEmailInIdAccountValue")); } if(state.getAttribute("emailInIdAccountValue")!=null) { context.put("emailInIdAccountValue", (String)state.getAttribute("emailInIdAccountValue")); } if(state.getAttribute("form_same_role") != null) { context.put("form_same_role", ((Boolean) state.getAttribute("form_same_role")).toString()); } else { context.put("form_same_role", Boolean.TRUE.toString()); } context.put("backIndex", "12"); return (String)getContext(data).get("template") + TEMPLATE[5]; case 6: /* buildContextForTemplate chef_site-removeParticipants.vm * */ context.put("title", site.getTitle()); realmId = SiteService.siteReference(site.getId()); try { AuthzGroup realm = AuthzGroupService.getAuthzGroup(realmId); try { List removeableList = (List) state.getAttribute(STATE_REMOVEABLE_USER_LIST); List removeableParticipants = new Vector(); for (int k = 0; k < removeableList.size(); k++) { User user = UserDirectoryService.getUser((String) removeableList.get(k)); Participant participant = new Participant(); participant.name = user.getSortName(); participant.uniqname = user.getId(); Role r = realm.getUserRole(user.getId()); if (r != null) { participant.role = r.getId(); } removeableParticipants.add(participant); } context.put("removeableList", removeableParticipants); } catch (UserNotDefinedException ee) { } } catch (GroupNotDefinedException e) { } context.put("backIndex", "18"); return (String)getContext(data).get("template") + TEMPLATE[6]; case 7: /* buildContextForTemplate chef_site-changeRoles.vm * */ context.put("same_role", state.getAttribute(STATE_CHANGEROLE_SAMEROLE)); roles = getRoles(state); context.put("roles", roles); context.put("currentRole", state.getAttribute(STATE_CHANGEROLE_SAMEROLE_ROLE)); context.put("participantSelectedList", state.getAttribute(STATE_SELECTED_PARTICIPANTS)); context.put("selectedRoles", state.getAttribute(STATE_SELECTED_PARTICIPANT_ROLES)); context.put("siteTitle", site.getTitle()); return (String)getContext(data).get("template") + TEMPLATE[7]; case 8: /* buildContextForTemplate chef_site-siteDeleteConfirm.vm * */ String site_title = NULL_STRING; String[] removals = (String[]) state.getAttribute(STATE_SITE_REMOVALS); List remove = new Vector(); String user = SessionManager.getCurrentSessionUserId(); String workspace = SiteService.getUserSiteId(user); if( removals != null && removals.length != 0 ) { for (int i = 0; i < removals.length; i++ ) { String id = (String) removals[i]; if(!(id.equals(workspace))) { try { site_title = SiteService.getSite(id).getTitle(); } catch (IdUnusedException e) { M_log.warn("SiteAction.doSite_delete_confirmed - IdUnusedException " + id); addAlert(state, rb.getString("java.sitewith")+" " + id + " "+rb.getString("java.couldnt")+" "); } if(SiteService.allowRemoveSite(id)) { try { Site removeSite = SiteService.getSite(id); remove.add(removeSite); } catch (IdUnusedException e) { M_log.warn("SiteAction.buildContextForTemplate chef_site-siteDeleteConfirm.vm: IdUnusedException"); } } else { addAlert(state, site_title + " "+rb.getString("java.couldntdel") + " "); } } else { addAlert(state, rb.getString("java.yourwork")); } } if(remove.size() == 0) { addAlert(state, rb.getString("java.click")); } } context.put("removals", remove); return (String)getContext(data).get("template") + TEMPLATE[8]; case 9: /* buildContextForTemplate chef_site-publishUnpublish.vm * */ context.put("publish", Boolean.valueOf(((SiteInfo)state.getAttribute(STATE_SITE_INFO)).getPublished())); context.put("backIndex", "12"); return (String)getContext(data).get("template") + TEMPLATE[9]; case 10: /* buildContextForTemplate chef_site-newSiteConfirm.vm * */ siteInfo = (SiteInfo)state.getAttribute(STATE_SITE_INFO); siteType = (String) state.getAttribute(STATE_SITE_TYPE); if (siteType.equalsIgnoreCase("course")) { context.put ("isCourseSite", Boolean.TRUE); context.put ("isProjectSite", Boolean.FALSE); if (state.getAttribute(STATE_ADD_CLASS_PROVIDER_CHOSEN) != null) { context.put ("selectedProviderCourse", state.getAttribute(STATE_ADD_CLASS_PROVIDER_CHOSEN)); } if (state.getAttribute(STATE_MANUAL_ADD_COURSE_NUMBER) != null) { int number = ((Integer) state.getAttribute(STATE_MANUAL_ADD_COURSE_NUMBER)).intValue(); context.put ("manualAddNumber", new Integer(number - 1)); context.put ("manualAddFields", state.getAttribute(STATE_MANUAL_ADD_COURSE_FIELDS)); } context.put ("skins", state.getAttribute(STATE_ICONS)); if (StringUtil.trimToNull(siteInfo.getIconUrl()) != null) { context.put("selectedIcon", siteInfo.getIconUrl()); } } else { context.put ("isCourseSite", Boolean.FALSE); if (siteType!=null && siteType.equalsIgnoreCase("project")) { context.put("isProjectSite", Boolean.TRUE); } if (StringUtil.trimToNull(siteInfo.iconUrl) != null) { context.put("iconUrl", siteInfo.iconUrl); } } context.put("title", siteInfo.title); context.put("description", siteInfo.description); context.put("short_description", siteInfo.short_description); context.put("siteContactName", siteInfo.site_contact_name); context.put("siteContactEmail", siteInfo.site_contact_email); siteType = (String) state.getAttribute(STATE_SITE_TYPE); toolRegistrationSelectedList = (List) state.getAttribute(STATE_TOOL_REGISTRATION_SELECTED_LIST); context.put (STATE_TOOL_REGISTRATION_SELECTED_LIST, toolRegistrationSelectedList); // String toolId's context.put (STATE_TOOL_REGISTRATION_LIST, state.getAttribute(STATE_TOOL_REGISTRATION_LIST)); // %%% use Tool context.put("check_home", state.getAttribute(STATE_TOOL_HOME_SELECTED)); context.put("emailId", state.getAttribute(STATE_TOOL_EMAIL_ADDRESS)); context.put("serverName", ServerConfigurationService.getServerName()); context.put("include", new Boolean(siteInfo.include)); context.put("published", new Boolean(siteInfo.published)); context.put("joinable", new Boolean(siteInfo.joinable)); context.put("joinerRole", siteInfo.joinerRole); context.put("newsTitles", (Hashtable) state.getAttribute(STATE_NEWS_TITLES)); context.put("wcTitles", (Hashtable) state.getAttribute(STATE_WEB_CONTENT_TITLES)); // back to edit access page context.put("back", "18"); context.put("importSiteTools", state.getAttribute(STATE_IMPORT_SITE_TOOL)); context.put("siteService", SiteService.getInstance()); // those manual inputs context.put("form_requiredFields", CourseManagementService.getCourseIdRequiredFields()); context.put("fieldValues", state.getAttribute(STATE_MANUAL_ADD_COURSE_FIELDS)); return (String)getContext(data).get("template") + TEMPLATE[10]; case 11: /* buildContextForTemplate chef_site-newSitePublishUnpublish.vm * */ return (String)getContext(data).get("template") + TEMPLATE[11]; case 12: /* buildContextForTemplate chef_site-siteInfo-list.vm * */ context.put("userDirectoryService", UserDirectoryService.getInstance()); try { siteProperties = site.getProperties(); siteType = site.getType(); if (siteType != null) { state.setAttribute(STATE_SITE_TYPE, siteType); } boolean isMyWorkspace = false; if (SiteService.isUserSite(site.getId())) { if (SiteService.getSiteUserId(site.getId()).equals(SessionManager.getCurrentSessionUserId())) { isMyWorkspace = true; context.put("siteUserId", SiteService.getSiteUserId(site.getId())); } } context.put("isMyWorkspace", Boolean.valueOf(isMyWorkspace)); String siteId = site.getId(); if (state.getAttribute(STATE_ICONS)!= null) { List skins = (List)state.getAttribute(STATE_ICONS); for (int i = 0; i < skins.size(); i++) { Icon s = (Icon)skins.get(i); if(!StringUtil.different(s.getUrl(), site.getIconUrl())) { context.put("siteUnit", s.getName()); break; } } } context.put("siteIcon", site.getIconUrl()); context.put("siteTitle", site.getTitle()); context.put("siteDescription", site.getDescription()); context.put("siteJoinable", new Boolean(site.isJoinable())); if(site.isPublished()) { context.put("published", Boolean.TRUE); } else { context.put("published", Boolean.FALSE); context.put("owner", site.getCreatedBy().getSortName()); } Time creationTime = site.getCreatedTime(); if (creationTime != null) { context.put("siteCreationDate", creationTime.toStringLocalFull()); } boolean allowUpdateSite = SiteService.allowUpdateSite(siteId); context.put("allowUpdate", Boolean.valueOf(allowUpdateSite)); boolean allowUpdateGroupMembership = SiteService.allowUpdateGroupMembership(siteId); context.put("allowUpdateGroupMembership", Boolean.valueOf(allowUpdateGroupMembership)); boolean allowUpdateSiteMembership = SiteService.allowUpdateSiteMembership(siteId); context.put("allowUpdateSiteMembership", Boolean.valueOf(allowUpdateSiteMembership)); if (allowUpdateSite) { // top menu bar Menu b = new MenuImpl(portlet, data, (String) state.getAttribute(STATE_ACTION)); if (!isMyWorkspace) { b.add( new MenuEntry(rb.getString("java.editsite"), "doMenu_edit_site_info")); } b.add( new MenuEntry(rb.getString("java.edittools"), "doMenu_edit_site_tools")); if (!isMyWorkspace && (ServerConfigurationService.getString("wsetup.group.support") == "" || ServerConfigurationService.getString("wsetup.group.support").equalsIgnoreCase(Boolean.TRUE.toString()))) { // show the group toolbar unless configured to not support group b.add( new MenuEntry(rb.getString("java.group"), "doMenu_group")); } if (!isMyWorkspace) { List gradToolsSiteTypes = (List) state.getAttribute(GRADTOOLS_SITE_TYPES); boolean isGradToolSite = false; if (siteType != null && gradToolsSiteTypes.contains(siteType)) { isGradToolSite = true; } if (siteType == null || siteType != null && !isGradToolSite) { // hide site access for GRADTOOLS type of sites b.add( new MenuEntry(rb.getString("java.siteaccess"), "doMenu_edit_site_access")); } b.add( new MenuEntry(rb.getString("java.addp"), "doMenu_siteInfo_addParticipant")); if (siteType != null && siteType.equals("course")) { b.add( new MenuEntry(rb.getString("java.editc"), "doMenu_siteInfo_editClass")); } if (siteType == null || siteType != null && !isGradToolSite) { // hide site duplicate and import for GRADTOOLS type of sites b.add( new MenuEntry(rb.getString("java.duplicate"), "doMenu_siteInfo_duplicate")); List updatableSites = SiteService.getSites(org.sakaiproject.site.api.SiteService.SelectionType.UPDATE, null, null, null, SortType.TITLE_ASC, null); // import link should be visible even if only one site if (updatableSites.size() > 0) { b.add( new MenuEntry(rb.getString("java.import"), "doMenu_siteInfo_import")); // a configuration param for showing/hiding import from file choice String importFromFile = ServerConfigurationService.getString("site.setup.import.file", Boolean.TRUE.toString()); if (importFromFile.equalsIgnoreCase("true")) { //htripath: June 4th added as per Kris and changed desc of above b.add(new MenuEntry(rb.getString("java.importFile"), "doAttachmentsMtrlFrmFile")); } } } } context.put("menu", b); } if (allowUpdateGroupMembership) { // show Manage Groups menu Menu b = new MenuImpl(portlet, data, (String) state.getAttribute(STATE_ACTION)); if (!isMyWorkspace && (ServerConfigurationService.getString("wsetup.group.support") == "" || ServerConfigurationService.getString("wsetup.group.support").equalsIgnoreCase(Boolean.TRUE.toString()))) { // show the group toolbar unless configured to not support group b.add( new MenuEntry(rb.getString("java.group"), "doMenu_group")); } context.put("menu", b); } if (allowUpdateSiteMembership) { // show add participant menu Menu b = new MenuImpl(portlet, data, (String) state.getAttribute(STATE_ACTION)); if (!isMyWorkspace) { // show the Add Participant menu b.add( new MenuEntry(rb.getString("java.addp"), "doMenu_siteInfo_addParticipant")); } context.put("menu", b); } if (((String) state.getAttribute(STATE_SITE_MODE)).equalsIgnoreCase(SITE_MODE_SITESETUP)) { // editing from worksite setup tool context.put("fromWSetup", Boolean.TRUE); if (state.getAttribute(STATE_PREV_SITE) != null) { context.put("prevSite", state.getAttribute(STATE_PREV_SITE)); } if (state.getAttribute(STATE_NEXT_SITE) != null) { context.put("nextSite", state.getAttribute(STATE_NEXT_SITE)); } } else { context.put("fromWSetup", Boolean.FALSE); } //allow view roster? boolean allowViewRoster = SiteService.allowViewRoster(siteId); if (allowViewRoster) { context.put("viewRoster", Boolean.TRUE); } else { context.put("viewRoster", Boolean.FALSE); } //set participant list if (allowUpdateSite || allowViewRoster || allowUpdateSiteMembership) { List participants = new Vector(); participants = getParticipantList(state); sortedBy = (String) state.getAttribute (SORTED_BY); sortedAsc = (String) state.getAttribute (SORTED_ASC); if(sortedBy==null) { state.setAttribute(SORTED_BY, SORTED_BY_PARTICIPANT_NAME); sortedBy = SORTED_BY_PARTICIPANT_NAME; } if (sortedAsc==null) { state.setAttribute(SORTED_ASC, SORTED_ASC); sortedAsc = SORTED_ASC; } if(sortedBy!=null) context.put ("currentSortedBy", sortedBy); if(sortedAsc!=null) context.put ("currentSortAsc", sortedAsc); Iterator sortedParticipants = null; if (sortedBy != null) { sortedParticipants = new SortedIterator (participants.iterator (), new SiteComparator (sortedBy, sortedAsc)); participants.clear(); while (sortedParticipants.hasNext()) { participants.add(sortedParticipants.next()); } } context.put("participantListSize", new Integer(participants.size())); context.put("participantList", prepPage(state)); pagingInfoToContext(state, context); } context.put("include", Boolean.valueOf(site.isPubView())); // site contact information String contactName = siteProperties.getProperty(PROP_SITE_CONTACT_NAME); String contactEmail = siteProperties.getProperty(PROP_SITE_CONTACT_EMAIL); if (contactName == null && contactEmail == null) { User u = site.getCreatedBy(); String email = u.getEmail(); if (email != null) { contactEmail = u.getEmail(); } contactName = u.getDisplayName(); } if (contactName != null) { context.put("contactName", contactName); } if (contactEmail != null) { context.put("contactEmail", contactEmail); } if (siteType != null && siteType.equalsIgnoreCase("course")) { context.put("isCourseSite", Boolean.TRUE); List providerCourseList = getProviderCourseList(StringUtil.trimToNull(getExternalRealmId(state))); if (providerCourseList != null) { state.setAttribute(SITE_PROVIDER_COURSE_LIST, providerCourseList); context.put("providerCourseList", providerCourseList); } String manualCourseListString = site.getProperties().getProperty(PROP_SITE_REQUEST_COURSE); if (manualCourseListString != null) { List manualCourseList = new Vector(); if (manualCourseListString.indexOf("+") != -1) { manualCourseList = new ArrayList(Arrays.asList(manualCourseListString.split("\\+"))); } else { manualCourseList.add(manualCourseListString); } state.setAttribute(SITE_MANUAL_COURSE_LIST, manualCourseList); context.put("manualCourseList", manualCourseList); } context.put("term", siteProperties.getProperty(PROP_SITE_TERM)); } else { context.put("isCourseSite", Boolean.FALSE); } } catch (Exception e) { M_log.warn(this + " site info list: " + e.toString()); } roles = getRoles(state); context.put("roles", roles); // will have the choice to active/inactive user or not String activeInactiveUser = ServerConfigurationService.getString("activeInactiveUser", Boolean.FALSE.toString()); if (activeInactiveUser.equalsIgnoreCase("true")) { context.put("activeInactiveUser", Boolean.TRUE); // put realm object into context realmId = SiteService.siteReference(site.getId()); try { context.put("realm", AuthzGroupService.getAuthzGroup(realmId)); } catch (GroupNotDefinedException e) { M_log.warn(this + " IdUnusedException " + realmId); } } else { context.put("activeInactiveUser", Boolean.FALSE); } context.put("groupsWithMember", site.getGroupsWithMember(UserDirectoryService.getCurrentUser().getId())); return (String)getContext(data).get("template") + TEMPLATE[12]; case 13: /* buildContextForTemplate chef_site-siteInfo-editInfo.vm * */ siteProperties = site.getProperties(); context.put("title", state.getAttribute(FORM_SITEINFO_TITLE)); context.put("titleEditableSiteType", state.getAttribute(TITLE_EDITABLE_SITE_TYPE)); context.put("type", site.getType()); siteType = (String) state.getAttribute(STATE_SITE_TYPE); if (siteType != null && siteType.equalsIgnoreCase("course")) { context.put("isCourseSite", Boolean.TRUE); context.put("skins", state.getAttribute(STATE_ICONS)); if (state.getAttribute(FORM_SITEINFO_SKIN) != null) { context.put("selectedIcon",state.getAttribute(FORM_SITEINFO_SKIN)); } else if (site.getIconUrl() != null) { context.put("selectedIcon",site.getIconUrl()); } terms = CourseManagementService.getTerms(); if (terms != null && terms.size() >0) { context.put("termList", terms); } if (state.getAttribute(FORM_SITEINFO_TERM) == null) { String currentTerm = site.getProperties().getProperty(PROP_SITE_TERM); if (currentTerm != null) { state.setAttribute(FORM_SITEINFO_TERM, currentTerm); } } if (state.getAttribute(FORM_SITEINFO_TERM) != null) { context.put("selectedTerm", state.getAttribute(FORM_SITEINFO_TERM)); } } else { context.put("isCourseSite", Boolean.FALSE); if (state.getAttribute(FORM_SITEINFO_ICON_URL) == null && StringUtil.trimToNull(site.getIconUrl()) != null) { state.setAttribute(FORM_SITEINFO_ICON_URL, site.getIconUrl()); } if (state.getAttribute(FORM_SITEINFO_ICON_URL) != null) { context.put("iconUrl", state.getAttribute(FORM_SITEINFO_ICON_URL)); } } context.put("description", state.getAttribute(FORM_SITEINFO_DESCRIPTION)); context.put("short_description", state.getAttribute(FORM_SITEINFO_SHORT_DESCRIPTION)); context.put("form_site_contact_name", state.getAttribute(FORM_SITEINFO_CONTACT_NAME)); context.put("form_site_contact_email", state.getAttribute(FORM_SITEINFO_CONTACT_EMAIL)); //Display of appearance icon/url list with course site based on // "disable.course.site.skin.selection" value set with sakai.properties file. if ((ServerConfigurationService.getString("disable.course.site.skin.selection")).equals("true")){ context.put("disableCourseSelection", Boolean.TRUE); } return (String)getContext(data).get("template") + TEMPLATE[13]; case 14: /* buildContextForTemplate chef_site-siteInfo-editInfoConfirm.vm * */ siteProperties = site.getProperties(); siteType = (String)state.getAttribute(STATE_SITE_TYPE); if (siteType != null && siteType.equalsIgnoreCase("course")) { context.put("isCourseSite", Boolean.TRUE); context.put("siteTerm", state.getAttribute(FORM_SITEINFO_TERM)); } else { context.put("isCourseSite", Boolean.FALSE); } context.put("oTitle", site.getTitle()); context.put("title", state.getAttribute(FORM_SITEINFO_TITLE)); context.put("description", state.getAttribute(FORM_SITEINFO_DESCRIPTION)); context.put("oDescription", site.getDescription()); context.put("short_description", state.getAttribute(FORM_SITEINFO_SHORT_DESCRIPTION)); context.put("oShort_description", site.getShortDescription()); context.put("skin", state.getAttribute(FORM_SITEINFO_SKIN)); context.put("oSkin", site.getIconUrl()); context.put("skins", state.getAttribute(STATE_ICONS)); context.put("oIcon", site.getIconUrl()); context.put("icon", state.getAttribute(FORM_SITEINFO_ICON_URL)); context.put("include", state.getAttribute(FORM_SITEINFO_INCLUDE)); context.put("oInclude", Boolean.valueOf(site.isPubView())); context.put("name", state.getAttribute(FORM_SITEINFO_CONTACT_NAME)); context.put("oName", siteProperties.getProperty(PROP_SITE_CONTACT_NAME)); context.put("email", state.getAttribute(FORM_SITEINFO_CONTACT_EMAIL)); context.put("oEmail", siteProperties.getProperty(PROP_SITE_CONTACT_EMAIL)); return (String)getContext(data).get("template") + TEMPLATE[14]; case 15: /* buildContextForTemplate chef_site-addRemoveFeatureConfirm.vm * */ context.put("title", site.getTitle()); site_type = (String)state.getAttribute(STATE_SITE_TYPE); myworkspace_site = false; if (SiteService.isUserSite(site.getId())) { if (SiteService.getSiteUserId(site.getId()).equals(SessionManager.getCurrentSessionUserId())) { myworkspace_site = true; site_type = "myworkspace"; } } context.put (STATE_TOOL_REGISTRATION_LIST, state.getAttribute(STATE_TOOL_REGISTRATION_LIST)); context.put("check_home", state.getAttribute(STATE_TOOL_HOME_SELECTED)); context.put("selectedTools", orderToolIds(state, (String) state.getAttribute(STATE_SITE_TYPE), (List) state.getAttribute(STATE_TOOL_REGISTRATION_SELECTED_LIST))); context.put("oldSelectedTools", state.getAttribute(STATE_TOOL_REGISTRATION_OLD_SELECTED_LIST)); context.put("oldSelectedHome", state.getAttribute(STATE_TOOL_REGISTRATION_OLD_SELECTED_HOME)); context.put("continueIndex", "12"); if (state.getAttribute(STATE_TOOL_EMAIL_ADDRESS) != null) { context.put("emailId", state.getAttribute(STATE_TOOL_EMAIL_ADDRESS)); } context.put("serverName", ServerConfigurationService.getServerName()); context.put("newsTitles", (Hashtable) state.getAttribute(STATE_NEWS_TITLES)); context.put("wcTitles", (Hashtable) state.getAttribute(STATE_WEB_CONTENT_TITLES)); if (fromENWModifyView(state)) { context.put("back", "26"); } else { context.put("back", "4"); } return (String)getContext(data).get("template") + TEMPLATE[15]; case 16: /* buildContextForTemplate chef_site-publishUnpublish-sendEmail.vm * */ context.put("title", site.getTitle()); context.put("willNotify", state.getAttribute(FORM_WILL_NOTIFY)); return (String)getContext(data).get("template") + TEMPLATE[16]; case 17: /* buildContextForTemplate chef_site-publishUnpublish-confirm.vm * */ context.put("title", site.getTitle()); context.put("continueIndex", "12"); SiteInfo sInfo = (SiteInfo) state.getAttribute(STATE_SITE_INFO); if (sInfo.getPublished()) { context.put("publish", Boolean.TRUE); context.put("backIndex", "16"); } else { context.put("publish", Boolean.FALSE); context.put("backIndex", "9"); } context.put("willNotify", state.getAttribute(FORM_WILL_NOTIFY)); return (String)getContext(data).get("template") + TEMPLATE[17]; case 18: /* buildContextForTemplate chef_siteInfo-editAccess.vm * */ List publicChangeableSiteTypes = (List) state.getAttribute(STATE_PUBLIC_CHANGEABLE_SITE_TYPES); List unJoinableSiteTypes = (List) state.getAttribute(STATE_DISABLE_JOINABLE_SITE_TYPE); if (site != null) { //editing existing site context.put("site", site); siteType = state.getAttribute(STATE_SITE_TYPE)!=null?(String)state.getAttribute(STATE_SITE_TYPE):null; if ( siteType != null && publicChangeableSiteTypes.contains(siteType)) { context.put ("publicChangeable", Boolean.TRUE); } else { context.put("publicChangeable", Boolean.FALSE); } context.put("include", Boolean.valueOf(site.isPubView())); if ( siteType != null && !unJoinableSiteTypes.contains(siteType)) { // site can be set as joinable context.put("disableJoinable", Boolean.FALSE); if (state.getAttribute(STATE_JOINABLE) == null) { state.setAttribute(STATE_JOINABLE, Boolean.valueOf(site.isJoinable())); } if (state.getAttribute(STATE_JOINERROLE) == null || state.getAttribute(STATE_JOINABLE) != null && ((Boolean) state.getAttribute(STATE_JOINABLE)).booleanValue()) { state.setAttribute(STATE_JOINERROLE, site.getJoinerRole()); } if (state.getAttribute(STATE_JOINABLE) != null) { context.put("joinable", state.getAttribute(STATE_JOINABLE)); } if (state.getAttribute(STATE_JOINERROLE) != null) { context.put("joinerRole", state.getAttribute(STATE_JOINERROLE)); } } else { //site cannot be set as joinable context.put("disableJoinable", Boolean.TRUE); } context.put("roles", getRoles(state)); context.put("back", "12"); } else { siteInfo = (SiteInfo) state.getAttribute(STATE_SITE_INFO); if ( siteInfo.site_type != null && publicChangeableSiteTypes.contains(siteInfo.site_type)) { context.put ("publicChangeable", Boolean.TRUE); } else { context.put("publicChangeable", Boolean.FALSE); } context.put("include", Boolean.valueOf(siteInfo.getInclude())); context.put("published", Boolean.valueOf(siteInfo.getPublished())); if ( siteInfo.site_type != null && !unJoinableSiteTypes.contains(siteInfo.site_type)) { // site can be set as joinable context.put("disableJoinable", Boolean.FALSE); context.put("joinable", Boolean.valueOf(siteInfo.joinable)); context.put("joinerRole", siteInfo.joinerRole); } else { // site cannot be set as joinable context.put("disableJoinable", Boolean.TRUE); } // use the type's template, if defined String realmTemplate = "!site.template"; if (siteInfo.site_type != null) { realmTemplate = realmTemplate + "." + siteInfo.site_type; } try { AuthzGroup r = AuthzGroupService.getAuthzGroup(realmTemplate); context.put("roles", r.getRoles()); } catch (GroupNotDefinedException e) { try { AuthzGroup rr = AuthzGroupService.getAuthzGroup("!site.template"); context.put("roles", rr.getRoles()); } catch (GroupNotDefinedException ee) { } } // new site, go to confirmation page context.put("continue", "10"); if (fromENWModifyView(state)) { context.put("back", "26"); } else if (state.getAttribute(STATE_IMPORT) != null) { context.put("back", "27"); } else { context.put("back", "3"); } siteType = (String) state.getAttribute(STATE_SITE_TYPE); if (siteType!=null && siteType.equalsIgnoreCase("course")) { context.put ("isCourseSite", Boolean.TRUE); context.put("isProjectSite", Boolean.FALSE); } else { context.put ("isCourseSite", Boolean.FALSE); if (siteType.equalsIgnoreCase("project")) { context.put("isProjectSite", Boolean.TRUE); } } } return (String)getContext(data).get("template") + TEMPLATE[18]; case 19: /* buildContextForTemplate chef_site-addParticipant-sameRole.vm * */ context.put("title", site.getTitle()); context.put("roles", getRoles(state)); context.put("participantList", state.getAttribute(STATE_ADD_PARTICIPANTS)); context.put("form_selectedRole", state.getAttribute("form_selectedRole")); return (String)getContext(data).get("template") + TEMPLATE[19]; case 20: /* buildContextForTemplate chef_site-addParticipant-differentRole.vm * */ context.put("title", site.getTitle()); context.put("roles", getRoles(state)); context.put("selectedRoles", state.getAttribute(STATE_SELECTED_PARTICIPANT_ROLES)); context.put("participantList", state.getAttribute(STATE_ADD_PARTICIPANTS)); return (String)getContext(data).get("template") + TEMPLATE[20]; case 21: /* buildContextForTemplate chef_site-addParticipant-notification.vm * */ context.put("title", site.getTitle()); context.put("sitePublished", Boolean.valueOf(site.isPublished())); if (state.getAttribute("form_selectedNotify") == null) { state.setAttribute("form_selectedNotify", Boolean.FALSE); } context.put("notify", state.getAttribute("form_selectedNotify")); boolean same_role = state.getAttribute("form_same_role")==null?true:((Boolean) state.getAttribute("form_same_role")).booleanValue(); if (same_role) { context.put("backIndex", "19"); } else { context.put("backIndex", "20"); } return (String)getContext(data).get("template") + TEMPLATE[21]; case 22: /* buildContextForTemplate chef_site-addParticipant-confirm.vm * */ context.put("title", site.getTitle()); context.put("participants", state.getAttribute(STATE_ADD_PARTICIPANTS)); context.put("notify", state.getAttribute("form_selectedNotify")); context.put("roles", getRoles(state)); context.put("same_role", state.getAttribute("form_same_role")); context.put("selectedRoles", state.getAttribute(STATE_SELECTED_PARTICIPANT_ROLES)); context.put("selectedRole", state.getAttribute("form_selectedRole")); return (String)getContext(data).get("template") + TEMPLATE[22]; case 23: /* buildContextForTemplate chef_siteInfo-editAccess-globalAccess.vm * */ context.put("title", site.getTitle()); context.put("roles", getRoles(state)); if (state.getAttribute("form_joinable") == null) { state.setAttribute("form_joinable", new Boolean(site.isJoinable())); } context.put("form_joinable", state.getAttribute("form_joinable")); if (state.getAttribute("form_joinerRole") == null) { state.setAttribute("form_joinerRole", site.getJoinerRole()); } context.put("form_joinerRole", state.getAttribute("form_joinerRole")); return (String)getContext(data).get("template") + TEMPLATE[23]; case 24: /* buildContextForTemplate chef_siteInfo-editAccess-globalAccess-confirm.vm * */ context.put("title", site.getTitle()); context.put("form_joinable", state.getAttribute("form_joinable")); context.put("form_joinerRole", state.getAttribute("form_joinerRole")); return (String)getContext(data).get("template") + TEMPLATE[24]; case 25: /* buildContextForTemplate chef_changeRoles-confirm.vm * */ Boolean sameRole = (Boolean) state.getAttribute(STATE_CHANGEROLE_SAMEROLE); context.put("sameRole", sameRole); if (sameRole.booleanValue()) { // same role context.put("currentRole", state.getAttribute(STATE_CHANGEROLE_SAMEROLE_ROLE)); } else { context.put("selectedRoles", state.getAttribute(STATE_SELECTED_PARTICIPANT_ROLES)); } roles = getRoles(state); context.put("roles", roles); context.put("participantSelectedList", state.getAttribute(STATE_SELECTED_PARTICIPANTS)); if (state.getAttribute(STATE_SELECTED_PARTICIPANT_ROLES) != null) { context.put("selectedRoles", state.getAttribute(STATE_SELECTED_PARTICIPANT_ROLES)); } context.put("siteTitle", site.getTitle()); return (String)getContext(data).get("template") + TEMPLATE[25]; case 26: /* buildContextForTemplate chef_site-modifyENW.vm * */ site_type = (String) state.getAttribute(STATE_SITE_TYPE); boolean existingSite = site != null? true:false; if (existingSite) { // revising a existing site's tool context.put("existingSite", Boolean.TRUE); context.put("back", "4"); context.put("continue", "15"); context.put("function", "eventSubmit_doAdd_remove_features"); } else { // new site context.put("existingSite", Boolean.FALSE); context.put("function", "eventSubmit_doAdd_features"); if (state.getAttribute(STATE_IMPORT) != null) { context.put("back", "27"); } else { // new site, go to edit access page context.put("back", "3"); } context.put("continue", "18"); } context.put (STATE_TOOL_REGISTRATION_LIST, state.getAttribute(STATE_TOOL_REGISTRATION_LIST)); toolRegistrationSelectedList = (List) state.getAttribute(STATE_TOOL_REGISTRATION_SELECTED_LIST); context.put (STATE_TOOL_REGISTRATION_SELECTED_LIST, toolRegistrationSelectedList); // String toolId's String emailId = (String) state.getAttribute(STATE_TOOL_EMAIL_ADDRESS); if (emailId != null) { context.put("emailId", emailId); } //titles for news tools newsTitles = (Hashtable) state.getAttribute(STATE_NEWS_TITLES); if (newsTitles == null) { newsTitles = new Hashtable(); newsTitles.put("sakai.news", NEWS_DEFAULT_TITLE); state.setAttribute(STATE_NEWS_TITLES, newsTitles); } context.put("newsTitles", newsTitles); //urls for news tools newsUrls = (Hashtable) state.getAttribute(STATE_NEWS_URLS); if (newsUrls == null) { newsUrls = new Hashtable(); newsUrls.put("sakai.news", NEWS_DEFAULT_URL); state.setAttribute(STATE_NEWS_URLS, newsUrls); } context.put("newsUrls", newsUrls); // titles for web content tools wcTitles = (Hashtable) state.getAttribute(STATE_WEB_CONTENT_TITLES); if (wcTitles == null) { wcTitles = new Hashtable(); wcTitles.put("sakai.iframe", WEB_CONTENT_DEFAULT_TITLE); state.setAttribute(STATE_WEB_CONTENT_TITLES, wcTitles); } context.put("wcTitles", wcTitles); //URLs for web content tools wcUrls = (Hashtable) state.getAttribute(STATE_WEB_CONTENT_URLS); if (wcUrls == null) { wcUrls = new Hashtable(); wcUrls.put("sakai.iframe", WEB_CONTENT_DEFAULT_URL); state.setAttribute(STATE_WEB_CONTENT_URLS, wcUrls); } context.put("wcUrls", wcUrls); context.put("serverName", ServerConfigurationService.getServerName()); context.put("oldSelectedTools", state.getAttribute(STATE_TOOL_REGISTRATION_OLD_SELECTED_LIST)); return (String)getContext(data).get("template") + TEMPLATE[26]; case 27: /* buildContextForTemplate chef_site-importSites.vm * */ existingSite = site != null? true:false; site_type = (String) state.getAttribute(STATE_SITE_TYPE); if (existingSite) { // revising a existing site's tool context.put("continue", "12"); context.put("back", "28"); context.put("totalSteps", "2"); context.put("step", "2"); context.put("currentSite", site); } else { // new site, go to edit access page context.put("back", "3"); if (fromENWModifyView(state)) { context.put("continue", "26"); } else { context.put("continue", "18"); } } context.put (STATE_TOOL_REGISTRATION_LIST, state.getAttribute(STATE_TOOL_REGISTRATION_LIST)); context.put ("selectedTools", orderToolIds(state, site_type, (List) state.getAttribute(STATE_TOOL_REGISTRATION_SELECTED_LIST))); // String toolId's context.put("importSites", state.getAttribute(STATE_IMPORT_SITES)); context.put("importSitesTools", state.getAttribute(STATE_IMPORT_SITE_TOOL)); context.put("check_home", state.getAttribute(STATE_TOOL_HOME_SELECTED)); context.put("importSupportedTools", importTools()); return (String)getContext(data).get("template") + TEMPLATE[27]; case 28: /* buildContextForTemplate chef_siteinfo-import.vm * */ context.put("currentSite", site); context.put("importSiteList", state.getAttribute(STATE_IMPORT_SITES)); context.put("sites", SiteService.getSites(org.sakaiproject.site.api.SiteService.SelectionType.UPDATE, null, null, null, SortType.TITLE_ASC, null)); return (String)getContext(data).get("template") + TEMPLATE[28]; case 29: /* buildContextForTemplate chef_siteinfo-duplicate.vm * */ context.put("siteTitle", site.getTitle()); String sType = site.getType(); if (sType != null && sType.equals("course")) { context.put("isCourseSite", Boolean.TRUE); } else { context.put("isCourseSite", Boolean.FALSE); } if (state.getAttribute(SITE_DUPLICATED) == null) { context.put("siteDuplicated", Boolean.FALSE); } else { context.put("siteDuplicated", Boolean.TRUE); context.put("duplicatedName", state.getAttribute(SITE_DUPLICATED_NAME)); } return (String)getContext(data).get("template") + TEMPLATE[29]; case 30: /* *buildContextForTemplate chef_site-sitemanage-search.vm */ List newTypes = new Vector(); if (state.getAttribute(NO_SHOW_SEARCH_TYPE) != null) { String noType = state.getAttribute(NO_SHOW_SEARCH_TYPE).toString(); List oldTypes = SiteService.getSiteTypes(); for (int i = 0; i < oldTypes.size(); i++) { siteType = oldTypes.get(i).toString(); if ((siteType.indexOf(noType)) == -1) { newTypes.add(siteType); } } } else { newTypes = SiteService.getSiteTypes(); } // remove the "myworkspace" type for (Iterator i = newTypes.iterator(); i.hasNext();) { String t = (String) i.next(); if ("myworkspace".equalsIgnoreCase(t)) { i.remove(); } } context.put("siteTypes", newTypes); terms = CourseManagementService.getTerms(); String termSearchSiteType = (String)state.getAttribute(SEARCH_TERM_SITE_TYPE); if (termSearchSiteType != null) { context.put("termSearchSiteType", termSearchSiteType); context.put("terms", terms); } return (String)getContext(data).get("template") + TEMPLATE[30]; case 31: /* * buildContextForTemplate chef_site-sitemanage-list.vm */ Integer newPageSize = (Integer) state.getAttribute("inter_size"); if (newPageSize != null) { context.put("pagesize", newPageSize); state.setAttribute(STATE_PAGESIZE, newPageSize); } else { state.setAttribute(STATE_PAGESIZE, new Integer(DEFAULT_PAGE_SIZE)); context.put("pagesize", new Integer(DEFAULT_PAGE_SIZE)); } // put the service in the context (used for allow update calls on each site) context.put("service", SiteService.getInstance()); // prepare the paging of realms sites = prepPage(state); context.put("sites", sites); pagingInfoToContext(state, context); bar = new MenuImpl(); if (SiteService.allowAddSite("")) { bar.add( new MenuEntry(rb.getString("java.newsite"), "doNew") ); } if (bar.size() > 0) { context.put(Menu.CONTEXT_MENU, bar); } Vector siteItems = new Vector(); for (int i = 0; i < sites.size(); i++) { SiteItem siteItem = new SiteItem(); site = (Site)sites.get(i); siteItem.setSite(site); siteType = site.getType(); if (siteType != null && siteType.equalsIgnoreCase("course")) { realmId = SiteService.siteReference(site.getId()); String rv = null; try { AuthzGroup realm = AuthzGroupService.getAuthzGroup(realmId); rv = realm.getProviderGroupId(); } catch (GroupNotDefinedException e) { M_log.warn("SiteAction.getExternalRealmId, site realm not found"); } List providerCourseList = getProviderCourseList(StringUtil.trimToNull(rv)); if (providerCourseList != null) { siteItem.setProviderCourseList(providerCourseList); } } siteItems.add(siteItem); } context.put("siteItems", siteItems); context.put("termProp", (String)state.getAttribute(SEARCH_TERM_PROP)); context.put("searchText", (String)state.getAttribute(STATE_SEARCH)); context.put("siteType", (String)state.getAttribute(STATE_SEARCH_SITE_TYPE)); context.put("termSelection", (String)state.getAttribute(STATE_TERM_SELECTION)); context.put("termSearchSiteType", (String)state.getAttribute(SEARCH_TERM_SITE_TYPE)); return (String)getContext(data).get("template") + TEMPLATE[31]; case 32: /* * buildContextForTemplate chef_site-sitemanage-participants.vm */ String siteId = (String) state.getAttribute("siteId"); try { site = SiteService.getSite(siteId); context.put("site", site); bar = new MenuImpl(); bar.add( new MenuEntry(rb.getString("java.addp"), null, true, MenuItem.CHECKED_NA, "doMenu_sitemanage_addParticipant", "site-form") ); context.put(Menu.CONTEXT_MENU, bar); // for paging newPageSize = (Integer) state.getAttribute("inter_size"); if (newPageSize != null) { context.put("pagesize", newPageSize); state.setAttribute(STATE_PAGESIZE, newPageSize); } else { state.setAttribute(STATE_PAGESIZE, new Integer(DEFAULT_PAGE_SIZE)); context.put("pagesize", new Integer(DEFAULT_PAGE_SIZE)); } // put the service in the context (used for allow update calls on each site) context.put("service", SiteService.getInstance()); // prepare the paging of realms List participants = prepPage(state); context.put("participants", participants); pagingInfoToContext(state, context); roles = getRoles(state); context.put("roles", roles); // will have the choice to active/inactive user or not activeInactiveUser = ServerConfigurationService.getString("activeInactiveUser", Boolean.FALSE.toString()); if (activeInactiveUser.equalsIgnoreCase("true")) { context.put("activeInactiveUser", Boolean.TRUE); // put realm object into context realmId = SiteService.siteReference(site.getId()); try { context.put("realm", AuthzGroupService.getAuthzGroup(realmId)); } catch (GroupNotDefinedException e) { M_log.warn(this + " IdUnusedException " + realmId); } } else { context.put("activeInactiveUser", Boolean.FALSE); } boolean allowUpdateSite = SiteService.allowUpdateSite(siteId); if (allowUpdateSite) { context.put("allowUpdate", Boolean.TRUE); } else { context.put("allowUpate", Boolean.FALSE); } return (String)getContext(data).get("template") + TEMPLATE[32]; } catch(IdUnusedException e) { return (String)getContext(data).get("template") + TEMPLATE[31]; } case 33: /* * buildContextForTemplate chef_site-sitemanage-addParticipant.vm */ // Note that (for now) these strings are in both sakai.properties and sitesetupgeneric.properties context.put("noEmailInIdAccountName", ServerConfigurationService.getString("noEmailInIdAccountName")); context.put("noEmailInIdAccountLabel", ServerConfigurationService.getString("noEmailInIdAccountLabel")); context.put("emailInIdAccountName", ServerConfigurationService.getString("emailInIdAccountName")); context.put("emailInIdAccountLabel", ServerConfigurationService.getString("emailInIdAccountLabel")); try { site = SiteService.getSite(state.getAttribute("siteId").toString()); context.put("title", site.getTitle()); roles = getRoles(state); context.put("roles", roles); if(state.getAttribute("noEmailInIdAccountValue")!=null) { context.put("noEmailInIdAccountValue", (String)state.getAttribute("noEmailInIdAccountValue")); } if(state.getAttribute("emailInIdAccountValue")!=null) { context.put("emailInIdAccountValue", (String)state.getAttribute("emailInIdAccountValue")); } if(state.getAttribute("form_same_role") != null) { context.put("form_same_role", ((Boolean) state.getAttribute("form_same_role")).toString()); } else { context.put("form_same_role", Boolean.TRUE.toString()); } context.put("backIndex", "32"); return (String)getContext(data).get("template") + TEMPLATE[33]; } catch(Exception e) { return (String)getContext(data).get("template") + TEMPLATE[32]; } case 34: /* * buildContextForTemplate chef_site-sitemanage-sameRole.vm */ context.put("title", site.getTitle()); context.put("roles", getRoles(state)); context.put("participantList", state.getAttribute(STATE_ADD_PARTICIPANTS)); context.put("form_selectedRole", state.getAttribute("form_selectedRole")); return (String)getContext(data).get("template") + TEMPLATE[34]; case 35: /* * buildContextForTemplate chef_site-sitemanage-differentRoles.vm */ context.put("title", site.getTitle()); context.put("roles", getRoles(state)); context.put("selectedRoles", state.getAttribute(STATE_SELECTED_PARTICIPANT_ROLES)); context.put("participantList", state.getAttribute(STATE_ADD_PARTICIPANTS)); return (String)getContext(data).get("template") + TEMPLATE[35]; case 36: /* * buildContextForTemplate chef_site-newSiteCourse.vm */ if (site != null) { context.put("site", site); context.put("siteTitle", site.getTitle()); terms = CourseManagementService.getTerms(); if (terms != null && terms.size() >0) { context.put("termList", terms); } List providerCourseList = (List) state.getAttribute(SITE_PROVIDER_COURSE_LIST); context.put("providerCourseList", providerCourseList); context.put("manualCourseList", state.getAttribute(SITE_MANUAL_COURSE_LIST)); Term t = (Term) state.getAttribute(STATE_TERM_SELECTED); context.put ("term", t); if (t != null) { String userId = StringUtil.trimToZero(SessionManager.getCurrentSessionUserId()); List courses = CourseManagementService.getInstructorCourses(userId, t.getYear(), t.getTerm()); if (courses != null && courses.size() > 0) { Vector notIncludedCourse = new Vector(); // remove included sites for (Iterator i = courses.iterator(); i.hasNext(); ) { Course c = (Course) i.next(); if (!providerCourseList.contains(c.getId())) { notIncludedCourse.add(c); } } state.setAttribute(STATE_TERM_COURSE_LIST, notIncludedCourse); } else { state.removeAttribute(STATE_TERM_COURSE_LIST); } } // step number used in UI state.setAttribute(SITE_CREATE_CURRENT_STEP, new Integer("1")); } else { if (state.getAttribute(STATE_ADD_CLASS_PROVIDER_CHOSEN) != null) { context.put ("selectedProviderCourse", state.getAttribute(STATE_ADD_CLASS_PROVIDER_CHOSEN)); } if(state.getAttribute(STATE_MANUAL_ADD_COURSE_NUMBER) != null) { context.put("selectedManualCourse", Boolean.TRUE); } context.put ("term", (Term) state.getAttribute(STATE_TERM_SELECTED)); } if (((String) state.getAttribute(STATE_SITE_MODE)).equalsIgnoreCase(SITE_MODE_SITESETUP)) { context.put("backIndex", "1"); } else if (((String) state.getAttribute(STATE_SITE_MODE)).equalsIgnoreCase(SITE_MODE_SITEINFO)) { context.put("backIndex", ""); } context.put("termCourseList", (List) state.getAttribute(STATE_TERM_COURSE_LIST)); return (String)getContext(data).get("template") + TEMPLATE[36]; case 37: /* * buildContextForTemplate chef_site-newSiteCourseManual.vm */ if (site != null) { context.put("site", site); context.put("siteTitle", site.getTitle()); coursesIntoContext(state, context, site); } buildInstructorSectionsList(state, params, context); context.put("form_requiredFields", CourseManagementService.getCourseIdRequiredFields()); context.put("form_requiredFieldsSizes", CourseManagementService.getCourseIdRequiredFieldsSizes()); context.put("form_additional", siteInfo.additional); context.put("form_title", siteInfo.title); context.put("form_description", siteInfo.description); context.put("noEmailInIdAccountName", ServerConfigurationService.getString("noEmailInIdAccountName", "")); context.put("value_uniqname", state.getAttribute(STATE_SITE_QUEST_UNIQNAME)); int number = 1; if (state.getAttribute(STATE_MANUAL_ADD_COURSE_NUMBER) != null) { number = ((Integer) state.getAttribute(STATE_MANUAL_ADD_COURSE_NUMBER)).intValue(); context.put("currentNumber", new Integer(number)); } context.put("currentNumber", new Integer(number)); context.put("listSize", new Integer(number-1)); context.put("fieldValues", state.getAttribute(STATE_MANUAL_ADD_COURSE_FIELDS)); if (state.getAttribute(STATE_ADD_CLASS_PROVIDER_CHOSEN) != null) { List l = (List) state.getAttribute(STATE_ADD_CLASS_PROVIDER_CHOSEN); context.put ("selectedProviderCourse", l); context.put("size", new Integer(l.size()-1)); } if (site != null) { context.put("back", "36"); } else { if (state.getAttribute(STATE_AUTO_ADD) != null) { context.put("autoAdd", Boolean.TRUE); context.put("back", "36"); } else { context.put("back", "1"); } } context.put("isFutureTerm", state.getAttribute(STATE_FUTURE_TERM_SELECTED)); context.put("weeksAhead", ServerConfigurationService.getString("roster.available.weeks.before.term.start", "0")); return (String)getContext(data).get("template") + TEMPLATE[37]; case 38: /* * buildContextForTemplate chef_site-sitemanage-editInfo.vm */ bar = new MenuImpl(portlet, data, (String) state.getAttribute(STATE_ACTION)); if (state.getAttribute("siteId") != null) { if (SiteService.allowRemoveSite(state.getAttribute("siteId").toString())) { bar.add( new MenuEntry(rb.getString("java.delete"), null, true, MenuItem.CHECKED_NA, "doSitemanage_site_delete", "site-form")); } } bar.add( new MenuEntry(rb.getString("java.saveas"), null, true, MenuItem.CHECKED_NA, "doSitemanage_saveas_request", "site-form") ); context.put("menu", bar); context.put("title", state.getAttribute(FORM_SITEINFO_TITLE)); types = SiteService.getSiteTypes(); context.put("types", types); context.put("siteType", state.getAttribute("siteType")); if (SecurityService.isSuperUser()) { context.put("isSuperUser", Boolean.TRUE); } else { context.put("isSuperUser", Boolean.FALSE); } context.put("description", state.getAttribute(FORM_SITEINFO_DESCRIPTION)); context.put("short_description", state.getAttribute(FORM_SITEINFO_SHORT_DESCRIPTION)); context.put("skins", state.getAttribute("skins")); context.put("skin", state.getAttribute(FORM_SITEINFO_SKIN)); context.put("iconUrl", state.getAttribute("siteIconUrl")); context.put("include", state.getAttribute(FORM_SITEINFO_INCLUDE)); context.put("form_site_contact_name", state.getAttribute(FORM_SITEINFO_CONTACT_NAME)); context.put("form_site_contact_email", state.getAttribute(FORM_SITEINFO_CONTACT_EMAIL)); if (state.getAttribute(STATE_SITE_SIZE_DEFAULT_SELECT) == null) { context.put("default_size_selected", Boolean.TRUE); } else { context.put("default_size_selected", state.getAttribute(STATE_SITE_SIZE_DEFAULT_SELECT)); } return (String)getContext(data).get("template") + TEMPLATE[38]; case 39: /* * buildContextForTemplate chef_site-sitemanage-editInfo.vm */ context.put("site", site); context.put("include", Boolean.valueOf(site.isPubView())); context.put("roles", getRoles(state)); return (String)getContext(data).get("template") + TEMPLATE[39]; case 40: /* * buildContextForTemplate chef_site-sitemanage-siteDeleteConfirmation.vm */ String id = (String) state.getAttribute("siteId"); site_title = NULL_STRING; user = SessionManager.getCurrentSessionUserId(); workspace = SiteService.getUserSiteId(user); boolean removeable = true; if(!(id.equals(workspace))) { try { site_title = SiteService.getSite(id).getTitle(); } catch (IdUnusedException e) { M_log.warn("SiteAction.doSitemanage_delete_confirmed - IdUnusedException " + id); addAlert(state, rb.getString("java.sitewith")+" " + id + " "+ rb.getString("java.couldnt")+" "); } if(SiteService.allowRemoveSite(id)) { try { SiteService.getSite(id); } catch (IdUnusedException e) { M_log.warn("SiteAction.buildContextForTemplate chef_site-sitemanage-siteDeleteConfirm.vm: IdUnusedException"); } } else { removeable = false; addAlert(state, site_title + " "+rb.getString("java.couldntdel")+" "); } } else { removeable = false; addAlert(state, rb.getString("java.yourwork")); } if(!removeable) { addAlert(state, rb.getString("java.click")); } context.put("removeable", new Boolean(removeable)); return (String)getContext(data).get("template") + TEMPLATE[40]; case 41: /* * buildContextForTemplate chef_site-sitemanage-site-saveas.vm */ context.put("site", site); return (String)getContext(data).get("template") + TEMPLATE[41]; case 42: /* buildContextForTemplate chef_site-gradtoolsConfirm.vm * */ siteInfo = (SiteInfo)state.getAttribute(STATE_SITE_INFO); context.put("title", siteInfo.title); context.put("description", siteInfo.description); context.put("short_description", siteInfo.short_description); toolRegistrationList = (Vector) state.getAttribute(STATE_PROJECT_TOOL_LIST); toolRegistrationSelectedList = (List) state.getAttribute(STATE_TOOL_REGISTRATION_SELECTED_LIST); context.put (STATE_TOOL_REGISTRATION_SELECTED_LIST, toolRegistrationSelectedList); // String toolId's context.put (STATE_TOOL_REGISTRATION_LIST, toolRegistrationList ); // %%% use Tool context.put("check_home", state.getAttribute(STATE_TOOL_HOME_SELECTED)); context.put("emailId", state.getAttribute(STATE_TOOL_EMAIL_ADDRESS)); context.put("serverName", ServerConfigurationService.getServerName()); context.put("include", new Boolean(siteInfo.include)); return (String)getContext(data).get("template") + TEMPLATE[42]; case 43: /* buildContextForTemplate chef_siteInfo-editClass.vm * */ bar = new MenuImpl(portlet, data, (String) state.getAttribute(STATE_ACTION)); if (SiteService.allowAddSite(null)) { bar.add( new MenuEntry(rb.getString("java.addclasses"), "doMenu_siteInfo_addClass")); } context.put("menu", bar); context.put("siteTitle", site.getTitle()); coursesIntoContext(state, context, site); return (String)getContext(data).get("template") + TEMPLATE[43]; case 44: /* buildContextForTemplate chef_siteInfo-addCourseConfirm.vm * */ context.put("siteTitle", site.getTitle()); coursesIntoContext(state, context, site); context.put("providerAddCourses", state.getAttribute(STATE_ADD_CLASS_PROVIDER_CHOSEN)); if (state.getAttribute(STATE_MANUAL_ADD_COURSE_NUMBER) != null) { int addNumber = ((Integer) state.getAttribute(STATE_MANUAL_ADD_COURSE_NUMBER)).intValue() -1; context.put("manualAddNumber", new Integer(addNumber)); context.put("requestFields", state.getAttribute(STATE_MANUAL_ADD_COURSE_FIELDS)); context.put("backIndex", "37"); } else { context.put("backIndex", "36"); } //those manual inputs context.put("form_requiredFields", CourseManagementService.getCourseIdRequiredFields()); context.put("fieldValues", state.getAttribute(STATE_MANUAL_ADD_COURSE_FIELDS)); return (String)getContext(data).get("template") + TEMPLATE[44]; //htripath - import materials from classic case 45: /* buildContextForTemplate chef_siteInfo-importMtrlMaster.vm * */ return (String)getContext(data).get("template") + TEMPLATE[45]; case 46: /* buildContextForTemplate chef_siteInfo-importMtrlCopy.vm * */ // this is for list display in listbox context.put("allZipSites", state.getAttribute(ALL_ZIP_IMPORT_SITES)); context.put("finalZipSites", state.getAttribute(FINAL_ZIP_IMPORT_SITES)); //zip file //context.put("zipreffile",state.getAttribute(CLASSIC_ZIP_FILE_NAME)); return (String)getContext(data).get("template") + TEMPLATE[46]; case 47: /* buildContextForTemplate chef_siteInfo-importMtrlCopyConfirm.vm * */ context.put("finalZipSites", state.getAttribute(FINAL_ZIP_IMPORT_SITES)); return (String)getContext(data).get("template") + TEMPLATE[47]; case 48: /* buildContextForTemplate chef_siteInfo-importMtrlCopyConfirm.vm * */ context.put("finalZipSites", state.getAttribute(FINAL_ZIP_IMPORT_SITES)); return (String)getContext(data).get("template") + TEMPLATE[48]; case 49: /* buildContextForTemplate chef_siteInfo-group.vm * */ context.put("site", site); bar = new MenuImpl(portlet, data, (String) state.getAttribute(STATE_ACTION)); if (SiteService.allowUpdateSite(site.getId()) || SiteService.allowUpdateGroupMembership(site.getId())) { bar.add( new MenuEntry(rb.getString("java.new"), "doGroup_new")); } context.put("menu", bar); // the group list sortedBy = (String) state.getAttribute (SORTED_BY); sortedAsc = (String) state.getAttribute (SORTED_ASC); if(sortedBy!=null) context.put ("currentSortedBy", sortedBy); if(sortedAsc!=null) context.put ("currentSortAsc", sortedAsc); // only show groups created by WSetup tool itself Collection groups = (Collection) site.getGroups(); List groupsByWSetup = new Vector(); for(Iterator gIterator = groups.iterator(); gIterator.hasNext();) { Group gNext = (Group) gIterator.next(); String gProp = gNext.getProperties().getProperty(GROUP_PROP_WSETUP_CREATED); if (gProp != null && gProp.equals(Boolean.TRUE.toString())) { groupsByWSetup.add(gNext); } } if (sortedBy != null && sortedAsc != null) { context.put("groups", new SortedIterator (groupsByWSetup.iterator (), new SiteComparator (sortedBy, sortedAsc))); } return (String)getContext(data).get("template") + TEMPLATE[49]; case 50: /* buildContextForTemplate chef_siteInfo-groupedit.vm * */ Group g = getStateGroup(state); if (g != null) { context.put("group", g); context.put("newgroup", Boolean.FALSE); } else { context.put("newgroup", Boolean.TRUE); } if (state.getAttribute(STATE_GROUP_TITLE) != null) { context.put("title", state.getAttribute(STATE_GROUP_TITLE)); } if (state.getAttribute(STATE_GROUP_DESCRIPTION) != null) { context.put("description", state.getAttribute(STATE_GROUP_DESCRIPTION)); } Iterator siteMembers = new SortedIterator (getParticipantList(state).iterator (), new SiteComparator (SORTED_BY_PARTICIPANT_NAME, Boolean.TRUE.toString())); if (siteMembers != null && siteMembers.hasNext()) { context.put("generalMembers", siteMembers); } Set groupMembersSet = (Set) state.getAttribute(STATE_GROUP_MEMBERS); if (state.getAttribute(STATE_GROUP_MEMBERS) != null) { context.put("groupMembers", new SortedIterator(groupMembersSet.iterator(), new SiteComparator (SORTED_BY_MEMBER_NAME, Boolean.TRUE.toString()))); } context.put("groupMembersClone", groupMembersSet); context.put("userDirectoryService", UserDirectoryService.getInstance()); return (String)getContext(data).get("template") + TEMPLATE[50]; case 51: /* buildContextForTemplate chef_siteInfo-groupDeleteConfirm.vm * */ context.put("site", site); context.put("removeGroupIds", new ArrayList(Arrays.asList((String[])state.getAttribute(STATE_GROUP_REMOVE)))); return (String)getContext(data).get("template") + TEMPLATE[51]; } // should never be reached return (String)getContext(data).get("template") + TEMPLATE[0]; } // buildContextForTemplate | 54846 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54846/260e4645c5211a1c110d7c42b5b7b74835909921/SiteAction.java/buggy/site-manage-tool/tool/src/java/org/sakaiproject/site/tool/SiteAction.java |
public IRubyObject reopen(IRubyObject arg1, IRubyObject[] args) { if (arg1.isKindOf(getRuntime().getClasses().getIoClass())) { RubyIO ios = (RubyIO) arg1; int keepFileno = handler.getFileno(); // When we reopen, we want our fileno to be preserved even // though we have a new IOHandler. // Note: When we clone we get a new fileno...then we replace it. // This ends up incrementing our fileno index up, which makes the // fileno we choose different from ruby. Since this seems a bit // too implementation specific, I did not bother trying to get // these to agree (what scary code would depend on fileno generating // a particular way?) handler = ios.handler.cloneIOHandler(); handler.setFileno(keepFileno); // Update fileno list with our new handler registerIOHandler(handler); } else if (arg1.isKindOf(getRuntime().getClasses().getStringClass())) { String path = ((RubyString) arg1).getValue(); String mode = "r"; if (args != null && args.length > 0) { if (!args[0].isKindOf(getRuntime().getClasses().getStringClass())) { throw getRuntime().newTypeError(args[0], getRuntime().getClasses().getStringClass()); } mode = ((RubyString) args[0]).getValue(); } try { if (handler != null) { close(); } modes = new IOModes(getRuntime(), mode); handler = new IOHandlerSeekable(getRuntime(), path, modes); registerIOHandler(handler); } catch (IOException e) { throw new IOError(getRuntime(), e.toString()); } } // A potentially previously close IO is being 'reopened'. isOpen = true; return this; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f9c6cd5042b99c686c9ec5d78c8e251c3fda461c/RubyIO.java/buggy/src/org/jruby/RubyIO.java |
||
scanFile(fInfo, false); | scanFile(fInfo); | public void scanDownloadFile(FileInfo fInfo, File tempFile) { synchronized (scanLock) { // rename file File targetFile = fInfo.getDiskFile(getController() .getFolderRepository()); if (!tempFile.renameTo(targetFile)) { log().warn( "Was not able to rename tempfile, copiing " + tempFile.getAbsolutePath()); try { Util.copyFile(tempFile, targetFile); } catch (IOException e) { // TODO give a diskfull warning? log().verbose(e); log().error( "Unable to store completed download " + targetFile.getAbsolutePath() + ". " + e.getMessage()); } } if (tempFile.exists() && !tempFile.delete()) { log().error("Unable to remove temp file: " + tempFile); } // Set modified date of remote targetFile.setLastModified(fInfo.getModifiedDate().getTime()); // Update internal database FileInfo dbFile = getFile(fInfo); if (dbFile != null) { // Update database dbFile.setModifiedInfo(fInfo.getModifiedBy(), fInfo .getModifiedDate()); dbFile.setVersion(fInfo.getVersion()); dbFile.setSize(fInfo.getSize()); } else { // File new, scan scanFile(fInfo, false); } // Folder has changed folderChanged(); // Fire just change, store comes later // fireFolderChanged(); } // re-calculate statistics statistic.calculate(); } | 51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/3bf5c7635a50044af14b35a996730763de3eb538/Folder.java/clean/src/main/de/dal33t/powerfolder/disk/Folder.java |
boolean scanFile(FileInfo fInfo, boolean restored) { | boolean scanFile(FileInfo fInfo) { | boolean scanFile(FileInfo fInfo, boolean restored) { synchronized (scanLock) { if (fInfo == null) { throw new NullPointerException("File is null"); } // First relink modified by memberinfo to // actual instance if available on nodemanager Member from = getController().getNodeManager().getNode( fInfo.getModifiedBy()); if (from != null) { fInfo.setModifiedInfo(from.getInfo(), fInfo.getModifiedDate()); } if (logVerbose) { log().verbose( "Scanning file: " + fInfo + ", folderId: " + fInfo); } File file = getDiskFile(fInfo); if (restored && file.exists()) { fInfo.setDeleted(false); } // file has been removed if (fInfo.isDeleted()) { log().verbose( "File does not exists on local disk, flagging as deleted: " + file); removeFileLocal(fInfo, false); } else if (!file.canRead()) { // ignore not readable log().verbose("File not readable: " + file); return false; } // ignore our database file if (file.getName().equals(DB_FILENAME) || file.getName().equals(DB_BACKUP_FILENAME)) { if (!file.isHidden()) { Util.makeHiddenOnWindows(file); } log().verbose("Ignoring folder database file: " + file); return false; } // check for incomplete download files and delete them, if // the real file exists if (Util.isTempDownloadFile(file)) { if (Util.isCompletedTempDownloadFile(file) || fInfo.isDeleted()) { log().verbose("Removing temp download file: " + file); file.delete(); } else { log().verbose("Ignoring incomplete download file: " + file); } return false; } // ignore placeholderfiles or remove them if file exists if (Util.isPlaceHolderFile(file)) { if (!syncProfile.isCreatePlaceHolderFiles()) { log().verbose("Removing placeholder file: " + file); file.delete(); } else { log().verbose("Ignoring placeholder file: " + file); } return false; } // ignore a copy backup tempfile // created on copy process if overwriting file if (FileCopier.isTempBackup(file)) { return false; } // remove placeholder file if exist for this file // Commented, no useful until full implementation of placeholder // file /* * if (file.exists()) { File placeHolderFile = * Util.getPlaceHolderFile(file); if (placeHolderFile.exists()) { * log().verbose("Removing placeholder file for: " + file); * placeHolderFile.delete(); } } */ if (checkFilenames) { checkFileName(fInfo); } synchronized (knownFiles) { // link new file to our folder fInfo.setFolder(this); if (!isKnown(fInfo)) { log().verbose( fInfo + ", modified by: " + fInfo.getModifiedBy()); // Update last - modified data MemberInfo modifiedBy = fInfo.getModifiedBy(); if (modifiedBy == null) { modifiedBy = getController().getMySelf().getInfo(); } if (file.exists()) { fInfo.setModifiedInfo(modifiedBy, new Date(file .lastModified())); fInfo.setSize(file.length()); } // add file to folder FileInfo converted = convertToMetaInfoFileInfo(fInfo); addFile(converted); // update directory // don't do this in the server version if (rootDirectory != null) { getDirectory().add(getController().getMySelf(), converted); } // get folder icon info and set it if (Util.isDesktopIni(file)) { makeFolderIcon(file); } // Fire folder change event // fireEvent(new FolderChanged()); if (logVerbose) { log().verbose( this.toString() + ": Local file scanned: " + fInfo.toDetailString()); } return true; } // Now process/check existing files FileInfo dbFile = getFile(fInfo); boolean fileChanged = dbFile.syncFromDiskIfRequired( getController(), file); if (fileChanged) { // Increase fileversion dbFile.increaseVersion(); } // Convert to meta info loaded fileinfo if nessesary FileInfo convertedFile = convertToMetaInfoFileInfo(dbFile); if (convertedFile != dbFile) { // DO A IDENTITY MATCH, THIS HERE MEANS, A META INFO // FILEINFO WAS CREATED addFile(convertedFile); fileChanged = true; } if (logVerbose) { log().verbose("File already known: " + fInfo); } return fileChanged; } } } | 51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/3bf5c7635a50044af14b35a996730763de3eb538/Folder.java/clean/src/main/de/dal33t/powerfolder/disk/Folder.java |
if (restored && file.exists()) { fInfo.setDeleted(false); } | boolean scanFile(FileInfo fInfo, boolean restored) { synchronized (scanLock) { if (fInfo == null) { throw new NullPointerException("File is null"); } // First relink modified by memberinfo to // actual instance if available on nodemanager Member from = getController().getNodeManager().getNode( fInfo.getModifiedBy()); if (from != null) { fInfo.setModifiedInfo(from.getInfo(), fInfo.getModifiedDate()); } if (logVerbose) { log().verbose( "Scanning file: " + fInfo + ", folderId: " + fInfo); } File file = getDiskFile(fInfo); if (restored && file.exists()) { fInfo.setDeleted(false); } // file has been removed if (fInfo.isDeleted()) { log().verbose( "File does not exists on local disk, flagging as deleted: " + file); removeFileLocal(fInfo, false); } else if (!file.canRead()) { // ignore not readable log().verbose("File not readable: " + file); return false; } // ignore our database file if (file.getName().equals(DB_FILENAME) || file.getName().equals(DB_BACKUP_FILENAME)) { if (!file.isHidden()) { Util.makeHiddenOnWindows(file); } log().verbose("Ignoring folder database file: " + file); return false; } // check for incomplete download files and delete them, if // the real file exists if (Util.isTempDownloadFile(file)) { if (Util.isCompletedTempDownloadFile(file) || fInfo.isDeleted()) { log().verbose("Removing temp download file: " + file); file.delete(); } else { log().verbose("Ignoring incomplete download file: " + file); } return false; } // ignore placeholderfiles or remove them if file exists if (Util.isPlaceHolderFile(file)) { if (!syncProfile.isCreatePlaceHolderFiles()) { log().verbose("Removing placeholder file: " + file); file.delete(); } else { log().verbose("Ignoring placeholder file: " + file); } return false; } // ignore a copy backup tempfile // created on copy process if overwriting file if (FileCopier.isTempBackup(file)) { return false; } // remove placeholder file if exist for this file // Commented, no useful until full implementation of placeholder // file /* * if (file.exists()) { File placeHolderFile = * Util.getPlaceHolderFile(file); if (placeHolderFile.exists()) { * log().verbose("Removing placeholder file for: " + file); * placeHolderFile.delete(); } } */ if (checkFilenames) { checkFileName(fInfo); } synchronized (knownFiles) { // link new file to our folder fInfo.setFolder(this); if (!isKnown(fInfo)) { log().verbose( fInfo + ", modified by: " + fInfo.getModifiedBy()); // Update last - modified data MemberInfo modifiedBy = fInfo.getModifiedBy(); if (modifiedBy == null) { modifiedBy = getController().getMySelf().getInfo(); } if (file.exists()) { fInfo.setModifiedInfo(modifiedBy, new Date(file .lastModified())); fInfo.setSize(file.length()); } // add file to folder FileInfo converted = convertToMetaInfoFileInfo(fInfo); addFile(converted); // update directory // don't do this in the server version if (rootDirectory != null) { getDirectory().add(getController().getMySelf(), converted); } // get folder icon info and set it if (Util.isDesktopIni(file)) { makeFolderIcon(file); } // Fire folder change event // fireEvent(new FolderChanged()); if (logVerbose) { log().verbose( this.toString() + ": Local file scanned: " + fInfo.toDetailString()); } return true; } // Now process/check existing files FileInfo dbFile = getFile(fInfo); boolean fileChanged = dbFile.syncFromDiskIfRequired( getController(), file); if (fileChanged) { // Increase fileversion dbFile.increaseVersion(); } // Convert to meta info loaded fileinfo if nessesary FileInfo convertedFile = convertToMetaInfoFileInfo(dbFile); if (convertedFile != dbFile) { // DO A IDENTITY MATCH, THIS HERE MEANS, A META INFO // FILEINFO WAS CREATED addFile(convertedFile); fileChanged = true; } if (logVerbose) { log().verbose("File already known: " + fInfo); } return fileChanged; } } } | 51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/3bf5c7635a50044af14b35a996730763de3eb538/Folder.java/clean/src/main/de/dal33t/powerfolder/disk/Folder.java |
|
log().warn("File changed on disk: " + dbFile.toDetailString()); | boolean scanFile(FileInfo fInfo, boolean restored) { synchronized (scanLock) { if (fInfo == null) { throw new NullPointerException("File is null"); } // First relink modified by memberinfo to // actual instance if available on nodemanager Member from = getController().getNodeManager().getNode( fInfo.getModifiedBy()); if (from != null) { fInfo.setModifiedInfo(from.getInfo(), fInfo.getModifiedDate()); } if (logVerbose) { log().verbose( "Scanning file: " + fInfo + ", folderId: " + fInfo); } File file = getDiskFile(fInfo); if (restored && file.exists()) { fInfo.setDeleted(false); } // file has been removed if (fInfo.isDeleted()) { log().verbose( "File does not exists on local disk, flagging as deleted: " + file); removeFileLocal(fInfo, false); } else if (!file.canRead()) { // ignore not readable log().verbose("File not readable: " + file); return false; } // ignore our database file if (file.getName().equals(DB_FILENAME) || file.getName().equals(DB_BACKUP_FILENAME)) { if (!file.isHidden()) { Util.makeHiddenOnWindows(file); } log().verbose("Ignoring folder database file: " + file); return false; } // check for incomplete download files and delete them, if // the real file exists if (Util.isTempDownloadFile(file)) { if (Util.isCompletedTempDownloadFile(file) || fInfo.isDeleted()) { log().verbose("Removing temp download file: " + file); file.delete(); } else { log().verbose("Ignoring incomplete download file: " + file); } return false; } // ignore placeholderfiles or remove them if file exists if (Util.isPlaceHolderFile(file)) { if (!syncProfile.isCreatePlaceHolderFiles()) { log().verbose("Removing placeholder file: " + file); file.delete(); } else { log().verbose("Ignoring placeholder file: " + file); } return false; } // ignore a copy backup tempfile // created on copy process if overwriting file if (FileCopier.isTempBackup(file)) { return false; } // remove placeholder file if exist for this file // Commented, no useful until full implementation of placeholder // file /* * if (file.exists()) { File placeHolderFile = * Util.getPlaceHolderFile(file); if (placeHolderFile.exists()) { * log().verbose("Removing placeholder file for: " + file); * placeHolderFile.delete(); } } */ if (checkFilenames) { checkFileName(fInfo); } synchronized (knownFiles) { // link new file to our folder fInfo.setFolder(this); if (!isKnown(fInfo)) { log().verbose( fInfo + ", modified by: " + fInfo.getModifiedBy()); // Update last - modified data MemberInfo modifiedBy = fInfo.getModifiedBy(); if (modifiedBy == null) { modifiedBy = getController().getMySelf().getInfo(); } if (file.exists()) { fInfo.setModifiedInfo(modifiedBy, new Date(file .lastModified())); fInfo.setSize(file.length()); } // add file to folder FileInfo converted = convertToMetaInfoFileInfo(fInfo); addFile(converted); // update directory // don't do this in the server version if (rootDirectory != null) { getDirectory().add(getController().getMySelf(), converted); } // get folder icon info and set it if (Util.isDesktopIni(file)) { makeFolderIcon(file); } // Fire folder change event // fireEvent(new FolderChanged()); if (logVerbose) { log().verbose( this.toString() + ": Local file scanned: " + fInfo.toDetailString()); } return true; } // Now process/check existing files FileInfo dbFile = getFile(fInfo); boolean fileChanged = dbFile.syncFromDiskIfRequired( getController(), file); if (fileChanged) { // Increase fileversion dbFile.increaseVersion(); } // Convert to meta info loaded fileinfo if nessesary FileInfo convertedFile = convertToMetaInfoFileInfo(dbFile); if (convertedFile != dbFile) { // DO A IDENTITY MATCH, THIS HERE MEANS, A META INFO // FILEINFO WAS CREATED addFile(convertedFile); fileChanged = true; } if (logVerbose) { log().verbose("File already known: " + fInfo); } return fileChanged; } } } | 51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/3bf5c7635a50044af14b35a996730763de3eb538/Folder.java/clean/src/main/de/dal33t/powerfolder/disk/Folder.java |
|
int nfiles = scanFile(fInfo, false) ? 1 : 0; | int nfiles = scanFile(fInfo) ? 1 : 0; | private int scanLocalFile(File file, Set remaining) { synchronized (scanLock) { if (file.isDirectory()) { if (file.equals(getSystemSubDir()) || getController().getRecycleBin().isRecycleBin(this, file)) { // Skipping these subdirs log().verbose( "Skipping system subdir: " + file.getAbsolutePath()); return 0; } if (logVerbose) { log().verbose( "Scanning directory: " + file.getAbsolutePath()); } File[] subFiles = file.listFiles(); int changedFiles = 0; if (subFiles.length > 0) { for (File subFile : subFiles) { changedFiles += scanLocalFile(subFile, remaining); } } else { // directory empty, remove it if (!file.equals(localBase)) { file.delete(); } } // try { // // sleep 2 ms to give cpu time // Thread.sleep(5); // } catch (InterruptedException e) { // log().verbose(e); // } return changedFiles; } else if (file.isFile()) { FileInfo fInfo = new FileInfo(this, file); // file is not longer remaining remaining.remove(fInfo); int nfiles = scanFile(fInfo, false) ? 1 : 0; // try { // // sleep 2 ms to give cpu time // Thread.sleep(2); // } catch (InterruptedException e) { // log().verbose(e); // } return nfiles; } else { log().warn("Unkown file found: " + file.getAbsolutePath()); return 0; } } } | 51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/3bf5c7635a50044af14b35a996730763de3eb538/Folder.java/clean/src/main/de/dal33t/powerfolder/disk/Folder.java |
if (scanFile(fileInfo, false)) { | if (scanFile(fileInfo)) { | public void scanNewFile(FileInfo fileInfo) { if (scanFile(fileInfo, false)) { folderChanged(); statistic.calculate(); } } | 51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/3bf5c7635a50044af14b35a996730763de3eb538/Folder.java/clean/src/main/de/dal33t/powerfolder/disk/Folder.java |
public void asyncExec(Runnable runnable) { Display display = this.getViewSite().getWorkbenchWindow().getShell().getDisplay(); // If the display is disposed, you cant do anything with it!!! if (display == null || display.isDisposed()) return; display.asyncExec(runnable); } | 52787 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52787/5f0e054e217b43e236e946026f28ae03563d593b/PortfolioView.java/clean/source/trunk/src/main/java/org/marketcetera/photon/views/PortfolioView.java |
||
noex = iVisited.getNoex(); | noex = iVisited.getVisibility(); | public void visitDefnNode(DefnNode iVisited) { RubyModule rubyClass = ruby.getRubyClass(); if (rubyClass == null) { throw new TypeError(ruby, "No class to add method."); } //if (ruby_class == getRuby().getObjectClass() && node.nd_mid() == init) { // warn("redefining Object#initialize may cause infinite loop"); //} //if (node.nd_mid() == __id__ || node.nd_mid() == __send__) { // warn("redefining `%s' may cause serious problem", ((RubyId)node.nd_mid()).toName()); //} // ruby_class.setFrozen(true); ICallable method = rubyClass.searchMethod(iVisited.getName()); // RubyObject origin = body.getOrigin(); // if (body != null){ // if (ruby_verbose.isTrue() && ruby_class == origin && body.nd_cnt() == 0) { // rom.rb_warning("discarding old %s", ((RubyId)node.nd_mid()).toName()); // } // if (node.nd_noex() != 0) { /* toplevel */ /* should upgrade to rb_warn() if no super was called inside? */ // rom.rb_warning("overriding global function `%s'", ((RubyId)node.nd_mid()).toName()); // } // } Visibility noex = Visibility.PUBLIC; if (ruby.isScope(Constants.SCOPE_PRIVATE) || iVisited.getName().equals("initialize")) { noex = Visibility.PRIVATE; } else if (ruby.isScope(Constants.SCOPE_PROTECTED)) { noex = Visibility.PROTECTED; } else if (rubyClass == ruby.getClasses().getObjectClass()) { noex = iVisited.getNoex(); } /* FIXME Fix the undef stuff if (method != null && method.getImplementationClass() == rubyClass && (method.getVisibility() & Constants.NOEX_UNDEF) != 0) { noex |= Constants.NOEX_UNDEF; } */ // FIXME Create new method store class. // ScopeNode body = copyNodeScope((ScopeNode)iVisited.getBodyNode(), ruby.getNamespace()); DefaultMethod newMethod = new DefaultMethod(iVisited.getBodyNode(), (ArgsNode) iVisited.getArgsNode(), ruby.getNamespace(), noex); rubyClass.addMethod(iVisited.getName(), newMethod); if (ruby.getCurrentMethodScope() == Constants.SCOPE_MODFUNC) { rubyClass.getSingletonClass().addMethod(iVisited.getName(), new WrapperCallable(newMethod, Visibility.PUBLIC)); rubyClass.callMethod("singleton_method_added", builtins.toSymbol(iVisited.getName())); } if (rubyClass.isSingleton()) { rubyClass.getInstanceVariable("__attached__").callMethod("singleton_method_added", builtins.toSymbol(iVisited.getName())); } else { rubyClass.callMethod("method_added", builtins.toSymbol(iVisited.getName())); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/615c030e9e2e4f7129fe3e92d877dd15dd313c3d/EvaluateVisitor.java/buggy/org/jruby/evaluator/EvaluateVisitor.java |
public WeakSymbolEntry(RubySymbol symbol) { super(symbol, unusedSymbols); | public WeakSymbolEntry(RubySymbol symbol, ReferenceQueue queue) { super(symbol, queue); | public WeakSymbolEntry(RubySymbol symbol) { super(symbol, unusedSymbols); this.name = symbol.asSymbol(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/cc20d41e6031b7e9c9ed46676d32e45334ed0d53/RubySymbol.java/buggy/src/org/jruby/RubySymbol.java |
private String name() { | public String name() { | private String name() { return name; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/cc20d41e6031b7e9c9ed46676d32e45334ed0d53/RubySymbol.java/buggy/src/org/jruby/RubySymbol.java |
table.put(symbol.asSymbol(), new WeakSymbolEntry(symbol)); | table.put(symbol.asSymbol(), new WeakSymbolEntry(symbol, unusedSymbols)); | public void store(RubySymbol symbol) { clean(); table.put(symbol.asSymbol(), new WeakSymbolEntry(symbol)); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/cc20d41e6031b7e9c9ed46676d32e45334ed0d53/RubySymbol.java/buggy/src/org/jruby/RubySymbol.java |
public static RubySymbol getSymbol(Ruby runtime, long id) { | public static IRubyObject getSymbol(Ruby runtime, long id) { | public static RubySymbol getSymbol(Ruby runtime, long id) { RubySymbol result = runtime.symbolTable.lookup(id); if (result == null) { return nilSymbol(runtime); } return result; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/cc20d41e6031b7e9c9ed46676d32e45334ed0d53/RubySymbol.java/buggy/src/org/jruby/RubySymbol.java |
return nilSymbol(runtime); | return runtime.getNil(); | public static RubySymbol getSymbol(Ruby runtime, long id) { RubySymbol result = runtime.symbolTable.lookup(id); if (result == null) { return nilSymbol(runtime); } return result; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/cc20d41e6031b7e9c9ed46676d32e45334ed0d53/RubySymbol.java/buggy/src/org/jruby/RubySymbol.java |
if (name == null) { result = new RubySymbol(runtime, null) { public boolean isNil() { return true; } }; } else { result = new RubySymbol(runtime, name); } | result = new RubySymbol(runtime, name); | public static RubySymbol newSymbol(Ruby runtime, String name) { RubySymbol result; synchronized (RubySymbol.class) { // Locked to prevent the creation of multiple instances of // the same symbol. Most code depends on them being unique. result = runtime.symbolTable.lookup(name); if (result == null) { if (name == null) { result = new RubySymbol(runtime, null) { public boolean isNil() { return true; } }; } else { result = new RubySymbol(runtime, name); } runtime.symbolTable.store(result); } } return result; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/cc20d41e6031b7e9c9ed46676d32e45334ed0d53/RubySymbol.java/buggy/src/org/jruby/RubySymbol.java |
if (getNode() instanceof AttrSetNode) { return Arity.singleArgument(); } else if (getNode() instanceof InstVarNode) { return Arity.noArguments(); } else { return Arity.optional(); } | return arity; | public Arity getArity() { if (getNode() instanceof AttrSetNode) { return Arity.singleArgument(); } else if (getNode() instanceof InstVarNode) { return Arity.noArguments(); } else { return Arity.optional(); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/22f7644c54d60864170082d304f734f88e2f961f/EvaluateMethod.java/buggy/src/org/jruby/internal/runtime/methods/EvaluateMethod.java |
TableItem ti = (TableItem) item; | TableItem ti = item; | protected void doUpdateItem(Widget widget, Object element, boolean fullMap) { if (widget instanceof TableItem) { TableItem item = (TableItem) widget; // remember element we are showing if (fullMap) { associate(element, item); } else { item.setData(element); mapElement(element, item); } IBaseLabelProvider prov = getLabelProvider(); ITableLabelProvider tprov = null; ILabelProvider lprov = null; if (prov instanceof ITableLabelProvider) { tprov = (ITableLabelProvider) prov; } else { lprov = (ILabelProvider) prov; } int columnCount = table.getColumnCount(); TableItem ti = (TableItem) item; // Also enter loop if no columns added. See 1G9WWGZ: JFUIF:WINNT - TableViewer with 0 columns does not work for (int column = 0; column < columnCount || column == 0; column++) { // Similar code in TableTreeViewer.doUpdateItem() String text = "";//$NON-NLS-1$ Image image = null; if (tprov != null) { text = tprov.getColumnText(element, column); image = tprov.getColumnImage(element, column); } else { if (column == 0) { text = lprov.getText(element); image = lprov.getImage(element); } } ti.setText(column, text); if (ti.getImage(column) != image) { ti.setImage(column, image); } } if (prov instanceof IColorProvider) { IColorProvider cprov = (IColorProvider) prov; ti.setForeground(cprov.getForeground(element)); ti.setBackground(cprov.getBackground(element)); } if (prov instanceof IFontProvider) { IFontProvider fprov = (IFontProvider) prov; ti.setFont(fprov.getFont(element)); } }} | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/d036bb43d67ed272b29da05b4ebb9973127da313/TableViewer.java/buggy/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TableViewer.java |
if (isDynamic(items[i])) { } else newItem = createItemAdditionContribution(items[i]); } else if (IWorkbenchRegistryConstants.TAG_DYNAMIC_CONTRIBUTION.equals(itemType)) { if (!dynamicFactories.containsKey(items[i])) { AbstractDynamicContribution newFactory = (AbstractDynamicContribution) Util.safeLoadExecutableExtension(items[i], IWorkbenchRegistryConstants.ATT_CLASS, AbstractDynamicContribution.class); dynamicFactories.put(items[i], newFactory); } AbstractDynamicContribution dynamicFactory = (AbstractDynamicContribution) dynamicFactories.get(items[i]); if (dynamicFactory != null) { List dynamicContributions = new ArrayList(); dynamicFactory.createContributionItems(dynamicContributions); for (Iterator iterator = dynamicContributions.iterator(); iterator .hasNext();) { IContributionItem ici = (IContributionItem) iterator.next(); additions.add(ici); } } | newItem = createItemAdditionContribution(items[i]); } else if (IWorkbenchRegistryConstants.TAG_DYNAMIC_CONTRIBUTION .equals(itemType)) { newItem = createDynamicAdditionContribution(items[i]); | public void createContributionItems(IMenuService menuService, List additions) { additions.clear(); IConfigurationElement[] items = additionElement.getChildren(); for (int i = 0; i < items.length; i++) { String itemType = items[i].getName(); IContributionItem newItem = null; if (IWorkbenchRegistryConstants.TAG_ITEM.equals(itemType)) { if (isDynamic(items[i])) { } else newItem = createItemAdditionContribution(items[i]); } else if (IWorkbenchRegistryConstants.TAG_DYNAMIC_CONTRIBUTION.equals(itemType)) { // ** Special Case ** Load the defined class and populate with // any items it returns. We leave 'newItem' as null since we are // -replacing- this element with a set of items // Attempt the load a cache to avoid failing retries if (!dynamicFactories.containsKey(items[i])) { AbstractDynamicContribution newFactory = (AbstractDynamicContribution) Util.safeLoadExecutableExtension(items[i], IWorkbenchRegistryConstants.ATT_CLASS, AbstractDynamicContribution.class); dynamicFactories.put(items[i], newFactory); } // If we get null now it means that the load failed... AbstractDynamicContribution dynamicFactory = (AbstractDynamicContribution) dynamicFactories.get(items[i]); if (dynamicFactory != null) { List dynamicContributions = new ArrayList(); dynamicFactory.createContributionItems(dynamicContributions); for (Iterator iterator = dynamicContributions.iterator(); iterator .hasNext();) { IContributionItem ici = (IContributionItem) iterator.next(); additions.add(ici); } } } else if (IWorkbenchRegistryConstants.TAG_WIDGET.equals(itemType)) { newItem = createWidgetAdditionContribution(items[i]); } else if (IWorkbenchRegistryConstants.TAG_SEPARATOR .equals(itemType)) { newItem = createSeparatorAdditionContribution(items[i]); } else if (IWorkbenchRegistryConstants.TAG_MENU.equals(itemType)) { newItem = createMenuAdditionContribution(items[i]); } // Cache the relationship between the ICI and the // registry element used to back it if (newItem != null) { iciToConfigElementMap.put(newItem, items[i]); additions.add(newItem); Expression visibleWhen = getVisibleWhenForItem(newItem); if (visibleWhen != null) { menuService.registerVisibleWhen(newItem, visibleWhen); } } } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/24cd644ab72242d12f8ed721556c8bade808714d/MenuAdditionCacheEntry.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/MenuAdditionCacheEntry.java |
return new WidgetContributionItem(getId(widgetAddition), widgetAddition); | if (failedLoads.contains(widgetAddition)) return null; final IWorkbenchWidget loadedWidget = (IWorkbenchWidget) Util .safeLoadExecutableExtension(widgetAddition, IWorkbenchRegistryConstants.ATT_CLASS, IWorkbenchWidget.class); if (loadedWidget == null) { failedLoads.add(widgetAddition); return null; } return new WidgetContributionItem(getId(widgetAddition)) { public IWorkbenchWidget createWidget() { return loadedWidget; } }; | private IContributionItem createWidgetAdditionContribution( final IConfigurationElement widgetAddition) { return new WidgetContributionItem(getId(widgetAddition), widgetAddition); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/24cd644ab72242d12f8ed721556c8bade808714d/MenuAdditionCacheEntry.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/MenuAdditionCacheEntry.java |
if ( getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT ) { return _domCSSValue.getCssText(); } else { if ( cssSACPrimitiveValueType() == CSSPrimitiveValue.CSS_STRING ){ return ( (CSSPrimitiveValue)_domCSSValue ).getStringValue(); } else { return "NOT-A-STRING"; } | switch ( getPrimitiveType()) { case CSSPrimitiveValue.CSS_IDENT: case CSSPrimitiveValue.CSS_URI: return _domCSSValue.getCssText(); case CSSPrimitiveValue.CSS_STRING: return ( (CSSPrimitiveValue)_domCSSValue ).getStringValue(); default: return "NOT-A-STRING"; | public String getStringValue() { assert( getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE ); if ( getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT ) { return _domCSSValue.getCssText(); } else { if ( cssSACPrimitiveValueType() == CSSPrimitiveValue.CSS_STRING ){ return ( (CSSPrimitiveValue)_domCSSValue ).getStringValue(); } else { return "NOT-A-STRING"; } } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/679e408a424b7d3405778c87c04dd57897247127/XRValueImpl.java/buggy/src/java/com/pdoubleya/xhtmlrenderer/css/impl/XRValueImpl.java |
if(part != null) part.getTitleImage(); ReferenceCounter imageCache = WorkbenchImages.getImageCache(); Image image = (Image)imageCache.get(imageDescritor); if(image != null) { imageCache.removeRef(imageDescritor); | if(image != null && imageDescritor != null) { if(part != null) part.getTitleImage(); ReferenceCounter imageCache = WorkbenchImages.getImageCache(); image = (Image)imageCache.get(imageDescritor); if(image != null) { imageCache.removeRef(imageDescritor); } image = null; imageDescritor = null; | public void releaseReferences() { id = null; tooltip = null; title = null; //make sure part has inc. the reference count. if(part != null) part.getTitleImage(); ReferenceCounter imageCache = WorkbenchImages.getImageCache(); Image image = (Image)imageCache.get(imageDescritor); if(image != null) { imageCache.removeRef(imageDescritor); } image = null; imageDescritor = null; } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/e25b372df9daaaff02436d5ace0f2c2310e47109/WorkbenchPartReference.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPartReference.java |
image = null; imageDescritor = null; | public void releaseReferences() { id = null; tooltip = null; title = null; //make sure part has inc. the reference count. if(part != null) part.getTitleImage(); ReferenceCounter imageCache = WorkbenchImages.getImageCache(); Image image = (Image)imageCache.get(imageDescritor); if(image != null) { imageCache.removeRef(imageDescritor); } image = null; imageDescritor = null; } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/e25b372df9daaaff02436d5ace0f2c2310e47109/WorkbenchPartReference.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPartReference.java |
|
MessageDialog.openError(getControl().getShell(), new String(), e.getLocalizedMessage()); | protected boolean transfer(IPreferenceFilter[] transfers) { File exportFile = new File(getDestinationValue()); if (!ensureTargetIsValid(exportFile)) { return false; } FileOutputStream fos = null; try { if (transfers.length > 0) { try { fos = new FileOutputStream(exportFile); } catch (FileNotFoundException e) { WorkbenchPlugin.log(e.getMessage(), e); return false; } IPreferencesService service = Platform.getPreferencesService(); try { service.exportPreferences(service.getRootNode(), transfers, fos); } catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); return false; } } } finally { if (fos != null) try { fos.close(); } catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); } } return true; } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/250c51b2f3ebf5ca47b3af7cf0f26a919a99c71b/WizardPreferencesExportPage1.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java |
|
Message latestMessage = fixMessageHistory.getLatestMessage(clOrdID); if (latestMessage != null){ | Message latestMessage = fixMessageHistory.getLatestExecutionReport(clOrdID); if (latestMessage == null){ latestMessage = fixMessageHistory.getLatestMessage(clOrdID); if (latestMessage == null){ internalMainLogger.error("Could not send cancel request for order ID "+clOrdID); return; } | public void cancelOneOrderByClOrdID(String clOrdID) throws NoMoreIDsException { Message latestMessage = fixMessageHistory.getLatestMessage(clOrdID); if (latestMessage != null){ Message cancelMessage = new quickfix.fix42.Message(); cancelMessage.getHeader().setString(MsgType.FIELD, MsgType.ORDER_CANCEL_REQUEST); cancelMessage.setField(new OrigClOrdID(clOrdID)); cancelMessage.setField(new ClOrdID(this.idFactory.getNext())); fillFieldsFromExistingMessage(cancelMessage, latestMessage); fixMessageHistory.addOutgoingMessage(cancelMessage); try { sendToApplicationQueue(cancelMessage); } catch (JMSException e) { internalMainLogger.error("Error sending cancel for order "+clOrdID, e); } } else { internalMainLogger.error("Could not send cancel request for order ID "+clOrdID); } } | 52787 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52787/6a34478b554292b36701d7eaebf25a934e3abba0/OrderManager.java/clean/source/trunk/src/main/java/org/marketcetera/photon/OrderManager.java |
} else { internalMainLogger.error("Could not send cancel request for order ID "+clOrdID); | public void cancelOneOrderByClOrdID(String clOrdID) throws NoMoreIDsException { Message latestMessage = fixMessageHistory.getLatestMessage(clOrdID); if (latestMessage != null){ Message cancelMessage = new quickfix.fix42.Message(); cancelMessage.getHeader().setString(MsgType.FIELD, MsgType.ORDER_CANCEL_REQUEST); cancelMessage.setField(new OrigClOrdID(clOrdID)); cancelMessage.setField(new ClOrdID(this.idFactory.getNext())); fillFieldsFromExistingMessage(cancelMessage, latestMessage); fixMessageHistory.addOutgoingMessage(cancelMessage); try { sendToApplicationQueue(cancelMessage); } catch (JMSException e) { internalMainLogger.error("Error sending cancel for order "+clOrdID, e); } } else { internalMainLogger.error("Could not send cancel request for order ID "+clOrdID); } } | 52787 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52787/6a34478b554292b36701d7eaebf25a934e3abba0/OrderManager.java/clean/source/trunk/src/main/java/org/marketcetera/photon/OrderManager.java |
|
public void cancelOneOrderByClOrdID(String clOrdID) throws NoMoreIDsException { Message latestMessage = fixMessageHistory.getLatestMessage(clOrdID); if (latestMessage != null){ Message cancelMessage = new quickfix.fix42.Message(); cancelMessage.getHeader().setString(MsgType.FIELD, MsgType.ORDER_CANCEL_REQUEST); cancelMessage.setField(new OrigClOrdID(clOrdID)); cancelMessage.setField(new ClOrdID(this.idFactory.getNext())); fillFieldsFromExistingMessage(cancelMessage, latestMessage); fixMessageHistory.addOutgoingMessage(cancelMessage); try { sendToApplicationQueue(cancelMessage); } catch (JMSException e) { internalMainLogger.error("Error sending cancel for order "+clOrdID, e); } } else { internalMainLogger.error("Could not send cancel request for order ID "+clOrdID); } } | 52787 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52787/6a34478b554292b36701d7eaebf25a934e3abba0/OrderManager.java/clean/source/trunk/src/main/java/org/marketcetera/photon/OrderManager.java |
||
String reason = aMessage.getString(CxlRejReason.FIELD); | String reason = null; try { reason = aMessage.getString(CxlRejReason.FIELD); } catch (FieldNotFound fnf){ } | private void handleCancelReject(Message aMessage) throws FieldNotFound { String reason = aMessage.getString(CxlRejReason.FIELD); String text = aMessage.getString(Text.FIELD); String origClOrdID = aMessage.getString(OrigClOrdID.FIELD); String errorMsg = "Cancel rejected for order " + origClOrdID + ": " + (text == null ? "" : text) + (reason == null ? "" : " (" + reason + ")"); internalMainLogger.error(errorMsg); } | 52787 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52787/6a34478b554292b36701d7eaebf25a934e3abba0/OrderManager.java/clean/source/trunk/src/main/java/org/marketcetera/photon/OrderManager.java |
try { aMessage.getString(OrigClOrdID.FIELD); cancelOneOrder(aMessage); } catch (FieldNotFound e) { } | cancelOneOrder(aMessage); | public void handleInternalMessage(Message aMessage) throws FieldNotFound, MarketceteraException, JMSException { if (FIXMessageUtil.isOrderSingle(aMessage)) { addNewOrder(aMessage); } else if (FIXMessageUtil.isCancelRequest(aMessage)) { try { aMessage.getString(OrigClOrdID.FIELD); cancelOneOrder(aMessage); } catch (FieldNotFound e) { } } else if (FIXMessageUtil.isCancelReplaceRequest(aMessage)) { cancelReplaceOneOrder(aMessage); } else if (FIXMessageUtil.isCancelRequest(aMessage)) { cancelOneOrder(aMessage); } } | 52787 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52787/6a34478b554292b36701d7eaebf25a934e3abba0/OrderManager.java/clean/source/trunk/src/main/java/org/marketcetera/photon/OrderManager.java |
addTest(new TestSuite(DuplicateMenuItemTest.class)); | public NavigatorTestSuite() { addTest(new TestSuite(ResourceNavigatorTest.class)); addTest(new TestSuite(NavigatorTest.class)); addTest(new TestSuite(DecoratorTestCase.class)); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/8238fa0ce352aa120833aa8f87ba7c693807792a/NavigatorTestSuite.java/buggy/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/NavigatorTestSuite.java |
|
this.sharedContext.addIDBox(id,box); } | this.sharedContext.addIDBox(id, box); } | public void addIDBox(String id, Box box) { this.sharedContext.addIDBox(id,box); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/9ac58abece8ac0f02983d3b07df9656b6a59c78a/ContextImpl.java/clean/src/java/org/xhtmlrenderer/layout/ContextImpl.java |
return this.sharedContext.getIDBox(id); } | return this.sharedContext.getIDBox(id); } | public Box getIDBox(String id) { return this.sharedContext.getIDBox(id); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/9ac58abece8ac0f02983d3b07df9656b6a59c78a/ContextImpl.java/clean/src/java/org/xhtmlrenderer/layout/ContextImpl.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.