code_snippet
stringlengths
92
2.48k
score
float64
1.83
4.89
long logoId = 0; Group group = null; try { group = getGroup(); if (!group.isStagingGroup()) { return logoId; } } catch (Exception e) { return logoId; } Group liveGroup = group.getLiveGroup(); LayoutSet liveLayoutSet = null; if (isPrivateLayout()) { liveLayoutSet = liveGroup.getPrivateLayoutSet(); } else { liveLayoutSet = liveGroup.getPublicLayoutSet(); } return liveLayoutSet.getLogoId(); } @Override public String getSettings() { if (_settingsProperties == null) { return super.getSettings(); } else { return _settingsProperties.toString(); } } public UnicodeProperties getSettingsProperties() { if (_settingsProperties == null) { _settingsProperties = new UnicodeProperties(true); try { _settingsProperties.load(super.getSettings()); } catch (IOException ioe) { _log.error(ioe, ioe); } }
3.541833
import com.liferay.portalweb.portal.util.RuntimeVariables; /** * @author Brian Wing Shun Chan */ public class TearDownBlogsEntryCPTest extends BaseTestCase { public void testTearDownBlogsEntryCP() throws Exception { int label = 1; while (label >= 1) { switch (label) { case 1: selenium.open("/web/guest/home/"); loadRequiredJavaScriptModules(); for (int second = 0;; second++) { if (second >= 90) { fail("timeout"); } try { if (selenium.isElementPresent("link=Control Panel")) { break; } } catch (Exception e) { } Thread.sleep(1000); }
3.234043
DB db = DBFactoryUtil.getDB(); Thread currentThread = Thread.currentThread(); ClassLoader classLoader = currentThread.getContextClassLoader(); String tablesSQL = StringUtil.read( classLoader, "com/liferay/portal/tools/sql/dependencies/portal-tables.sql"); String indexesSQL = StringUtil.read( classLoader, "com/liferay/portal/tools/sql/dependencies/indexes.sql"); String indexesProperties = StringUtil.read( classLoader, "com/liferay/portal/tools/sql/dependencies/indexes.properties"); db.updateIndexes( tablesSQL, indexesSQL, indexesProperties, _dropIndexes); } catch (Exception e) { _log.error(e, e); } } public void upgradeProcess(int buildNumber) throws UpgradeException { if (buildNumber == ReleaseInfo.getBuildNumber()) { if (_log.isDebugEnabled()) { _log.debug( "Skipping upgrade process from " + buildNumber + " to " + ReleaseInfo.getBuildNumber()); } return; } String[] upgradeProcessClassNames = getUpgradeProcessClassNames( PropsKeys.UPGRADE_PROCESSES); if (upgradeProcessClassNames.length == 0) { upgradeProcessClassNames = getUpgradeProcessClassNames( PropsKeys.UPGRADE_PROCESSES + StringPool.PERIOD + buildNumber); if (upgradeProcessClassNames.length == 0) { if (_log.isInfoEnabled()) { _log.info( "Upgrading from " + buildNumber + " to " + ReleaseInfo.getBuildNumber() + " is not supported"); }
3.080357
public SetServerManagerContextPathCommand( IRemoteServerWorkingCopy server, String serverManagerContextPath ) { super( server, "Set Server Manager Context Path" ); this.serverManagerContextPath = serverManagerContextPath; } public void execute() { oldServerManagerContextPath = server.getServerManagerContextPath(); server.setServerManagerContextPath( serverManagerContextPath ); }
3.632479
try { if (selenium.isVisible("//section")) { break; } } catch (Exception e) { } Thread.sleep(1000); }
3.543478
createGroup(model, "websites", parameter_group); return model; } private static BasicPluginConfigModel createInstallationConfigGroup(final JythonPlugin plugin, final JythonPluginCore core, final JythonPluginInitialiser jpi, final BasicPluginConfigModel parent, final boolean init_ok) { BasicPluginConfigModel model = core.plugin_interface.getUIManager().createBasicPluginConfigModel(parent.getSection(), "azjython.install"); addJythonStatusParameter(init_ok, core, model, false); // Things to disable upon installing Jython. final List disable_on_install = new ArrayList(); // We reuse this multiple times to store parameters in a group. ArrayList parameter_group = new ArrayList(); LabelParameter lp = model.addLabelParameter2("azjython.config.auto_config.info"); final ActionParameter start_param = model.addActionParameter2("azjython.blank", "azjython.config.auto_config.start"); final ActionParameter stop_param = model.addActionParameter2("azjython.blank", "azjython.config.auto_config.stop"); start_param.setEnabled(!init_ok); stop_param.setEnabled(false); parameter_group.add(lp); parameter_group.add(start_param); parameter_group.add(stop_param); disable_on_install.add(start_param); disable_on_install.add(stop_param); createGroup(model, "auto_config", parameter_group); final DirectoryParameter dm = model.addDirectoryParameter2("jython.path", "azjython.config.jythonpath", ""); disable_on_install.add(dm); parameter_group.add(dm); ActionParameter am = model.addActionParameter2("azjython.config.install", "azjython.config.install.action"); disable_on_install.add(am); parameter_group.add(am); final ParameterListener auto_install_listener = new ParameterListener() { public void parameterChanged(Parameter p) { boolean installed = jpi.installJython(true); if (installed) { for (int i=0; i < disable_on_install.size(); i++) { ((Parameter)disable_on_install.get(i)).setEnabled(false); } } } }; am.addListener(auto_install_listener); am.setEnabled(!init_ok);
2.936652
RuntimeVariables.replace("Select All")); assertTrue(selenium.isChecked( "xPath=(//input[@name='_125_allRowIds'])[2]")); selenium.clickAt("//input[@value='Deactivate']", RuntimeVariables.replace("Deactivate")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); assertTrue(selenium.getConfirmation() .matches("^Are you sure you want to deactivate the selected users[\\s\\S]$")); for (int second = 0;; second++) { if (second >= 90) { fail("timeout"); } try { if (selenium.isVisible( "//div[@class='portlet-msg-success']")) { break; } } catch (Exception e) { } Thread.sleep(1000); } assertEquals(RuntimeVariables.replace( "Your request completed successfully."), selenium.getText("//div[@class='portlet-msg-success']")); case 2: selenium.clickAt("link=Search All Users", RuntimeVariables.replace("Search All Users")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); boolean advancedVisible = selenium.isVisible( "link=Advanced \u00bb"); if (!advancedVisible) { label = 3; continue; } selenium.clickAt("link=Advanced \u00bb", RuntimeVariables.replace("Advanced")); case 3:
3.039823
return listenerID; } public String getMessageID() { return messageID; } public String getOperationID() { return operationID; } protected long getSequenceNo() { return lSequenceNo; } protected void setSequenceNo(long sequenceNo) { lSequenceNo = sequenceNo; } public String toString() { String paramString = parameters.toString(); return "PlaformMessage {" + "cn" + contentNetworkID + ", " + lSequenceNo + ", " + messageID + ", " + listenerID + ", " + operationID + ", " + (paramString.length() > 32767 ? paramString.substring(0, 32767) : paramString) + "}"; } public String toShortString() { return (requiresAuthorization ? "AUTH: " : "") + getMessageID() + "." + getListenerID() + "." + getOperationID(); } /** * @return * * @since 3.1.1.1 */ public boolean sendAZID() { return sendAZID; }
3.713693
else if (RUBY.getValue().equals(value)) { return RUBY; } throw new IllegalArgumentException("Invalid value " + value); } public String getValue() { return _value; }
3.992308
selenium.open("/web/guest/home/"); loadRequiredJavaScriptModules(); for (int second = 0;; second++) { if (second >= 90) { fail("timeout"); } try { if (selenium.isElementPresent("link=Site Name")) { break; } } catch (Exception e) { } Thread.sleep(1000); } selenium.clickAt("link=Site Name", RuntimeVariables.replace("Site Name")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); selenium.clickAt("link=Web Content Display Test Page", RuntimeVariables.replace("Web Content Display Test Page")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); assertTrue(selenium.isPartialText("//a[@id='_145_addApplication']", "More")); selenium.clickAt("//a[@id='_145_addApplication']", RuntimeVariables.replace("More")); for (int second = 0;; second++) { if (second >= 90) { fail("timeout"); } try { if (selenium.isElementPresent( "//div[@title='Web Content Display']/p/a")) { break; } } catch (Exception e) { } Thread.sleep(1000); } selenium.clickAt("//div[@title='Web Content Display']/p/a", RuntimeVariables.replace("Web Content Display"));
3.324111
sendRedirect(actionRequest, actionResponse); } catch (Exception e) { if (e instanceof PrincipalException) { SessionErrors.add(actionRequest, e.getClass().getName()); setForward(actionRequest, "portlet.sites_admin.error"); } else { throw e; } } } @Override public ActionForward render( ActionMapping mapping, ActionForm form, PortletConfig portletConfig, RenderRequest renderRequest, RenderResponse renderResponse) throws Exception { try { ActionUtil.getGroup(renderRequest); ActionUtil.getRole(renderRequest); Role role = (Role)renderRequest.getAttribute(WebKeys.ROLE); if (role != null) { String name = role.getName(); if (name.equals(RoleConstants.ORGANIZATION_USER) || name.equals(RoleConstants.SITE_MEMBER)) { throw new NoSuchRoleException(); } } } catch (Exception e) { if (e instanceof NoSuchGroupException || e instanceof NoSuchRoleException || e instanceof PrincipalException) { SessionErrors.add(renderRequest, e.getClass().getName()); return mapping.findForward("portlet.sites_admin.error"); } else { throw e; } }
3.464
float trialFitness = posFitnesses[solutionPosID]; if(trialFitness BETTER_THAN fitnesses[solutionPosID]) { posBetter = true; bias = 0.2f*bias + 0.4f*(dif+bias); } else { trialFitness = negFitnesses[solutionPosID]; if(trialFitness BETTER_THAN fitnesses[solutionPosID]) { negBetter = true; bias = bias - 0.4f*(dif+bias); } } if(posBetter || negBetter) { successes[solutionPosID]++; fails[solutionPosID] = 0; biases[solutionPosID] = bias; fitnesses[solutionPosID] = trialFitness; } else { successes[solutionPosID] = 0; fails[solutionPosID]++; }
3.745968
for (int second = 0;; second++) { if (second >= 90) { fail("timeout"); } try { if (selenium.isVisible( "//td[@id='cke_contents__15__15_structure_el_TextAreaField_content']/iframe")) { break; } } catch (Exception e) { } Thread.sleep(1000); } selenium.selectFrame( "//td[@id='cke_contents__15__15_structure_el_TextAreaField_content']/iframe"); selenium.type("//body", RuntimeVariables.replace("WCD Web Content Content")); selenium.selectFrame("relative=top"); selenium.clickAt("//a[@id='_15_abstractLink']", RuntimeVariables.replace("Abstract")); for (int second = 0;; second++) { if (second >= 90) { fail("timeout"); }
3.177215
*/ public class AddAddress1MyAccountTest extends BaseTestCase { public void testAddAddress1MyAccount() throws Exception { selenium.open("/web/guest/home"); loadRequiredJavaScriptModules(); for (int second = 0;; second++) { if (second >= 90) { fail("timeout"); }
3.459016
String temp = ""; for (int i=0;i<library_path.length();i++){ char c = library_path.charAt(i); if ( c != '"' ){ temp += c; }else{ changed = true; } } library_path = temp; // remove trailing separator chars if they exist as they stuff up // the following " while( library_path.endsWith(File.separator)){ changed = true; library_path = library_path.substring( 0, library_path.length()-1 ); } if ( changed ){
3.411017
return (Address)message.get(_ADDRESS); } public static ClusterLink getClusterLink() { if ((_clusterLink == null) || !_clusterLink.isEnabled()) { if (_log.isWarnEnabled()) { _log.warn("ClusterLinkUtil has not been initialized"); } return null; } return _clusterLink; } public static List<Address> getLocalTransportAddresses() { if ((_clusterLink == null) || !_clusterLink.isEnabled()) { if (_log.isWarnEnabled()) { _log.warn("ClusterLinkUtil has not been initialized"); } return Collections.emptyList(); } return _clusterLink.getLocalTransportAddresses(); } public static List<Address> getTransportAddresses(Priority priority) { if ((_clusterLink == null) || !_clusterLink.isEnabled()) { if (_log.isWarnEnabled()) { _log.warn("ClusterLinkUtil has not been initialized"); } return Collections.emptyList(); } return _clusterLink.getTransportAddresses(priority); } public static boolean isForwardMessage(Message message) { return message.getBoolean(CLUSTER_FORWARD_MESSAGE); } public static void sendMulticastMessage( Message message, Priority priority) { if ((_clusterLink == null) || !_clusterLink.isEnabled()) { if (_log.isWarnEnabled()) { _log.warn("ClusterLinkUtil has not been initialized"); }
3.129032
} } } } protected int isBuddy( Peer peer ) { String peer_ip = peer.getIp();
2.045872
Category category ); /** * A category has been removed from the CategoryManager * @param category Category that was removed */ public void categoryRemoved( Category category );
3.054622
/** * @author Brian Wing Shun Chan */ public class PluginUtil { public static <P extends Plugin> List<P> restrictPlugins( List<P> plugins, long companyId, long userId) throws SystemException { List<P> visiblePlugins = new ArrayList<P>(plugins.size()); for (P plugin : plugins) { PluginSetting pluginSetting = PluginSettingLocalServiceUtil.getPluginSetting( companyId, plugin.getPluginId(), plugin.getPluginType()); if (pluginSetting.isActive() && pluginSetting.hasPermission(userId)) { visiblePlugins.add(plugin); } } return visiblePlugins; } public static <P extends Plugin> List<P> restrictPlugins( List<P> plugins, User user) throws SystemException {
3.321285
public void testCreate() throws Exception { long pk = nextLong(); SCProductVersion scProductVersion = _persistence.create(pk); assertNotNull(scProductVersion); assertEquals(scProductVersion.getPrimaryKey(), pk); } public void testRemove() throws Exception { SCProductVersion newSCProductVersion = addSCProductVersion(); _persistence.remove(newSCProductVersion); SCProductVersion existingSCProductVersion = _persistence.fetchByPrimaryKey(newSCProductVersion.getPrimaryKey()); assertNull(existingSCProductVersion); } public void testUpdateNew() throws Exception { addSCProductVersion(); } public void testUpdateExisting() throws Exception { long pk = nextLong(); SCProductVersion newSCProductVersion = _persistence.create(pk); newSCProductVersion.setCompanyId(nextLong()); newSCProductVersion.setUserId(nextLong()); newSCProductVersion.setUserName(randomString()); newSCProductVersion.setCreateDate(nextDate()); newSCProductVersion.setModifiedDate(nextDate()); newSCProductVersion.setProductEntryId(nextLong()); newSCProductVersion.setVersion(randomString()); newSCProductVersion.setChangeLog(randomString()); newSCProductVersion.setDownloadPageURL(randomString()); newSCProductVersion.setDirectDownloadURL(randomString()); newSCProductVersion.setRepoStoreArtifact(randomBoolean());
3.22314
"//div[@class='lfr-component lfr-menu-list']/ul/li[3]/a")) { break; } } catch (Exception e) { } Thread.sleep(1000); } selenium.click(RuntimeVariables.replace( "//div[@class='lfr-component lfr-menu-list']/ul/li[3]/a")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); assertTrue(selenium.getConfirmation() .matches("^Are you sure you want to delete this[\\s\\S]$")); case 4: boolean bookmarksFolder4Present = selenium.isElementPresent( "//td[4]/span/ul/li/strong/a"); if (!bookmarksFolder4Present) { label = 5; continue; } selenium.clickAt("//td[4]/span/ul/li/strong/a", RuntimeVariables.replace(""));
3.171429
package org.bouncycastle.jce; import java.util.Enumeration; import org.bouncycastle.asn1.x9.X962NamedCurves; import org.bouncycastle.asn1.x9.X9ECParameters; import org.bouncycastle.jce.spec.ECNamedCurveParameterSpec; /** * a table of locally supported named curves. */ public class ECNamedCurveTable { /** * return a parameter spec representing the passed in named * curve. The routine returns null if the curve is not present. * * @param name the name of the curve requested * @return a parameter spec for the curve, null if it is not available. */ public static ECNamedCurveParameterSpec getParameterSpec( String name) { X9ECParameters ecP = X962NamedCurves.getByName(name); if (ecP == null) { return null; } return new ECNamedCurveParameterSpec( name, ecP.getCurve(), ecP.getG(), ecP.getN(), ecP.getH(), ecP.getSeed()); } /** * return an enumeration of the names of the available curves. * * @return an enumeration of the names of the available curves. */ public static Enumeration getNames() { return X962NamedCurves.getNames(); }
3.935484
package net.sourceforge.squirrel_sql.client.gui.db; import javax.swing.JFrame; import net.sourceforge.squirrel_sql.client.ApplicationArguments; import net.sourceforge.squirrel_sql.client.gui.db.aliasproperties.ConnectionPropertiesPanel; public class ConnectionPropertiesPanelTestUI { /** * @param args */ public static void main(String[] args) { ApplicationArguments.initialize(new String[] {}); final JFrame frame = new JFrame("Test ConnectionPropertiesPanel"); SQLAliasConnectionProperties props = new SQLAliasConnectionProperties(); ConnectionPropertiesPanel panel = new ConnectionPropertiesPanel(props); frame.getContentPane().add(panel); frame.setSize(500,300); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
3.865079
if (selenium.isVisible( "//td[@id='cke_contents__19_editor']/iframe")) { break; } } catch (Exception e) { } Thread.sleep(1000); }
3.011858
/** * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved. * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package com.liferay.portal.sharepoint.methods; import com.liferay.portal.sharepoint.ResponseElement; import com.liferay.portal.sharepoint.SharepointRequest; import com.liferay.portal.sharepoint.SharepointStorage; import java.util.ArrayList; import java.util.List; /** * @author Bruno Farache */ public class UncheckoutDocumentMethodImpl extends BaseMethodImpl { public String getMethodName() { return _METHOD_NAME; } @Override public String getRootPath(SharepointRequest sharepointRequest) { return sharepointRequest.getParameterValue("document_name"); } @Override protected List<ResponseElement> getElements( SharepointRequest sharepointRequest) throws Exception { List<ResponseElement> elements = new ArrayList<ResponseElement>(); SharepointStorage storage = sharepointRequest.getSharepointStorage(); elements.add(storage.getDocumentTree(sharepointRequest)); return elements; }
3.661157
getLeecherCount(); /** * Gives access to the number of peers that have failed NAT checks, 0 if NAT checking * is disabled. * @return */ public int getBadNATCount();
3.475806
"8", "com.liferay.portlet.calendar", new String[] {"ADD_EVENT", "EXPORT_ALL_EVENTS"}); updatePortletPermissions( "20", "com.liferay.portlet.documentlibrary", new String[] {"ADD_FOLDER"}); updatePortletPermissions( "31", "com.liferay.portlet.imagegallery", new String[] {"ADD_FOLDER"}); updatePortletPermissions( "15", "com.liferay.portlet.journal", new String[] { "ADD_ARTICLE", "ADD_FEED", "ADD_STRUCTURE", "ADD_TEMPLATE", "APPROVE_ARTICLE" }); updatePortletPermissions( "19", "com.liferay.portlet.messageboards", new String[] {"ADD_CATEGORY", "BAN_USER"}); updatePortletPermissions( "25", "com.liferay.portlet.polls", new String[] {"ADD_QUESTION"}); updatePortletPermissions( "34", "com.liferay.portlet.shopping", new String[] {"ADD_CATEGORY", "MANAGE_COUPONS", "MANAGE_ORDERS"}); updatePortletPermissions( "98", "com.liferay.portlet.softwarecatalog", new String[] {"ADD_FRAMEWORK_VERSION", "ADD_PRODUCT_ENTRY"}); updatePortletPermissions( "99", "com.liferay.portlet.tags", new String[] {"ADD_ENTRY", "ADD_VOCABULARY"}); updatePortletPermissions( "36", "com.liferay.portlet.wiki", new String[] {"ADD_NODE"}); } protected Object[] getLayout(long plid) throws Exception { Connection con = null; PreparedStatement ps = null; ResultSet rs = null; try { con = DataAccess.getConnection(); ps = con.prepareStatement(_GET_LAYOUT);
3.121951
package net.sourceforge.squirrel_sql.plugins.graph; import java.awt.*; public class ConnectionPoints { Point[] points; boolean pointsAreLeftOfWindow;
4.148
"_2_announcementsTypetestEmailCheckbox"); if (testEmailChecked) { label = 6; continue; } selenium.clickAt("_2_announcementsTypetestEmailCheckbox", RuntimeVariables.replace(""));
3.1875
public void setCompanyId(long companyId); /** * Returns the user ID of this meetups registration. * * @return the user ID of this meetups registration */ public long getUserId(); /** * Sets the user ID of this meetups registration. * * @param userId the user ID of this meetups registration */ public void setUserId(long userId); /** * Returns the user uuid of this meetups registration. * * @return the user uuid of this meetups registration * @throws SystemException if a system exception occurred */ public String getUserUuid() throws SystemException; /** * Sets the user uuid of this meetups registration. * * @param userUuid the user uuid of this meetups registration */ public void setUserUuid(String userUuid);
4.171875
if (name == null) { throw new IllegalArgumentException(); } _events.add(new EventImpl(name.getLocalPart(), name, value)); } public void setEvent(String name, Serializable value) { if (name == null) { throw new IllegalArgumentException(); } setEvent(new QName(getDefaultNamespace(), name), value); } public void setPortletMode(PortletMode portletMode) throws PortletModeException { if (_redirectLocation != null) { throw new IllegalStateException(); } if (!_portletRequestImpl.isPortletModeAllowed(portletMode)) { throw new PortletModeException(portletMode.toString(), portletMode); } try { _portletMode = PortalUtil.updatePortletMode( _portletName, _user, _layout, portletMode, _portletRequestImpl.getHttpServletRequest());
3.251908
_instance._disconnect(); } } public static void send(String to, String msg) { _instance._send(to, msg); } public void update(Observable obs, Object obj) { _connecting = false;
3.70566
WorkflowConstants.CONTEXT_ENTRY_CLASS_NAME)); if (workflowContext.containsKey( WorkflowConstants.CONTEXT_ENTRY_CLASS_PK)) { kaleoInstanceToken.setClassPK( GetterUtil.getLong( (String)workflowContext.get( WorkflowConstants.CONTEXT_ENTRY_CLASS_PK))); }
2.76494
/** * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved. * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package com.liferay.portal.workflow.kaleo.runtime.util; import com.liferay.portal.kernel.json.JSONFactoryUtil; import com.liferay.portal.kernel.json.JSONObject; import com.liferay.portal.service.ServiceContext; import com.liferay.portal.workflow.kaleo.model.KaleoInstanceToken; import com.liferay.portal.workflow.kaleo.model.KaleoTaskInstanceToken; import com.liferay.portal.workflow.kaleo.runtime.ExecutionContext; import com.liferay.portal.workflow.kaleo.service.KaleoInstanceTokenLocalServiceUtil; import com.liferay.portal.workflow.kaleo.service.KaleoTaskInstanceTokenLocalServiceUtil; import com.liferay.portal.workflow.kaleo.util.WorkflowContextUtil; import java.io.Serializable; import java.util.Map;
3.879377
long fileEntryTypeId = ParamUtil.getLong( serviceContext, "fileEntryTypeId", -1L); Map<String, Fields> fieldsMap = getFieldsMap( serviceContext, fileEntryTypeId); DLFileEntry dlFileEntry = dlFileEntryLocalService.updateFileEntry( userId, fileEntryId, sourceFileName, mimeType, title, description, changeLog, majorVersion, fileEntryTypeId, fieldsMap, null, is, size, serviceContext);
2.878049
*/ public UserFinder getUserFinder() { return userFinder; } /** * Sets the user finder. * * @param userFinder the user finder */ public void setUserFinder(UserFinder userFinder) { this.userFinder = userFinder; } /** * Returns the asset entry local service. * * @return the asset entry local service */ public AssetEntryLocalService getAssetEntryLocalService() { return assetEntryLocalService; } /** * Sets the asset entry local service. * * @param assetEntryLocalService the asset entry local service */ public void setAssetEntryLocalService( AssetEntryLocalService assetEntryLocalService) { this.assetEntryLocalService = assetEntryLocalService; } /** * Returns the asset entry remote service. * * @return the asset entry remote service */ public AssetEntryService getAssetEntryService() { return assetEntryService; } /** * Sets the asset entry remote service. * * @param assetEntryService the asset entry remote service */ public void setAssetEntryService(AssetEntryService assetEntryService) { this.assetEntryService = assetEntryService; }
4.127572
public abstract class AliasAction extends SquirrelAction { /** Logger for this class. */ private static ILogger s_log = LoggerController.createLogger(DeleteAliasAction.class); /** Internationalized strings for this class. */ private static final StringManager s_stringMgr = StringManagerFactory.getStringManager(DeleteAliasAction.class); public AliasAction(IApplication app) { super(app); } protected void moveToFrontAndSelectAliasFrame() { IApplication app = getApplication(); AliasesListInternalFrame tw = app.getWindowManager().getAliasesListInternalFrame(); tw.moveToFront(); try { tw.setSelected(true); } catch (PropertyVetoException ex) { //i18n[DeleteAliasAction.error.selectingwindow=Error selecting window] s_log.error(s_stringMgr.getString("DeleteAliasAction.error.selectingwindow"), ex); } }
3.401639
DownloadListener l ) { } public void addCompletionListener( DownloadCompletionListener l ) { notSupported(); } public void removeCompletionListener( DownloadCompletionListener l ) { notSupported(); } public void addTrackerListener( DownloadTrackerListener l ) { } public void addTrackerListener( DownloadTrackerListener l, boolean immediateTrigger) { } public void removeTrackerListener( DownloadTrackerListener l ) { } public void addDownloadWillBeRemovedListener( DownloadWillBeRemovedListener l ) { notSupported(); } public void removeDownloadWillBeRemovedListener( DownloadWillBeRemovedListener l ) { notSupported(); }
3.07113
*/ public class AuthTokenWrapper implements AuthToken { public AuthTokenWrapper(AuthToken authToken) { _authToken = authToken; _originalAuthToken = authToken; } public void check(HttpServletRequest request) throws PortalException { _authToken.check(request); } public String getToken(HttpServletRequest request) { return _authToken.getToken(request); } public String getToken( HttpServletRequest request, long plid, String portletId) { return _authToken.getToken(request, plid, portletId); } public void setAuthToken(AuthToken authToken) { if (authToken == null) { _authToken = _originalAuthToken; } else { _authToken = authToken; } }
3.574297
} catch (Exception e) { _log.error(e, e); throw new RemoteException(e.getMessage()); } } public static void testCounterIncrement_Rollback() throws RemoteException { try { PortalServiceUtil.testCounterIncrement_Rollback(); } catch (Exception e) { _log.error(e, e); throw new RemoteException(e.getMessage()); } } public static void testDeleteClassName() throws RemoteException { try { PortalServiceUtil.testDeleteClassName(); } catch (Exception e) { _log.error(e, e); throw new RemoteException(e.getMessage()); } }
3.207792
public long getClassPK(); /** * Sets the class p k of this expando row. * * @param classPK the class p k of this expando row */ public void setClassPK(long classPK); public boolean isNew();
3.531915
Date createDate = getCreateDate(); if (createDate != null) { passwordPolicyCacheModel.createDate = createDate.getTime(); } else { passwordPolicyCacheModel.createDate = Long.MIN_VALUE; } Date modifiedDate = getModifiedDate(); if (modifiedDate != null) { passwordPolicyCacheModel.modifiedDate = modifiedDate.getTime(); } else { passwordPolicyCacheModel.modifiedDate = Long.MIN_VALUE; } passwordPolicyCacheModel.defaultPolicy = getDefaultPolicy(); passwordPolicyCacheModel.name = getName(); String name = passwordPolicyCacheModel.name; if ((name != null) && (name.length() == 0)) { passwordPolicyCacheModel.name = null; } passwordPolicyCacheModel.description = getDescription();
3.383621
if (selenium.isVisible( "link=Web Content Display Permissions Page")) { break; } } catch (Exception e) { } Thread.sleep(1000); }
2.778261
throws com.liferay.portal.kernel.exception.PortalException, com.liferay.portal.kernel.exception.SystemException; public void deleteEntry(long entryId) throws com.liferay.portal.kernel.exception.PortalException, com.liferay.portal.kernel.exception.SystemException; @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public java.util.List<com.liferay.portlet.bookmarks.model.BookmarksEntry> getEntries( long groupId, long folderId, int start, int end) throws com.liferay.portal.kernel.exception.SystemException; @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public java.util.List<com.liferay.portlet.bookmarks.model.BookmarksEntry> getEntries( long groupId, long folderId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator orderByComparator) throws com.liferay.portal.kernel.exception.SystemException; @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public int getEntriesCount(long groupId, long folderId) throws com.liferay.portal.kernel.exception.SystemException; @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public com.liferay.portlet.bookmarks.model.BookmarksEntry getEntry( long entryId) throws com.liferay.portal.kernel.exception.PortalException, com.liferay.portal.kernel.exception.SystemException; @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public int getFoldersEntriesCount(long groupId, java.util.List<java.lang.Long> folderIds) throws com.liferay.portal.kernel.exception.SystemException; @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public java.util.List<com.liferay.portlet.bookmarks.model.BookmarksEntry> getGroupEntries( long groupId, int start, int end) throws com.liferay.portal.kernel.exception.SystemException; @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public java.util.List<com.liferay.portlet.bookmarks.model.BookmarksEntry> getGroupEntries( long groupId, long userId, int start, int end) throws com.liferay.portal.kernel.exception.SystemException; @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public int getGroupEntriesCount(long groupId) throws com.liferay.portal.kernel.exception.SystemException; @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public int getGroupEntriesCount(long groupId, long userId) throws com.liferay.portal.kernel.exception.SystemException;
1.991416
import com.liferay.portalweb.portal.BaseTestCase; import com.liferay.portalweb.portal.util.RuntimeVariables; /** * @author Brian Wing Shun Chan */ public class ViewDeleteDLDocumentTypeTest extends BaseTestCase { public void testViewDeleteDLDocumentType() throws Exception { selenium.open("/web/guest/home/"); loadRequiredJavaScriptModules(); for (int second = 0;; second++) { if (second >= 90) { fail("timeout"); } try { if (selenium.isVisible("link=Documents and Media Test Page")) { break; } } catch (Exception e) { } Thread.sleep(1000); } selenium.clickAt("link=Documents and Media Test Page", RuntimeVariables.replace("Documents and Media Test Page")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); Thread.sleep(5000); assertFalse(selenium.isElementPresent( "//div[@class='lfr-component lfr-menu-list']/ul/li[10]/a")); selenium.open("/web/guest/home/"); loadRequiredJavaScriptModules(); for (int second = 0;; second++) { if (second >= 90) { fail("timeout"); } try { if (selenium.isVisible("link=Documents and Media Test Page")) { break; } } catch (Exception e) { }
3.229787
try { if (selenium.isVisible("link=Sign Out")) { break; } } catch (Exception e) { } Thread.sleep(1000); } selenium.clickAt("link=Sign Out", RuntimeVariables.replace("Sign Out")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); for (int second = 0;; second++) { if (second >= 90) { fail("timeout"); } try { if (selenium.isVisible("//input[@value='Sign In']")) { break; } } catch (Exception e) { } Thread.sleep(1000); }
3.439655
public class PluginGlobalPreferencesTab implements IGlobalPreferencesPanel { protected PluginQueryTokenizerPreferencesPanel _prefs = null; private JScrollPane _myscrolledPanel; private String _title = null; private String _hint = null; public PluginGlobalPreferencesTab(PluginQueryTokenizerPreferencesPanel prefsPanel) { _myscrolledPanel = new JScrollPane(prefsPanel); _prefs = prefsPanel; } public void initialize(IApplication app) { /* Do Nothing */ } public void uninitialize(IApplication app) { /* Do Nothing */ } public void applyChanges() { if (_prefs != null) { _prefs.applyChanges(); } } /* * (non-Javadoc) * * @see net.sourceforge.squirrel_sql.client.util.IOptionPanel#getTitle() */ public String getTitle() { return _title; } public void setTitle(String title) { this._title = title; } /* * (non-Javadoc) * * @see net.sourceforge.squirrel_sql.client.util.IOptionPanel#getHint() */ public String getHint() { return _hint; }
3.653509
layoutRevision.setCreateDate(serviceContext.getCreateDate(now)); layoutRevision.setModifiedDate(serviceContext.getModifiedDate(now)); layoutRevision.setLayoutSetBranchId( oldLayoutRevision.getLayoutSetBranchId()); layoutRevision.setParentLayoutRevisionId( oldLayoutRevision.getLayoutRevisionId()); layoutRevision.setHead(false); layoutRevision.setLayoutBranchId(layoutBranchId); layoutRevision.setPlid(oldLayoutRevision.getPlid()); layoutRevision.setPrivateLayout( oldLayoutRevision.isPrivateLayout()); layoutRevision.setName(name); layoutRevision.setTitle(title); layoutRevision.setDescription(description); layoutRevision.setKeywords(keywords); layoutRevision.setRobots(robots); layoutRevision.setTypeSettings(typeSettings); if (iconImage) { layoutRevision.setIconImage(iconImage); layoutRevision.setIconImageId(iconImageId); } layoutRevision.setThemeId(themeId); layoutRevision.setColorSchemeId(colorSchemeId); layoutRevision.setWapThemeId(wapThemeId); layoutRevision.setWapColorSchemeId(wapColorSchemeId); layoutRevision.setCss(css); layoutRevision.setStatus(WorkflowConstants.STATUS_DRAFT); layoutRevision.setStatusDate(serviceContext.getModifiedDate(now));
2.482759
selenium.clickAt("link=Search All Users", RuntimeVariables.replace("Search All Users")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); boolean advancedVisible = selenium.isVisible( "link=Advanced \u00bb"); if (!advancedVisible) { label = 3;
3.101215
return _dataType; } public int getPrecision() { return _precision; } public String getLiteralPrefix() { return _literalPrefix; } public String getLiteralSuffix() { return _literalSuffix; } public String getCreateParams() { return _createParams; } /** * @see java.lang.Object#hashCode() */ @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (_autoIncrement ? 1231 : 1237); return result; } /** * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; final DataTypeInfo other = (DataTypeInfo) obj; if (!getSimpleName().equals(other.getSimpleName())) return false; return true; }
3.606426
package org.gudy.azureus2.pluginsimpl.local.update; /** * @author parg * */ import java.io.*; import org.gudy.azureus2.platform.PlatformManager; import org.gudy.azureus2.platform.PlatformManagerCapabilities; import org.gudy.azureus2.platform.PlatformManagerFactory; import org.gudy.azureus2.plugins.update.*; import org.gudy.azureus2.core3.util.*; import org.gudy.azureus2.core3.internat.MessageText; import org.gudy.azureus2.core3.logging.*; import com.aelitis.azureus.core.update.AzureusRestarter; import com.aelitis.azureus.core.update.AzureusRestarterFactory; public class UpdateInstallerImpl implements UpdateInstaller { // change these and you'll need to change the Updater!!!! protected static final String UPDATE_DIR = "updates"; protected static final String ACTIONS = "install.act"; protected static AEMonitor class_mon = new AEMonitor( "UpdateInstaller:class" ); private UpdateManagerImpl manager; private File install_dir; protected static void checkForFailedInstalls( UpdateManagerImpl manager ) { try{ File update_dir = new File( manager.getUserDir() + File.separator + UPDATE_DIR ); File[] dirs = update_dir.listFiles(); if ( dirs != null ){ boolean found_failure = false; String files = "";
2.799197
boolean suborganization2Present = selenium.isElementPresent( "//td[4]/span/ul/li/strong/a"); if (!suborganization2Present) { label = 3; continue; } selenium.clickAt("//input[@name='_125_allRowIds']", RuntimeVariables.replace("All Rows")); selenium.click(RuntimeVariables.replace( "//input[@value='Delete']")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); assertTrue(selenium.getConfirmation() .matches("^Are you sure you want to delete this[\\s\\S]$")); case 3: selenium.clickAt("link=Users and Organizations", RuntimeVariables.replace("Users and Organizations")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); selenium.type("//input[@id='_125_keywords']", RuntimeVariables.replace("Selenium")); selenium.click(RuntimeVariables.replace( "//input[@value='Search']")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); selenium.clickAt("//input[@name='_125_rowIds']", RuntimeVariables.replace("Row")); selenium.click(RuntimeVariables.replace( "//input[@value='Delete']")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); assertTrue(selenium.getConfirmation() .matches("^Are you sure you want to delete this[\\s\\S]$")); selenium.type("//input[@id='_125_keywords']", RuntimeVariables.replace("Test")); selenium.click(RuntimeVariables.replace( "//input[@value='Search']")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); boolean organization3Present = selenium.isElementPresent( "//td[4]/span/ul/li/strong/a"); if (!organization3Present) { label = 9;
2.26749
throws PortalException, SystemException { for (PollsQuestion question : pollsQuestionPersistence.findByGroupId(groupId)) { deleteQuestion(question); } } public PollsQuestion getQuestion(long questionId) throws PortalException, SystemException { return pollsQuestionPersistence.findByPrimaryKey(questionId); } public List<PollsQuestion> getQuestions(long groupId) throws SystemException { return pollsQuestionPersistence.findByGroupId(groupId); } public List<PollsQuestion> getQuestions(long groupId, int start, int end) throws SystemException { return pollsQuestionPersistence.findByGroupId(groupId, start, end); } public int getQuestionsCount(long groupId) throws SystemException { return pollsQuestionPersistence.countByGroupId(groupId); }
3.395833
public String get(Object key) { String value = null; if (key != null) { FacesContext facesContext = FacesContext.getCurrentInstance(); Locale locale = facesContext.getViewRoot().getLocale(); if (locale == null) { locale = facesContext.getApplication().getDefaultLocale(); } value = LanguageUtil.get(locale, key.toString()); if (_log.isDebugEnabled()) { _log.debug( "{locale=" + locale + ", key=" + key + ", value=" + value); } } return value; } public boolean isEmpty() { throw new UnsupportedOperationException(); } public Set<String> keySet() { throw new UnsupportedOperationException(); }
3.54321
testSuite.addTestSuite(AddPortletMBTest.class); testSuite.addTestSuite(AddMBCategoryTest.class); testSuite.addTestSuite(AddMBMessage1Tag1Test.class); testSuite.addTestSuite(AddMBMessage2Tag2Test.class); testSuite.addTestSuite(AddMBMessage3Tag3Test.class); testSuite.addTestSuite(AddMBMessageATagTest.class); testSuite.addTestSuite(AddMBMessageBTagTest.class); testSuite.addTestSuite(AddMBMessageCTagTest.class); testSuite.addTestSuite(SearchTagsTest.class); testSuite.addTestSuite(ViewTagsTest.class);
3.531496
throws InstanceNotFoundException, MBeanRegistrationException { synchronized (_objectNameCache) { ObjectName objectName = _objectNameCache.get(objectNameCacheKey); if (objectName == null) { _mBeanServer.unregisterMBean(defaultObjectName); } else { _objectNameCache.remove(objectNameCacheKey);
3.401639
selenium.clickAt("link=Control Panel", RuntimeVariables.replace("Control Panel")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); selenium.clickAt("link=Sites", RuntimeVariables.replace("Sites")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); selenium.type("//input[@id='_134_name']", RuntimeVariables.replace("Community")); selenium.clickAt("//input[@value='Search']", RuntimeVariables.replace("Search")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); boolean community1Present = selenium.isElementPresent( "//span[@title='Actions']/ul/li/strong/a/span"); if (!community1Present) { label = 2; continue; } selenium.clickAt("//span[@title='Actions']/ul/li/strong/a/span", RuntimeVariables.replace("Actions")); for (int second = 0;; second++) { if (second >= 90) { fail("timeout"); }
2.676349
public long getInterval(); public long getMinInterval(); public int getTimeUntilNextUpdate();
3.724
import com.liferay.portal.kernel.cal.DayAndPosition; import com.liferay.portal.kernel.cal.Duration; import com.liferay.portal.kernel.cal.Recurrence; import java.util.Calendar; /** * @author Douglas Wong */ public class RecurrenceMonthlyByDayTest extends RecurrenceTestCase { public void testRecurrence() { Recurrence recurrence = getRecurrence( dtStart, durationOneHour, FRIDAY, 3, 1); Calendar beforeRecurrence = getCalendar(2008, FEBRUARY, 15, 22, 9); assertRecurrenceEquals(false, recurrence, beforeRecurrence); Calendar duringRecurrence1 = getCalendar(2008, FEBRUARY, 15, 22, 10); Calendar duringRecurrence2 = getCalendar(2008, MARCH, 21, 22, 15); assertRecurrenceEquals(true, recurrence, duringRecurrence1); assertRecurrenceEquals(true, recurrence, duringRecurrence2); Calendar afterRecurrence = getCalendar(2008, FEBRUARY, 15, 23, 10); assertRecurrenceEquals(false, recurrence, afterRecurrence); }
3.686992
/** * Created on Sep 19, 2008 * * Copyright 2008 Vuze, Inc. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package org.gudy.azureus2.plugins.download; /** * For registering columns, menus, etc with a datasource * @author TuxPaper * @created Sep 19, 2008 * */ public interface DownloadTypeIncomplete {
3.934426
/** * Sets the org group permission finder. * * @param orgGroupPermissionFinder the org group permission finder */ public void setOrgGroupPermissionFinder( OrgGroupPermissionFinder orgGroupPermissionFinder) { this.orgGroupPermissionFinder = orgGroupPermissionFinder; }
3.280632
com.liferay.portal.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException, com.liferay.portal.kernel.exception.SystemException { try { MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class.getName(), "updateLayoutSetPrototype", _updateLayoutSetPrototypeParameterTypes4); MethodHandler methodHandler = new MethodHandler(methodKey, layoutSetPrototypeId, nameMap, description, active, layoutsUpdateable, serviceContext); Object returnObj = null; try { returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler); } catch (Exception e) { if (e instanceof com.liferay.portal.kernel.exception.PortalException) { throw (com.liferay.portal.kernel.exception.PortalException)e; } if (e instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException)e; } throw new com.liferay.portal.kernel.exception.SystemException(e); } return (com.liferay.portal.model.LayoutSetPrototype)returnObj; } catch (com.liferay.portal.kernel.exception.SystemException se) { _log.error(se, se); throw se; } } public static com.liferay.portal.model.LayoutSetPrototype updateLayoutSetPrototype( HttpPrincipal httpPrincipal, long layoutSetPrototypeId, java.lang.String settings) throws com.liferay.portal.kernel.exception.PortalException, com.liferay.portal.kernel.exception.SystemException { try { MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class.getName(), "updateLayoutSetPrototype", _updateLayoutSetPrototypeParameterTypes5); MethodHandler methodHandler = new MethodHandler(methodKey, layoutSetPrototypeId, settings);
2.612022
/** * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved. * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package com.liferay.portal.kernel.messaging.proxy; import java.io.Serializable; /** * @author Micha Kiener * @author Michael C. Han * @author Brian Wing Shun Chan */ public class ProxyResponse implements Serializable { public Exception getException() { return _exception; } public Object getResult() { return _result; } public boolean hasError() { if (_exception != null) { return true; } else { return false; } } public void setException(Exception exception) { _exception = exception; } public void setResult(Object result) { _result = result; }
4.021505
continue; }else if ( c == '\\' ){ escape = true; continue; } if ( c == '"' || c == '\'' && ( i == 0 || chars[ i-1 ] != '\\' )){ if ( quote == ' ' ){ bit_contains_quotes = true; quote = c; }else if ( quote == c ){ quote = ' '; }else{ bit += c; } }else{ if ( quote == ' ' ){ if ( c == ' ' ){
2.747423
} } public void addBar_Rollback(java.lang.String text) throws com.liferay.portal.kernel.exception.SystemException { MethodHandler methodHandler = new MethodHandler(_addBar_RollbackMethodKey17, ClpSerializer.translateInput(text)); try { _classLoaderProxy.invoke(methodHandler); } catch (Throwable t) { if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException)t; } if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } } public com.liferay.testtransaction.model.Bar addBar_Success( java.lang.String text) throws com.liferay.portal.kernel.exception.SystemException { Object returnObj = null; MethodHandler methodHandler = new MethodHandler(_addBar_SuccessMethodKey18, ClpSerializer.translateInput(text)); try { returnObj = _classLoaderProxy.invoke(methodHandler); } catch (Throwable t) { if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException)t; } if (t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } }
2.751323
public class SWTSkinPropertiesImpl extends SkinPropertiesImpl implements SWTSkinProperties { private static Map colorMap = new LightHashMap(); /** * @param skinPath * @param mainSkinFile */ public SWTSkinPropertiesImpl(ClassLoader classLoader, String skinPath, String mainSkinFile) { super(classLoader, skinPath, mainSkinFile); } /** * */ public SWTSkinPropertiesImpl() { super(); } // @see com.aelitis.azureus.ui.swt.skin.SWTSkinProperties#getColor(java.lang.String) public Color getColor(String sID) { Color color; if (colorMap.containsKey(sID)) { return (Color) colorMap.get(sID); } try { int[] rgb = getColorValue(sID); if (rgb[0] > -1) { color = ColorCache.getColor(Utils.getDisplay(), rgb[0], rgb[1], rgb[2]); } else { color = ColorCache.getColor(Utils.getDisplay(), getStringValue(sID)); } } catch (Exception e) { // IMP.getLogger().log(LoggerChannel.LT_ERROR, // "Failed loading color : color." + colorNames[i]); color = null; } colorMap.put(sID, color); return color; } public void clearCache() { super.clearCache(); colorMap.clear(); }
3.382514
selenium.clickAt("link=Control Panel", RuntimeVariables.replace("Control Panel")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); selenium.clickAt("link=Users and Organizations", RuntimeVariables.replace("Users and Organizations")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); selenium.type("//input[@id='_125_keywords']", RuntimeVariables.replace("selen01")); selenium.clickAt("//input[@value='Search']", RuntimeVariables.replace("Search")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); selenium.clickAt("//td[2]/a", RuntimeVariables.replace("User Name")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); for (int second = 0;; second++) { if (second >= 90) { fail("timeout"); } try { if (selenium.isVisible("//a[@id='_125_phoneNumbersLink']")) { break; } } catch (Exception e) { }
2.764706
*/ public void setGadgetKey(String gadgetKey); /** * Returns the service name of this o auth token. * * @return the service name of this o auth token */ @AutoEscape public String getServiceName();
3.830688
} abstract void encode(DEROutputStream out) throws IOException; public String toString() { return "#"+new String(Hex.encode(string)); }
3.727723
_app = app; } protected void paintComponent(Graphics g) { setPreferredSize(getRequiredSize()); super.paintComponent(g); } public void remove(Component comp) { if (comp != null) { comp.removeComponentListener(_listener); super.remove(comp); } revalidate(); repaint(); } protected void addImpl(Component comp, Object constraints, int index) { if (comp != null) { comp.addComponentListener(_listener); revalidate(); } super.addImpl(comp, constraints, index); }
3.450777
for (KaleoTimer model : models) { soapModels.add(toSoapModel(model)); } return soapModels.toArray(new KaleoTimerSoap[soapModels.size()]); } public KaleoTimerSoap() { }
3.59375
import net.sourceforge.squirrel_sql.fw.util.ICommand; import net.sourceforge.squirrel_sql.fw.util.Resources; import net.sourceforge.squirrel_sql.fw.util.StringManager; import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory; import net.sourceforge.squirrel_sql.plugins.refactoring.commands.AddAutoIncrementCommand; public class AddAutoIncrementAction extends AbstractRefactoringAction { private static final long serialVersionUID = -5316665324698095673L; /** * Internationalized strings for this class. */ private static final StringManager s_stringMgr = StringManagerFactory.getStringManager(AddAutoIncrementAction.class); private static interface i18n { String ACTION_PART = s_stringMgr.getString("AddAutoIncrementAction.actionPart"); String OBJECT_PART = s_stringMgr.getString("Shared.tableObject"); String SINGLE_OBJECT_MESSAGE = s_stringMgr.getString("Shared.singleObjectMessage", OBJECT_PART, ACTION_PART); } public AddAutoIncrementAction(final IApplication app, final Resources rsrc) { super(app, rsrc); }
3.492308
RuntimeVariables.replace("Add")); for (int second = 0;; second++) { if (second >= 90) { fail("timeout"); } try { if (selenium.isVisible( "//div[@class='lfr-component lfr-menu-list']/ul/li[4]/a")) { break; } } catch (Exception e) { } Thread.sleep(1000); } assertEquals(RuntimeVariables.replace("Basic Document"), selenium.getText( "//div[@class='lfr-component lfr-menu-list']/ul/li[4]/a")); selenium.clickAt("//div[@class='lfr-component lfr-menu-list']/ul/li[4]/a", RuntimeVariables.replace("Basic Document")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); selenium.type("//input[@id='_20_file']", RuntimeVariables.replace( "L:\\portal\\build\\portal-web\\test\\com\\liferay\\portalweb\\portlet\\documentlibrary\\dependencies\\test_document.txt")); selenium.type("//input[@id='_20_title']", RuntimeVariables.replace("DL Folder Document Title")); selenium.type("//textarea[@id='_20_description']", RuntimeVariables.replace("DL Folder Document Description")); selenium.clickAt("//input[@value='Publish']", RuntimeVariables.replace("Publish")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); for (int second = 0;; second++) { if (second >= 90) { fail("timeout"); } try { if (selenium.isVisible("//div[@class='portlet-msg-success']")) { break; } } catch (Exception e) { }
2.585106
} } catch (Exception e) { } Thread.sleep(1000); } selenium.clickAt("//div[@title='Knowledge Base Article']/p/a", RuntimeVariables.replace("Add"));
3.510204
import com.liferay.portal.model.User; import com.liferay.portal.security.permission.ActionKeys; import com.liferay.portal.service.base.EmailAddressServiceBaseImpl; import com.liferay.portal.service.permission.CommonPermissionUtil; import java.util.List; /** * @author Brian Wing Shun Chan * @author Alexander Chow */ public class EmailAddressServiceImpl extends EmailAddressServiceBaseImpl { public EmailAddress addEmailAddress( String className, long classPK, String address, int typeId, boolean primary) throws PortalException, SystemException { CommonPermissionUtil.check( getPermissionChecker(), className, classPK, ActionKeys.UPDATE); return emailAddressLocalService.addEmailAddress( getUserId(), className, classPK, address, typeId, primary); } public void deleteEmailAddress(long emailAddressId) throws PortalException, SystemException { EmailAddress emailAddress = emailAddressPersistence.findByPrimaryKey( emailAddressId); CommonPermissionUtil.check( getPermissionChecker(), emailAddress.getClassNameId(), emailAddress.getClassPK(), ActionKeys.UPDATE); emailAddressLocalService.deleteEmailAddress(emailAddressId); } public EmailAddress getEmailAddress(long emailAddressId) throws PortalException, SystemException { EmailAddress emailAddress = emailAddressPersistence.findByPrimaryKey( emailAddressId); CommonPermissionUtil.check( getPermissionChecker(), emailAddress.getClassNameId(), emailAddress.getClassPK(), ActionKeys.VIEW); return emailAddress; }
3.327778
/** * @author Brian Wing Shun Chan */ public class DBUpgradeTags528TestSuite extends BaseTestSuite { public static Test suite() { TestSuite testSuite = new TestSuite(); testSuite.addTest(LoginTests.suite()); testSuite.addTest(TagsTestPlan.suite());
3.821229
find.append("\\s*</array>.*"); value.append("\n\t\t\t"); String match = "(?s)(<key>" + key + "</key>\\s*<array>)(.*?)(</array>)"; setValue(find.toString(),match,value.toString()); } private boolean isValuePresent( String match ) throws IOException { String fileContent = getFileContent(); //System.out.println("Searching for:\n" + match); return fileContent.matches(match); } /** * * @param find the regex expression to find if the value is already present * @param match the regex expression that will match for the replace, it needs to capture 3 groups, the 2nd one being replaced by value * @param value the value that replaces the 2nd match group */ private void setValue( String find, String match, String value) throws IOException { String fileContent = getFileContent(); if( !isValuePresent(find)) { //System.out.println("Changing " +plistFile); fileContent = fileContent.replaceFirst(match, "$1"+value + "$3"); setFileContent(fileContent); touchFile(); } } private String getFileContent() throws IOException { FileReader fr = null;
3.315476
return true; } } return false; } @Test public void testGetValueAt() { for (int rowIdx = 0; rowIdx < classUnderTest.getRowCount(); rowIdx++) { for (int colIdx = 0; colIdx < classUnderTest.getColumnCount(); colIdx++) { assertNotNull(classUnderTest.getValueAt(rowIdx, colIdx)); } } } @Test public void testGetValueAt_InvalidColumn() { try { classUnderTest.getValueAt(0, classUnderTest.getColumnCount()); fail("Expected an exception for call to getValue with a column that is one higher that the " + "highest column index allowed by this table model"); } catch (IndexOutOfBoundsException e) { // This is acceptable } catch (IllegalArgumentException e) { // This is acceptable } }
3.269461
import org.eclipse.sapphire.modeling.annotations.Type; import org.eclipse.sapphire.modeling.annotations.ValidFileSystemResourceType; import org.eclipse.sapphire.modeling.xml.annotations.XmlBinding; /** * @author Gregory Amerson */ @GenerateImpl public interface IPortalPropertiesFile extends IModelElement {
3.560694
PropsKeys.XUGGLER_ENABLED, PropsValues.XUGGLER_ENABLED) || _hasAudio(fileVersion)) { return; } if (_isGeneratePreview(fileVersion)) { File file = null; if (fileVersion instanceof LiferayFileVersion) { try { LiferayFileVersion liferayFileVersion = (LiferayFileVersion)fileVersion; file = liferayFileVersion.getFile(false); } catch (UnsupportedOperationException uoe) { } } if (file == null) { InputStream inputStream = fileVersion.getContentStream( false); FileUtil.write(audioTempFile, inputStream); file = audioTempFile; } try { _generateAudioXuggler(fileVersion, file, previewTempFile); } catch (Exception e) { _log.error(e, e); } } } catch (NoSuchFileEntryException nsfee) { } finally { _fileVersionIds.remove(fileVersion.getFileVersionId()); FileUtil.delete(audioTempFile); FileUtil.delete(previewTempFile); } } private void _generateAudioXuggler( FileVersion fileVersion, File srcFile, File destFile) throws Exception {
2.818713
public LiferayDecorationsProvider(IRuntime adaptableObject) { // runtime = adaptableObject; } public ImageDescriptor getIcon() { return LiferayServerUIPlugin.imageDescriptorFromPlugin( LiferayServerUIPlugin.PLUGIN_ID, "icons/e16/server.png" ); } }
3.351852
import com.liferay.portal.kernel.exception.PortalException; /** * @author Alexander Chow */ public class LockException extends PortalException { public LockException() { super(); }
3.680982
calendarImpl.setCalendarId(getCalendarId()); calendarImpl.setGroupId(getGroupId()); calendarImpl.setCompanyId(getCompanyId()); calendarImpl.setUserId(getUserId()); calendarImpl.setUserName(getUserName()); calendarImpl.setCreateDate(getCreateDate()); calendarImpl.setModifiedDate(getModifiedDate()); calendarImpl.setResourceBlockId(getResourceBlockId()); calendarImpl.setCalendarResourceId(getCalendarResourceId()); calendarImpl.setName(getName()); calendarImpl.setDescription(getDescription()); calendarImpl.setColor(getColor()); calendarImpl.setDefaultCalendar(getDefaultCalendar()); calendarImpl.resetOriginalValues(); return calendarImpl; } public int compareTo(Calendar calendar) { int value = 0; value = getName().compareTo(calendar.getName()); if (value != 0) { return value; } return 0; }
3.306748
*/ public void init(CipherParameters params) throws IllegalArgumentException; /** * Return the name of the algorithm the MAC implements. * * @return the name of the algorithm the MAC implements. */ public String getAlgorithmName(); /** * Return the block size for this cipher (in bytes). * * @return the block size for this cipher in bytes. */ public int getMacSize(); /** * add a single byte to the mac for processing. * * @param in the byte to be processed. * @exception IllegalStateException if the MAC is not initialised. */ public void update(byte in) throws IllegalStateException; /** * @param in the array containing the input. * @param inOff the index in the array the data begins at. * @param len the length of the input starting at inOff. * @exception IllegalStateException if the MAC is not initialised. * @exception DataLengthException if there isn't enough data in in. */ public void update(byte[] in, int inOff, int len) throws DataLengthException, IllegalStateException; /** * Compute the final statge of the MAC writing the output to the out * parameter. * <p> * doFinal leaves the MAC in the same state it was after the last init. * * @param out the array the MAC is to be output to. * @param outOff the offset into the out buffer the output is to start at. * @exception DataLengthException if there isn't enough space in out. * @exception IllegalStateException if the MAC is not initialised. */ public int doFinal(byte[] out, int outOff) throws DataLengthException, IllegalStateException;
3.801205
{ DHTNATPuncher puncher = plugin.getDHT().getNATPuncher(); if ( puncher == null ){ return( null ); } return( puncher.punch( "Tunnel", contact, null, null )); }
3.338889
WebKeys.MOBILE_DEVICE_RULES_RULE_EDITOR_JSP, editorJSP); long ruleGroupId = BeanParamUtil.getLong( rule, renderRequest, "ruleGroupId"); MDRRuleGroup ruleGroup = MDRRuleGroupServiceUtil.getRuleGroup( ruleGroupId); renderRequest.setAttribute( WebKeys.MOBILE_DEVICE_RULES_RULE_GROUP, ruleGroup); return mapping.findForward("portlet.mobile_device_rules.edit_rule"); } @Override public void serveResource( ActionMapping mapping, ActionForm form, PortletConfig portletConfig, ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws Exception { long ruleId = ParamUtil.getLong(resourceRequest, "ruleId"); if (ruleId > 0) { MDRRule rule = MDRRuleServiceUtil.fetchRule(ruleId); resourceRequest.setAttribute( WebKeys.MOBILE_DEVICE_RULES_RULE, rule); } String type = ParamUtil.getString(resourceRequest, "type");
2.79096
{ continue; } SchemaLoadInfo schemaLoadInfo = new SchemaLoadInfo(addStringArrays(tableTypes, viewTypes)); schemaLoadInfo.schemaName = _schemaDetails[i].getSchemaName(); schemaLoadInfo.tableTypes = new String[0]; if(SQLAliasSchemaDetailProperties.SCHEMA_LOADING_ID_DONT_LOAD !=_schemaDetails[i].getTable()) { schemaLoadInfo.tableTypes = addStringArrays(schemaLoadInfo.tableTypes, tableTypes); } if(SQLAliasSchemaDetailProperties.SCHEMA_LOADING_ID_DONT_LOAD !=_schemaDetails[i].getView()) { schemaLoadInfo.tableTypes = addStringArrays(schemaLoadInfo.tableTypes, viewTypes); } if(SQLAliasSchemaDetailProperties.SCHEMA_LOADING_ID_DONT_LOAD !=_schemaDetails[i].getProcedure()) { schemaLoadInfo.loadProcedures = true; } else { schemaLoadInfo.loadProcedures = false; } schemaLoadInfos.add(schemaLoadInfo); }
2.916201
private com.sap.engine.services.dc.wsgate.Option[] options; public Deploy() { } public Deploy( com.sap.engine.services.dc.wsgate.ArchiveFile[] archiveFiles, com.sap.engine.services.dc.wsgate.Option[] options) { this.archiveFiles = archiveFiles; this.options = options; } /** * Gets the archiveFiles value for this Deploy. * * @return archiveFiles */ public com.sap.engine.services.dc.wsgate.ArchiveFile[] getArchiveFiles() { return archiveFiles; } /** * Sets the archiveFiles value for this Deploy. * * @param archiveFiles */ public void setArchiveFiles(com.sap.engine.services.dc.wsgate.ArchiveFile[] archiveFiles) { this.archiveFiles = archiveFiles; } public com.sap.engine.services.dc.wsgate.ArchiveFile getArchiveFiles(int i) { return this.archiveFiles[i]; } public void setArchiveFiles(int i, com.sap.engine.services.dc.wsgate.ArchiveFile _value) { this.archiveFiles[i] = _value; } /** * Gets the options value for this Deploy. * * @return options */ public com.sap.engine.services.dc.wsgate.Option[] getOptions() { return options; }
3.337278
/** * @author Peter Shin * @author Brian Wing Shun Chan */ public class AdminActivityKeys { public static final int ADD_KB_ARTICLE = 1; public static final int ADD_KB_COMMENT = 5;
3.907609
/** * <p>Title: sqsc-isqlj</p> * <p>Description: SquirrelSQL plugin for iSqlJ</p> * <p>Copyright: Copyright (c) 2003 Stathis Alexopoulos</p> * @author Stathis Alexopoulos [email protected] * <br> * <br> * <p> * This file is part of sqsc-isqlj. * </p> * <br> * <p> * sqsc-isqlj is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Foobar is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with Foobar; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * </p> */ import net.sourceforge.squirrel_sql.client.plugin.IPlugin; import net.sourceforge.squirrel_sql.client.plugin.PluginResources;
3.732984
import com.liferay.portalweb.portal.BaseTestCase; import com.liferay.portalweb.portal.util.RuntimeVariables; /** * @author Brian Wing Shun Chan */ public class AddFrontPageTest extends BaseTestCase { public void testAddFrontPage() throws Exception { selenium.open("/web/guest/home/"); loadRequiredJavaScriptModules();
3.709677
fail("timeout"); } try { if (selenium.isVisible("//section")) { break; } } catch (Exception e) { }
3.44
RuntimeVariables.replace("Control Panel")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); selenium.clickAt("link=Web Content", RuntimeVariables.replace("Web Content")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); boolean webContent1Present = selenium.isElementPresent( "_15_rowIds"); if (!webContent1Present) { label = 2; continue; } selenium.clickAt("//input[@name='_15_allRowIds']", RuntimeVariables.replace("")); selenium.click(RuntimeVariables.replace( "//input[@value='Delete']")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); assertTrue(selenium.getConfirmation() .matches("^Are you sure you want to delete the selected web content[\\s\\S]$")); case 2: boolean webContent2Present = selenium.isElementPresent( "_15_rowIds");
2.960452
selenium.getValue("//input[@value='New Message']")); selenium.clickAt("//input[@value='New Message']", RuntimeVariables.replace("New Message")); for (int second = 0;; second++) { if (second >= 90) { fail("timeout"); } try { if (selenium.isVisible("//span[2]/span/button")) { break; } } catch (Exception e) { } Thread.sleep(1000); } selenium.clickAt("//span[2]/span/button", RuntimeVariables.replace("Dropdown")); assertEquals(RuntimeVariables.replace( "socialofficefriendfn socialofficefriendmn socialofficefriendln"), selenium.getText("//div[8]/div/div/ul/li[1]")); selenium.clickAt("//div[8]/div/div/ul/li[1]", RuntimeVariables.replace( "socialofficefriendfn socialofficefriendmn socialofficefriendln")); assertEquals("socialofficefriendfn socialofficefriendmn socialofficefriendln <socialofficefriendsn>,", selenium.getValue("//span/input")); assertTrue(selenium.isVisible("//span[1]/span/span/input")); selenium.type("//span[1]/span/span/input", RuntimeVariables.replace("Message3 Subject")); assertTrue(selenium.isVisible("//textarea")); selenium.type("//textarea", RuntimeVariables.replace("Message3 Body")); selenium.clickAt("//input[@value='Send']", RuntimeVariables.replace("Send")); for (int second = 0;; second++) { if (second >= 90) { fail("timeout"); } try { if (selenium.isVisible("//div[@class='portlet-msg-success']")) { break; } } catch (Exception e) { }
2.763314
LiferayPortletRequest liferayPortletRequest, LiferayPortletResponse liferayPortletResponse) throws Exception; public PortletURL getURLExport( LiferayPortletRequest liferayPortletRequest, LiferayPortletResponse liferayPortletResponse) throws Exception; public String getUrlTitle();
3.127778
JPanel pnlName = new JPanel(new BorderLayout()); // i18n[graph.name=Name] JLabel lblName = new JLabel(s_stringMgr.getString("graph.name")); pnlName.add(lblName, BorderLayout.WEST); txtName = new JTextField(); pnlName.add(txtName, BorderLayout.CENTER); pnlEdit.add(pnlName);
3.483333
StringBundler sb = new StringBundler(17); sb.append("{resourcePermissionId="); sb.append(resourcePermissionId); sb.append(", companyId="); sb.append(companyId); sb.append(", name="); sb.append(name); sb.append(", scope="); sb.append(scope); sb.append(", primKey="); sb.append(primKey); sb.append(", roleId="); sb.append(roleId); sb.append(", ownerId="); sb.append(ownerId); sb.append(", actionIds="); sb.append(actionIds); sb.append("}"); return sb.toString(); } public ResourcePermission toEntityModel() { ResourcePermissionImpl resourcePermissionImpl = new ResourcePermissionImpl(); resourcePermissionImpl.setResourcePermissionId(resourcePermissionId); resourcePermissionImpl.setCompanyId(companyId); if (name == null) { resourcePermissionImpl.setName(StringPool.BLANK); } else { resourcePermissionImpl.setName(name); } resourcePermissionImpl.setScope(scope); if (primKey == null) { resourcePermissionImpl.setPrimKey(StringPool.BLANK); } else { resourcePermissionImpl.setPrimKey(primKey); } resourcePermissionImpl.setRoleId(roleId); resourcePermissionImpl.setOwnerId(ownerId); resourcePermissionImpl.setActionIds(actionIds); resourcePermissionImpl.resetOriginalValues();
3.382979
selenium.clickAt("//input[@value='Search']", RuntimeVariables.replace("Search")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); assertEquals(RuntimeVariables.replace("Open"), selenium.getText("//td[2]/a")); selenium.clickAt("//td[2]/a", RuntimeVariables.replace("Open")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); assertEquals(RuntimeVariables.replace("Test1 Folder1"), selenium.getText("//b")); selenium.clickAt("//b", RuntimeVariables.replace("Test1 Folder1")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); selenium.clickAt("//input[@value='Add Document']", RuntimeVariables.replace("Add Document")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); for (int second = 0;; second++) { if (second >= 90) { fail("timeout"); } try { if (selenium.isVisible( "//a[@class='use-fallback using-new-uploader']")) { break; } } catch (Exception e) { } Thread.sleep(1000); } assertEquals(RuntimeVariables.replace("Use the classic uploader."), selenium.getText("//a[@class='use-fallback using-new-uploader']")); selenium.click("//a[@class='use-fallback using-new-uploader']"); selenium.type("//input[@id='_20_file']", RuntimeVariables.replace( "L:\\portal\\build\\portal-web\\test\\com\\liferay\\portalweb\\portal\\dbupgrade\\sampledata523\\documentlibrary\\document\\dependencies\\test_document.txt")); selenium.type("//input[@id='_20_title']", RuntimeVariables.replace("Test1 Document1")); selenium.type("//textarea[@id='_20_description']", RuntimeVariables.replace("This is Test1 Document1")); selenium.clickAt("//input[@value='Save']", RuntimeVariables.replace("Save")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules();
2.446809
/** * @author Brian Wing Shun Chan */ public class ViewSitePublicPageDropDownTests extends BaseTestSuite { public static Test suite() { TestSuite testSuite = new TestSuite(); testSuite.addTestSuite(AddSitesTest.class); testSuite.addTestSuite(AddSitesPublicPageTest.class); testSuite.addTestSuite(ViewSitesPublicPageDropDownTest.class); testSuite.addTestSuite(TearDownSitesTest.class);
3.780105
/* * Copyright (C) 2007 Rob Manning * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sourceforge.squirrel_sql.plugins.dbdiff; import net.sourceforge.squirrel_sql.client.session.ISession; import net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo; /** * This is implemented in order to pass needed info along to diff executor. */ public interface SessionInfoProvider { public void setSourceSession(ISession session); public ISession getSourceSession(); public IDatabaseObjectInfo[] getSourceSelectedDatabaseObjects(); public IDatabaseObjectInfo[] getDestSelectedDatabaseObjects(); public void setDestSelectedDatabaseObjects(IDatabaseObjectInfo[] infos); public void setSourceSelectedDatabaseObjects(IDatabaseObjectInfo[] infos); public void setDestSession(ISession session); public ISession getDestSession(); /** * @return the scriptFileManager */ public IScriptFileManager getScriptFileManager();
3.735

Java Code Readability Merged Dataset

This dataset contains 421 Java code snippets along with a readability score, aggregated from several scientific papers [1, 2, 3].

You can download the dataset using Hugging Face:

from datasets import load_dataset
ds = load_dataset("se2p/code-readability-merged")

The snippets are not split into train and test (and validation) set. Thus, the whole dataset is in the train set:

ds = ds['train']
ds_as_list = ds.to_list() # Convert the dataset to whatever format suits you best

The dataset is structured as follows:

{
  "code_snippet": ...,  # Java source code snippet
  "score": ...          # Readability score
}

The main goal of this repository is to train code readability classifiers for Java source code. The dataset is a combination and normalization of three datasets:

  1. Buse, R. P., & Weimer, W. R. (2009). Learning a metric for code readability. IEEE Transactions on software engineering, 36(4), 546-558.
  2. Dorn, J. (2012). A General Software Readability Model.
  3. Scalabrino, S., Linares‐Vásquez, M., Oliveto, R., & Poshyvanyk, D. (2018). A comprehensive model for code readability. Journal of Software: Evolution and Process, 30(6), e1958.

The raw datasets can be downloaded here.

Dataset Details

Uses

The dataset can be used for training Java code readability classifiers.

Dataset Structure

Each entry of the dataset consists of a code_snippet and a score. The code_snippet (string) is the code snippet that was rated in a study by multiple participants. Those could answer based on a five point Likert scale, with 1 being very unreadable and 5 being very readable. The score (float) is the averaged rating score of all participants between 1.0 (very unreadable) and 5.0 (very readable).

Dataset Creation

Curation Rationale

To advance code readability classification, the creation of datasets in this research field is of high importance. As a first step, we provide a merged and normalized version of existing datasets on Hugging Face. This makes access and ease of usage of this existing data easier.

Source Data

The source of the data are the papers from Buse, Dorn and Scalabrino.

Buse conducted a survey with 120 computer science students (17 from first year courses, 63 from second year courses, 30 third or fourth year courses, 10 graduated) on 100 code snippets. The code snippets were generated from five open source Java projects.

Dorn conducted a survey with 5000 participants (1800 with industry experience) on 360 code snippets from which 121 are Java code snippets. The used snippets were drawn from ten open source projects in the SourceForge repository (of March 15, 2012).

Scalabrino conducted a survey with 9 computer science students on 200 new code snippets. The snippets were selected from four open source Java projects: jUnit, Hibernate, jFreeChart and ArgoUML.

Data Collection and Processing

The dataset was preprocessed by averaging the readability rating for each code snippet. The code snippets and ratings were then merged from the three sources.

Each of the three, Buse, Dorn and Sclabrino selected their code snippets based on different criteria. They had a different number of participants for their surveys. One could argue that a code snippet that was rated by more participants might have a more accurate readability score and therefore is more valuable than one with less ratings. However, for simplicity those differences are ignored.

Other than the selection (and generation) done by the original data source authors, no further processing is applied to the data.

Who are the source data producers?

The source data producers are the people that wrote the used open source Java projects, as well as the study participants, which were mostly computer science students.

Personal and Sensitive Information

The ratings of the code snippets are anonymized and averaged. Thus, no personal or sensitive information is contained in this dataset.

Bias, Risks, and Limitations

The size of the dataset is very small. The ratings of code snippets were done mostly by computer science students, who do not represent the group of Java programmers in general.

Recommendations

The dataset should be used to train small Java code readability classifiers.

Citation

  1. Buse, R. P., & Weimer, W. R. (2009). Learning a metric for code readability. IEEE Transactions on software engineering, 36(4), 546-558.
  2. Dorn, J. (2012). A General Software Readability Model.
  3. Scalabrino, S., Linares‐Vásquez, M., Oliveto, R., & Poshyvanyk, D. (2018). A comprehensive model for code readability. Journal of Software: Evolution and Process, 30(6), e1958.
@article{buse2009learning,
  title={Learning a metric for code readability},
  author={Buse, Raymond PL and Weimer, Westley R},
  journal={IEEE Transactions on software engineering},
  volume={36},
  number={4},
  pages={546--558},
  year={2009},
  publisher={IEEE}
}

@inproceedings{dorn2012general,
  title={A General Software Readability Model},
  author={Jonathan Dorn},
  year={2012},
  url={https://api.semanticscholar.org/CorpusID:14098740}
}

@article{scalabrino2018comprehensive,
  title={A comprehensive model for code readability},
  author={Scalabrino, Simone and Linares-V{\'a}squez, Mario and Oliveto, Rocco and Poshyvanyk, Denys},
  journal={Journal of Software: Evolution and Process},
  volume={30},
  number={6},
  pages={e1958},
  year={2018},
  publisher={Wiley Online Library}
}

Dataset Card Authors

Lukas Krodinger, Chair of Software Engineering II, University of Passau.

Dataset Card Contact

Feel free to contact me via E-Mail if you have any questions or remarks.

Downloads last month
78
Edit dataset card

Models trained or fine-tuned on se2p/code-readability-merged