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.ge... | 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/gues... | 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(
... | 3.080357 |
public SetServerManagerContextPathCommand( IRemoteServerWorkingCopy server, String serverManagerContextPath ) {
super( server, "Set Server Manager Context Path" );
this.serverManagerContextPath = serverManagerContextPath;
}
public void execute() {
oldServerManagerContextPath = server.getServerManagerContextP... | 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) {
BasicPluginConfigMod... | 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();
asse... | 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 p... | 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.clic... | 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 rend... | 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;
... | 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(
... | 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;
... | 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<Addr... | 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 pluginSe... | 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 = addSCP... | 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");
... | 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
{
/**
... | 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
... | 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... | 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"});
updateP... | 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
*/
pub... | 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);
... | 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... | 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,
cha... | 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 s... | 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.... | 3.401639 |
DownloadListener l )
{
}
public void
addCompletionListener(
DownloadCompletionListener l )
{
notSupported();
}
public void
removeCompletionListener(
DownloadCompletionListener l )
{
notSupported();
}
public void
addTrackerListener(
DownloadTrackerListener l )
{
}
public void
addTr... | 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 re... | 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 RemoteExcept... | 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 = ... | 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.S... | 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/");
lo... | 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++... | 3.439655 |
public class PluginGlobalPreferencesTab implements IGlobalPreferencesPanel {
protected PluginQueryTokenizerPreferencesPanel _prefs = null;
private JScrollPane _myscrolledPanel;
private String _title = null;
private String _hint = null;
public PluginGlobalPreferencesTab(PluginQueryTokeni... | 3.653509 |
layoutRevision.setCreateDate(serviceContext.getCreateDate(now));
layoutRevision.setModifiedDate(serviceContext.getModifiedDate(now));
layoutRevision.setLayoutSetBranchId(
oldLayoutRevision.getLayoutSetBranchId());
layoutRevision.setParentLayoutRevisionId(
oldLayoutRevision.getLayoutRevisionId());
... | 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... | 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.*;
imp... | 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.repl... | 2.26749 |
throws PortalException, SystemException {
for (PollsQuestion question :
pollsQuestionPersistence.findByGroupId(groupId)) {
deleteQuestion(question);
}
}
public PollsQuestion getQuestion(long questionId)
throws PortalException, SystemException {
return pollsQuestionPersistence.findByPrimaryKey(que... | 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 = LanguageUt... | 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);
... | 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();
... | 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() {
Recur... | 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 dist... | 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",
_updateLa... | 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... | 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 = '... | 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... | 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, ski... | 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");
loadRequi... | 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();
}
prote... | 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.AddAutoIncrementComma... | 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);
}
assertE... | 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
*... | 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();
... | 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))... | 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)fileV... | 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());
calen... | 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 ... | 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);
ret... | 2.79096 |
{
continue;
}
SchemaLoadInfo schemaLoadInfo = new SchemaLoadInfo(addStringArrays(tableTypes, viewTypes));
schemaLoadInfo.schemaName = _schemaDetails[i].getSchemaName();
schemaLoadInfo.tableTypes = new String[0];
if(SQLAliasSchemaDe... | 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... | 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 stathis@rege.org
* <br>
* <br>
* <p>
* This file is part of sqsc-isqlj.
* </p>
* <br>
* <p>
* sqsc-isqlj is free software; you can redistribute... | 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/");
loadRequiredJavaScriptModul... | 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 webContent1Pre... | 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;
... | 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... | 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"));
seleni... | 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(ViewSitesPubl... | 3.780105 |
/*
* Copyright (C) 2007 Rob Manning
* manningr@users.sourceforge.net
*
* 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 ... | 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:
- Buse, R. P., & Weimer, W. R. (2009). Learning a metric for code readability. IEEE Transactions on software engineering, 36(4), 546-558.
- Dorn, J. (2012). A General Software Readability Model.
- 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
- Buse, R. P., & Weimer, W. R. (2009). Learning a metric for code readability. IEEE Transactions on software engineering, 36(4), 546-558.
- Dorn, J. (2012). A General Software Readability Model.
- 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
- 20